From 03a78d76f19fc32e4be5d5996613564932d099c4 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Wed, 3 Apr 2024 16:36:40 +0200 Subject: [PATCH] Regenerate client for 8.13 (#8071) --- docfx.json | 46 + .../_Generated/Api/ApiUrlLookup.g.cs | 147 +- .../AsyncSearch/AsyncSearchStatusRequest.g.cs | 8 - .../AsyncSearchStatusResponse.g.cs | 16 + .../AsyncSearch/DeleteAsyncSearchRequest.g.cs | 8 - .../DeleteAsyncSearchResponse.g.cs | 1 + .../AsyncSearch/GetAsyncSearchRequest.g.cs | 8 - .../AsyncSearch/GetAsyncSearchResponse.g.cs | 15 + .../AsyncSearch/SubmitAsyncSearchRequest.g.cs | 414 +- .../SubmitAsyncSearchResponse.g.cs | 15 + .../_Generated/Api/BulkRequest.g.cs | 12 + .../_Generated/Api/BulkResponse.g.cs | 1 + .../_Generated/Api/ClearScrollResponse.g.cs | 1 + .../Api/ClosePointInTimeResponse.g.cs | 1 + .../Cluster/AllocationExplainResponse.g.cs | 1 + .../Api/Cluster/ClusterInfoRequest.g.cs | 82 + .../Api/Cluster/ClusterInfoResponse.g.cs | 41 + .../Api/Cluster/ClusterStatsRequest.g.cs | 10 +- .../Api/Cluster/ClusterStatsResponse.g.cs | 5 + .../DeleteComponentTemplateRequest.g.cs | 106 + .../DeleteComponentTemplateResponse.g.cs | 36 + .../ExistsComponentTemplateRequest.g.cs | 106 + .../ExistsComponentTemplateResponse.g.cs | 31 + .../Cluster/GetClusterSettingsResponse.g.cs | 1 + .../Cluster/GetComponentTemplateRequest.g.cs | 138 + .../Cluster/GetComponentTemplateResponse.g.cs | 33 + .../_Generated/Api/Cluster/HealthRequest.g.cs | 16 +- .../Api/Cluster/HealthResponse.g.cs | 1 + .../Api/Cluster/PendingTasksResponse.g.cs | 1 + .../Cluster/PutComponentTemplateRequest.g.cs | 369 + .../Cluster/PutComponentTemplateResponse.g.cs | 36 + .../_Generated/Api/CountRequest.g.cs | 26 +- .../_Generated/Api/CountResponse.g.cs | 1 + .../_Generated/Api/CreateRequest.g.cs | 23 +- .../_Generated/Api/CreateResponse.g.cs | 1 + .../_Generated/Api/DeleteByQueryRequest.g.cs | 48 +- .../_Generated/Api/DeleteByQueryResponse.g.cs | 1 + .../Api/DeleteByQueryRethrottleRequest.g.cs | 12 +- .../Api/DeleteByQueryRethrottleResponse.g.cs | 1 + .../_Generated/Api/DeleteRequest.g.cs | 28 - .../_Generated/Api/DeleteResponse.g.cs | 1 + .../_Generated/Api/DeleteScriptRequest.g.cs | 8 - .../_Generated/Api/DeleteScriptResponse.g.cs | 1 + .../Api/Enrich/DeletePolicyRequest.g.cs | 4 - .../Api/Enrich/DeletePolicyResponse.g.cs | 1 + .../Api/Enrich/EnrichStatsResponse.g.cs | 1 + .../Api/Enrich/ExecutePolicyRequest.g.cs | 4 - .../Api/Enrich/ExecutePolicyResponse.g.cs | 3 +- .../Api/Enrich/GetPolicyRequest.g.cs | 4 + .../Api/Enrich/GetPolicyResponse.g.cs | 1 + .../Api/Enrich/PutPolicyRequest.g.cs | 68 +- .../Api/Enrich/PutPolicyResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlDeleteRequest.g.cs | 8 - .../_Generated/Api/Eql/EqlDeleteResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlGetRequest.g.cs | 8 - .../_Generated/Api/Eql/EqlGetResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlSearchRequest.g.cs | 111 +- .../_Generated/Api/Eql/EqlSearchResponse.g.cs | 1 + .../Api/Eql/GetEqlStatusRequest.g.cs | 8 - .../Api/Eql/GetEqlStatusResponse.g.cs | 1 + .../_Generated/Api/ExistsRequest.g.cs | 28 - .../_Generated/Api/ExistsResponse.g.cs | 5 +- .../_Generated/Api/ExistsSourceRequest.g.cs | 28 - .../_Generated/Api/ExistsSourceResponse.g.cs | 5 +- .../_Generated/Api/ExplainRequest.g.cs | 48 +- .../_Generated/Api/ExplainResponse.g.cs | 1 + .../_Generated/Api/FieldCapsRequest.g.cs | 53 +- .../_Generated/Api/FieldCapsResponse.g.cs | 4 +- .../_Generated/Api/GetRequest.g.cs | 28 - .../_Generated/Api/GetResponse.g.cs | 1 + .../_Generated/Api/GetScriptRequest.g.cs | 8 - .../_Generated/Api/GetScriptResponse.g.cs | 1 + .../_Generated/Api/GetSourceRequest.g.cs | 28 - .../_Generated/Api/GetSourceResponse.g.cs | 1 + .../_Generated/Api/Graph/ExploreRequest.g.cs | 100 +- .../_Generated/Api/Graph/ExploreResponse.g.cs | 1 + .../_Generated/Api/HealthReportRequest.g.cs | 126 + .../_Generated/Api/HealthReportResponse.g.cs | 37 + .../IndexManagement/AnalyzeIndexRequest.g.cs | 509 ++ .../IndexManagement/AnalyzeIndexResponse.g.cs | 35 + .../IndexManagement/ClearCacheRequest.g.cs | 216 + .../IndexManagement/ClearCacheResponse.g.cs | 33 + .../IndexManagement/CloseIndexRequest.g.cs | 8 - .../IndexManagement/CloseIndexResponse.g.cs | 1 + .../CreateDataStreamRequest.g.cs | 4 - .../CreateDataStreamResponse.g.cs | 1 + .../IndexManagement/CreateIndexRequest.g.cs | 64 +- .../IndexManagement/CreateIndexResponse.g.cs | 1 + .../DataStreamsStatsRequest.g.cs | 102 + .../DataStreamsStatsResponse.g.cs | 66 + .../IndexManagement/DeleteAliasRequest.g.cs | 8 - .../IndexManagement/DeleteAliasResponse.g.cs | 1 + .../DeleteDataLifecycleRequest.g.cs | 4 - .../DeleteDataLifecycleResponse.g.cs | 1 + .../DeleteDataStreamRequest.g.cs | 4 - .../DeleteDataStreamResponse.g.cs | 1 + .../IndexManagement/DeleteIndexRequest.g.cs | 8 - .../IndexManagement/DeleteIndexResponse.g.cs | 4 + .../DeleteIndexTemplateRequest.g.cs | 4 - .../DeleteIndexTemplateResponse.g.cs | 1 + .../IndexManagement/ExistsAliasRequest.g.cs | 28 +- .../IndexManagement/ExistsAliasResponse.g.cs | 5 +- .../ExistsIndexTemplateRequest.g.cs | 4 - .../ExistsIndexTemplateResponse.g.cs | 5 +- .../Api/IndexManagement/ExistsRequest.g.cs | 8 - .../Api/IndexManagement/ExistsResponse.g.cs | 5 +- .../ExplainDataLifecycleRequest.g.cs | 8 - .../ExplainDataLifecycleResponse.g.cs | 1 + .../Api/IndexManagement/FlushRequest.g.cs | 8 + .../Api/IndexManagement/FlushResponse.g.cs | 1 + .../IndexManagement/ForcemergeRequest.g.cs | 8 + .../IndexManagement/ForcemergeResponse.g.cs | 1 + .../Api/IndexManagement/GetAliasRequest.g.cs | 28 +- .../GetDataLifecycleRequest.g.cs | 4 - .../GetDataLifecycleResponse.g.cs | 1 + .../IndexManagement/GetDataStreamRequest.g.cs | 4 + .../GetDataStreamResponse.g.cs | 1 + .../Api/IndexManagement/GetIndexRequest.g.cs | 8 - .../GetIndexTemplateRequest.g.cs | 4 + .../GetIndexTemplateResponse.g.cs | 1 + .../GetIndicesSettingsRequest.g.cs | 236 + .../GetIndicesSettingsResponse.g.cs | 37 + .../IndexManagement/GetMappingRequest.g.cs | 8 + .../IndexManagement/IndicesStatsRequest.g.cs | 32 +- .../IndexManagement/IndicesStatsResponse.g.cs | 1 + .../MigrateToDataStreamRequest.g.cs | 4 - .../MigrateToDataStreamResponse.g.cs | 1 + .../ModifyDataStreamRequest.g.cs | 155 + .../ModifyDataStreamResponse.g.cs | 36 + .../Api/IndexManagement/OpenIndexRequest.g.cs | 8 - .../IndexManagement/OpenIndexResponse.g.cs | 1 + .../Api/IndexManagement/PutAliasRequest.g.cs | 28 +- .../Api/IndexManagement/PutAliasResponse.g.cs | 1 + .../PutDataLifecycleRequest.g.cs | 14 +- .../PutDataLifecycleResponse.g.cs | 1 + .../PutIndexTemplateRequest.g.cs | 56 +- .../PutIndexTemplateResponse.g.cs | 1 + .../PutIndicesSettingsRequest.g.cs | 262 + .../PutIndicesSettingsResponse.g.cs | 36 + .../IndexManagement/PutMappingRequest.g.cs | 110 +- .../IndexManagement/PutMappingResponse.g.cs | 4 + .../IndexManagement/PutTemplateRequest.g.cs | 187 +- .../IndexManagement/PutTemplateResponse.g.cs | 1 + .../Api/IndexManagement/RecoveryRequest.g.cs | 151 + .../Api/IndexManagement/RecoveryResponse.g.cs | 37 + .../Api/IndexManagement/RefreshRequest.g.cs | 8 + .../Api/IndexManagement/RefreshResponse.g.cs | 1 + .../IndexManagement/ResolveIndexRequest.g.cs | 94 + .../IndexManagement/ResolveIndexResponse.g.cs | 37 + .../Api/IndexManagement/RolloverRequest.g.cs | 208 +- .../Api/IndexManagement/RolloverResponse.g.cs | 1 + .../Api/IndexManagement/SegmentsRequest.g.cs | 177 + .../Api/IndexManagement/SegmentsResponse.g.cs | 35 + .../SimulateIndexTemplateRequest.g.cs | 66 +- .../SimulateIndexTemplateResponse.g.cs | 1 + .../SimulateTemplateRequest.g.cs | 104 +- .../SimulateTemplateResponse.g.cs | 1 + .../IndexManagement/UpdateAliasesRequest.g.cs | 42 +- .../UpdateAliasesResponse.g.cs | 1 + .../IndexManagement/ValidateQueryRequest.g.cs | 385 + .../ValidateQueryResponse.g.cs | 39 + .../_Generated/Api/IndexRequest.g.cs | 27 +- .../_Generated/Api/IndexResponse.g.cs | 1 + .../_Generated/Api/InfoResponse.g.cs | 1 + .../Api/Ingest/DeletePipelineRequest.g.cs | 8 - .../Api/Ingest/DeletePipelineResponse.g.cs | 1 + .../Api/Ingest/GeoIpStatsResponse.g.cs | 3 +- .../Api/Ingest/GetPipelineRequest.g.cs | 8 + .../Api/Ingest/ProcessorGrokResponse.g.cs | 1 + .../Api/Ingest/PutPipelineRequest.g.cs | 80 +- .../Api/Ingest/PutPipelineResponse.g.cs | 1 + .../Api/Ingest/SimulateRequest.g.cs | 60 +- .../Api/Ingest/SimulateResponse.g.cs | 1 + .../LicenseManagement/GetLicenseRequest.g.cs | 84 + .../LicenseManagement/GetLicenseResponse.g.cs | 33 + ...earTrainedModelDeploymentCacheRequest.g.cs | 82 + ...arTrainedModelDeploymentCacheResponse.g.cs | 33 + .../Api/MachineLearning/CloseJobRequest.g.cs | 151 + .../Api/MachineLearning/CloseJobResponse.g.cs | 33 + .../DeleteCalendarEventRequest.g.cs | 88 + .../DeleteCalendarEventResponse.g.cs | 36 + .../DeleteCalendarJobRequest.g.cs | 88 + .../DeleteCalendarJobResponse.g.cs | 49 + .../DeleteCalendarRequest.g.cs | 82 + .../DeleteCalendarResponse.g.cs | 36 + .../DeleteDataFrameAnalyticsRequest.g.cs | 139 + .../DeleteDataFrameAnalyticsResponse.g.cs | 36 + .../DeleteDatafeedRequest.g.cs | 94 + .../DeleteDatafeedResponse.g.cs | 36 + .../DeleteExpiredDataRequest.g.cs | 137 + .../DeleteExpiredDataResponse.g.cs | 33 + .../MachineLearning/DeleteFilterRequest.g.cs | 82 + .../MachineLearning/DeleteFilterResponse.g.cs | 36 + .../DeleteForecastRequest.g.cs | 120 + .../DeleteForecastResponse.g.cs | 36 + .../Api/MachineLearning/DeleteJobRequest.g.cs | 120 + .../MachineLearning/DeleteJobResponse.g.cs | 36 + .../DeleteModelSnapshotRequest.g.cs | 88 + .../DeleteModelSnapshotResponse.g.cs | 36 + .../DeleteTrainedModelAliasRequest.g.cs | 88 + .../DeleteTrainedModelAliasResponse.g.cs | 36 + .../DeleteTrainedModelRequest.g.cs | 94 + .../DeleteTrainedModelResponse.g.cs | 36 + .../EstimateModelMemoryRequest.g.cs | 276 + .../EstimateModelMemoryResponse.g.cs | 33 + .../EvaluateDataFrameRequest.g.cs | 328 + .../EvaluateDataFrameResponse.g.cs | 37 + .../ExplainDataFrameAnalyticsRequest.g.cs | 674 ++ .../ExplainDataFrameAnalyticsResponse.g.cs | 42 + .../Api/MachineLearning/FlushJobRequest.g.cs | 195 + .../Api/MachineLearning/FlushJobResponse.g.cs | 39 + .../Api/MachineLearning/ForecastRequest.g.cs | 153 + .../Api/MachineLearning/ForecastResponse.g.cs | 35 + .../MachineLearning/GetBucketsRequest.g.cs | 559 ++ .../MachineLearning/GetBucketsResponse.g.cs | 35 + .../GetCalendarEventsRequest.g.cs | 142 + .../GetCalendarEventsResponse.g.cs | 35 + .../MachineLearning/GetCalendarsRequest.g.cs | 169 + .../MachineLearning/GetCalendarsResponse.g.cs | 35 + .../MachineLearning/GetCategoriesRequest.g.cs | 187 + .../GetCategoriesResponse.g.cs | 35 + .../GetDataFrameAnalyticsRequest.g.cs | 181 + .../GetDataFrameAnalyticsResponse.g.cs | 39 + .../GetDataFrameAnalyticsStatsRequest.g.cs | 181 + .../GetDataFrameAnalyticsStatsResponse.g.cs | 39 + .../GetDatafeedStatsRequest.g.cs | 106 + .../GetDatafeedStatsResponse.g.cs | 35 + .../MachineLearning/GetDatafeedsRequest.g.cs | 118 + .../MachineLearning/GetDatafeedsResponse.g.cs | 35 + .../MachineLearning/GetFiltersRequest.g.cs | 114 + .../MachineLearning/GetFiltersResponse.g.cs | 35 + .../GetInfluencersRequest.g.cs | 321 + .../GetInfluencersResponse.g.cs | 39 + .../MachineLearning/GetJobStatsRequest.g.cs | 106 + .../MachineLearning/GetJobStatsResponse.g.cs | 35 + .../Api/MachineLearning/GetJobsRequest.g.cs | 118 + .../Api/MachineLearning/GetJobsResponse.g.cs | 35 + .../GetMemoryStatsRequest.g.cs | 114 + .../GetMemoryStatsResponse.g.cs | 37 + .../GetModelSnapshotUpgradeStatsRequest.g.cs | 104 + .../GetModelSnapshotUpgradeStatsResponse.g.cs | 35 + .../GetModelSnapshotsRequest.g.cs | 445 ++ .../GetModelSnapshotsResponse.g.cs | 35 + .../GetOverallBucketsRequest.g.cs | 241 + .../GetOverallBucketsResponse.g.cs | 39 + .../MachineLearning/GetRecordsRequest.g.cs | 497 ++ .../MachineLearning/GetRecordsResponse.g.cs | 35 + .../GetTrainedModelsRequest.g.cs | 178 + .../GetTrainedModelsResponse.g.cs | 39 + .../GetTrainedModelsStatsRequest.g.cs | 130 + .../GetTrainedModelsStatsResponse.g.cs | 42 + .../InferTrainedModelRequest.g.cs | 260 + .../InferTrainedModelResponse.g.cs | 33 + .../Api/MachineLearning/MlInfoRequest.g.cs | 72 + .../Api/MachineLearning/MlInfoResponse.g.cs | 39 + .../Api/MachineLearning/OpenJobRequest.g.cs | 107 + .../Api/MachineLearning/OpenJobResponse.g.cs | 38 + .../PostCalendarEventsRequest.g.cs | 165 + .../PostCalendarEventsResponse.g.cs | 33 + .../PreviewDataFrameAnalyticsRequest.g.cs | 228 + .../PreviewDataFrameAnalyticsResponse.g.cs | 36 + .../PutCalendarJobRequest.g.cs | 88 + .../PutCalendarJobResponse.g.cs | 49 + .../MachineLearning/PutCalendarRequest.g.cs | 129 + .../MachineLearning/PutCalendarResponse.g.cs | 49 + .../PutDataFrameAnalyticsRequest.g.cs | 718 ++ .../PutDataFrameAnalyticsResponse.g.cs | 55 + .../MachineLearning/PutDatafeedRequest.g.cs | 1117 +++ .../MachineLearning/PutDatafeedResponse.g.cs | 61 + .../Api/MachineLearning/PutFilterRequest.g.cs | 129 + .../MachineLearning/PutFilterResponse.g.cs | 37 + .../Api/MachineLearning/PutJobRequest.g.cs | 988 +++ .../Api/MachineLearning/PutJobResponse.g.cs | 71 + .../PutTrainedModelAliasRequest.g.cs | 100 + .../PutTrainedModelAliasResponse.g.cs | 36 + .../PutTrainedModelDefinitionPartRequest.g.cs | 145 + ...PutTrainedModelDefinitionPartResponse.g.cs | 36 + .../PutTrainedModelRequest.g.cs | 803 ++ .../PutTrainedModelResponse.g.cs | 129 + .../PutTrainedModelVocabularyRequest.g.cs | 147 + .../PutTrainedModelVocabularyResponse.g.cs | 36 + .../Api/MachineLearning/ResetJobRequest.g.cs | 106 + .../Api/MachineLearning/ResetJobResponse.g.cs | 36 + .../RevertModelSnapshotRequest.g.cs | 113 + .../RevertModelSnapshotResponse.g.cs | 33 + .../SetUpgradeModeRequest.g.cs | 96 + .../SetUpgradeModeResponse.g.cs | 36 + .../StartDataFrameAnalyticsRequest.g.cs | 126 + .../StartDataFrameAnalyticsResponse.g.cs | 39 + .../MachineLearning/StartDatafeedRequest.g.cs | 159 + .../StartDatafeedResponse.g.cs | 43 + .../StartTrainedModelDeploymentRequest.g.cs | 166 + .../StartTrainedModelDeploymentResponse.g.cs | 33 + .../StopDataFrameAnalyticsRequest.g.cs | 156 + .../StopDataFrameAnalyticsResponse.g.cs | 33 + .../MachineLearning/StopDatafeedRequest.g.cs | 151 + .../MachineLearning/StopDatafeedResponse.g.cs | 33 + .../StopTrainedModelDeploymentRequest.g.cs | 106 + .../StopTrainedModelDeploymentResponse.g.cs | 33 + .../UpdateDataFrameAnalyticsRequest.g.cs | 270 + .../UpdateDataFrameAnalyticsResponse.g.cs | 55 + .../UpdateDatafeedRequest.g.cs | 1069 +++ .../UpdateDatafeedResponse.g.cs | 61 + .../MachineLearning/UpdateFilterRequest.g.cs | 151 + .../MachineLearning/UpdateFilterResponse.g.cs | 37 + .../Api/MachineLearning/UpdateJobRequest.g.cs | 944 +++ .../MachineLearning/UpdateJobResponse.g.cs | 73 + .../UpdateModelSnapshotRequest.g.cs | 135 + .../UpdateModelSnapshotResponse.g.cs | 35 + .../UpgradeJobSnapshotRequest.g.cs | 112 + .../UpgradeJobSnapshotResponse.g.cs} | 21 +- .../ValidateDetectorRequest.g.cs | 149 + .../ValidateDetectorResponse.g.cs | 36 + .../Api/MachineLearning/ValidateRequest.g.cs | 595 ++ .../Api/MachineLearning/ValidateResponse.g.cs | 36 + .../_Generated/Api/MultiGetRequest.g.cs | 46 +- .../_Generated/Api/MultiGetResponse.g.cs | 1 + .../_Generated/Api/MultiSearchRequest.g.cs | 76 +- .../_Generated/Api/MultiSearchResponse.g.cs | 1 + .../Api/MultiSearchTemplateRequest.g.cs | 76 +- .../Api/MultiSearchTemplateResponse.g.cs | 1 + .../Api/MultiTermVectorsRequest.g.cs | 40 +- .../Api/MultiTermVectorsResponse.g.cs | 1 + .../Api/Nodes/HotThreadsRequest.g.cs | 186 + .../Api/Nodes/HotThreadsResponse.g.cs | 33 + .../Api/Nodes/NodesInfoRequest.g.cs | 140 + .../Api/Nodes/NodesInfoResponse.g.cs | 41 + .../Api/Nodes/NodesStatsRequest.g.cs | 295 + .../Api/Nodes/NodesStatsResponse.g.cs | 41 + .../NodesUsageRequest.g.cs} | 66 +- .../Api/Nodes/NodesUsageResponse.g.cs | 41 + .../Api/OpenPointInTimeRequest.g.cs | 8 - .../Api/OpenPointInTimeResponse.g.cs | 1 + .../_Generated/Api/PingResponse.g.cs | 1 + .../_Generated/Api/PutScriptRequest.g.cs | 48 +- .../_Generated/Api/PutScriptResponse.g.cs | 1 + .../_Generated/Api/RankEvalRequest.g.cs | 60 +- .../_Generated/Api/RankEvalResponse.g.cs | 3 +- .../_Generated/Api/ReindexRequest.g.cs | 40 +- .../_Generated/Api/ReindexResponse.g.cs | 1 + .../Api/ReindexRethrottleRequest.g.cs | 12 +- .../Api/ReindexRethrottleResponse.g.cs | 1 + .../Api/RenderSearchTemplateRequest.g.cs | 8 + .../Api/RenderSearchTemplateResponse.g.cs | 1 + .../_Generated/Api/ScrollResponse.g.cs | 1 + .../_Generated/Api/SearchMvtRequest.g.cs | 874 +++ .../_Generated/Api/SearchMvtResponse.g.cs | 31 + .../_Generated/Api/SearchRequest.g.cs | 444 +- .../_Generated/Api/SearchResponse.g.cs | 1 + .../_Generated/Api/SearchTemplateRequest.g.cs | 8 + .../Api/SearchTemplateResponse.g.cs | 1 + .../Snapshot/CleanupRepositoryRequest.g.cs | 106 + .../Snapshot/CleanupRepositoryResponse.g.cs | 36 + .../Api/Snapshot/CloneSnapshotRequest.g.cs | 124 + .../Api/Snapshot/CloneSnapshotResponse.g.cs | 36 + .../Api/Snapshot/CreateRepositoryRequest.g.cs | 125 + .../Snapshot/CreateRepositoryResponse.g.cs | 36 + .../Api/Snapshot/CreateSnapshotRequest.g.cs | 247 + .../Api/Snapshot/CreateSnapshotResponse.g.cs | 42 + .../Api/Snapshot/DeleteRepositoryRequest.g.cs | 106 + .../Snapshot/DeleteRepositoryResponse.g.cs | 36 + .../Api/Snapshot/DeleteSnapshotRequest.g.cs | 100 + .../Api/Snapshot/DeleteSnapshotResponse.g.cs | 36 + .../Api/Snapshot/GetRepositoryRequest.g.cs | 114 + .../Api/Snapshot/GetRepositoryResponse.g.cs | 37 + .../Api/Snapshot/GetSnapshotRequest.g.cs | 244 + .../GetSnapshotResponse.g.cs} | 29 +- .../Api/Snapshot/RestoreRequest.g.cs | 497 ++ .../Api/Snapshot/RestoreResponse.g.cs | 33 + .../Api/Snapshot/SnapshotStatusRequest.g.cs | 124 + .../Api/Snapshot/SnapshotStatusResponse.g.cs | 33 + .../Api/Snapshot/VerifyRepositoryRequest.g.cs | 106 + .../Snapshot/VerifyRepositoryResponse.g.cs | 33 + .../DeleteLifecycleRequest.g.cs | 82 + .../DeleteLifecycleResponse.g.cs | 36 + .../ExecuteLifecycleRequest.g.cs | 82 + .../ExecuteLifecycleResponse.g.cs | 33 + .../ExecuteRetentionRequest.g.cs | 72 + .../ExecuteRetentionResponse.g.cs | 36 + .../GetLifecycleRequest.g.cs | 90 + .../GetLifecycleResponse.g.cs | 37 + .../GetSlmStatusRequest.g.cs | 72 + .../GetSlmStatusResponse.g.cs | 33 + .../GetStatsRequest.g.cs | 72 + .../GetStatsResponse.g.cs | 51 + .../PutLifecycleRequest.g.cs | 279 + .../PutLifecycleResponse.g.cs | 36 + .../StartSlmRequest.g.cs | 72 + .../StartSlmResponse.g.cs | 36 + .../StopSlmRequest.g.cs | 72 + .../StopSlmResponse.g.cs | 36 + .../Api/Sql/ClearCursorResponse.g.cs | 1 + .../Api/Sql/DeleteAsyncRequest.g.cs | 8 - .../Api/Sql/DeleteAsyncResponse.g.cs | 1 + .../_Generated/Api/Sql/GetAsyncRequest.g.cs | 8 - .../_Generated/Api/Sql/GetAsyncResponse.g.cs | 1 + .../Api/Sql/GetAsyncStatusRequest.g.cs | 8 - .../Api/Sql/GetAsyncStatusResponse.g.cs | 1 + .../_Generated/Api/Sql/QueryRequest.g.cs | 54 +- .../_Generated/Api/Sql/QueryResponse.g.cs | 1 + .../_Generated/Api/Sql/TranslateRequest.g.cs | 306 + .../TranslateResponse.g.cs} | 37 +- .../Api/Synonyms/DeleteSynonymRequest.g.cs | 112 + .../Api/Synonyms/DeleteSynonymResponse.g.cs | 36 + .../Synonyms/DeleteSynonymRuleRequest.g.cs | 88 + .../Synonyms/DeleteSynonymRuleResponse.g.cs | 42 + .../Api/Synonyms/GetSynonymRequest.g.cs | 139 + .../Api/Synonyms/GetSynonymResponse.g.cs | 35 + .../Api/Synonyms/GetSynonymRuleRequest.g.cs | 88 + .../Api/Synonyms/GetSynonymRuleResponse.g.cs | 42 + .../Api/Synonyms/GetSynonymsSetsRequest.g.cs | 96 + .../Api/Synonyms/GetSynonymsSetsResponse.g.cs | 35 + .../Api/Synonyms/PutSynonymRequest.g.cs | 272 + .../Api/Synonyms/PutSynonymResponse.g.cs | 35 + .../Api/Synonyms/PutSynonymRuleRequest.g.cs | 103 + .../Api/Synonyms/PutSynonymRuleResponse.g.cs | 42 + .../_Generated/Api/Tasks/CancelRequest.g.cs | 136 - .../_Generated/Api/Tasks/ListRequest.g.cs | 170 - .../_Generated/Api/TermVectorsRequest.g.cs | 29 +- .../_Generated/Api/TermVectorsResponse.g.cs | 1 + .../_Generated/Api/TermsEnumRequest.g.cs | 41 +- .../_Generated/Api/TermsEnumResponse.g.cs | 1 + .../TextStructure/TestGrokPatternRequest.g.cs | 123 + .../TestGrokPatternResponse.g.cs | 33 + .../DeleteTransformRequest.g.cs | 118 + .../DeleteTransformResponse.g.cs | 36 + .../GetTransformRequest.g.cs | 142 + .../GetTransformResponse.g.cs | 35 + .../GetTransformStatsRequest.g.cs | 134 + .../GetTransformStatsResponse.g.cs | 35 + .../PreviewTransformRequest.g.cs | 909 +++ .../PreviewTransformResponse.g.cs | 35 + .../PutTransformRequest.g.cs | 957 +++ .../PutTransformResponse.g.cs | 36 + .../ResetTransformRequest.g.cs | 94 + .../ResetTransformResponse.g.cs | 36 + .../ScheduleNowTransformRequest.g.cs | 96 + .../ScheduleNowTransformResponse.g.cs | 36 + .../StartTransformRequest.g.cs | 110 + .../StartTransformResponse.g.cs | 36 + .../StopTransformRequest.g.cs | 146 + .../StopTransformResponse.g.cs | 36 + .../UpdateTransformRequest.g.cs | 752 ++ .../UpdateTransformResponse.g.cs | 59 + .../UpgradeTransformsRequest.g.cs | 96 + .../UpgradeTransformsResponse.g.cs | 48 + .../_Generated/Api/UpdateByQueryRequest.g.cs | 48 +- .../_Generated/Api/UpdateByQueryResponse.g.cs | 1 + .../Api/UpdateByQueryRethrottleRequest.g.cs | 12 +- .../Api/UpdateByQueryRethrottleResponse.g.cs | 1 + .../_Generated/Api/UpdateRequest.g.cs | 30 +- .../_Generated/Api/UpdateResponse.g.cs | 1 + .../Api/Xpack/XpackInfoRequest.g.cs | 96 + .../Api/Xpack/XpackInfoResponse.g.cs | 39 + .../Api/Xpack/XpackUsageRequest.g.cs | 84 + .../Api/Xpack/XpackUsageResponse.g.cs | 89 + .../ElasticsearchClient.AsyncSearch.g.cs | 333 +- .../Client/ElasticsearchClient.Cluster.g.cs | 428 +- .../Client/ElasticsearchClient.Enrich.g.cs | 275 +- .../Client/ElasticsearchClient.Eql.g.cs | 303 +- .../Client/ElasticsearchClient.Graph.g.cs | 72 +- .../Client/ElasticsearchClient.Indices.g.cs | 2826 +++---- .../Client/ElasticsearchClient.Ingest.g.cs | 354 +- .../Client/ElasticsearchClient.License.g.cs | 92 + .../Client/ElasticsearchClient.Ml.g.cs | 3925 ++++++++++ .../Client/ElasticsearchClient.Nodes.g.cs | 273 + .../Client/ElasticsearchClient.Slm.g.cs | 516 ++ .../Client/ElasticsearchClient.Snapshot.g.cs | 622 ++ .../Client/ElasticsearchClient.Sql.g.cs | 372 +- .../Client/ElasticsearchClient.Synonyms.g.cs | 388 + .../Client/ElasticsearchClient.Tasks.g.cs | 320 - .../ElasticsearchClient.TextStructure.g.cs | 92 + .../Client/ElasticsearchClient.Transform.g.cs | 644 ++ .../Client/ElasticsearchClient.Xpack.g.cs | 145 + .../Client/ElasticsearchClient.g.cs | 3158 ++------ .../AdjacencyMatrixAggregation.g.cs | 224 +- .../Aggregations/AdjacencyMatrixBucket.g.cs | 82 +- .../Aggregations/AggregateDictionary.g.cs | 655 +- .../Types/Aggregations/Aggregation.g.cs | 2448 +++--- .../AutoDateHistogramAggregation.g.cs | 417 +- .../Types/Aggregations/AverageAggregate.g.cs | 4 + .../Aggregations/AverageAggregation.g.cs | 218 +- .../AverageBucketAggregation.g.cs | 145 + .../Aggregations/BoxplotAggregation.g.cs | 215 +- .../BucketMetricValueAggregate.g.cs | 44 + .../Aggregations/BucketScriptAggregation.g.cs | 167 + .../BucketSelectorAggregation.g.cs | 167 + .../Aggregations/BucketSortAggregation.g.cs | 233 +- .../Types/Aggregations/Buckets.g.cs | 7 +- .../Types/Aggregations/BucketsPath.g.cs | 5 +- .../Aggregations/CardinalityAggregation.g.cs | 253 +- .../Types/Aggregations/ChildrenAggregate.g.cs | 82 +- .../Aggregations/ChildrenAggregation.g.cs | 251 +- .../Aggregations/CompositeAggregate.g.cs | 2 +- .../Aggregations/CompositeAggregation.g.cs | 273 +- .../CompositeAggregationSource.g.cs | 410 + .../Types/Aggregations/CompositeBucket.g.cs | 84 +- .../CompositeDateHistogramAggregation.g.cs | 447 ++ .../CompositeGeoTileGridAggregation.g.cs | 344 + .../CompositeHistogramAggregation.g.cs | 307 + .../CompositeTermsAggregation.g.cs | 287 + .../CumulativeCardinalityAggregation.g.cs | 161 +- .../CumulativeSumAggregation.g.cs | 161 +- .../DateHistogramAggregation.g.cs | 473 +- .../Aggregations/DateHistogramBucket.g.cs | 95 +- .../Aggregations/DateRangeAggregation.g.cs | 379 +- .../Aggregations/DerivativeAggregate.g.cs | 4 + .../Aggregations/DerivativeAggregation.g.cs | 161 +- .../DiversifiedSamplerAggregation.g.cs | 329 +- .../Types/Aggregations/DoubleTermsBucket.g.cs | 108 +- .../ExtendedStatsAggregation.g.cs | 237 +- .../ExtendedStatsBucketAggregation.g.cs | 192 +- .../Types/Aggregations/FieldDateMath.g.cs | 9 +- .../Types/Aggregations/FilterAggregate.g.cs | 82 +- .../Aggregations/FiltersAggregation.g.cs | 282 +- .../Types/Aggregations/FiltersBucket.g.cs | 69 +- .../FrequentItemSetsAggregate.g.cs | 36 + .../FrequentItemSetsAggregation.g.cs | 431 ++ .../Aggregations/FrequentItemSetsBucket.g.cs | 93 + .../Aggregations/FrequentItemSetsField.g.cs | 183 + .../Aggregations/GeoBoundsAggregation.g.cs | 214 +- .../Aggregations/GeoCentroidAggregation.g.cs | 238 +- .../Aggregations/GeoDistanceAggregation.g.cs | 365 +- .../Aggregations/GeoLineAggregation.g.cs | 215 +- .../Types/Aggregations/GeoLinePoint.g.cs | 9 + .../Types/Aggregations/GeoLineSort.g.cs | 9 + .../Aggregations/GeohashGridAggregation.g.cs | 333 +- .../Types/Aggregations/GeohashGridBucket.g.cs | 82 +- .../Aggregations/GeohexGridAggregation.g.cs | 325 +- .../Types/Aggregations/GeohexGridBucket.g.cs | 82 +- .../Aggregations/GeotileGridAggregation.g.cs | 342 +- .../Types/Aggregations/GeotileGridBucket.g.cs | 82 +- .../Types/Aggregations/GlobalAggregate.g.cs | 82 +- .../Types/Aggregations/GlobalAggregation.g.cs | 209 +- .../HdrPercentileRanksAggregate.g.cs | 36 + .../Aggregations/HdrPercentilesAggregate.g.cs | 36 + .../Aggregations/HistogramAggregation.g.cs | 404 +- .../Types/Aggregations/HistogramBucket.g.cs | 95 +- .../Aggregations/InferenceAggregate.g.cs | 72 +- .../Aggregations/InferenceAggregation.g.cs | 244 +- .../Types/Aggregations/InferenceConfig.g.cs | 131 +- .../Aggregations/IpPrefixAggregation.g.cs | 350 +- .../Types/Aggregations/IpPrefixBucket.g.cs | 121 +- .../Aggregations/IpRangeAggregation.g.cs | 304 +- .../Types/Aggregations/IpRangeBucket.g.cs | 108 +- .../Aggregations/LongRareTermsAggregate.g.cs | 39 + .../Aggregations/LongRareTermsBucket.g.cs | 93 + .../Types/Aggregations/LongTermsBucket.g.cs | 108 +- .../Aggregations/MatrixStatsAggregation.g.cs | 188 +- .../Types/Aggregations/MaxAggregate.g.cs | 4 + .../Types/Aggregations/MaxAggregation.g.cs | 218 +- .../Aggregations/MaxBucketAggregation.g.cs | 145 + .../MedianAbsoluteDeviationAggregate.g.cs | 4 + .../MedianAbsoluteDeviationAggregation.g.cs | 238 +- .../Types/Aggregations/MinAggregate.g.cs | 4 + .../Types/Aggregations/MinAggregation.g.cs | 218 +- .../Aggregations/MinBucketAggregation.g.cs | 145 + .../Types/Aggregations/MissingAggregate.g.cs | 82 +- .../Aggregations/MissingAggregation.g.cs | 262 +- .../MovingFunctionAggregation.g.cs | 211 + .../MovingPercentilesAggregation.g.cs | 189 + .../Types/Aggregations/MultiTermLookup.g.cs | 19 +- .../Aggregations/MultiTermsAggregation.g.cs | 422 +- .../Types/Aggregations/MultiTermsBucket.g.cs | 108 +- .../Types/Aggregations/NestedAggregate.g.cs | 82 +- .../Types/Aggregations/NestedAggregation.g.cs | 224 +- .../Aggregations/NormalizeAggregation.g.cs | 167 + .../Types/Aggregations/ParentAggregate.g.cs | 82 +- .../Types/Aggregations/ParentAggregation.g.cs | 251 +- .../PercentageScoreHeuristic.g.cs | 2 + .../PercentileRanksAggregation.g.cs | 319 +- .../Types/Aggregations/Percentiles.g.cs | 6 +- .../Aggregations/PercentilesAggregation.g.cs | 319 +- .../PercentilesBucketAggregation.g.cs | 192 +- .../Types/Aggregations/RangeAggregation.g.cs | 361 +- .../Types/Aggregations/RangeBucket.g.cs | 154 +- .../Aggregations/RareTermsAggregation.g.cs | 381 +- .../Types/Aggregations/RateAggregation.g.cs | 256 +- .../Aggregations/ReverseNestedAggregate.g.cs | 82 +- .../ReverseNestedAggregation.g.cs | 224 +- .../Types/Aggregations/SamplerAggregate.g.cs | 82 +- .../Aggregations/SamplerAggregation.g.cs | 251 +- .../ScriptedMetricAggregation.g.cs | 299 +- .../SerialDifferencingAggregation.g.cs | 167 + .../SignificantLongTermsAggregate.g.cs | 40 + .../SignificantLongTermsBucket.g.cs | 109 + .../SignificantStringTermsBucket.g.cs | 108 +- .../SignificantTermsAggregation.g.cs | 663 +- .../SignificantTextAggregation.g.cs | 1223 +++ .../Aggregations/SimpleValueAggregate.g.cs | 4 + .../Types/Aggregations/StatsAggregation.g.cs | 218 +- .../Aggregations/StatsBucketAggregation.g.cs | 161 +- .../Aggregations/StringRareTermsBucket.g.cs | 82 +- .../Aggregations/StringStatsAggregation.g.cs | 214 +- .../Types/Aggregations/StringTermsBucket.g.cs | 95 +- .../Types/Aggregations/SumAggregate.g.cs | 4 + .../Types/Aggregations/SumAggregation.g.cs | 218 +- .../Aggregations/SumBucketAggregation.g.cs | 145 + .../Types/Aggregations/TTestAggregation.g.cs | 221 +- .../Types/Aggregations/TermsAggregation.g.cs | 558 +- .../Types/Aggregations/TestPopulation.g.cs | 29 +- .../Aggregations/TopHitsAggregation.g.cs | 507 +- .../Types/Aggregations/TopMetrics.g.cs | 4 +- .../Aggregations/TopMetricsAggregation.g.cs | 318 +- .../Types/Aggregations/TopMetricsValue.g.cs | 9 + .../UnmappedRareTermsAggregate.g.cs | 39 + .../UnmappedSamplerAggregate.g.cs | 85 + .../UnmappedSignificantTermsAggregate.g.cs | 43 + .../Aggregations/UnmappedTermsAggregate.g.cs | 43 + .../Aggregations/ValueCountAggregate.g.cs | 4 + .../Aggregations/ValueCountAggregation.g.cs | 218 +- .../VariableWidthHistogramAggregation.g.cs | 181 +- .../VariableWidthHistogramBucket.g.cs | 161 +- .../WeightedAverageAggregate.g.cs | 4 + .../WeightedAverageAggregation.g.cs | 240 +- .../Aggregations/WeightedAverageValue.g.cs | 9 + .../_Generated/Types/Analysis/Analyzers.g.cs | 165 +- .../Analysis/AsciiFoldingTokenFilter.g.cs | 9 +- .../Types/Analysis/CharFilters.g.cs | 54 +- .../Types/Analysis/CharGroupTokenizer.g.cs | 4 +- .../Analysis/CommonGramsTokenFilter.g.cs | 4 +- .../Types/Analysis/ConditionTokenFilter.g.cs | 4 +- .../Analysis/DelimitedPayloadTokenFilter.g.cs | 4 +- .../DictionaryDecompounderTokenFilter.g.cs | 4 +- .../Types/Analysis/DutchAnalyzer.g.cs | 2 +- .../Types/Analysis/EdgeNGramTokenFilter.g.cs | 9 +- .../Types/Analysis/EdgeNGramTokenizer.g.cs | 4 +- .../Types/Analysis/ElisionTokenFilter.g.cs | 9 +- .../Types/Analysis/FingerprintAnalyzer.g.cs | 6 +- .../Analysis/FingerprintTokenFilter.g.cs | 4 +- .../Types/Analysis/HtmlStripCharFilter.g.cs | 4 +- .../Types/Analysis/HunspellTokenFilter.g.cs | 4 +- .../HyphenationDecompounderTokenFilter.g.cs | 4 +- .../Analysis/IcuCollationTokenFilter.g.cs | 4 +- .../Types/Analysis/IcuFoldingTokenFilter.g.cs | 4 +- .../Analysis/IcuNormalizationCharFilter.g.cs | 4 +- .../Analysis/IcuNormalizationTokenFilter.g.cs | 4 +- .../Types/Analysis/IcuTokenizer.g.cs | 4 +- .../Analysis/IcuTransformTokenFilter.g.cs | 4 +- .../Types/Analysis/KStemTokenFilter.g.cs | 4 +- .../Types/Analysis/KeepTypesTokenFilter.g.cs | 4 +- .../Types/Analysis/KeepWordsTokenFilter.g.cs | 4 +- .../Types/Analysis/KeywordAnalyzer.g.cs | 4 +- .../Analysis/KeywordMarkerTokenFilter.g.cs | 4 +- .../Types/Analysis/KeywordTokenizer.g.cs | 4 +- .../KuromojiIterationMarkCharFilter.g.cs | 4 +- .../KuromojiPartOfSpeechTokenFilter.g.cs | 4 +- .../KuromojiReadingFormTokenFilter.g.cs | 4 +- .../Analysis/KuromojiStemmerTokenFilter.g.cs | 4 +- .../Types/Analysis/KuromojiTokenizer.g.cs | 4 +- .../Types/Analysis/LanguageAnalyzer.g.cs | 6 +- .../Types/Analysis/LengthTokenFilter.g.cs | 4 +- .../Types/Analysis/LetterTokenizer.g.cs | 4 +- .../Analysis/LimitTokenCountTokenFilter.g.cs | 9 +- .../Types/Analysis/LowercaseTokenFilter.g.cs | 4 +- .../Types/Analysis/LowercaseTokenizer.g.cs | 4 +- .../Types/Analysis/MappingCharFilter.g.cs | 4 +- .../Analysis/MultiplexerTokenFilter.g.cs | 9 +- .../Types/Analysis/NGramTokenFilter.g.cs | 9 +- .../Types/Analysis/NGramTokenizer.g.cs | 4 +- .../Types/Analysis/NoriAnalyzer.g.cs | 4 +- .../Analysis/NoriPartOfSpeechTokenFilter.g.cs | 4 +- .../Types/Analysis/NoriTokenizer.g.cs | 4 +- .../Types/Analysis/Normalizers.g.cs | 21 +- .../Analysis/PathHierarchyTokenizer.g.cs | 19 +- .../Types/Analysis/PatternAnalyzer.g.cs | 6 +- .../Analysis/PatternCaptureTokenFilter.g.cs | 9 +- .../Analysis/PatternReplaceCharFilter.g.cs | 4 +- .../Analysis/PatternReplaceTokenFilter.g.cs | 4 +- .../Types/Analysis/PatternTokenizer.g.cs | 4 +- .../Types/Analysis/PhoneticTokenFilter.g.cs | 4 +- .../Types/Analysis/PorterStemTokenFilter.g.cs | 4 +- .../Types/Analysis/PredicateTokenFilter.g.cs | 4 +- .../Analysis/RemoveDuplicatesTokenFilter.g.cs | 4 +- .../Types/Analysis/ReverseTokenFilter.g.cs | 4 +- .../Types/Analysis/ShingleTokenFilter.g.cs | 16 +- .../Types/Analysis/SimpleAnalyzer.g.cs | 4 +- .../Types/Analysis/SnowballAnalyzer.g.cs | 6 +- .../Types/Analysis/SnowballTokenFilter.g.cs | 4 +- .../Types/Analysis/StandardAnalyzer.g.cs | 2 +- .../Types/Analysis/StandardTokenizer.g.cs | 4 +- .../Analysis/StemmerOverrideTokenFilter.g.cs | 4 +- .../Types/Analysis/StemmerTokenFilter.g.cs | 9 +- .../Types/Analysis/StopAnalyzer.g.cs | 6 +- .../Types/Analysis/StopTokenFilter.g.cs | 6 +- .../Analysis/SynonymGraphTokenFilter.g.cs | 4 +- .../Types/Analysis/SynonymTokenFilter.g.cs | 4 +- .../Types/Analysis/TokenFilters.g.cs | 552 +- .../_Generated/Types/Analysis/Tokenizers.g.cs | 162 +- .../Types/Analysis/TrimTokenFilter.g.cs | 4 +- .../Types/Analysis/TruncateTokenFilter.g.cs | 4 +- .../Types/Analysis/UaxEmailUrlTokenizer.g.cs | 4 +- .../Types/Analysis/UniqueTokenFilter.g.cs | 4 +- .../Types/Analysis/UppercaseTokenFilter.g.cs | 4 +- .../Types/Analysis/WhitespaceAnalyzer.g.cs | 4 +- .../Types/Analysis/WhitespaceTokenizer.g.cs | 4 +- .../WordDelimiterGraphTokenFilter.g.cs | 9 +- .../Analysis/WordDelimiterTokenFilter.g.cs | 9 +- .../Types/AsyncSearch/AsyncSearch.g.cs | 21 +- .../_Generated/Types/ByteSize.g.cs | 7 +- .../Types/Cluster/CharFilterTypes.g.cs | 6 + .../ComponentTemplate.g.cs} | 11 +- .../Types/Cluster/ComponentTemplateNode.g.cs | 38 + .../Cluster/ComponentTemplateSummary.g.cs | 45 + .../_Generated/Types/ClusterDetails.g.cs | 4 +- .../Types/Core/Bulk/ResponseItem.g.cs | 47 +- .../_Generated/Types/Core/Context.g.cs | 8 +- .../Types/Core/FieldCaps/FieldCapability.g.cs | 33 +- .../_Generated/Types/Core/Get/GetResult.g.cs | 9 +- .../Types/Core/HealthReport/Diagnosis.g.cs | 42 + .../DiagnosisAffectedResources.g.cs | 43 + .../Core/HealthReport/DiskIndicator.g.cs | 45 + .../HealthReport/DiskIndicatorDetails.g.cs | 42 + .../Types/Core/HealthReport/IlmIndicator.g.cs | 45 + .../HealthReport/IlmIndicatorDetails.g.cs | 36 + .../Types/Core/HealthReport/Impact.g.cs | 40 + .../HealthReport/IndicatorNode.g.cs} | 11 +- .../Types/Core/HealthReport/Indicators.g.cs | 46 + .../HealthReport/MasterIsStableIndicator.g.cs | 45 + ...IsStableIndicatorClusterFormationNode.g.cs | 38 + .../MasterIsStableIndicatorDetails.g.cs | 40 + ...ableIndicatorExceptionFetchingHistory.g.cs | 36 + .../RepositoryIntegrityIndicator.g.cs | 45 + .../RepositoryIntegrityIndicatorDetails.g.cs | 38 + .../ShardsAvailabilityIndicator.g.cs | 45 + .../ShardsAvailabilityIndicatorDetails.g.cs | 50 + .../HealthReport/ShardsCapacityIndicator.g.cs | 45 + .../ShardsCapacityIndicatorDetails.g.cs | 36 + .../ShardsCapacityIndicatorTierDetail.g.cs | 36 + .../Types/Core/HealthReport/SlmIndicator.g.cs | 45 + .../HealthReport/SlmIndicatorDetails.g.cs | 38 + .../SlmIndicatorUnhealthyPolicies.g.cs | 36 + .../Types/Core/MGet/MultiGetError.g.cs | 4 +- .../Types/Core/MGet/MultiGetOperation.g.cs | 134 +- .../Types/Core/MSearch/MultiSearchItem.g.cs | 12 +- .../Types/Core/MSearch/MultisearchBody.g.cs | 2312 +----- .../Types/Core/MSearch/MultisearchHeader.g.cs | 186 +- .../Core/MSearchTemplate/TemplateConfig.g.cs | 106 +- .../MultiTermVectorsOperation.g.cs | 64 +- .../Mtermvectors/MultiTermVectorsResult.g.cs | 12 +- .../Types/Core/MultiGetResponseItem.g.cs | 4 +- .../Types/Core/MultiSearchResponseItem.g.cs | 4 +- .../Types/Core/RankEval/RankEvalMetric.g.cs | 50 +- ...ankEvalMetricDiscountedCumulativeGain.g.cs | 8 + .../RankEvalMetricExpectedReciprocalRank.g.cs | 8 + .../RankEvalMetricMeanReciprocalRank.g.cs | 15 + .../RankEval/RankEvalMetricPrecision.g.cs | 16 + .../Core/RankEval/RankEvalMetricRecall.g.cs | 15 + .../Types/Core/RankEval/RankEvalQuery.g.cs | 20 +- .../Core/RankEval/RankEvalRequestItem.g.cs | 52 +- .../Types/Core/Reindex/RemoteSource.g.cs | 6 +- .../_Generated/Types/Core/Reindex/Source.g.cs | 134 +- .../Core/ReindexRethrottle/ReindexTask.g.cs | 2 +- .../Types/Core/Search/CompletionSuggest.g.cs | 41 + .../Core/Search/CompletionSuggestOption.g.cs | 52 + .../Core/Search/CompletionSuggester.g.cs | 103 +- .../Types/Core/Search/DirectGenerator.g.cs | 9 + .../Types/Core/Search/FieldCollapse.g.cs | 61 +- .../Types/Core/Search/FieldSuggester.g.cs | 42 +- .../Types/Core/Search/Highlight.g.cs | 223 +- .../Types/Core/Search/HighlightField.g.cs | 222 +- .../_Generated/Types/Core/Search/Hit.g.cs | 25 +- .../Types/Core/Search/HitsMetadata.g.cs | 2 +- .../Types/Core/Search/InnerHits.g.cs | 148 +- .../Core/Search/LaplaceSmoothingModel.g.cs | 2 +- .../LinearInterpolationSmoothingModel.g.cs | 2 +- .../Types/Core/Search/NestedIdentity.g.cs | 4 +- .../Types/Core/Search/PhraseSuggest.g.cs | 41 + .../Core/Search/PhraseSuggestCollate.g.cs | 10 +- .../Core/Search/PhraseSuggestOption.g.cs | 40 + .../Types/Core/Search/PhraseSuggester.g.cs | 141 +- .../Types/Core/Search/RegexOptions.g.cs | 6 +- .../_Generated/Types/Core/Search/Rescore.g.cs | 20 +- .../Types/Core/Search/RescoreQuery.g.cs | 32 +- .../Types/Core/Search/SmoothingModel.g.cs | 142 +- .../Types/Core/Search/SourceFilter.g.cs | 42 + .../Search/StupidBackoffSmoothingModel.g.cs | 2 +- .../Types/Core/Search/SuggestDictionary.g.cs | 108 + .../Types/Core/Search/Suggester.g.cs | 71 +- .../Types/Core/Search/TermSuggest.g.cs | 41 + .../Types/Core/Search/TermSuggestOption.g.cs | 42 + .../Types/Core/Search/TermSuggester.g.cs | 49 +- .../_Generated/Types/Core/SourceConfig.g.cs | 7 +- .../Types/Core/SourceConfigParam.g.cs | 7 +- .../_Generated/Types/Core/TrackHits.g.cs | 7 +- .../_Generated/Types/EmptyObject.g.cs | 2 + .../_Generated/Types/Enrich/EnrichPolicy.g.cs | 84 +- .../Types/Enrich/EnrichSummary.g.cs | 2 +- .../Types/Enums/Enums.Aggregations.g.cs | 127 +- .../Types/Enums/Enums.Analysis.g.cs | 66 +- .../_Generated/Types/Enums/Enums.Cluster.g.cs | 15 +- .../Types/Enums/Enums.Core.HealthReport.g.cs | 141 + .../Types/Enums/Enums.Core.Search.g.cs | 33 +- .../Types/Enums/Enums.Core.SearchMvt.g.cs | 120 + .../_Generated/Types/Enums/Enums.Enrich.g.cs | 12 +- .../_Generated/Types/Enums/Enums.Eql.g.cs | 9 +- .../Types/Enums/Enums.IndexManagement.g.cs | 88 +- .../_Generated/Types/Enums/Enums.Ingest.g.cs | 18 +- .../Types/Enums/Enums.LicenseManagement.g.cs | 176 + .../Types/Enums/Enums.MachineLearning.g.cs | 1206 +++ .../_Generated/Types/Enums/Enums.Mapping.g.cs | 39 +- .../Types/Enums/Enums.NoNamespace.g.cs | 273 +- .../Types/Enums/Enums.QueryDsl.g.cs | 103 +- .../Types/Enums/Enums.Snapshot.g.cs | 184 + .../_Generated/Types/Enums/Enums.Tasks.g.cs | 86 - .../_Generated/Types/Enums/Enums.Watcher.g.cs | 9 +- .../_Generated/Types/Eql/HitsEvent.g.cs | 7 +- .../_Generated/Types/ErrorCause.g.cs | 12 +- .../_Generated/Types/ErrorResponseBase.g.cs | 3 +- .../_Generated/Types/FieldSort.g.cs | 30 +- .../_Generated/Types/Fuzziness.g.cs | 7 +- .../_Generated/Types/GeoDistanceSort.g.cs | 68 +- .../_Generated/Types/GeoHashLocation.g.cs | 2 +- .../_Generated/Types/GeoLocation.g.cs | 5 +- .../_Generated/Types/GeohashPrecision.g.cs | 7 +- .../Types/Graph/ExploreControls.g.cs | 20 +- .../_Generated/Types/Graph/Hop.g.cs | 72 +- .../Types/Graph/SampleDiversity.g.cs | 6 + .../Types/Graph/VertexDefinition.g.cs | 41 +- .../Configurations.g.cs | 38 + .../ForceMergeConfiguration.g.cs} | 9 +- .../Types/IndexLifecycleManagement/Phase.g.cs | 38 + .../IndexLifecycleManagement/Phases.g.cs | 42 + .../ShrinkConfiguration.g.cs} | 9 +- .../Types/IndexManagement/Action.g.cs | 237 - .../Types/IndexManagement/AddAction.g.cs | 22 +- .../Types/IndexManagement/Alias.g.cs | 20 +- .../Types/IndexManagement/AnalyzeDetail.g.cs | 42 + .../Types/IndexManagement/AnalyzeToken.g.cs | 44 + .../Types/IndexManagement/AnalyzerDetail.g.cs | 36 + .../IndexManagement/CharFilterDetail.g.cs | 36 + .../Types/IndexManagement/DataStream.g.cs | 14 +- .../IndexManagement/DataStreamIndex.g.cs | 2 +- .../IndexManagement/DataStreamLifecycle.g.cs | 10 +- .../DataStreamLifecycleDownsampling.g.cs | 16 +- ...DataStreamLifecycleRolloverConditions.g.cs | 166 +- .../DataStreamLifecycleWithRollover.g.cs | 133 +- .../IndexManagement/DataStreamsStatsItem.g.cs | 61 + .../IndexManagement/DownsampleConfig.g.cs | 2 +- .../IndexManagement/DownsamplingRound.g.cs | 10 +- .../IndexManagement/ExplainAnalyzeToken.g.cs | 136 + .../FielddataFrequencyFilter.g.cs | 9 +- .../Types/IndexManagement/FileDetails.g.cs | 38 + .../IndexAndDataStreamAction.g.cs | 83 + .../IndexModifyDataStreamAction.g.cs | 243 + .../Types/IndexManagement/IndexRouting.g.cs | 20 +- .../IndexRoutingAllocation.g.cs | 30 +- .../IndexRoutingAllocationDisk.g.cs | 6 +- .../Types/IndexManagement/IndexSegment.g.cs | 34 + .../IndexManagement/IndexSettingBlocks.g.cs | 25 +- .../Types/IndexManagement/IndexSettings.g.cs | 659 +- .../IndexSettingsAnalysis.g.cs | 34 +- .../IndexSettingsLifecycle.g.cs | 15 +- .../Types/IndexManagement/IndexState.g.cs | 92 +- .../Types/IndexManagement/IndexTemplate.g.cs | 411 +- .../IndexTemplateDataStreamConfiguration.g.cs | 52 +- .../IndexManagement/IndexTemplateMapping.g.cs | 72 +- .../IndexManagement/IndexTemplateSummary.g.cs | 343 +- .../IndexUpdateAliasesAction.g.cs | 258 + .../IndexManagement/IndexVersioning.g.cs | 4 +- .../IndexManagement/IndexingPressure.g.cs | 10 +- .../IndexingSlowlogSettings.g.cs | 10 +- .../IndexingSlowlogTresholds.g.cs | 10 +- .../IndicesValidationExplanation.g.cs | 40 + .../IndexManagement/MappingLimitSettings.g.cs | 62 +- .../Types/IndexManagement/Merge.g.cs | 10 +- .../Types/IndexManagement/MergeScheduler.g.cs | 10 +- .../IndexManagement/NumericFielddata.g.cs | 7 +- .../Types/IndexManagement/Queries.g.cs | 10 +- .../Types/IndexManagement/RecoveryBytes.g.cs | 50 + .../Types/IndexManagement/RecoveryFiles.g.cs | 42 + .../IndexManagement/RecoveryIndexStatus.g.cs | 50 + .../Types/IndexManagement/RecoveryOrigin.g.cs | 56 + .../IndexManagement/RecoveryStartStatus.g.cs | 40 + .../Types/IndexManagement/RecoveryStatus.g.cs | 34 + .../Types/IndexManagement/ReloadDetails.g.cs | 38 + .../Types/IndexManagement/ReloadResult.g.cs | 36 + .../Types/IndexManagement/RemoveAction.g.cs | 2 +- .../IndexManagement/RemoveIndexAction.g.cs | 2 +- .../ResolveIndexAliasItem.g.cs | 37 + .../ResolveIndexDataStreamsItem.g.cs | 39 + .../IndexManagement/ResolveIndexItem.g.cs | 40 + .../IndexManagement/RolloverConditions.g.cs | 4 +- .../Types/IndexManagement/Segment.g.cs | 50 + .../IndexManagement/SettingsAnalyze.g.cs | 5 +- .../IndexManagement/SettingsQueryString.g.cs | 3 +- .../Types/IndexManagement/SettingsSearch.g.cs | 20 +- .../IndexManagement/SettingsSimilarities.g.cs | 177 + .../IndexManagement/SettingsSimilarity.g.cs | 363 - .../SettingsSimilarityBm25.g.cs | 53 +- ...df.g.cs => SettingsSimilarityBoolean.g.cs} | 29 +- .../SettingsSimilarityDfi.g.cs | 9 +- .../SettingsSimilarityDfr.g.cs | 11 +- .../IndexManagement/SettingsSimilarityIb.g.cs | 11 +- .../SettingsSimilarityLmd.g.cs | 23 +- .../SettingsSimilarityLmj.g.cs | 23 +- .../SettingsSimilarityScripted.g.cs | 86 + .../Types/IndexManagement/ShardRecovery.g.cs | 64 + .../IndexManagement/ShardSegmentRouting.g.cs | 38 + .../Types/IndexManagement/ShardStats.g.cs | 2 + .../Types/IndexManagement/ShardsSegment.g.cs | 40 + .../IndexManagement/SlowlogSettings.g.cs | 10 +- .../IndexManagement/SlowlogTresholds.g.cs | 20 +- .../Types/IndexManagement/SoftDeletes.g.cs | 10 +- .../Types/IndexManagement/TokenDetail.g.cs | 36 + .../Types/IndexManagement/Translog.g.cs | 10 +- .../Types/IndexManagement/TranslogStatus.g.cs | 44 + .../Types/IndexManagement/VerifyIndex.g.cs | 40 + .../_Generated/Types/IndicesOptions.g.cs | 142 + .../Types/Ingest/AppendProcessor.g.cs | 101 +- .../Types/Ingest/AttachmentProcessor.g.cs | 156 +- .../Types/Ingest/BytesProcessor.g.cs | 109 +- .../Types/Ingest/CircleProcessor.g.cs | 109 +- .../Types/Ingest/ConvertProcessor.g.cs | 109 +- .../_Generated/Types/Ingest/CsvProcessor.g.cs | 100 +- .../Types/Ingest/DateIndexNameProcessor.g.cs | 101 +- .../Types/Ingest/DateProcessor.g.cs | 109 +- .../Types/Ingest/DissectProcessor.g.cs | 101 +- .../Types/Ingest/DocumentSimulation.g.cs | 15 +- .../Types/Ingest/DotExpanderProcessor.g.cs | 100 +- .../Types/Ingest/DropProcessor.g.cs | 91 +- .../Types/Ingest/EnrichProcessor.g.cs | 117 +- .../Types/Ingest/FailProcessor.g.cs | 91 +- .../Types/Ingest/ForeachProcessor.g.cs | 120 +- .../Types/Ingest/GeoIpProcessor.g.cs | 110 +- .../Types/Ingest/GrokProcessor.g.cs | 100 +- .../Types/Ingest/GsubProcessor.g.cs | 109 +- .../Types/Ingest/InferenceConfig.g.cs | 124 +- .../Ingest/InferenceConfigClassification.g.cs | 20 +- .../Ingest/InferenceConfigRegression.g.cs | 11 +- .../Types/Ingest/InferenceProcessor.g.cs | 120 +- .../Types/Ingest/JoinProcessor.g.cs | 109 +- .../Types/Ingest/JsonProcessor.g.cs | 110 +- .../Types/Ingest/KeyValueProcessor.g.cs | 109 +- .../Types/Ingest/LowercaseProcessor.g.cs | 109 +- .../_Generated/Types/Ingest/Pipeline.g.cs | 84 +- .../Types/Ingest/PipelineProcessor.g.cs | 91 +- .../_Generated/Types/Ingest/Processor.g.cs | 811 +- .../Types/Ingest/RemoveProcessor.g.cs | 91 +- .../Types/Ingest/RenameProcessor.g.cs | 109 +- .../Types/Ingest/RerouteProcessor.g.cs | 94 +- .../Types/Ingest/ScriptProcessor.g.cs | 523 ++ .../_Generated/Types/Ingest/SetProcessor.g.cs | 118 +- .../Ingest/SetSecurityUserProcessor.g.cs | 100 +- .../Types/Ingest/SortProcessor.g.cs | 109 +- .../Types/Ingest/SplitProcessor.g.cs | 109 +- .../Types/Ingest/TrimProcessor.g.cs | 109 +- .../Types/Ingest/UppercaseProcessor.g.cs | 109 +- .../Types/Ingest/UrlDecodeProcessor.g.cs | 109 +- .../Types/Ingest/UserAgentProcessor.g.cs | 109 +- .../_Generated/Types/InlineGet.g.cs | 90 +- .../_Generated/Types/InlineScript.g.cs | 7 + .../_Generated/Types/KnnQuery.g.cs | 168 +- .../LicenseManagement/LicenseInformation.g.cs | 56 + .../MachineLearning/AggregateOutput.g.cs | 228 + .../Types/MachineLearning/AnalysisConfig.g.cs | 729 ++ .../MachineLearning/AnalysisConfigRead.g.cs | 97 + .../Types/MachineLearning/AnalysisLimits.g.cs | 91 + .../MachineLearning/AnalysisMemoryLimit.g.cs | 65 + .../Types/MachineLearning/Anomaly.g.cs | 175 + .../Types/MachineLearning/AnomalyCause.g.cs | 60 + .../MachineLearning/AnomalyDetectors.g.cs | 42 + .../MachineLearning/AnomalyExplanation.g.cs | 91 + .../MachineLearning/ApiKeyAuthorization.g.cs | 43 + .../MachineLearning/BucketInfluencer.g.cs | 97 + .../Types/MachineLearning/BucketSummary.g.cs | 93 + .../Types/MachineLearning/Calendar.g.cs | 49 + .../Types/MachineLearning/CalendarEvent.g.cs | 138 + .../CategorizationAnalyzer.g.cs | 42 + .../CategorizationAnalyzerDefinition.g.cs | 113 + .../Types/MachineLearning/Category.g.cs | 103 + .../Types/MachineLearning/ChunkingConfig.g.cs | 87 + .../ClassificationInferenceOptions.g.cs | 6 +- .../MachineLearning/ConfusionMatrixItem.g.cs | 40 + .../ConfusionMatrixPrediction.g.cs | 36 + .../ConfusionMatrixThreshold.g.cs | 55 + .../Types/MachineLearning/DataCounts.g.cs | 70 + .../MachineLearning/DataDescription.g.cs | 242 + .../Types/MachineLearning/Datafeed.g.cs | 187 + .../DatafeedAuthorization.g.cs | 49 + .../Types/MachineLearning/DatafeedConfig.g.cs | 1004 +++ .../MachineLearning/DatafeedRunningState.g.cs | 49 + .../Types/MachineLearning/DatafeedStats.g.cs | 61 + .../MachineLearning/DatafeedTimingStats.g.cs | 67 + .../Types/MachineLearning/Datafeeds.g.cs | 34 + .../MachineLearning/DataframeAnalysis.g.cs | 258 + .../DataframeAnalysisAnalyzedFields.g.cs | 83 + .../DataframeAnalysisClassification.g.cs | 1200 +++ .../DataframeAnalysisFeatureProcessor.g.cs | 288 + ...ysisFeatureProcessorFrequencyEncoding.g.cs | 169 + ...AnalysisFeatureProcessorMultiEncoding.g.cs | 67 + ...AnalysisFeatureProcessorNGramEncoding.g.cs | 304 + ...nalysisFeatureProcessorOneHotEncoding.g.cs | 161 + ...sisFeatureProcessorTargetMeanEncoding.g.cs | 221 + .../DataframeAnalysisOutlierDetection.g.cs | 181 + .../DataframeAnalysisRegression.g.cs | 1210 +++ .../MachineLearning/DataframeAnalytics.g.cs | 67 + .../DataframeAnalyticsAuthorization.g.cs | 49 + .../DataframeAnalyticsDestination.g.cs | 167 + .../DataframeAnalyticsFieldSelection.g.cs | 67 + .../DataframeAnalyticsMemoryEstimation.g.cs | 43 + .../DataframeAnalyticsSource.g.cs | 327 + .../DataframeAnalyticsStatsDataCounts.g.cs | 49 + .../DataframeAnalyticsStatsMemoryUsage.g.cs | 55 + .../DataframeAnalyticsStatsProgress.g.cs | 43 + .../DataframeAnalyticsSummary.g.cs | 60 + .../DataframeClassificationSummary.g.cs | 61 + ...ataframeClassificationSummaryAccuracy.g.cs | 36 + ...ationSummaryMulticlassConfusionMatrix.g.cs | 36 + ...taframeClassificationSummaryPrecision.g.cs | 36 + .../DataframeClassificationSummaryRecall.g.cs | 36 + .../MachineLearning/DataframeEvaluation.g.cs | 258 + .../DataframeEvaluationClass.g.cs | 36 + .../DataframeEvaluationClassification.g.cs | 377 + ...aframeEvaluationClassificationMetrics.g.cs | 187 + ...EvaluationClassificationMetricsAucRoc.g.cs | 91 + .../DataframeEvaluationOutlierDetection.g.cs | 295 + ...rameEvaluationOutlierDetectionMetrics.g.cs | 165 + .../DataframeEvaluationRegression.g.cs | 295 + .../DataframeEvaluationRegressionMetrics.g.cs | 195 + ...frameEvaluationRegressionMetricsHuber.g.cs | 69 + ...aframeEvaluationRegressionMetricsMsle.g.cs | 69 + .../DataframeEvaluationSummaryAucRoc.g.cs | 36 + ...frameEvaluationSummaryAucRocCurveItem.g.cs | 38 + .../DataframeEvaluationValue.g.cs | 34 + .../DataframeOutlierDetectionSummary.g.cs | 55 + .../DataframePreviewConfig.g.cs | 384 + .../DataframeRegressionSummary.g.cs | 55 + .../Types/MachineLearning/Defaults.g.cs | 36 + .../Types/MachineLearning/Definition.g.cs | 179 + .../DelayedDataCheckConfig.g.cs | 87 + .../Types/MachineLearning/DetectionRule.g.cs | 293 + .../Types/MachineLearning/Detector.g.cs | 703 ++ .../Types/MachineLearning/DetectorRead.g.cs | 91 + .../Types/MachineLearning/Ensemble.g.cs | 211 + .../FillMaskInferenceOptions.g.cs | 20 +- .../FillMaskInferenceUpdateOptions.g.cs | 20 +- .../Types/MachineLearning/Filter.g.cs | 49 + .../Types/MachineLearning/FilterRef.g.cs | 87 + .../FrequencyEncodingPreprocessor.g.cs | 83 + .../Types/MachineLearning/GeoResults.g.cs | 43 + .../Types/MachineLearning/Hyperparameter.g.cs | 61 + .../InferenceConfigCreate.g.cs | 366 + .../InferenceConfigUpdate.g.cs | 363 + .../InferenceResponseResult.g.cs | 85 + .../Types/MachineLearning/Influence.g.cs | 36 + .../Types/MachineLearning/Influencer.g.cs | 97 + .../Types/MachineLearning/Input.g.cs | 59 + .../_Generated/Types/MachineLearning/Job.g.cs | 157 + .../Types/MachineLearning/JobBlocked.g.cs | 36 + .../JobForecastStatistics.g.cs | 44 + .../Types/MachineLearning/JobStatistics.g.cs | 40 + .../Types/MachineLearning/JobStats.g.cs | 85 + .../Types/MachineLearning/JobTimingStats.g.cs | 48 + .../Types/MachineLearning/JvmStats.g.cs | 67 + .../Types/MachineLearning/Limits.g.cs | 38 + .../Types/MachineLearning/MemMlStats.g.cs | 91 + .../Types/MachineLearning/MemStats.g.cs | 61 + .../Types/MachineLearning/Memory.g.cs | 66 + .../MachineLearning/ModelPlotConfig.g.cs | 213 + .../Types/MachineLearning/ModelSizeStats.g.cs | 74 + .../Types/MachineLearning/ModelSnapshot.g.cs | 91 + .../MachineLearning/ModelSnapshotUpgrade.g.cs | 40 + .../Types/MachineLearning/NativeCode.g.cs | 36 + .../NerInferenceOptions.g.cs | 36 +- .../NerInferenceUpdateOptions.g.cs | 20 +- .../NlpBertTokenizationConfig.g.cs | 8 +- .../NlpRobertaTokenizationConfig.g.cs | 10 +- .../NlpTokenizationUpdateOptions.g.cs | 8 +- .../OneHotEncodingPreprocessor.g.cs | 72 + .../Types/MachineLearning/OverallBucket.g.cs | 73 + .../MachineLearning/OverallBucketJob.g.cs | 36 + .../Page.g.cs} | 54 +- .../PassThroughInferenceOptions.g.cs | 36 +- .../PassThroughInferenceUpdateOptions.g.cs | 20 +- .../PerPartitionCategorization.g.cs | 91 + .../Types/MachineLearning/Preprocessor.g.cs | 258 + .../QuestionAnsweringInferenceOptions.g.cs | 20 +- ...estionAnsweringInferenceUpdateOptions.g.cs | 20 +- .../RegressionInferenceOptions.g.cs | 15 +- .../Types/MachineLearning/RuleCondition.g.cs | 101 + .../RunningStateSearchInterval.g.cs | 55 + .../TargetMeanEncodingPreprocessor.g.cs | 94 + .../TextClassificationInferenceOptions.g.cs | 20 +- ...tClassificationInferenceUpdateOptions.g.cs | 20 +- .../TextEmbeddingInferenceOptions.g.cs | 20 +- .../TextEmbeddingInferenceUpdateOptions.g.cs | 20 +- .../TextExpansionInferenceOptions.g.cs | 20 +- .../TextExpansionInferenceUpdateOptions.g.cs | 20 +- .../MachineLearning/TokenizationConfig.g.cs | 261 + .../Types/MachineLearning/TopClassEntry.g.cs | 38 + .../TotalFeatureImportance.g.cs | 49 + .../TotalFeatureImportanceClass.g.cs | 43 + .../TotalFeatureImportanceStatistics.g.cs | 49 + .../Types/MachineLearning/TrainedModel.g.cs | 203 + .../TrainedModelAssignment.g.cs | 53 + .../TrainedModelAssignmentRoutingTable.g.cs | 55 + .../TrainedModelAssignmentTaskParameters.g.cs | 75 + .../MachineLearning/TrainedModelConfig.g.cs | 130 + .../TrainedModelConfigInput.g.cs | 37 + .../TrainedModelConfigMetadata.g.cs | 51 + ...rainedModelDeploymentAllocationStatus.g.cs | 49 + .../TrainedModelDeploymentNodesStats.g.cs | 97 + .../TrainedModelDeploymentStats.g.cs | 117 + .../MachineLearning/TrainedModelEntities.g.cs | 42 + .../TrainedModelInferenceClassImportance.g.cs | 36 + ...rainedModelInferenceFeatureImportance.g.cs | 38 + .../TrainedModelInferenceStats.g.cs | 61 + .../MachineLearning/TrainedModelLocation.g.cs | 34 + .../TrainedModelLocationIndex.g.cs | 34 + .../TrainedModelPrefixStrings.g.cs | 91 + .../TrainedModelSizeStats.g.cs | 43 + .../MachineLearning/TrainedModelStats.g.cs | 67 + .../MachineLearning/TrainedModelTree.g.cs | 162 + .../MachineLearning/TrainedModelTreeNode.g.cs | 179 + .../TransformAuthorization.g.cs | 49 + .../{Ml => MachineLearning}/Vocabulary.g.cs | 2 +- .../Types/MachineLearning/Weights.g.cs | 59 + ...eroShotClassificationInferenceOptions.g.cs | 20 +- ...tClassificationInferenceUpdateOptions.g.cs | 20 +- .../AggregateMetricDoubleProperty.g.cs | 34 +- .../Types/Mapping/BinaryProperty.g.cs | 34 +- .../Types/Mapping/BooleanProperty.g.cs | 66 +- .../Types/Mapping/ByteNumberProperty.g.cs | 116 +- .../Types/Mapping/CompletionProperty.g.cs | 118 +- .../Mapping/ConstantKeywordProperty.g.cs | 34 +- .../Types/Mapping/DateNanosProperty.g.cs | 34 +- .../Types/Mapping/DateProperty.g.cs | 66 +- .../Types/Mapping/DateRangeProperty.g.cs | 34 +- .../Mapping/DenseVectorIndexOptions.g.cs | 9 +- .../Types/Mapping/DenseVectorProperty.g.cs | 92 +- .../Types/Mapping/DoubleNumberProperty.g.cs | 98 +- .../Types/Mapping/DoubleRangeProperty.g.cs | 34 +- .../Types/Mapping/DynamicProperty.g.cs | 66 +- .../Types/Mapping/DynamicTemplate.g.cs | 107 + .../Types/Mapping/FieldAliasProperty.g.cs | 40 +- .../Types/Mapping/FlattenedProperty.g.cs | 34 +- .../Types/Mapping/FloatNumberProperty.g.cs | 98 +- .../Types/Mapping/FloatRangeProperty.g.cs | 34 +- .../Types/Mapping/GeoPointProperty.g.cs | 124 +- .../Types/Mapping/GeoShapeProperty.g.cs | 37 +- .../Mapping/HalfFloatNumberProperty.g.cs | 98 +- .../Types/Mapping/HistogramProperty.g.cs | 34 +- .../Types/Mapping/IntegerNumberProperty.g.cs | 98 +- .../Types/Mapping/IntegerRangeProperty.g.cs | 34 +- .../_Generated/Types/Mapping/IpProperty.g.cs | 78 +- .../Types/Mapping/IpRangeProperty.g.cs | 34 +- .../Types/Mapping/JoinProperty.g.cs | 48 +- .../Types/Mapping/KeywordProperty.g.cs | 78 +- .../Types/Mapping/LongNumberProperty.g.cs | 98 +- .../Types/Mapping/LongRangeProperty.g.cs | 34 +- .../Types/Mapping/MatchOnlyTextProperty.g.cs | 24 +- .../Types/Mapping/Murmur3HashProperty.g.cs | 34 +- .../Types/Mapping/NestedProperty.g.cs | 34 +- .../Types/Mapping/ObjectProperty.g.cs | 34 +- .../Types/Mapping/PercolatorProperty.g.cs | 34 +- .../Types/Mapping/PointProperty.g.cs | 34 +- .../_Generated/Types/Mapping/Properties.g.cs | 851 ++- .../Types/Mapping/RankFeatureProperty.g.cs | 34 +- .../Types/Mapping/RankFeaturesProperty.g.cs | 64 +- .../Types/Mapping/RuntimeField.g.cs | 50 +- .../Mapping/RuntimeFieldFetchFields.g.cs | 6 + .../Mapping/ScaledFloatNumberProperty.g.cs | 98 +- .../Mapping/SearchAsYouTypeProperty.g.cs | 34 +- .../Types/Mapping/ShapeProperty.g.cs | 37 +- .../Types/Mapping/ShortNumberProperty.g.cs | 116 +- .../Types/Mapping/SparseVectorProperty.g.cs | 34 +- .../Types/Mapping/SuggestContext.g.cs | 16 +- .../Types/Mapping/TextIndexPrefixes.g.cs | 8 +- .../Types/Mapping/TextProperty.g.cs | 98 +- .../Types/Mapping/TokenCountProperty.g.cs | 34 +- .../_Generated/Types/Mapping/TypeMapping.g.cs | 188 +- .../Mapping/UnsignedLongNumberProperty.g.cs | 98 +- .../Types/Mapping/VersionProperty.g.cs | 34 +- .../Types/Mapping/WildcardProperty.g.cs | 34 +- .../Types/Ml/InferenceConfigCreate.g.cs | 345 - .../Types/Ml/InferenceConfigUpdate.g.cs | 342 - .../Types/Ml/TokenizationConfig.g.cs | 239 - .../_Generated/Types/NestedSortValue.g.cs | 46 +- .../Types/Nodes/AdaptiveSelection.g.cs | 73 + .../_Generated/Types/Nodes/Breaker.g.cs | 67 + .../_Generated/Types/Nodes/Cgroup.g.cs | 49 + .../_Generated/Types/Nodes/CgroupCpu.g.cs | 55 + .../_Generated/Types/Nodes/CgroupCpuStat.g.cs | 49 + .../_Generated/Types/Nodes/CgroupMemory.g.cs | 49 + .../_Generated/Types/Nodes/Client.g.cs | 97 + .../Types/Nodes/ClusterAppliedStats.g.cs | 34 + .../Types/Nodes/ClusterStateQueue.g.cs | 49 + .../Types/Nodes/ClusterStateUpdate.g.cs | 121 + .../_Generated/Types/Nodes/Context.g.cs | 40 + .../_Generated/Types/Nodes/Cpu.g.cs | 48 + .../_Generated/Types/Nodes/CpuAcct.g.cs | 43 + .../_Generated/Types/Nodes/DataPathStats.g.cs | 99 + .../Types/Nodes/DeprecationIndexing.g.cs | 34 + .../_Generated/Types/Nodes/Discovery.g.cs | 54 + .../Types/Nodes/ExtendedMemoryStats.g.cs | 79 + .../_Generated/Types/Nodes/FileSystem.g.cs | 55 + .../Types/Nodes/FileSystemTotal.g.cs | 67 + .../Types/Nodes/GarbageCollector.g.cs | 37 + .../Types/Nodes/GarbageCollectorTotal.g.cs | 49 + .../_Generated/Types/Nodes/HotThread.g.cs | 40 + .../_Generated/Types/Nodes/Http.g.cs | 49 + .../Types/Nodes/IndexingPressure.g.cs | 37 + .../Types/Nodes/IndexingPressureMemory.g.cs | 55 + .../_Generated/Types/Nodes/Ingest.g.cs | 43 + .../_Generated/Types/Nodes/IngestTotal.g.cs | 61 + .../_Generated/Types/Nodes/IoStatDevice.g.cs | 67 + .../_Generated/Types/Nodes/IoStats.g.cs | 43 + .../_Generated/Types/Nodes/Jvm.g.cs | 79 + .../_Generated/Types/Nodes/JvmClasses.g.cs | 49 + .../Types/Nodes/JvmMemoryStats.g.cs | 73 + .../_Generated/Types/Nodes/JvmThreads.g.cs | 43 + .../Types/Nodes/KeyedProcessor.g.cs | 36 + .../_Generated/Types/Nodes/MemoryStats.g.cs | 67 + .../Types/Nodes/NodeBufferPool.g.cs | 61 + .../_Generated/Types/Nodes/NodeInfo.g.cs | 112 + .../Types/Nodes/NodeInfoAction.g.cs | 34 + .../Types/Nodes/NodeInfoAggregation.g.cs | 34 + .../Types/Nodes/NodeInfoBootstrap.g.cs | 34 + .../Types/Nodes/NodeInfoClient.g.cs | 34 + .../Types/Nodes/NodeInfoDiscover.g.cs | 89 + .../_Generated/Types/Nodes/NodeInfoHttp.g.cs | 40 + .../Types/Nodes/NodeInfoIngest.g.cs | 34 + .../Types/Nodes/NodeInfoIngestDownloader.g.cs | 34 + .../Types/Nodes/NodeInfoIngestInfo.g.cs | 34 + .../Types/Nodes/NodeInfoIngestProcessor.g.cs | 34 + .../Types/Nodes/NodeInfoJvmMemory.g.cs | 52 + .../Types/Nodes/NodeInfoMemory.g.cs | 36 + .../Types/Nodes/NodeInfoNetwork.g.cs | 36 + .../Types/Nodes/NodeInfoNetworkInterface.g.cs | 38 + .../_Generated/Types/Nodes/NodeInfoOSCPU.g.cs | 48 + .../_Generated/Types/Nodes/NodeInfoPath.g.cs | 40 + .../Types/Nodes/NodeInfoRepositories.g.cs | 34 + .../Types/Nodes/NodeInfoRepositoriesUrl.g.cs | 34 + .../Types/Nodes/NodeInfoScript.g.cs | 36 + .../Types/Nodes/NodeInfoSearch.g.cs | 34 + .../Types/Nodes/NodeInfoSearchRemote.g.cs | 34 + .../Types/Nodes/NodeInfoSettings.g.cs | 62 + .../Types/Nodes/NodeInfoSettingsCluster.g.cs | 42 + .../NodeInfoSettingsClusterElection.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsHttp.g.cs | 40 + .../Types/Nodes/NodeInfoSettingsHttpType.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsIngest.g.cs | 100 + .../Types/Nodes/NodeInfoSettingsNetwork.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsNode.g.cs | 38 + .../Nodes/NodeInfoSettingsTransport.g.cs | 38 + .../NodeInfoSettingsTransportFeatures.g.cs | 34 + .../Nodes/NodeInfoSettingsTransportType.g.cs | 34 + .../Types/Nodes/NodeInfoTransport.g.cs | 38 + .../_Generated/Types/Nodes/NodeInfoXpack.g.cs | 38 + .../Types/Nodes/NodeInfoXpackLicense.g.cs | 34 + .../Types/Nodes/NodeInfoXpackLicenseType.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecurity.g.cs | 40 + .../Nodes/NodeInfoXpackSecurityAuthc.g.cs | 36 + .../NodeInfoXpackSecurityAuthcRealms.g.cs | 38 + ...odeInfoXpackSecurityAuthcRealmsStatus.g.cs | 36 + .../NodeInfoXpackSecurityAuthcToken.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecuritySsl.g.cs | 34 + .../_Generated/Types/Nodes/NodeJvmInfo.g.cs | 151 + .../Types/Nodes/NodeOperatingSystemInfo.g.cs | 75 + .../Types/Nodes/NodeProcessInfo.g.cs | 49 + .../Types/Nodes/NodeThreadPoolInfo.g.cs | 44 + .../_Generated/Types/Nodes/NodeUsage.g.cs | 40 + .../Types/Nodes/OperatingSystem.g.cs | 42 + .../_Generated/Types/Nodes/Pool.g.cs | 55 + .../Types/Nodes/PressureMemory.g.cs | 109 + .../_Generated/Types/Nodes/Process.g.cs | 61 + .../_Generated/Types/Nodes/Processor.g.cs | 55 + .../Types/Nodes/PublishedClusterStates.g.cs | 49 + .../_Generated/Types/Nodes/Recording.g.cs | 40 + .../_Generated/Types/Nodes/ScriptCache.g.cs | 51 + .../_Generated/Types/Nodes/Scripting.g.cs | 57 + .../Types/Nodes/SerializedClusterState.g.cs | 40 + .../Nodes/SerializedClusterStateDetail.g.cs | 42 + .../_Generated/Types/Nodes/Stats.g.cs | 157 + .../_Generated/Types/Nodes/ThreadCount.g.cs | 67 + .../_Generated/Types/Nodes/Transport.g.cs | 91 + .../Types/Nodes/TransportHistogram.g.cs | 49 + .../_Generated/Types/QueryDsl/BoolQuery.g.cs | 147 +- .../Types/QueryDsl/BoostingQuery.g.cs | 59 +- .../Types/QueryDsl/CombinedFieldsQuery.g.cs | 39 +- .../Types/QueryDsl/ConstantScoreQuery.g.cs | 39 +- .../Types/QueryDsl/DateRangeQuery.g.cs | 202 +- .../Types/QueryDsl/DisMaxQuery.g.cs | 51 +- .../Types/QueryDsl/ExistsQuery.g.cs | 28 +- .../Types/QueryDsl/FieldAndFormat.g.cs | 9 + .../FieldValueFactorScoreFunction.g.cs | 11 +- .../Types/QueryDsl/FunctionScore.g.cs | 105 +- .../Types/QueryDsl/FunctionScoreQuery.g.cs | 71 +- .../_Generated/Types/QueryDsl/FuzzyQuery.g.cs | 148 +- .../Types/QueryDsl/GeoBoundingBoxQuery.g.cs | 107 +- .../Types/QueryDsl/GeoDistanceQuery.g.cs | 105 +- .../Types/QueryDsl/GeoPolygonQuery.g.cs | 135 +- .../Types/QueryDsl/HasChildQuery.g.cs | 63 +- .../Types/QueryDsl/HasParentQuery.g.cs | 63 +- .../_Generated/Types/QueryDsl/IdsQuery.g.cs | 16 +- .../_Generated/Types/QueryDsl/Intervals.g.cs | 208 +- .../Types/QueryDsl/IntervalsAllOf.g.cs | 55 +- .../Types/QueryDsl/IntervalsAnyOf.g.cs | 55 +- .../Types/QueryDsl/IntervalsFilter.g.cs | 221 +- .../Types/QueryDsl/IntervalsFuzzy.g.cs | 12 + .../Types/QueryDsl/IntervalsMatch.g.cs | 32 +- .../Types/QueryDsl/IntervalsPrefix.g.cs | 12 + .../Types/QueryDsl/IntervalsQuery.g.cs | 261 +- .../Types/QueryDsl/IntervalsWildcard.g.cs | 12 + .../_Generated/Types/QueryDsl/Like.g.cs | 8 +- .../Types/QueryDsl/LikeDocument.g.cs | 32 +- .../Types/QueryDsl/MatchAllQuery.g.cs | 16 +- .../Types/QueryDsl/MatchBoolPrefixQuery.g.cs | 188 +- .../Types/QueryDsl/MatchNoneQuery.g.cs | 16 +- .../QueryDsl/MatchPhrasePrefixQuery.g.cs | 132 +- .../Types/QueryDsl/MatchPhraseQuery.g.cs | 122 +- .../_Generated/Types/QueryDsl/MatchQuery.g.cs | 230 +- .../Types/QueryDsl/MoreLikeThisQuery.g.cs | 53 +- .../Types/QueryDsl/MultiMatchQuery.g.cs | 37 +- .../Types/QueryDsl/NestedQuery.g.cs | 68 +- .../Types/QueryDsl/NumberRangeQuery.g.cs | 166 +- .../Types/QueryDsl/ParentIdQuery.g.cs | 20 +- .../Types/QueryDsl/PercolateQuery.g.cs | 36 +- .../Types/QueryDsl/PinnedQuery.g.cs | 146 +- .../Types/QueryDsl/PrefixQuery.g.cs | 118 +- .../_Generated/Types/QueryDsl/Query.g.cs | 1226 ++- .../Types/QueryDsl/QueryStringQuery.g.cs | 76 +- .../Types/QueryDsl/RandomScoreFunction.g.cs | 18 +- .../_Generated/Types/QueryDsl/RangeQuery.g.cs | 42 + .../QueryDsl/RankFeatureFunctionLinear.g.cs | 2 + .../Types/QueryDsl/RankFeatureQuery.g.cs | 108 +- .../Types/QueryDsl/RegexpQuery.g.cs | 138 +- .../_Generated/Types/QueryDsl/RuleQuery.g.cs | 39 +- .../Types/QueryDsl/ScriptQuery.g.cs | 16 +- .../Types/QueryDsl/ScriptScoreFunction.g.cs | 2 +- .../Types/QueryDsl/ScriptScoreQuery.g.cs | 39 +- .../QueryDsl/SimpleQueryStringQuery.g.cs | 51 +- .../Types/QueryDsl/SpanContainingQuery.g.cs | 60 +- .../Types/QueryDsl/SpanFieldMaskingQuery.g.cs | 44 +- .../Types/QueryDsl/SpanFirstQuery.g.cs | 38 +- .../Types/QueryDsl/SpanMultiTermQuery.g.cs | 38 +- .../Types/QueryDsl/SpanNearQuery.g.cs | 50 +- .../Types/QueryDsl/SpanNotQuery.g.cs | 58 +- .../Types/QueryDsl/SpanOrQuery.g.cs | 50 +- .../_Generated/Types/QueryDsl/SpanQuery.g.cs | 284 +- .../Types/QueryDsl/SpanTermQuery.g.cs | 89 +- .../Types/QueryDsl/SpanWithinQuery.g.cs | 60 +- .../_Generated/Types/QueryDsl/TermQuery.g.cs | 100 +- .../Types/QueryDsl/TermsLookup.g.cs | 6 + .../_Generated/Types/QueryDsl/TermsQuery.g.cs | 59 +- .../Types/QueryDsl/TermsQueryField.g.cs | 4 +- .../Types/QueryDsl/TermsSetQuery.g.cs | 119 +- .../Types/QueryDsl/TextExpansionQuery.g.cs | 94 +- .../Types/QueryDsl/TokenPruningConfig.g.cs | 113 + .../Types/QueryDsl/WeightedTokensQuery.g.cs | 391 + .../Types/QueryDsl/WildcardQuery.g.cs | 134 +- .../Types/QueryDsl/WrapperQuery.g.cs | 16 +- .../_Generated/Types/QueryVectorBuilder.g.cs | 102 +- .../_Generated/Types/Rank.g.cs | 102 +- .../_Generated/Types/RrfRank.g.cs | 2 +- .../_Generated/Types/Script.g.cs | 4 +- .../_Generated/Types/ScriptSort.g.cs | 22 +- .../_Generated/Types/SegmentsStats.g.cs | 24 +- .../_Generated/Types/SlicedScroll.g.cs | 6 + .../_Generated/Types/Slices.g.cs | 7 +- .../Types/Snapshot/AzureRepository.g.cs | 144 + .../Snapshot/AzureRepositorySettings.g.cs | 183 + .../Snapshot/CleanupRepositoryResults.g.cs | 43 + .../Types/Snapshot/CompactNodeInfo.g.cs | 34 + .../Snapshot/FileCountSnapshotStats.g.cs | 36 + .../Types/Snapshot/GcsRepository.g.cs | 144 + .../Types/Snapshot/GcsRepositorySettings.g.cs | 179 + .../Types/Snapshot/IndexDetails.g.cs | 40 + .../Types/Snapshot/InfoFeatureState.g.cs | 37 + .../Types/Snapshot/ReadOnlyUrlRepository.g.cs | 144 + .../ReadOnlyUrlRepositorySettings.g.cs | 164 + .../Types/Snapshot/Repositories.g.cs | 161 + .../Types/Snapshot/S3Repository.g.cs | 144 + .../Types/Snapshot/S3RepositorySettings.g.cs | 224 + .../Types/Snapshot/ShardsStats.g.cs | 44 + .../Types/Snapshot/ShardsStatsSummary.g.cs | 42 + .../Snapshot/ShardsStatsSummaryItem.g.cs | 36 + .../Snapshot/SharedFileSystemRepository.g.cs | 144 + .../SharedFileSystemRepositorySettings.g.cs | 149 + .../Types/Snapshot/SnapshotIndexStats.g.cs | 38 + .../Types/Snapshot/SnapshotInfo.g.cs | 75 + .../Types/Snapshot/SnapshotResponseItem.g.cs | 38 + .../Types/Snapshot/SnapshotRestore.g.cs | 38 + .../Types/Snapshot/SnapshotShardFailure.g.cs | 42 + .../Types/Snapshot/SnapshotShardsStatus.g.cs | 36 + .../Types/Snapshot/SnapshotStats.g.cs | 42 + .../Types/Snapshot/SourceOnlyRepository.g.cs | 144 + .../SourceOnlyRepositorySettings.g.cs | 255 + .../_Generated/Types/Snapshot/Status.g.cs | 48 + .../InProgress.g.cs | 40 + .../Invocation.g.cs | 36 + .../Retention.g.cs | 101 + .../SlmConfiguration.g.cs | 179 + .../SlmPolicy.g.cs | 42 + .../SnapshotLifecycle.g.cs | 52 + .../Statistics.g.cs | 135 + .../Types/SpecUtils/OverloadOf.g.cs | 35 + .../_Generated/Types/StoredScriptId.g.cs | 7 + .../Types/Synonyms/SynonymRule.g.cs | 87 + .../Types/Synonyms/SynonymRuleRead.g.cs | 43 + .../Types/Synonyms/SynonymsSetItem.g.cs | 43 + .../Types/Tasks/ParentTaskInfo.g.cs | 4 + .../_Generated/Types/Tasks/TaskInfos.g.cs | 4 +- .../_Generated/Types/TextEmbedding.g.cs | 2 +- .../Types/TextStructure/MatchedField.g.cs | 38 + .../Types/TextStructure/MatchedText.g.cs | 36 + .../TransformManagement/CheckpointStats.g.cs | 44 + .../TransformManagement/Checkpointing.g.cs | 44 + .../TransformManagement/Destination.g.cs | 91 + .../Types/TransformManagement/Latest.g.cs | 159 + .../Types/TransformManagement/Pivot.g.cs | 186 + .../TransformManagement/PivotGroupBy.g.cs | 166 +- .../TransformManagement/RetentionPolicy.g.cs | 228 + .../Types/TransformManagement/Settings.g.cs | 185 + .../Types/TransformManagement/Source.g.cs | 229 + .../Types/TransformManagement/Sync.g.cs | 228 + .../TimeRetentionPolicy.g.cs | 161 + .../Types/TransformManagement/TimeSync.g.cs | 169 + .../TransformIndexerStats.g.cs | 66 + .../TransformProgress.g.cs | 42 + .../TransformManagement/TransformStats.g.cs | 44 + .../TransformStatsHealth.g.cs | 34 + .../TransformManagement/TransformSummary.g.cs | 95 + .../_Generated/Types/Xpack/Analytics.g.cs | 38 + .../Types/Xpack/AnalyticsStatistics.g.cs | 50 + .../_Generated/Types/Xpack/Archive.g.cs | 38 + .../_Generated/Types/Xpack/Audit.g.cs | 36 + .../_Generated/Types/Xpack/Base.g.cs | 36 + .../Types/Xpack/BuildInformation.g.cs | 36 + .../_Generated/Types/Xpack/Ccr.g.cs | 40 + .../_Generated/Types/Xpack/Counter.g.cs | 36 + .../_Generated/Types/Xpack/DataStreams.g.cs | 40 + .../Types/Xpack/DataTierPhaseStatistics.g.cs | 52 + .../_Generated/Types/Xpack/DataTiers.g.cs | 46 + .../_Generated/Types/Xpack/Datafeed.g.cs | 34 + .../_Generated/Types/Xpack/Eql.g.cs | 40 + .../_Generated/Types/Xpack/EqlFeatures.g.cs | 46 + .../Types/Xpack/EqlFeaturesJoin.g.cs | 42 + .../Types/Xpack/EqlFeaturesKeys.g.cs | 42 + .../Types/Xpack/EqlFeaturesPipes.g.cs | 36 + .../Types/Xpack/EqlFeaturesSequences.g.cs | 44 + .../_Generated/Types/Xpack/Feature.g.cs | 40 + .../_Generated/Types/Xpack/FeatureToggle.g.cs | 34 + .../_Generated/Types/Xpack/Features.g.cs | 88 + .../_Generated/Types/Xpack/Flattened.g.cs | 38 + .../_Generated/Types/Xpack/FrozenIndices.g.cs | 38 + .../Types/Xpack/HealthStatistics.g.cs | 38 + .../_Generated/Types/Xpack/Ilm.g.cs | 36 + .../Types/Xpack/IlmPolicyStatistics.g.cs | 36 + .../_Generated/Types/Xpack/Invocations.g.cs | 34 + .../_Generated/Types/Xpack/IpFilter.g.cs | 36 + .../_Generated/Types/Xpack/JobUsage.g.cs | 42 + .../Types/Xpack/MachineLearning.g.cs | 50 + .../Xpack/MinimalLicenseInformation.g.cs | 42 + .../_Generated/Types/Xpack/MlCounter.g.cs | 34 + .../Types/Xpack/MlDataFrameAnalyticsJobs.g.cs | 40 + .../MlDataFrameAnalyticsJobsAnalysis.g.cs | 38 + .../Xpack/MlDataFrameAnalyticsJobsCount.g.cs | 34 + .../Xpack/MlDataFrameAnalyticsJobsMemory.g.cs | 34 + .../_Generated/Types/Xpack/MlInference.g.cs | 38 + .../Types/Xpack/MlInferenceDeployments.g.cs | 40 + .../Xpack/MlInferenceDeploymentsTimeMs.g.cs | 34 + .../Xpack/MlInferenceIngestProcessor.g.cs | 40 + .../MlInferenceIngestProcessorCount.g.cs | 38 + .../Types/Xpack/MlInferenceTrainedModels.g.cs | 42 + .../Xpack/MlInferenceTrainedModelsCount.g.cs | 48 + .../Types/Xpack/MlJobForecasts.g.cs | 36 + .../_Generated/Types/Xpack/Monitoring.g.cs | 40 + .../Types/Xpack/NativeCodeInformation.g.cs | 36 + .../_Generated/Types/Xpack/Realm.g.cs | 52 + .../_Generated/Types/Xpack/RealmCache.g.cs | 34 + .../_Generated/Types/Xpack/RoleMapping.g.cs | 36 + .../Types/Xpack/RuntimeFieldTypes.g.cs | 38 + .../Types/Xpack/RuntimeFieldsType.g.cs | 60 + .../Types/Xpack/SearchableSnapshots.g.cs | 42 + .../_Generated/Types/Xpack/Security.g.cs | 60 + .../_Generated/Types/Xpack/SecurityRoles.g.cs | 38 + .../Types/Xpack/SecurityRolesDls.g.cs | 34 + .../Xpack/SecurityRolesDlsBitSetCache.g.cs | 38 + .../Types/Xpack/SecurityRolesFile.g.cs | 38 + .../Types/Xpack/SecurityRolesNative.g.cs | 38 + .../_Generated/Types/Xpack/Slm.g.cs | 40 + .../_Generated/Types/Xpack/Sql.g.cs | 40 + .../_Generated/Types/Xpack/Ssl.g.cs | 36 + .../_Generated/Types/Xpack/Vector.g.cs | 42 + .../_Generated/Types/Xpack/Watcher.g.cs | 42 + .../Types/Xpack/WatcherActionTotals.g.cs | 36 + .../Types/Xpack/WatcherActions.g.cs | 34 + .../_Generated/Types/Xpack/WatcherWatch.g.cs | 40 + .../Types/Xpack/WatcherWatchTrigger.g.cs | 36 + .../Xpack/WatcherWatchTriggerSchedule.g.cs | 40 + .../Types/Xpack/XpackUsageQuery.g.cs | 40 + .../AsyncSearch/SubmitAsyncSearchRequest.cs | 2 +- .../Api/IndexRequest.cs | 6 - .../Api/Ingest/Processor.cs | 30 - .../Api/ScrollResponse.cs | 2 +- .../Api/SearchRequest.cs | 8 +- .../Api/SearchResponse.cs | 2 +- .../Client/ElasticsearchClient-Manual.cs | 32 +- .../Client/IndicesNamespace.cs | 4 +- .../Aggregations/AggregationCombinator.cs | 44 - .../Aggregations/AggregationDictionary.cs | 65 - .../Core/Aggregations/IAggregate.cs | 11 - .../Core/Aggregations/SearchAggregation.cs | 34 - .../Core/Fluent/FluentDictionary.cs | 40 + .../Core/Request/RouteValues.cs | 10 +- .../AggregateDictionaryExtensions.cs | 92 - .../AggregationSerializationHelper.cs | 40 - .../Serialization/UnionConverter.cs | 6 +- .../AggregateDictionaryConverter.cs | 463 -- .../Types/Aggregations/Aggregation.cs | 39 - .../Aggregations/AggregationDescriptor.cs | 45 - .../Types/Aggregations/TermsAggregate.cs | 31 - .../TermsAggregationDescriptor.cs | 44 - .../Types/Aggregations/TermsBucket.cs | 31 - .../Types/AsyncSearch/AsyncSearch.cs | 2 +- .../Types/Core/Search/SuggestDictionary.cs | 223 - .../Types/MultiSearchItem.cs | 2 +- .../Types/QueryDsl/BoolQueryAndExtensions.cs | 4 +- .../Types/QueryDsl/Query.cs | 25 +- .../Types/QueryDsl/QueryDescriptor.cs | 50 - .../Types/QueryDsl/RangeQuery.cs | 234 - .../Types/QueryDsl/RawJsonQuery.cs | 5 +- .../Types/QueryDsl/SearchQuery.cs | 72 - .../_Generated/Api/ApiUrlLookup.g.cs | 216 +- .../AsyncSearch/AsyncSearchStatusRequest.g.cs | 8 - .../AsyncSearchStatusResponse.g.cs | 16 + .../AsyncSearch/DeleteAsyncSearchRequest.g.cs | 8 - .../DeleteAsyncSearchResponse.g.cs | 1 + .../AsyncSearch/GetAsyncSearchRequest.g.cs | 8 - .../AsyncSearch/GetAsyncSearchResponse.g.cs | 15 + .../AsyncSearch/SubmitAsyncSearchRequest.g.cs | 414 +- .../SubmitAsyncSearchResponse.g.cs | 15 + .../_Generated/Api/BulkRequest.g.cs | 12 + .../_Generated/Api/BulkResponse.g.cs | 1 + .../_Generated/Api/ClearScrollResponse.g.cs | 1 + .../Api/ClosePointInTimeResponse.g.cs | 1 + .../Cluster/AllocationExplainResponse.g.cs | 1 + .../Api/Cluster/ClusterInfoRequest.g.cs | 82 + .../Api/Cluster/ClusterInfoResponse.g.cs | 41 + .../Api/Cluster/ClusterStatsRequest.g.cs | 10 +- .../Api/Cluster/ClusterStatsResponse.g.cs | 5 + .../DeleteComponentTemplateRequest.g.cs | 106 + .../DeleteComponentTemplateResponse.g.cs | 36 + .../DeleteVotingConfigExclusionsRequest.g.cs | 84 + .../DeleteVotingConfigExclusionsResponse.g.cs | 31 + .../ExistsComponentTemplateRequest.g.cs | 106 + .../ExistsComponentTemplateResponse.g.cs | 31 + .../Cluster/GetClusterSettingsResponse.g.cs | 1 + .../Cluster/GetComponentTemplateRequest.g.cs | 138 + .../Cluster/GetComponentTemplateResponse.g.cs | 33 + .../_Generated/Api/Cluster/HealthRequest.g.cs | 16 +- .../Api/Cluster/HealthResponse.g.cs | 1 + .../Api/Cluster/PendingTasksResponse.g.cs | 1 + .../PostVotingConfigExclusionsRequest.g.cs | 108 + .../PostVotingConfigExclusionsResponse.g.cs | 31 + .../Cluster/PutComponentTemplateRequest.g.cs | 369 + .../Cluster/PutComponentTemplateResponse.g.cs | 36 + .../_Generated/Api/CountRequest.g.cs | 26 +- .../_Generated/Api/CountResponse.g.cs | 1 + .../_Generated/Api/CreateRequest.g.cs | 23 +- .../_Generated/Api/CreateResponse.g.cs | 1 + .../CcrStatsRequest.g.cs | 72 + .../CcrStatsResponse.g.cs | 35 + .../DeleteAutoFollowPatternRequest.g.cs | 82 + .../DeleteAutoFollowPatternResponse.g.cs | 36 + .../FollowInfoRequest.g.cs | 112 + .../FollowInfoResponse.g.cs | 33 + .../FollowRequest.g.cs | 468 ++ .../FollowResponse.g.cs | 37 + .../FollowStatsRequest.g.cs | 112 + .../FollowStatsResponse.g.cs | 33 + .../ForgetFollowerRequest.g.cs | 231 + .../ForgetFollowerResponse.g.cs | 33 + .../GetAutoFollowPatternRequest.g.cs | 90 + .../GetAutoFollowPatternResponse.g.cs | 33 + .../PauseAutoFollowPatternRequest.g.cs | 82 + .../PauseAutoFollowPatternResponse.g.cs | 36 + .../PauseFollowRequest.g.cs | 112 + .../PauseFollowResponse.g.cs | 36 + .../PutAutoFollowPatternRequest.g.cs | 411 + .../PutAutoFollowPatternResponse.g.cs | 36 + .../ResumeAutoFollowPatternRequest.g.cs | 82 + .../ResumeAutoFollowPatternResponse.g.cs | 36 + .../ResumeFollowRequest.g.cs | 399 + .../ResumeFollowResponse.g.cs | 36 + .../UnfollowRequest.g.cs | 112 + .../UnfollowResponse.g.cs | 36 + .../ListDanglingIndicesResponse.g.cs | 1 + .../_Generated/Api/DeleteByQueryRequest.g.cs | 48 +- .../_Generated/Api/DeleteByQueryResponse.g.cs | 1 + .../Api/DeleteByQueryRethrottleRequest.g.cs | 12 +- .../Api/DeleteByQueryRethrottleResponse.g.cs | 1 + .../_Generated/Api/DeleteRequest.g.cs | 28 - .../_Generated/Api/DeleteResponse.g.cs | 1 + .../_Generated/Api/DeleteScriptRequest.g.cs | 8 - .../_Generated/Api/DeleteScriptResponse.g.cs | 1 + .../Api/Enrich/DeletePolicyRequest.g.cs | 4 - .../Api/Enrich/DeletePolicyResponse.g.cs | 1 + .../Api/Enrich/EnrichStatsResponse.g.cs | 1 + .../Api/Enrich/ExecutePolicyRequest.g.cs | 4 - .../Api/Enrich/ExecutePolicyResponse.g.cs | 3 +- .../Api/Enrich/GetPolicyRequest.g.cs | 4 + .../Api/Enrich/GetPolicyResponse.g.cs | 1 + .../Api/Enrich/PutPolicyRequest.g.cs | 68 +- .../Api/Enrich/PutPolicyResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlDeleteRequest.g.cs | 8 - .../_Generated/Api/Eql/EqlDeleteResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlGetRequest.g.cs | 8 - .../_Generated/Api/Eql/EqlGetResponse.g.cs | 1 + .../_Generated/Api/Eql/EqlSearchRequest.g.cs | 111 +- .../_Generated/Api/Eql/EqlSearchResponse.g.cs | 1 + .../Api/Eql/GetEqlStatusRequest.g.cs | 8 - .../Api/Eql/GetEqlStatusResponse.g.cs | 1 + .../_Generated/Api/Esql/EsqlQueryRequest.g.cs | 37 +- .../Api/Esql/EsqlQueryResponse.g.cs | 4 +- .../_Generated/Api/ExistsRequest.g.cs | 28 - .../_Generated/Api/ExistsResponse.g.cs | 5 +- .../_Generated/Api/ExistsSourceRequest.g.cs | 28 - .../_Generated/Api/ExistsSourceResponse.g.cs | 5 +- .../_Generated/Api/ExplainRequest.g.cs | 48 +- .../_Generated/Api/ExplainResponse.g.cs | 1 + .../Api/Features/GetFeaturesRequest.g.cs | 72 + .../Api/Features/GetFeaturesResponse.g.cs | 33 + .../Api/Features/ResetFeaturesRequest.g.cs | 72 + .../Api/Features/ResetFeaturesResponse.g.cs | 33 + .../_Generated/Api/FieldCapsRequest.g.cs | 53 +- .../_Generated/Api/FieldCapsResponse.g.cs | 4 +- .../_Generated/Api/GetRequest.g.cs | 28 - .../_Generated/Api/GetResponse.g.cs | 1 + .../Api/GetScriptContextResponse.g.cs | 1 + .../Api/GetScriptLanguagesResponse.g.cs | 1 + .../_Generated/Api/GetScriptRequest.g.cs | 8 - .../_Generated/Api/GetScriptResponse.g.cs | 1 + .../_Generated/Api/GetSourceRequest.g.cs | 28 - .../_Generated/Api/GetSourceResponse.g.cs | 1 + .../_Generated/Api/Graph/ExploreRequest.g.cs | 100 +- .../_Generated/Api/Graph/ExploreResponse.g.cs | 1 + .../_Generated/Api/HealthReportRequest.g.cs | 126 + .../_Generated/Api/HealthReportResponse.g.cs | 37 + .../DeleteLifecycleRequest.g.cs | 106 + .../DeleteLifecycleResponse.g.cs | 36 + .../GetIlmStatusRequest.g.cs | 72 + .../GetIlmStatusResponse.g.cs | 33 + .../GetLifecycleRequest.g.cs | 114 + .../GetLifecycleResponse.g.cs | 37 + .../MigrateToDataTiersRequest.g.cs | 117 + .../MigrateToDataTiersResponse.g.cs | 46 + .../MoveToStepRequest.g.cs | 295 + .../MoveToStepResponse.g.cs | 36 + .../PutLifecycleRequest.g.cs | 154 + .../PutLifecycleResponse.g.cs | 36 + .../RemovePolicyRequest.g.cs | 112 + .../RemovePolicyResponse.g.cs | 35 + .../RetryRequest.g.cs | 112 + .../RetryResponse.g.cs | 36 + .../StartIlmRequest.g.cs | 82 + .../StartIlmResponse.g.cs | 36 + .../StopIlmRequest.g.cs | 82 + .../StopIlmResponse.g.cs | 36 + .../IndexManagement/AnalyzeIndexRequest.g.cs | 509 ++ .../IndexManagement/AnalyzeIndexResponse.g.cs | 35 + .../IndexManagement/ClearCacheRequest.g.cs | 216 + .../IndexManagement/ClearCacheResponse.g.cs | 33 + .../IndexManagement/CloneIndexRequest.g.cs | 20 +- .../IndexManagement/CloneIndexResponse.g.cs | 1 + .../IndexManagement/CloseIndexRequest.g.cs | 8 - .../IndexManagement/CloseIndexResponse.g.cs | 1 + .../CreateDataStreamRequest.g.cs | 4 - .../CreateDataStreamResponse.g.cs | 1 + .../IndexManagement/CreateIndexRequest.g.cs | 64 +- .../IndexManagement/CreateIndexResponse.g.cs | 1 + .../DataStreamsStatsRequest.g.cs | 102 + .../DataStreamsStatsResponse.g.cs | 66 + .../IndexManagement/DeleteAliasRequest.g.cs | 8 - .../IndexManagement/DeleteAliasResponse.g.cs | 1 + .../DeleteDataLifecycleRequest.g.cs | 4 - .../DeleteDataLifecycleResponse.g.cs | 1 + .../DeleteDataStreamRequest.g.cs | 4 - .../DeleteDataStreamResponse.g.cs | 1 + .../IndexManagement/DeleteIndexRequest.g.cs | 8 - .../IndexManagement/DeleteIndexResponse.g.cs | 4 + .../DeleteIndexTemplateRequest.g.cs | 4 - .../DeleteIndexTemplateResponse.g.cs | 1 + .../DeleteTemplateRequest.g.cs | 4 - .../DeleteTemplateResponse.g.cs | 1 + .../Api/IndexManagement/DiskUsageRequest.g.cs | 178 + .../IndexManagement/DiskUsageResponse.g.cs | 31 + .../IndexManagement/DownsampleRequest.g.cs | 177 + .../IndexManagement/DownsampleResponse.g.cs | 31 + .../IndexManagement/ExistsAliasRequest.g.cs | 28 +- .../IndexManagement/ExistsAliasResponse.g.cs | 5 +- .../ExistsIndexTemplateRequest.g.cs | 4 - .../ExistsIndexTemplateResponse.g.cs | 5 +- .../Api/IndexManagement/ExistsRequest.g.cs | 8 - .../Api/IndexManagement/ExistsResponse.g.cs | 5 +- .../ExistsTemplateRequest.g.cs | 4 - .../ExistsTemplateResponse.g.cs | 5 +- .../ExplainDataLifecycleRequest.g.cs | 8 - .../ExplainDataLifecycleResponse.g.cs | 1 + .../FieldUsageStatsRequest.g.cs | 204 + .../FieldUsageStatsResponse.g.cs | 33 + .../Api/IndexManagement/FlushRequest.g.cs | 8 + .../Api/IndexManagement/FlushResponse.g.cs | 1 + .../IndexManagement/ForcemergeRequest.g.cs | 8 + .../IndexManagement/ForcemergeResponse.g.cs | 1 + .../Api/IndexManagement/GetAliasRequest.g.cs | 28 +- .../GetDataLifecycleRequest.g.cs | 4 - .../GetDataLifecycleResponse.g.cs | 1 + .../IndexManagement/GetDataStreamRequest.g.cs | 4 + .../GetDataStreamResponse.g.cs | 1 + .../GetFieldMappingRequest.g.cs | 12 +- .../Api/IndexManagement/GetIndexRequest.g.cs | 8 - .../GetIndexTemplateRequest.g.cs | 4 + .../GetIndexTemplateResponse.g.cs | 1 + .../GetIndicesSettingsRequest.g.cs | 236 + .../GetIndicesSettingsResponse.g.cs | 37 + .../IndexManagement/GetMappingRequest.g.cs | 8 + .../IndexManagement/GetTemplateRequest.g.cs | 4 + .../IndexManagement/IndicesStatsRequest.g.cs | 32 +- .../IndexManagement/IndicesStatsResponse.g.cs | 1 + .../MigrateToDataStreamRequest.g.cs | 4 - .../MigrateToDataStreamResponse.g.cs | 1 + .../ModifyDataStreamRequest.g.cs | 155 + .../ModifyDataStreamResponse.g.cs | 36 + .../Api/IndexManagement/OpenIndexRequest.g.cs | 8 - .../IndexManagement/OpenIndexResponse.g.cs | 1 + .../PromoteDataStreamRequest.g.cs | 82 + .../PromoteDataStreamResponse.g.cs | 31 + .../Api/IndexManagement/PutAliasRequest.g.cs | 28 +- .../Api/IndexManagement/PutAliasResponse.g.cs | 1 + .../PutDataLifecycleRequest.g.cs | 14 +- .../PutDataLifecycleResponse.g.cs | 1 + .../PutIndexTemplateRequest.g.cs | 56 +- .../PutIndexTemplateResponse.g.cs | 1 + .../PutIndicesSettingsRequest.g.cs | 262 + .../PutIndicesSettingsResponse.g.cs | 36 + .../IndexManagement/PutMappingRequest.g.cs | 110 +- .../IndexManagement/PutMappingResponse.g.cs | 4 + .../IndexManagement/PutTemplateRequest.g.cs | 187 +- .../IndexManagement/PutTemplateResponse.g.cs | 1 + .../Api/IndexManagement/RecoveryRequest.g.cs | 151 + .../Api/IndexManagement/RecoveryResponse.g.cs | 37 + .../Api/IndexManagement/RefreshRequest.g.cs | 8 + .../Api/IndexManagement/RefreshResponse.g.cs | 1 + .../ReloadSearchAnalyzersRequest.g.cs | 152 + .../ReloadSearchAnalyzersResponse.g.cs | 35 + .../ResolveClusterRequest.g.cs | 130 + .../ResolveClusterResponse.g.cs | 37 + .../IndexManagement/ResolveIndexRequest.g.cs | 94 + .../IndexManagement/ResolveIndexResponse.g.cs | 37 + .../Api/IndexManagement/RolloverRequest.g.cs | 208 +- .../Api/IndexManagement/RolloverResponse.g.cs | 1 + .../Api/IndexManagement/SegmentsRequest.g.cs | 177 + .../Api/IndexManagement/SegmentsResponse.g.cs | 35 + .../IndexManagement/ShardStoresRequest.g.cs | 177 + .../IndexManagement/ShardStoresResponse.g.cs | 34 + .../IndexManagement/ShrinkIndexRequest.g.cs | 20 +- .../IndexManagement/ShrinkIndexResponse.g.cs | 1 + .../SimulateIndexTemplateRequest.g.cs | 66 +- .../SimulateIndexTemplateResponse.g.cs | 1 + .../SimulateTemplateRequest.g.cs | 104 +- .../SimulateTemplateResponse.g.cs | 1 + .../IndexManagement/SplitIndexRequest.g.cs | 20 +- .../IndexManagement/SplitIndexResponse.g.cs | 1 + .../IndexManagement/UpdateAliasesRequest.g.cs | 42 +- .../UpdateAliasesResponse.g.cs | 1 + .../IndexManagement/ValidateQueryRequest.g.cs | 385 + .../ValidateQueryResponse.g.cs | 39 + .../_Generated/Api/IndexRequest.g.cs | 27 +- .../_Generated/Api/IndexResponse.g.cs | 1 + .../Api/Inference/DeleteModelRequest.g.cs | 96 + .../Api/Inference/DeleteModelResponse.g.cs | 36 + .../Api/Inference/GetModelRequest.g.cs | 96 + .../Api/Inference/GetModelResponse.g.cs | 33 + .../Api/Inference/InferenceRequest.g.cs | 140 + .../Api/Inference/InferenceResponse.g.cs | 31 + .../Api/Inference/PutModelRequest.g.cs | 121 + .../Api/Inference/PutModelResponse.g.cs | 60 + .../_Generated/Api/InfoResponse.g.cs | 1 + .../Api/Ingest/DeletePipelineRequest.g.cs | 8 - .../Api/Ingest/DeletePipelineResponse.g.cs | 1 + .../Api/Ingest/GeoIpStatsResponse.g.cs | 3 +- .../Api/Ingest/GetPipelineRequest.g.cs | 8 + .../Api/Ingest/ProcessorGrokResponse.g.cs | 1 + .../Api/Ingest/PutPipelineRequest.g.cs | 80 +- .../Api/Ingest/PutPipelineResponse.g.cs | 1 + .../Api/Ingest/SimulateRequest.g.cs | 60 +- .../Api/Ingest/SimulateResponse.g.cs | 1 + .../DeleteLicenseRequest.g.cs | 72 + .../DeleteLicenseResponse.g.cs | 36 + .../GetBasicStatusRequest.g.cs | 72 + .../GetBasicStatusResponse.g.cs | 33 + .../LicenseManagement/GetLicenseRequest.g.cs | 84 + .../LicenseManagement/GetLicenseResponse.g.cs | 33 + .../GetTrialStatusRequest.g.cs | 72 + .../GetTrialStatusResponse.g.cs | 33 + .../Api/LicenseManagement/PostRequest.g.cs | 212 + .../Api/LicenseManagement/PostResponse.g.cs | 37 + .../PostStartBasicRequest.g.cs | 84 + .../PostStartBasicResponse.g.cs | 41 + .../PostStartTrialRequest.g.cs | 88 + .../PostStartTrialResponse.g.cs | 39 + ...earTrainedModelDeploymentCacheRequest.g.cs | 82 + ...arTrainedModelDeploymentCacheResponse.g.cs | 33 + .../Api/MachineLearning/CloseJobRequest.g.cs | 151 + .../Api/MachineLearning/CloseJobResponse.g.cs | 33 + .../DeleteCalendarEventRequest.g.cs | 88 + .../DeleteCalendarEventResponse.g.cs | 36 + .../DeleteCalendarJobRequest.g.cs | 88 + .../DeleteCalendarJobResponse.g.cs | 49 + .../DeleteCalendarRequest.g.cs | 82 + .../DeleteCalendarResponse.g.cs | 36 + .../DeleteDataFrameAnalyticsRequest.g.cs | 139 + .../DeleteDataFrameAnalyticsResponse.g.cs | 36 + .../DeleteDatafeedRequest.g.cs | 94 + .../DeleteDatafeedResponse.g.cs | 36 + .../DeleteExpiredDataRequest.g.cs | 137 + .../DeleteExpiredDataResponse.g.cs | 33 + .../MachineLearning/DeleteFilterRequest.g.cs | 82 + .../MachineLearning/DeleteFilterResponse.g.cs | 36 + .../DeleteForecastRequest.g.cs | 120 + .../DeleteForecastResponse.g.cs | 36 + .../Api/MachineLearning/DeleteJobRequest.g.cs | 120 + .../MachineLearning/DeleteJobResponse.g.cs | 36 + .../DeleteModelSnapshotRequest.g.cs | 88 + .../DeleteModelSnapshotResponse.g.cs | 36 + .../DeleteTrainedModelAliasRequest.g.cs | 88 + .../DeleteTrainedModelAliasResponse.g.cs | 36 + .../DeleteTrainedModelRequest.g.cs | 94 + .../DeleteTrainedModelResponse.g.cs | 36 + .../EstimateModelMemoryRequest.g.cs | 276 + .../EstimateModelMemoryResponse.g.cs | 33 + .../EvaluateDataFrameRequest.g.cs | 328 + .../EvaluateDataFrameResponse.g.cs | 37 + .../ExplainDataFrameAnalyticsRequest.g.cs | 674 ++ .../ExplainDataFrameAnalyticsResponse.g.cs | 42 + .../Api/MachineLearning/FlushJobRequest.g.cs | 195 + .../Api/MachineLearning/FlushJobResponse.g.cs | 39 + .../Api/MachineLearning/ForecastRequest.g.cs | 153 + .../Api/MachineLearning/ForecastResponse.g.cs | 35 + .../MachineLearning/GetBucketsRequest.g.cs | 559 ++ .../MachineLearning/GetBucketsResponse.g.cs | 35 + .../GetCalendarEventsRequest.g.cs | 142 + .../GetCalendarEventsResponse.g.cs | 35 + .../MachineLearning/GetCalendarsRequest.g.cs | 169 + .../MachineLearning/GetCalendarsResponse.g.cs | 35 + .../MachineLearning/GetCategoriesRequest.g.cs | 187 + .../GetCategoriesResponse.g.cs | 35 + .../GetDataFrameAnalyticsRequest.g.cs | 181 + .../GetDataFrameAnalyticsResponse.g.cs | 39 + .../GetDataFrameAnalyticsStatsRequest.g.cs | 181 + .../GetDataFrameAnalyticsStatsResponse.g.cs | 39 + .../GetDatafeedStatsRequest.g.cs | 106 + .../GetDatafeedStatsResponse.g.cs | 35 + .../MachineLearning/GetDatafeedsRequest.g.cs | 118 + .../MachineLearning/GetDatafeedsResponse.g.cs | 35 + .../MachineLearning/GetFiltersRequest.g.cs | 114 + .../MachineLearning/GetFiltersResponse.g.cs | 35 + .../GetInfluencersRequest.g.cs | 321 + .../GetInfluencersResponse.g.cs | 39 + .../MachineLearning/GetJobStatsRequest.g.cs | 106 + .../MachineLearning/GetJobStatsResponse.g.cs | 35 + .../Api/MachineLearning/GetJobsRequest.g.cs | 118 + .../Api/MachineLearning/GetJobsResponse.g.cs | 35 + .../GetMemoryStatsRequest.g.cs | 114 + .../GetMemoryStatsResponse.g.cs | 37 + .../GetModelSnapshotUpgradeStatsRequest.g.cs | 104 + .../GetModelSnapshotUpgradeStatsResponse.g.cs | 35 + .../GetModelSnapshotsRequest.g.cs | 445 ++ .../GetModelSnapshotsResponse.g.cs | 35 + .../GetOverallBucketsRequest.g.cs | 241 + .../GetOverallBucketsResponse.g.cs | 39 + .../MachineLearning/GetRecordsRequest.g.cs | 497 ++ .../MachineLearning/GetRecordsResponse.g.cs | 35 + .../GetTrainedModelsRequest.g.cs | 178 + .../GetTrainedModelsResponse.g.cs | 39 + .../GetTrainedModelsStatsRequest.g.cs | 130 + .../GetTrainedModelsStatsResponse.g.cs | 42 + .../InferTrainedModelRequest.g.cs | 260 + .../InferTrainedModelResponse.g.cs | 33 + .../Api/MachineLearning/MlInfoRequest.g.cs | 72 + .../Api/MachineLearning/MlInfoResponse.g.cs | 39 + .../Api/MachineLearning/OpenJobRequest.g.cs | 107 + .../Api/MachineLearning/OpenJobResponse.g.cs | 38 + .../PostCalendarEventsRequest.g.cs | 165 + .../PostCalendarEventsResponse.g.cs | 33 + .../PreviewDataFrameAnalyticsRequest.g.cs | 228 + .../PreviewDataFrameAnalyticsResponse.g.cs | 36 + .../PutCalendarJobRequest.g.cs | 88 + .../PutCalendarJobResponse.g.cs | 49 + .../MachineLearning/PutCalendarRequest.g.cs | 129 + .../MachineLearning/PutCalendarResponse.g.cs | 49 + .../PutDataFrameAnalyticsRequest.g.cs | 718 ++ .../PutDataFrameAnalyticsResponse.g.cs | 55 + .../MachineLearning/PutDatafeedRequest.g.cs | 1117 +++ .../MachineLearning/PutDatafeedResponse.g.cs | 61 + .../Api/MachineLearning/PutFilterRequest.g.cs | 129 + .../MachineLearning/PutFilterResponse.g.cs | 37 + .../Api/MachineLearning/PutJobRequest.g.cs | 988 +++ .../Api/MachineLearning/PutJobResponse.g.cs | 71 + .../PutTrainedModelAliasRequest.g.cs | 100 + .../PutTrainedModelAliasResponse.g.cs | 36 + .../PutTrainedModelDefinitionPartRequest.g.cs | 145 + ...PutTrainedModelDefinitionPartResponse.g.cs | 36 + .../PutTrainedModelRequest.g.cs | 803 ++ .../PutTrainedModelResponse.g.cs | 129 + .../PutTrainedModelVocabularyRequest.g.cs | 147 + .../PutTrainedModelVocabularyResponse.g.cs | 36 + .../Api/MachineLearning/ResetJobRequest.g.cs | 106 + .../Api/MachineLearning/ResetJobResponse.g.cs | 36 + .../RevertModelSnapshotRequest.g.cs | 113 + .../RevertModelSnapshotResponse.g.cs | 33 + .../SetUpgradeModeRequest.g.cs | 96 + .../SetUpgradeModeResponse.g.cs | 36 + .../StartDataFrameAnalyticsRequest.g.cs | 126 + .../StartDataFrameAnalyticsResponse.g.cs | 39 + .../MachineLearning/StartDatafeedRequest.g.cs | 159 + .../StartDatafeedResponse.g.cs | 43 + .../StartTrainedModelDeploymentRequest.g.cs | 178 + .../StartTrainedModelDeploymentResponse.g.cs | 33 + .../StopDataFrameAnalyticsRequest.g.cs | 156 + .../StopDataFrameAnalyticsResponse.g.cs | 33 + .../MachineLearning/StopDatafeedRequest.g.cs | 151 + .../MachineLearning/StopDatafeedResponse.g.cs | 33 + .../StopTrainedModelDeploymentRequest.g.cs | 106 + .../StopTrainedModelDeploymentResponse.g.cs | 33 + .../UpdateDataFrameAnalyticsRequest.g.cs | 270 + .../UpdateDataFrameAnalyticsResponse.g.cs | 55 + .../UpdateDatafeedRequest.g.cs | 1069 +++ .../UpdateDatafeedResponse.g.cs | 61 + .../MachineLearning/UpdateFilterRequest.g.cs | 151 + .../MachineLearning/UpdateFilterResponse.g.cs | 37 + .../Api/MachineLearning/UpdateJobRequest.g.cs | 944 +++ .../MachineLearning/UpdateJobResponse.g.cs | 73 + .../UpdateModelSnapshotRequest.g.cs | 135 + .../UpdateModelSnapshotResponse.g.cs | 35 + .../UpgradeJobSnapshotRequest.g.cs | 112 + .../UpgradeJobSnapshotResponse.g.cs | 42 + .../ValidateDetectorRequest.g.cs | 149 + .../ValidateDetectorResponse.g.cs | 36 + .../Api/MachineLearning/ValidateRequest.g.cs | 595 ++ .../Api/MachineLearning/ValidateResponse.g.cs | 36 + .../_Generated/Api/MultiGetRequest.g.cs | 46 +- .../_Generated/Api/MultiGetResponse.g.cs | 1 + .../_Generated/Api/MultiSearchRequest.g.cs | 76 +- .../_Generated/Api/MultiSearchResponse.g.cs | 1 + .../Api/MultiSearchTemplateRequest.g.cs | 76 +- .../Api/MultiSearchTemplateResponse.g.cs | 1 + .../Api/MultiTermVectorsRequest.g.cs | 40 +- .../Api/MultiTermVectorsResponse.g.cs | 1 + ...earRepositoriesMeteringArchiveRequest.g.cs | 88 + ...arRepositoriesMeteringArchiveResponse.g.cs | 48 + .../GetRepositoriesMeteringInfoRequest.g.cs | 82 + .../GetRepositoriesMeteringInfoResponse.g.cs | 48 + .../Api/Nodes/HotThreadsRequest.g.cs | 186 + .../Api/Nodes/HotThreadsResponse.g.cs | 33 + .../Api/Nodes/NodesInfoRequest.g.cs | 140 + .../Api/Nodes/NodesInfoResponse.g.cs | 41 + .../Api/Nodes/NodesStatsRequest.g.cs | 295 + .../Api/Nodes/NodesStatsResponse.g.cs | 41 + .../Api/Nodes/NodesUsageRequest.g.cs | 116 + .../Api/Nodes/NodesUsageResponse.g.cs | 41 + .../Nodes/ReloadSecureSettingsRequest.g.cs | 127 + .../Nodes/ReloadSecureSettingsResponse.g.cs | 41 + .../Api/OpenPointInTimeRequest.g.cs | 8 - .../Api/OpenPointInTimeResponse.g.cs | 1 + .../_Generated/Api/PingResponse.g.cs | 1 + .../_Generated/Api/PutScriptRequest.g.cs | 48 +- .../_Generated/Api/PutScriptResponse.g.cs | 1 + .../DeleteQueryRulesetRequest.g.cs | 82 + .../DeleteQueryRulesetResponse.g.cs | 36 + .../QueryRuleset/GetQueryRulesetRequest.g.cs | 82 + .../QueryRuleset/GetQueryRulesetResponse.g.cs | 42 + .../Api/QueryRuleset/ListRequest.g.cs | 96 + .../Api/QueryRuleset/ListResponse.g.cs | 35 + .../QueryRuleset/PutQueryRulesetRequest.g.cs | 159 + .../QueryRuleset/PutQueryRulesetResponse.g.cs | 33 + .../_Generated/Api/RankEvalRequest.g.cs | 60 +- .../_Generated/Api/RankEvalResponse.g.cs | 3 +- .../_Generated/Api/ReindexRequest.g.cs | 40 +- .../_Generated/Api/ReindexResponse.g.cs | 1 + .../Api/ReindexRethrottleRequest.g.cs | 12 +- .../Api/ReindexRethrottleResponse.g.cs | 1 + .../Api/RenderSearchTemplateRequest.g.cs | 8 + .../Api/RenderSearchTemplateResponse.g.cs | 1 + .../Api/Rollup/DeleteJobRequest.g.cs | 112 + .../Api/Rollup/DeleteJobResponse.g.cs | 35 + .../_Generated/Api/Rollup/GetJobsRequest.g.cs | 124 + .../Api/Rollup/GetJobsResponse.g.cs | 33 + .../Api/Rollup/GetRollupCapsRequest.g.cs | 124 + .../Api/Rollup/GetRollupCapsResponse.g.cs | 37 + .../Api/Rollup/GetRollupIndexCapsRequest.g.cs | 112 + .../Rollup/GetRollupIndexCapsResponse.g.cs | 37 + .../_Generated/Api/Rollup/PutJobRequest.g.cs | 556 ++ .../_Generated/Api/Rollup/PutJobResponse.g.cs | 36 + .../Api/Rollup/RollupSearchRequest.g.cs | 384 + .../Api/Rollup/RollupSearchResponse.g.cs | 43 + .../Api/Rollup/StartJobRequest.g.cs | 112 + .../Api/Rollup/StartJobResponse.g.cs | 33 + .../_Generated/Api/Rollup/StopJobRequest.g.cs | 139 + .../Api/Rollup/StopJobResponse.g.cs | 33 + .../Api/ScriptsPainlessExecuteRequest.g.cs | 336 + .../Api/ScriptsPainlessExecuteResponse.g.cs | 33 + .../_Generated/Api/ScrollResponse.g.cs | 1 + .../DeleteBehavioralAnalyticsRequest.g.cs | 82 + .../DeleteBehavioralAnalyticsResponse.g.cs | 36 + .../DeleteSearchApplicationRequest.g.cs | 82 + .../DeleteSearchApplicationResponse.g.cs | 36 + .../GetBehavioralAnalyticsRequest.g.cs | 90 + .../GetBehavioralAnalyticsResponse.g.cs | 37 + .../GetSearchApplicationRequest.g.cs | 82 + .../GetSearchApplicationResponse.g.cs | 60 + .../Api/SearchApplication/ListRequest.g.cs | 108 + .../Api/SearchApplication/ListResponse.g.cs | 35 + .../PutBehavioralAnalyticsRequest.g.cs | 82 + .../PutBehavioralAnalyticsResponse.g.cs | 42 + .../PutSearchApplicationRequest.g.cs | 121 + .../PutSearchApplicationResponse.g.cs | 33 + .../SearchApplicationSearchRequest.g.cs | 107 + .../SearchApplicationSearchResponse.g.cs | 59 + .../_Generated/Api/SearchMvtRequest.g.cs | 874 +++ .../_Generated/Api/SearchMvtResponse.g.cs | 31 + .../_Generated/Api/SearchRequest.g.cs | 444 +- .../_Generated/Api/SearchResponse.g.cs | 1 + .../_Generated/Api/SearchShardsRequest.g.cs | 8 + .../_Generated/Api/SearchShardsResponse.g.cs | 1 + .../_Generated/Api/SearchTemplateRequest.g.cs | 8 + .../Api/SearchTemplateResponse.g.cs | 1 + .../CacheStatsRequest.g.cs | 96 + .../CacheStatsResponse.g.cs | 33 + .../ClearCacheRequest.g.cs | 164 + .../ClearCacheResponse.g.cs | 31 + .../Api/SearchableSnapshots/MountRequest.g.cs | 183 + .../SearchableSnapshots/MountResponse.g.cs | 33 + .../SearchableSnapshotsStatsRequest.g.cs | 138 + .../SearchableSnapshotsStatsResponse.g.cs | 35 + .../Snapshot/CleanupRepositoryRequest.g.cs | 106 + .../Snapshot/CleanupRepositoryResponse.g.cs | 36 + .../Api/Snapshot/CloneSnapshotRequest.g.cs | 124 + .../Api/Snapshot/CloneSnapshotResponse.g.cs | 36 + .../Api/Snapshot/CreateRepositoryRequest.g.cs | 125 + .../Snapshot/CreateRepositoryResponse.g.cs | 36 + .../Api/Snapshot/CreateSnapshotRequest.g.cs | 247 + .../Api/Snapshot/CreateSnapshotResponse.g.cs | 42 + .../Api/Snapshot/DeleteRepositoryRequest.g.cs | 106 + .../Snapshot/DeleteRepositoryResponse.g.cs | 36 + .../Api/Snapshot/DeleteSnapshotRequest.g.cs | 100 + .../Api/Snapshot/DeleteSnapshotResponse.g.cs | 36 + .../Api/Snapshot/GetRepositoryRequest.g.cs | 114 + .../Api/Snapshot/GetRepositoryResponse.g.cs | 37 + .../Api/Snapshot/GetSnapshotRequest.g.cs | 244 + .../Api/Snapshot/GetSnapshotResponse.g.cs | 46 + .../Api/Snapshot/RestoreRequest.g.cs | 497 ++ .../Api/Snapshot/RestoreResponse.g.cs | 33 + .../Api/Snapshot/SnapshotStatusRequest.g.cs | 124 + .../Api/Snapshot/SnapshotStatusResponse.g.cs | 33 + .../Api/Snapshot/VerifyRepositoryRequest.g.cs | 106 + .../Snapshot/VerifyRepositoryResponse.g.cs | 33 + .../DeleteLifecycleRequest.g.cs | 82 + .../DeleteLifecycleResponse.g.cs | 36 + .../ExecuteLifecycleRequest.g.cs | 82 + .../ExecuteLifecycleResponse.g.cs | 33 + .../ExecuteRetentionRequest.g.cs | 72 + .../ExecuteRetentionResponse.g.cs | 36 + .../GetLifecycleRequest.g.cs | 90 + .../GetLifecycleResponse.g.cs | 37 + .../GetSlmStatusRequest.g.cs | 72 + .../GetSlmStatusResponse.g.cs | 33 + .../GetStatsRequest.g.cs | 72 + .../GetStatsResponse.g.cs | 51 + .../PutLifecycleRequest.g.cs | 279 + .../PutLifecycleResponse.g.cs | 36 + .../StartSlmRequest.g.cs | 72 + .../StartSlmResponse.g.cs | 36 + .../StopSlmRequest.g.cs | 72 + .../StopSlmResponse.g.cs | 36 + .../Api/Sql/ClearCursorResponse.g.cs | 1 + .../Api/Sql/DeleteAsyncRequest.g.cs | 8 - .../Api/Sql/DeleteAsyncResponse.g.cs | 1 + .../_Generated/Api/Sql/GetAsyncRequest.g.cs | 8 - .../_Generated/Api/Sql/GetAsyncResponse.g.cs | 1 + .../Api/Sql/GetAsyncStatusRequest.g.cs | 8 - .../Api/Sql/GetAsyncStatusResponse.g.cs | 1 + .../_Generated/Api/Sql/QueryRequest.g.cs | 54 +- .../_Generated/Api/Sql/QueryResponse.g.cs | 1 + .../_Generated/Api/Sql/TranslateRequest.g.cs | 306 + .../_Generated/Api/Sql/TranslateResponse.g.cs | 44 + .../Api/Synonyms/DeleteSynonymRequest.g.cs | 112 + .../Api/Synonyms/DeleteSynonymResponse.g.cs | 36 + .../Synonyms/DeleteSynonymRuleRequest.g.cs | 88 + .../Synonyms/DeleteSynonymRuleResponse.g.cs | 42 + .../Api/Synonyms/GetSynonymRequest.g.cs | 139 + .../Api/Synonyms/GetSynonymResponse.g.cs | 35 + .../Api/Synonyms/GetSynonymRuleRequest.g.cs | 88 + .../Api/Synonyms/GetSynonymRuleResponse.g.cs | 42 + .../Api/Synonyms/GetSynonymsSetsRequest.g.cs | 96 + .../Api/Synonyms/GetSynonymsSetsResponse.g.cs | 35 + .../Api/Synonyms/PutSynonymRequest.g.cs | 272 + .../Api/Synonyms/PutSynonymResponse.g.cs | 35 + .../Api/Synonyms/PutSynonymRuleRequest.g.cs | 103 + .../Api/Synonyms/PutSynonymRuleResponse.g.cs | 42 + .../_Generated/Api/Tasks/CancelRequest.g.cs | 12 +- .../_Generated/Api/Tasks/CancelResponse.g.cs | 4 +- .../_Generated/Api/Tasks/GetTasksRequest.g.cs | 14 +- .../Api/Tasks/GetTasksResponse.g.cs | 6 +- .../_Generated/Api/Tasks/ListRequest.g.cs | 2 - .../_Generated/Api/Tasks/ListResponse.g.cs | 4 +- .../_Generated/Api/TermVectorsRequest.g.cs | 29 +- .../_Generated/Api/TermVectorsResponse.g.cs | 1 + .../_Generated/Api/TermsEnumRequest.g.cs | 41 +- .../_Generated/Api/TermsEnumResponse.g.cs | 1 + .../TextStructure/TestGrokPatternRequest.g.cs | 123 + .../TestGrokPatternResponse.g.cs | 33 + .../DeleteTransformRequest.g.cs | 118 + .../DeleteTransformResponse.g.cs | 36 + .../GetTransformRequest.g.cs | 142 + .../GetTransformResponse.g.cs | 35 + .../GetTransformStatsRequest.g.cs | 134 + .../GetTransformStatsResponse.g.cs | 35 + .../PreviewTransformRequest.g.cs | 909 +++ .../PreviewTransformResponse.g.cs | 35 + .../PutTransformRequest.g.cs | 957 +++ .../PutTransformResponse.g.cs | 36 + .../ResetTransformRequest.g.cs | 94 + .../ResetTransformResponse.g.cs | 36 + .../ScheduleNowTransformRequest.g.cs | 96 + .../ScheduleNowTransformResponse.g.cs | 36 + .../StartTransformRequest.g.cs | 110 + .../StartTransformResponse.g.cs | 36 + .../StopTransformRequest.g.cs | 146 + .../StopTransformResponse.g.cs | 36 + .../UpdateTransformRequest.g.cs | 752 ++ .../UpdateTransformResponse.g.cs | 59 + .../UpgradeTransformsRequest.g.cs | 96 + .../UpgradeTransformsResponse.g.cs | 48 + .../_Generated/Api/UpdateByQueryRequest.g.cs | 48 +- .../_Generated/Api/UpdateByQueryResponse.g.cs | 1 + .../Api/UpdateByQueryRethrottleRequest.g.cs | 12 +- .../Api/UpdateByQueryRethrottleResponse.g.cs | 1 + .../_Generated/Api/UpdateRequest.g.cs | 30 +- .../_Generated/Api/UpdateResponse.g.cs | 1 + .../Api/Xpack/XpackInfoRequest.g.cs | 96 + .../Api/Xpack/XpackInfoResponse.g.cs | 39 + .../Api/Xpack/XpackUsageRequest.g.cs | 84 + .../Api/Xpack/XpackUsageResponse.g.cs | 89 + .../ElasticsearchClient.AsyncSearch.g.cs | 323 +- .../Client/ElasticsearchClient.Ccr.g.cs | 1127 +++ .../Client/ElasticsearchClient.Cluster.g.cs | 806 +- .../ElasticsearchClient.DanglingIndices.g.cs | 6 +- .../Client/ElasticsearchClient.Enrich.g.cs | 227 +- .../Client/ElasticsearchClient.Eql.g.cs | 263 +- .../Client/ElasticsearchClient.Esql.g.cs | 37 +- .../Client/ElasticsearchClient.Features.g.cs | 217 + .../Client/ElasticsearchClient.Graph.g.cs | 32 +- .../Client/ElasticsearchClient.Ilm.g.cs | 929 +++ .../Client/ElasticsearchClient.Indices.g.cs | 4733 +++++++----- .../Client/ElasticsearchClient.Inference.g.cs | 372 + .../Client/ElasticsearchClient.Ingest.g.cs | 164 +- .../Client/ElasticsearchClient.License.g.cs | 662 ++ .../Client/ElasticsearchClient.Ml.g.cs | 6637 +++++++++++++++++ .../Client/ElasticsearchClient.Nodes.g.cs | 708 ++ .../ElasticsearchClient.QueryRuleset.g.cs | 372 + .../Client/ElasticsearchClient.Rollup.g.cs | 774 ++ ...ElasticsearchClient.SearchApplication.g.cs | 728 ++ ...asticsearchClient.SearchableSnapshots.g.cs | 372 + .../Client/ElasticsearchClient.Slm.g.cs | 840 +++ .../Client/ElasticsearchClient.Snapshot.g.cs | 1018 +++ .../Client/ElasticsearchClient.Sql.g.cs | 334 +- .../Client/ElasticsearchClient.Synonyms.g.cs | 616 ++ .../Client/ElasticsearchClient.Tasks.g.cs | 100 +- .../ElasticsearchClient.TextStructure.g.cs | 128 + .../Client/ElasticsearchClient.Transform.g.cs | 1064 +++ .../Client/ElasticsearchClient.Xpack.g.cs | 217 + .../Client/ElasticsearchClient.g.cs | 2187 +++--- .../AdjacencyMatrixAggregation.g.cs | 224 +- .../Aggregations/AdjacencyMatrixBucket.g.cs | 82 +- .../Aggregations/AggregateDictionary.g.cs | 655 +- .../Types/Aggregations/Aggregation.g.cs | 2493 ++++--- .../AutoDateHistogramAggregation.g.cs | 417 +- .../Types/Aggregations/AverageAggregate.g.cs | 4 + .../Aggregations/AverageAggregation.g.cs | 218 +- .../AverageBucketAggregation.g.cs | 145 + .../Aggregations/BoxplotAggregation.g.cs | 215 +- .../BucketCorrelationAggregation.g.cs | 159 + .../BucketCorrelationFunction.g.cs | 99 + ...etCorrelationFunctionCountCorrelation.g.cs | 99 + ...tionFunctionCountCorrelationIndicator.g.cs | 105 + .../Aggregations/BucketKsAggregation.g.cs | 173 + .../BucketMetricValueAggregate.g.cs | 44 + .../Aggregations/BucketScriptAggregation.g.cs | 167 + .../BucketSelectorAggregation.g.cs | 167 + .../Aggregations/BucketSortAggregation.g.cs | 233 +- .../Types/Aggregations/Buckets.g.cs | 7 +- .../Types/Aggregations/BucketsPath.g.cs | 5 +- .../Aggregations/CardinalityAggregation.g.cs | 253 +- .../CategorizeTextAggregation.g.cs | 538 ++ .../Aggregations/CategorizeTextAnalyzer.g.cs | 42 + .../Types/Aggregations/ChildrenAggregate.g.cs | 82 +- .../Aggregations/ChildrenAggregation.g.cs | 251 +- .../Aggregations/CompositeAggregate.g.cs | 2 +- .../Aggregations/CompositeAggregation.g.cs | 273 +- .../CompositeAggregationSource.g.cs | 410 + .../Types/Aggregations/CompositeBucket.g.cs | 84 +- .../CompositeDateHistogramAggregation.g.cs | 447 ++ .../CompositeGeoTileGridAggregation.g.cs | 344 + .../CompositeHistogramAggregation.g.cs | 307 + .../CompositeTermsAggregation.g.cs | 287 + .../CumulativeCardinalityAggregation.g.cs | 161 +- .../CumulativeSumAggregation.g.cs | 161 +- .../CustomCategorizeTextAnalyzer.g.cs | 93 + .../DateHistogramAggregation.g.cs | 473 +- .../Aggregations/DateHistogramBucket.g.cs | 95 +- .../Aggregations/DateRangeAggregation.g.cs | 379 +- .../Aggregations/DerivativeAggregate.g.cs | 4 + .../Aggregations/DerivativeAggregation.g.cs | 161 +- .../DiversifiedSamplerAggregation.g.cs | 329 +- .../Types/Aggregations/DoubleTermsBucket.g.cs | 108 +- .../ExtendedStatsAggregation.g.cs | 237 +- .../ExtendedStatsBucketAggregation.g.cs | 192 +- .../Types/Aggregations/FieldDateMath.g.cs | 9 +- .../Types/Aggregations/FilterAggregate.g.cs | 82 +- .../Aggregations/FiltersAggregation.g.cs | 282 +- .../Types/Aggregations/FiltersBucket.g.cs | 69 +- .../FrequentItemSetsAggregate.g.cs | 36 + .../FrequentItemSetsAggregation.g.cs | 431 ++ .../Aggregations/FrequentItemSetsBucket.g.cs | 93 + .../Aggregations/FrequentItemSetsField.g.cs | 183 + .../Aggregations/GeoBoundsAggregation.g.cs | 214 +- .../Aggregations/GeoCentroidAggregation.g.cs | 238 +- .../Aggregations/GeoDistanceAggregation.g.cs | 365 +- .../Aggregations/GeoLineAggregation.g.cs | 215 +- .../Types/Aggregations/GeoLinePoint.g.cs | 9 + .../Types/Aggregations/GeoLineSort.g.cs | 9 + .../Aggregations/GeohashGridAggregation.g.cs | 333 +- .../Types/Aggregations/GeohashGridBucket.g.cs | 82 +- .../Aggregations/GeohexGridAggregation.g.cs | 325 +- .../Types/Aggregations/GeohexGridBucket.g.cs | 82 +- .../Aggregations/GeotileGridAggregation.g.cs | 342 +- .../Types/Aggregations/GeotileGridBucket.g.cs | 82 +- .../Types/Aggregations/GlobalAggregate.g.cs | 82 +- .../Types/Aggregations/GlobalAggregation.g.cs | 209 +- .../HdrPercentileRanksAggregate.g.cs | 36 + .../Aggregations/HdrPercentilesAggregate.g.cs | 36 + .../Aggregations/HistogramAggregation.g.cs | 404 +- .../Types/Aggregations/HistogramBucket.g.cs | 95 +- .../Aggregations/InferenceAggregate.g.cs | 72 +- .../Aggregations/InferenceAggregation.g.cs | 244 +- .../Types/Aggregations/InferenceConfig.g.cs | 131 +- .../Aggregations/IpPrefixAggregation.g.cs | 350 +- .../Types/Aggregations/IpPrefixBucket.g.cs | 121 +- .../Aggregations/IpRangeAggregation.g.cs | 304 +- .../Types/Aggregations/IpRangeBucket.g.cs | 108 +- .../Aggregations/LongRareTermsAggregate.g.cs | 39 + .../Aggregations/LongRareTermsBucket.g.cs | 93 + .../Types/Aggregations/LongTermsBucket.g.cs | 108 +- .../Aggregations/MatrixStatsAggregation.g.cs | 188 +- .../Types/Aggregations/MaxAggregate.g.cs | 4 + .../Types/Aggregations/MaxAggregation.g.cs | 218 +- .../Aggregations/MaxBucketAggregation.g.cs | 145 + .../MedianAbsoluteDeviationAggregate.g.cs | 4 + .../MedianAbsoluteDeviationAggregation.g.cs | 238 +- .../Types/Aggregations/MinAggregate.g.cs | 4 + .../Types/Aggregations/MinAggregation.g.cs | 218 +- .../Aggregations/MinBucketAggregation.g.cs | 145 + .../Types/Aggregations/MissingAggregate.g.cs | 82 +- .../Aggregations/MissingAggregation.g.cs | 262 +- .../MovingFunctionAggregation.g.cs | 211 + .../MovingPercentilesAggregation.g.cs | 189 + .../Types/Aggregations/MultiTermLookup.g.cs | 19 +- .../Aggregations/MultiTermsAggregation.g.cs | 422 +- .../Types/Aggregations/MultiTermsBucket.g.cs | 108 +- .../Types/Aggregations/NestedAggregate.g.cs | 82 +- .../Types/Aggregations/NestedAggregation.g.cs | 224 +- .../Aggregations/NormalizeAggregation.g.cs | 167 + .../Types/Aggregations/ParentAggregate.g.cs | 82 +- .../Types/Aggregations/ParentAggregation.g.cs | 251 +- .../PercentageScoreHeuristic.g.cs | 2 + .../PercentileRanksAggregation.g.cs | 319 +- .../Types/Aggregations/Percentiles.g.cs | 6 +- .../Aggregations/PercentilesAggregation.g.cs | 319 +- .../PercentilesBucketAggregation.g.cs | 192 +- .../Types/Aggregations/RangeAggregation.g.cs | 361 +- .../Types/Aggregations/RangeBucket.g.cs | 154 +- .../Aggregations/RareTermsAggregation.g.cs | 381 +- .../Types/Aggregations/RateAggregation.g.cs | 256 +- .../Aggregations/ReverseNestedAggregate.g.cs | 82 +- .../ReverseNestedAggregation.g.cs | 224 +- .../Types/Aggregations/SamplerAggregate.g.cs | 82 +- .../Aggregations/SamplerAggregation.g.cs | 251 +- .../ScriptedMetricAggregation.g.cs | 299 +- .../SerialDifferencingAggregation.g.cs | 167 + .../SignificantLongTermsAggregate.g.cs | 40 + .../SignificantLongTermsBucket.g.cs | 109 + .../SignificantStringTermsBucket.g.cs | 108 +- .../SignificantTermsAggregation.g.cs | 663 +- .../SignificantTextAggregation.g.cs | 1223 +++ .../Aggregations/SimpleValueAggregate.g.cs | 4 + .../Types/Aggregations/StatsAggregation.g.cs | 218 +- .../Aggregations/StatsBucketAggregation.g.cs | 161 +- .../Aggregations/StringRareTermsBucket.g.cs | 82 +- .../Aggregations/StringStatsAggregation.g.cs | 214 +- .../Types/Aggregations/StringTermsBucket.g.cs | 95 +- .../Types/Aggregations/SumAggregate.g.cs | 4 + .../Types/Aggregations/SumAggregation.g.cs | 218 +- .../Aggregations/SumBucketAggregation.g.cs | 145 + .../Types/Aggregations/TTestAggregation.g.cs | 221 +- .../Types/Aggregations/TermsAggregation.g.cs | 558 +- .../Types/Aggregations/TestPopulation.g.cs | 29 +- .../Aggregations/TopHitsAggregation.g.cs | 507 +- .../Types/Aggregations/TopMetrics.g.cs | 4 +- .../Aggregations/TopMetricsAggregation.g.cs | 318 +- .../Types/Aggregations/TopMetricsValue.g.cs | 9 + .../UnmappedRareTermsAggregate.g.cs | 39 + .../UnmappedSamplerAggregate.g.cs | 85 + .../UnmappedSignificantTermsAggregate.g.cs | 43 + .../Aggregations/UnmappedTermsAggregate.g.cs | 43 + .../Aggregations/ValueCountAggregate.g.cs | 4 + .../Aggregations/ValueCountAggregation.g.cs | 218 +- .../VariableWidthHistogramAggregation.g.cs | 181 +- .../VariableWidthHistogramBucket.g.cs | 161 +- .../WeightedAverageAggregate.g.cs | 4 + .../WeightedAverageAggregation.g.cs | 240 +- .../Aggregations/WeightedAverageValue.g.cs | 9 + .../_Generated/Types/Analysis/Analyzers.g.cs | 165 +- .../Analysis/AsciiFoldingTokenFilter.g.cs | 9 +- .../Types/Analysis/CharFilters.g.cs | 54 +- .../Types/Analysis/CharGroupTokenizer.g.cs | 4 +- .../Analysis/CommonGramsTokenFilter.g.cs | 4 +- .../Types/Analysis/ConditionTokenFilter.g.cs | 4 +- .../Analysis/DelimitedPayloadTokenFilter.g.cs | 4 +- .../DictionaryDecompounderTokenFilter.g.cs | 4 +- .../Types/Analysis/DutchAnalyzer.g.cs | 2 +- .../Types/Analysis/EdgeNGramTokenFilter.g.cs | 9 +- .../Types/Analysis/EdgeNGramTokenizer.g.cs | 4 +- .../Types/Analysis/ElisionTokenFilter.g.cs | 9 +- .../Types/Analysis/FingerprintAnalyzer.g.cs | 6 +- .../Analysis/FingerprintTokenFilter.g.cs | 4 +- .../Types/Analysis/HtmlStripCharFilter.g.cs | 4 +- .../Types/Analysis/HunspellTokenFilter.g.cs | 4 +- .../HyphenationDecompounderTokenFilter.g.cs | 4 +- .../Analysis/IcuCollationTokenFilter.g.cs | 4 +- .../Types/Analysis/IcuFoldingTokenFilter.g.cs | 4 +- .../Analysis/IcuNormalizationCharFilter.g.cs | 4 +- .../Analysis/IcuNormalizationTokenFilter.g.cs | 4 +- .../Types/Analysis/IcuTokenizer.g.cs | 4 +- .../Analysis/IcuTransformTokenFilter.g.cs | 4 +- .../Types/Analysis/KStemTokenFilter.g.cs | 4 +- .../Types/Analysis/KeepTypesTokenFilter.g.cs | 4 +- .../Types/Analysis/KeepWordsTokenFilter.g.cs | 4 +- .../Types/Analysis/KeywordAnalyzer.g.cs | 4 +- .../Analysis/KeywordMarkerTokenFilter.g.cs | 4 +- .../Types/Analysis/KeywordTokenizer.g.cs | 4 +- .../KuromojiIterationMarkCharFilter.g.cs | 4 +- .../KuromojiPartOfSpeechTokenFilter.g.cs | 4 +- .../KuromojiReadingFormTokenFilter.g.cs | 4 +- .../Analysis/KuromojiStemmerTokenFilter.g.cs | 4 +- .../Types/Analysis/KuromojiTokenizer.g.cs | 4 +- .../Types/Analysis/LanguageAnalyzer.g.cs | 6 +- .../Types/Analysis/LengthTokenFilter.g.cs | 4 +- .../Types/Analysis/LetterTokenizer.g.cs | 4 +- .../Analysis/LimitTokenCountTokenFilter.g.cs | 9 +- .../Types/Analysis/LowercaseTokenFilter.g.cs | 4 +- .../Types/Analysis/LowercaseTokenizer.g.cs | 4 +- .../Types/Analysis/MappingCharFilter.g.cs | 4 +- .../Analysis/MultiplexerTokenFilter.g.cs | 9 +- .../Types/Analysis/NGramTokenFilter.g.cs | 9 +- .../Types/Analysis/NGramTokenizer.g.cs | 4 +- .../Types/Analysis/NoriAnalyzer.g.cs | 4 +- .../Analysis/NoriPartOfSpeechTokenFilter.g.cs | 4 +- .../Types/Analysis/NoriTokenizer.g.cs | 4 +- .../Types/Analysis/Normalizers.g.cs | 21 +- .../Analysis/PathHierarchyTokenizer.g.cs | 19 +- .../Types/Analysis/PatternAnalyzer.g.cs | 6 +- .../Analysis/PatternCaptureTokenFilter.g.cs | 9 +- .../Analysis/PatternReplaceCharFilter.g.cs | 4 +- .../Analysis/PatternReplaceTokenFilter.g.cs | 4 +- .../Types/Analysis/PatternTokenizer.g.cs | 4 +- .../Types/Analysis/PhoneticTokenFilter.g.cs | 4 +- .../Types/Analysis/PorterStemTokenFilter.g.cs | 4 +- .../Types/Analysis/PredicateTokenFilter.g.cs | 4 +- .../Analysis/RemoveDuplicatesTokenFilter.g.cs | 4 +- .../Types/Analysis/ReverseTokenFilter.g.cs | 4 +- .../Types/Analysis/ShingleTokenFilter.g.cs | 16 +- .../Types/Analysis/SimpleAnalyzer.g.cs | 4 +- .../Types/Analysis/SnowballAnalyzer.g.cs | 6 +- .../Types/Analysis/SnowballTokenFilter.g.cs | 4 +- .../Types/Analysis/StandardAnalyzer.g.cs | 2 +- .../Types/Analysis/StandardTokenizer.g.cs | 4 +- .../Analysis/StemmerOverrideTokenFilter.g.cs | 4 +- .../Types/Analysis/StemmerTokenFilter.g.cs | 9 +- .../Types/Analysis/StopAnalyzer.g.cs | 6 +- .../Types/Analysis/StopTokenFilter.g.cs | 6 +- .../Analysis/SynonymGraphTokenFilter.g.cs | 4 +- .../Types/Analysis/SynonymTokenFilter.g.cs | 4 +- .../Types/Analysis/TokenFilters.g.cs | 552 +- .../_Generated/Types/Analysis/Tokenizers.g.cs | 162 +- .../Types/Analysis/TrimTokenFilter.g.cs | 4 +- .../Types/Analysis/TruncateTokenFilter.g.cs | 4 +- .../Types/Analysis/UaxEmailUrlTokenizer.g.cs | 4 +- .../Types/Analysis/UniqueTokenFilter.g.cs | 4 +- .../Types/Analysis/UppercaseTokenFilter.g.cs | 4 +- .../Types/Analysis/WhitespaceAnalyzer.g.cs | 4 +- .../Types/Analysis/WhitespaceTokenizer.g.cs | 4 +- .../WordDelimiterGraphTokenFilter.g.cs | 9 +- .../Analysis/WordDelimiterTokenFilter.g.cs | 9 +- .../Types/AsyncSearch/AsyncSearch.g.cs | 21 +- .../_Generated/Types/ByteSize.g.cs | 7 +- .../Types/Cluster/CharFilterTypes.g.cs | 6 + .../Types/Cluster/ComponentTemplate.g.cs | 36 + .../Types/Cluster/ComponentTemplateNode.g.cs | 38 + .../Cluster/ComponentTemplateSummary.g.cs | 45 + .../_Generated/Types/ClusterDetails.g.cs | 4 +- .../Types/Core/Bulk/ResponseItem.g.cs | 47 +- .../_Generated/Types/Core/Context.g.cs | 8 +- .../Types/Core/FieldCaps/FieldCapability.g.cs | 13 +- .../_Generated/Types/Core/Get/GetResult.g.cs | 9 +- .../Types/Core/HealthReport/Diagnosis.g.cs | 42 + .../DiagnosisAffectedResources.g.cs | 43 + .../Core/HealthReport/DiskIndicator.g.cs | 45 + .../HealthReport/DiskIndicatorDetails.g.cs | 42 + .../Types/Core/HealthReport/IlmIndicator.g.cs | 45 + .../HealthReport/IlmIndicatorDetails.g.cs | 36 + .../Types/Core/HealthReport/Impact.g.cs | 40 + .../HealthReport/IndicatorNode.g.cs} | 11 +- .../Types/Core/HealthReport/Indicators.g.cs | 46 + .../HealthReport/MasterIsStableIndicator.g.cs | 45 + ...IsStableIndicatorClusterFormationNode.g.cs | 38 + .../MasterIsStableIndicatorDetails.g.cs | 40 + ...bleIndicatorExceptionFetchingHistory.g.cs} | 11 +- .../RepositoryIntegrityIndicator.g.cs | 45 + .../RepositoryIntegrityIndicatorDetails.g.cs | 38 + .../ShardsAvailabilityIndicator.g.cs | 45 + .../ShardsAvailabilityIndicatorDetails.g.cs | 50 + .../HealthReport/ShardsCapacityIndicator.g.cs | 45 + .../ShardsCapacityIndicatorDetails.g.cs | 36 + .../ShardsCapacityIndicatorTierDetail.g.cs | 36 + .../Types/Core/HealthReport/SlmIndicator.g.cs | 45 + .../HealthReport/SlmIndicatorDetails.g.cs | 38 + .../SlmIndicatorUnhealthyPolicies.g.cs | 36 + .../Types/Core/MGet/MultiGetError.g.cs | 4 +- .../Types/Core/MGet/MultiGetOperation.g.cs | 134 +- .../Types/Core/MSearch/MultiSearchItem.g.cs | 12 +- .../Types/Core/MSearch/MultisearchBody.g.cs | 2312 +----- .../Types/Core/MSearch/MultisearchHeader.g.cs | 186 +- .../Core/MSearchTemplate/TemplateConfig.g.cs | 106 +- .../MultiTermVectorsOperation.g.cs | 64 +- .../Mtermvectors/MultiTermVectorsResult.g.cs | 12 +- .../Types/Core/MultiGetResponseItem.g.cs | 4 +- .../Types/Core/MultiSearchResponseItem.g.cs | 4 +- .../Types/Core/RankEval/RankEvalMetric.g.cs | 50 +- ...ankEvalMetricDiscountedCumulativeGain.g.cs | 8 + .../RankEvalMetricExpectedReciprocalRank.g.cs | 8 + .../RankEvalMetricMeanReciprocalRank.g.cs | 15 + .../RankEval/RankEvalMetricPrecision.g.cs | 16 + .../Core/RankEval/RankEvalMetricRecall.g.cs | 15 + .../Types/Core/RankEval/RankEvalQuery.g.cs | 20 +- .../Core/RankEval/RankEvalRequestItem.g.cs | 52 +- .../Types/Core/Reindex/RemoteSource.g.cs | 6 +- .../_Generated/Types/Core/Reindex/Source.g.cs | 134 +- .../Core/ReindexRethrottle/ReindexTask.g.cs | 2 +- .../PainlessContextSetup.g.cs | 221 + .../Types/Core/Search/CompletionSuggest.g.cs | 41 + .../Core/Search/CompletionSuggestOption.g.cs | 52 + .../Core/Search/CompletionSuggester.g.cs | 103 +- .../Types/Core/Search/DirectGenerator.g.cs | 9 + .../Types/Core/Search/FieldCollapse.g.cs | 61 +- .../Types/Core/Search/FieldSuggester.g.cs | 42 +- .../Types/Core/Search/Highlight.g.cs | 223 +- .../Types/Core/Search/HighlightField.g.cs | 222 +- .../_Generated/Types/Core/Search/Hit.g.cs | 25 +- .../Types/Core/Search/HitsMetadata.g.cs | 2 +- .../Types/Core/Search/InnerHits.g.cs | 148 +- .../Core/Search/LaplaceSmoothingModel.g.cs | 2 +- .../LinearInterpolationSmoothingModel.g.cs | 2 +- .../Types/Core/Search/NestedIdentity.g.cs | 4 +- .../Types/Core/Search/PhraseSuggest.g.cs | 41 + .../Core/Search/PhraseSuggestCollate.g.cs | 10 +- .../Core/Search/PhraseSuggestOption.g.cs | 40 + .../Types/Core/Search/PhraseSuggester.g.cs | 141 +- .../Types/Core/Search/RegexOptions.g.cs | 6 +- .../_Generated/Types/Core/Search/Rescore.g.cs | 20 +- .../Types/Core/Search/RescoreQuery.g.cs | 32 +- .../Types/Core/Search/SmoothingModel.g.cs | 142 +- .../Types/Core/Search/SourceFilter.g.cs | 42 + .../Search/StupidBackoffSmoothingModel.g.cs | 2 +- .../Types/Core/Search/SuggestDictionary.g.cs | 108 + .../Types/Core/Search/Suggester.g.cs | 71 +- .../Types/Core/Search/TermSuggest.g.cs | 41 + .../Types/Core/Search/TermSuggestOption.g.cs | 42 + .../Types/Core/Search/TermSuggester.g.cs | 49 +- .../Core/SearchShards/ShardStoreIndex.g.cs | 2 +- .../_Generated/Types/Core/SourceConfig.g.cs | 7 +- .../Types/Core/SourceConfigParam.g.cs | 7 +- .../_Generated/Types/Core/TrackHits.g.cs | 7 +- .../AutoFollowPattern.g.cs | 36 + .../AutoFollowPatternSummary.g.cs | 64 + .../AutoFollowStats.g.cs | 42 + .../AutoFollowedCluster.g.cs | 38 + .../FollowIndexStats.g.cs | 36 + .../FollowStats.g.cs} | 9 +- .../FollowerIndex.g.cs | 42 + .../FollowerIndexParameters.g.cs | 52 + .../ReadException.g.cs | 38 + .../CrossClusterReplication/ShardStats.g.cs | 98 + .../Types/DanglingIndices/DanglingIndex.g.cs | 3 +- .../Types/ElasticsearchVersionMinInfo.g.cs | 43 + .../_Generated/Types/EmptyObject.g.cs | 2 + .../_Generated/Types/Enrich/EnrichPolicy.g.cs | 84 +- .../Types/Enrich/EnrichSummary.g.cs | 2 +- .../Types/Enums/Enums.Aggregations.g.cs | 127 +- .../Types/Enums/Enums.Analysis.g.cs | 66 +- .../_Generated/Types/Enums/Enums.Cluster.g.cs | 15 +- .../Types/Enums/Enums.Core.HealthReport.g.cs | 141 + .../Types/Enums/Enums.Core.Search.g.cs | 33 +- .../Types/Enums/Enums.Core.SearchMvt.g.cs | 120 + .../Enums/Enums.CrossClusterReplication.g.cs} | 52 +- .../_Generated/Types/Enums/Enums.Enrich.g.cs | 12 +- .../_Generated/Types/Enums/Enums.Eql.g.cs | 9 +- .../Types/Enums/Enums.IndexManagement.g.cs | 205 +- .../Types/Enums/Enums.Inference.g.cs | 71 + .../_Generated/Types/Enums/Enums.Ingest.g.cs | 18 +- .../Types/Enums/Enums.LicenseManagement.g.cs | 176 + .../Types/Enums/Enums.MachineLearning.g.cs | 1206 +++ .../_Generated/Types/Enums/Enums.Mapping.g.cs | 39 +- .../Types/Enums/Enums.NoNamespace.g.cs | 273 +- .../Types/Enums/Enums.QueryDsl.g.cs | 103 +- .../Types/Enums/Enums.QueryRuleset.g.cs | 162 + .../_Generated/Types/Enums/Enums.Rollup.g.cs | 155 + ...Ml.g.cs => Enums.SearchableSnapshots.g.cs} | 57 +- .../Types/Enums/Enums.Snapshot.g.cs | 184 + .../_Generated/Types/Enums/Enums.Tasks.g.cs | 9 +- .../_Generated/Types/Enums/Enums.Watcher.g.cs | 9 +- .../_Generated/Types/Eql/HitsEvent.g.cs | 7 +- .../_Generated/Types/ErrorCause.g.cs | 12 +- .../_Generated/Types/ErrorResponseBase.g.cs | 3 +- .../_Generated/Types/Features/Feature.g.cs | 36 + .../_Generated/Types/FieldSort.g.cs | 30 +- .../_Generated/Types/Fuzziness.g.cs | 7 +- .../_Generated/Types/GeoDistanceSort.g.cs | 68 +- .../_Generated/Types/GeoHashLocation.g.cs | 2 +- .../_Generated/Types/GeoLocation.g.cs | 5 +- .../_Generated/Types/GeohashPrecision.g.cs | 7 +- .../Types/Graph/ExploreControls.g.cs | 20 +- .../_Generated/Types/Graph/Hop.g.cs | 72 +- .../Types/Graph/SampleDiversity.g.cs | 6 + .../Types/Graph/VertexDefinition.g.cs | 41 +- .../Configurations.g.cs | 183 + .../ForceMergeConfiguration.g.cs | 59 + .../IndexLifecycleManagement/IlmPolicy.g.cs | 108 + .../IndexLifecycleManagement/Lifecycle.g.cs | 38 + .../Types/IndexLifecycleManagement/Phase.g.cs | 123 + .../IndexLifecycleManagement/Phases.g.cs | 273 + .../ShrinkConfiguration.g.cs | 59 + .../IndexLifecycleManagement/StepKey.g.cs | 81 + .../Types/IndexManagement/Action.g.cs | 237 - .../Types/IndexManagement/AddAction.g.cs | 22 +- .../Types/IndexManagement/Alias.g.cs | 20 +- .../Types/IndexManagement/AnalyzeDetail.g.cs | 42 + .../Types/IndexManagement/AnalyzeToken.g.cs | 44 + .../Types/IndexManagement/AnalyzerDetail.g.cs | 36 + .../IndexManagement/CharFilterDetail.g.cs | 36 + .../Types/IndexManagement/DataStream.g.cs | 14 +- .../IndexManagement/DataStreamIndex.g.cs | 2 +- .../IndexManagement/DataStreamLifecycle.g.cs | 10 +- .../DataStreamLifecycleDownsampling.g.cs | 16 +- ...DataStreamLifecycleRolloverConditions.g.cs | 166 +- .../DataStreamLifecycleWithRollover.g.cs | 133 +- .../IndexManagement/DataStreamsStatsItem.g.cs | 61 + .../IndexManagement/DownsampleConfig.g.cs | 2 +- .../IndexManagement/DownsamplingRound.g.cs | 10 +- .../IndexManagement/ExplainAnalyzeToken.g.cs | 136 + .../FielddataFrequencyFilter.g.cs | 9 +- .../Types/IndexManagement/FileDetails.g.cs | 38 + .../IndexAndDataStreamAction.g.cs | 83 + .../IndexModifyDataStreamAction.g.cs | 243 + .../Types/IndexManagement/IndexRouting.g.cs | 20 +- .../IndexRoutingAllocation.g.cs | 30 +- .../IndexRoutingAllocationDisk.g.cs | 6 +- .../Types/IndexManagement/IndexSegment.g.cs | 34 + .../IndexManagement/IndexSettingBlocks.g.cs | 25 +- .../Types/IndexManagement/IndexSettings.g.cs | 659 +- .../IndexSettingsAnalysis.g.cs | 34 +- .../IndexSettingsLifecycle.g.cs | 15 +- .../Types/IndexManagement/IndexState.g.cs | 92 +- .../Types/IndexManagement/IndexTemplate.g.cs | 411 +- .../IndexTemplateDataStreamConfiguration.g.cs | 52 +- .../IndexManagement/IndexTemplateMapping.g.cs | 72 +- .../IndexManagement/IndexTemplateSummary.g.cs | 343 +- .../IndexUpdateAliasesAction.g.cs | 258 + .../IndexManagement/IndexVersioning.g.cs | 4 +- .../IndexManagement/IndexingPressure.g.cs | 10 +- .../IndexingSlowlogSettings.g.cs | 10 +- .../IndexingSlowlogTresholds.g.cs | 10 +- .../IndexManagement/IndicesShardStores.g.cs | 34 + .../IndicesValidationExplanation.g.cs | 40 + .../IndexManagement/MappingLimitSettings.g.cs | 62 +- .../Types/IndexManagement/Merge.g.cs | 10 +- .../Types/IndexManagement/MergeScheduler.g.cs | 10 +- .../IndexManagement/NumericFielddata.g.cs | 7 +- .../Types/IndexManagement/Queries.g.cs | 10 +- .../Types/IndexManagement/RecoveryBytes.g.cs | 50 + .../Types/IndexManagement/RecoveryFiles.g.cs | 42 + .../IndexManagement/RecoveryIndexStatus.g.cs | 50 + .../Types/IndexManagement/RecoveryOrigin.g.cs | 56 + .../IndexManagement/RecoveryStartStatus.g.cs | 40 + .../Types/IndexManagement/RecoveryStatus.g.cs | 34 + .../Types/IndexManagement/ReloadDetails.g.cs | 38 + .../Types/IndexManagement/ReloadResult.g.cs | 36 + .../Types/IndexManagement/RemoveAction.g.cs | 2 +- .../IndexManagement/RemoveIndexAction.g.cs | 2 +- .../IndexManagement/ResolveClusterInfo.g.cs | 64 + .../ResolveIndexAliasItem.g.cs | 37 + .../ResolveIndexDataStreamsItem.g.cs | 39 + .../IndexManagement/ResolveIndexItem.g.cs | 40 + .../IndexManagement/RolloverConditions.g.cs | 4 +- .../Types/IndexManagement/Segment.g.cs | 50 + .../IndexManagement/SettingsAnalyze.g.cs | 5 +- .../IndexManagement/SettingsQueryString.g.cs | 3 +- .../Types/IndexManagement/SettingsSearch.g.cs | 20 +- .../IndexManagement/SettingsSimilarities.g.cs | 177 + .../IndexManagement/SettingsSimilarity.g.cs | 363 - .../SettingsSimilarityBm25.g.cs | 53 +- ...df.g.cs => SettingsSimilarityBoolean.g.cs} | 29 +- .../SettingsSimilarityDfi.g.cs | 9 +- .../SettingsSimilarityDfr.g.cs | 11 +- .../IndexManagement/SettingsSimilarityIb.g.cs | 11 +- .../SettingsSimilarityLmd.g.cs | 23 +- .../SettingsSimilarityLmj.g.cs | 23 +- .../SettingsSimilarityScripted.g.cs | 86 + .../Types/IndexManagement/ShardRecovery.g.cs | 64 + .../IndexManagement/ShardSegmentRouting.g.cs | 38 + .../Types/IndexManagement/ShardStats.g.cs | 2 + .../Types/IndexManagement/ShardStore.g.cs | 87 + .../IndexManagement/ShardStoreException.g.cs | 36 + .../Types/IndexManagement/ShardStoreNode.g.cs | 44 + .../IndexManagement/ShardStoreWrapper.g.cs | 34 + .../Types/IndexManagement/ShardsSegment.g.cs | 40 + .../IndexManagement/SlowlogSettings.g.cs | 10 +- .../IndexManagement/SlowlogTresholds.g.cs | 20 +- .../Types/IndexManagement/SoftDeletes.g.cs | 10 +- .../IndexManagement/TemplateMapping.g.cs | 2 +- .../Types/IndexManagement/TokenDetail.g.cs | 36 + .../Types/IndexManagement/Translog.g.cs | 10 +- .../Types/IndexManagement/TranslogStatus.g.cs | 44 + .../Types/IndexManagement/VerifyIndex.g.cs | 40 + .../_Generated/Types/IndicesOptions.g.cs | 142 + .../Types/Inference/ModelConfig.g.cs | 107 + .../Types/Inference/ModelConfigContainer.g.cs | 64 + .../Types/Ingest/AppendProcessor.g.cs | 101 +- .../Types/Ingest/AttachmentProcessor.g.cs | 156 +- .../Types/Ingest/BytesProcessor.g.cs | 109 +- .../Types/Ingest/CircleProcessor.g.cs | 109 +- .../Types/Ingest/ConvertProcessor.g.cs | 109 +- .../_Generated/Types/Ingest/CsvProcessor.g.cs | 100 +- .../Types/Ingest/DateIndexNameProcessor.g.cs | 101 +- .../Types/Ingest/DateProcessor.g.cs | 109 +- .../Types/Ingest/DissectProcessor.g.cs | 101 +- .../Types/Ingest/DocumentSimulation.g.cs | 15 +- .../Types/Ingest/DotExpanderProcessor.g.cs | 100 +- .../Types/Ingest/DropProcessor.g.cs | 91 +- .../Types/Ingest/EnrichProcessor.g.cs | 117 +- .../Types/Ingest/FailProcessor.g.cs | 91 +- .../Types/Ingest/ForeachProcessor.g.cs | 120 +- .../Types/Ingest/GeoIpProcessor.g.cs | 110 +- .../Types/Ingest/GrokProcessor.g.cs | 100 +- .../Types/Ingest/GsubProcessor.g.cs | 109 +- .../Types/Ingest/InferenceConfig.g.cs | 124 +- .../Ingest/InferenceConfigClassification.g.cs | 20 +- .../Ingest/InferenceConfigRegression.g.cs | 11 +- .../Types/Ingest/InferenceProcessor.g.cs | 120 +- .../Types/Ingest/JoinProcessor.g.cs | 109 +- .../Types/Ingest/JsonProcessor.g.cs | 110 +- .../Types/Ingest/KeyValueProcessor.g.cs | 109 +- .../Types/Ingest/LowercaseProcessor.g.cs | 109 +- .../_Generated/Types/Ingest/Pipeline.g.cs | 84 +- .../Types/Ingest/PipelineProcessor.g.cs | 91 +- .../_Generated/Types/Ingest/Processor.g.cs | 811 +- .../Types/Ingest/RemoveProcessor.g.cs | 91 +- .../Types/Ingest/RenameProcessor.g.cs | 109 +- .../Types/Ingest/RerouteProcessor.g.cs | 94 +- .../Types/Ingest/ScriptProcessor.g.cs | 523 ++ .../_Generated/Types/Ingest/SetProcessor.g.cs | 118 +- .../Ingest/SetSecurityUserProcessor.g.cs | 100 +- .../Types/Ingest/SortProcessor.g.cs | 109 +- .../Types/Ingest/SplitProcessor.g.cs | 109 +- .../Types/Ingest/TrimProcessor.g.cs | 109 +- .../Types/Ingest/UppercaseProcessor.g.cs | 109 +- .../Types/Ingest/UrlDecodeProcessor.g.cs | 109 +- .../Types/Ingest/UserAgentProcessor.g.cs | 109 +- .../_Generated/Types/InlineGet.g.cs | 90 +- .../_Generated/Types/InlineScript.g.cs | 7 + .../_Generated/Types/KnnQuery.g.cs | 168 +- .../LicenseManagement/Acknowledgement.g.cs | 36 + .../Types/LicenseManagement/License.g.cs | 170 + .../LicenseManagement/LicenseInformation.g.cs | 56 + .../MachineLearning/AggregateOutput.g.cs | 228 + .../Types/MachineLearning/AnalysisConfig.g.cs | 729 ++ .../MachineLearning/AnalysisConfigRead.g.cs | 97 + .../Types/MachineLearning/AnalysisLimits.g.cs | 91 + .../MachineLearning/AnalysisMemoryLimit.g.cs | 65 + .../Types/MachineLearning/Anomaly.g.cs | 175 + .../Types/MachineLearning/AnomalyCause.g.cs | 60 + .../MachineLearning/AnomalyDetectors.g.cs | 42 + .../MachineLearning/AnomalyExplanation.g.cs | 91 + .../MachineLearning/ApiKeyAuthorization.g.cs | 43 + .../MachineLearning/BucketInfluencer.g.cs | 97 + .../Types/MachineLearning/BucketSummary.g.cs | 93 + .../Types/MachineLearning/Calendar.g.cs | 49 + .../Types/MachineLearning/CalendarEvent.g.cs | 138 + .../CategorizationAnalyzer.g.cs | 42 + .../CategorizationAnalyzerDefinition.g.cs | 113 + .../Types/MachineLearning/Category.g.cs | 103 + .../Types/MachineLearning/ChunkingConfig.g.cs | 87 + .../ClassificationInferenceOptions.g.cs | 6 +- .../MachineLearning/ConfusionMatrixItem.g.cs | 40 + .../ConfusionMatrixPrediction.g.cs | 36 + .../ConfusionMatrixThreshold.g.cs | 55 + .../Types/MachineLearning/DataCounts.g.cs | 70 + .../MachineLearning/DataDescription.g.cs | 242 + .../Types/MachineLearning/Datafeed.g.cs | 187 + .../DatafeedAuthorization.g.cs | 49 + .../Types/MachineLearning/DatafeedConfig.g.cs | 1004 +++ .../MachineLearning/DatafeedRunningState.g.cs | 49 + .../Types/MachineLearning/DatafeedStats.g.cs | 67 + .../MachineLearning/DatafeedTimingStats.g.cs | 67 + .../Datafeeds.g.cs} | 9 +- .../MachineLearning/DataframeAnalysis.g.cs | 258 + .../DataframeAnalysisAnalyzedFields.g.cs | 83 + .../DataframeAnalysisClassification.g.cs | 1200 +++ .../DataframeAnalysisFeatureProcessor.g.cs | 288 + ...ysisFeatureProcessorFrequencyEncoding.g.cs | 169 + ...AnalysisFeatureProcessorMultiEncoding.g.cs | 67 + ...AnalysisFeatureProcessorNGramEncoding.g.cs | 304 + ...nalysisFeatureProcessorOneHotEncoding.g.cs | 161 + ...sisFeatureProcessorTargetMeanEncoding.g.cs | 221 + .../DataframeAnalysisOutlierDetection.g.cs | 181 + .../DataframeAnalysisRegression.g.cs | 1210 +++ .../MachineLearning/DataframeAnalytics.g.cs | 73 + .../DataframeAnalyticsAuthorization.g.cs | 49 + .../DataframeAnalyticsDestination.g.cs | 167 + .../DataframeAnalyticsFieldSelection.g.cs | 67 + .../DataframeAnalyticsMemoryEstimation.g.cs | 43 + .../DataframeAnalyticsSource.g.cs | 327 + .../DataframeAnalyticsStatsDataCounts.g.cs | 49 + .../DataframeAnalyticsStatsMemoryUsage.g.cs | 55 + .../DataframeAnalyticsStatsProgress.g.cs | 43 + .../DataframeAnalyticsSummary.g.cs | 60 + .../DataframeClassificationSummary.g.cs | 61 + ...ataframeClassificationSummaryAccuracy.g.cs | 36 + ...ationSummaryMulticlassConfusionMatrix.g.cs | 36 + ...taframeClassificationSummaryPrecision.g.cs | 36 + .../DataframeClassificationSummaryRecall.g.cs | 36 + .../MachineLearning/DataframeEvaluation.g.cs | 258 + .../DataframeEvaluationClass.g.cs | 36 + .../DataframeEvaluationClassification.g.cs | 377 + ...aframeEvaluationClassificationMetrics.g.cs | 187 + ...EvaluationClassificationMetricsAucRoc.g.cs | 91 + .../DataframeEvaluationOutlierDetection.g.cs | 295 + ...rameEvaluationOutlierDetectionMetrics.g.cs | 165 + .../DataframeEvaluationRegression.g.cs | 295 + .../DataframeEvaluationRegressionMetrics.g.cs | 195 + ...frameEvaluationRegressionMetricsHuber.g.cs | 69 + ...aframeEvaluationRegressionMetricsMsle.g.cs | 69 + .../DataframeEvaluationSummaryAucRoc.g.cs | 36 + ...frameEvaluationSummaryAucRocCurveItem.g.cs | 38 + .../DataframeEvaluationValue.g.cs | 34 + .../DataframeOutlierDetectionSummary.g.cs | 55 + .../DataframePreviewConfig.g.cs | 384 + .../DataframeRegressionSummary.g.cs | 55 + .../Types/MachineLearning/Defaults.g.cs | 36 + .../Types/MachineLearning/Definition.g.cs | 179 + .../DelayedDataCheckConfig.g.cs | 87 + .../Types/MachineLearning/DetectionRule.g.cs | 293 + .../Types/MachineLearning/Detector.g.cs | 703 ++ .../Types/MachineLearning/DetectorRead.g.cs | 91 + .../Types/MachineLearning/DiscoveryNode.g.cs | 42 + .../Types/MachineLearning/Ensemble.g.cs | 211 + .../FillMaskInferenceOptions.g.cs | 20 +- .../FillMaskInferenceUpdateOptions.g.cs | 20 +- .../Types/MachineLearning/Filter.g.cs | 49 + .../Types/MachineLearning/FilterRef.g.cs | 87 + .../FrequencyEncodingPreprocessor.g.cs | 83 + .../Types/MachineLearning/GeoResults.g.cs | 43 + .../Types/MachineLearning/Hyperparameter.g.cs | 61 + .../InferenceConfigCreate.g.cs | 366 + .../InferenceConfigUpdate.g.cs | 363 + .../InferenceResponseResult.g.cs | 85 + .../Types/MachineLearning/Influence.g.cs | 36 + .../Types/MachineLearning/Influencer.g.cs | 97 + .../Types/MachineLearning/Input.g.cs | 59 + .../_Generated/Types/MachineLearning/Job.g.cs | 157 + .../Types/MachineLearning/JobBlocked.g.cs | 36 + .../JobForecastStatistics.g.cs | 44 + .../Types/MachineLearning/JobStatistics.g.cs | 40 + .../Types/MachineLearning/JobStats.g.cs | 91 + .../Types/MachineLearning/JobTimingStats.g.cs | 48 + .../Types/MachineLearning/JvmStats.g.cs | 67 + .../Types/MachineLearning/Limits.g.cs | 38 + .../Types/MachineLearning/MemMlStats.g.cs | 91 + .../Types/MachineLearning/MemStats.g.cs | 61 + .../Types/MachineLearning/Memory.g.cs | 66 + .../MachineLearning/ModelPlotConfig.g.cs | 213 + .../Types/MachineLearning/ModelSizeStats.g.cs | 74 + .../Types/MachineLearning/ModelSnapshot.g.cs | 91 + .../MachineLearning/ModelSnapshotUpgrade.g.cs | 42 + .../Types/MachineLearning/NativeCode.g.cs | 36 + .../NerInferenceOptions.g.cs | 36 +- .../NerInferenceUpdateOptions.g.cs | 20 +- .../NlpBertTokenizationConfig.g.cs | 8 +- .../NlpRobertaTokenizationConfig.g.cs | 10 +- .../NlpTokenizationUpdateOptions.g.cs | 8 +- .../OneHotEncodingPreprocessor.g.cs | 72 + .../Types/MachineLearning/OverallBucket.g.cs | 73 + .../MachineLearning/OverallBucketJob.g.cs | 36 + .../Page.g.cs} | 54 +- .../PassThroughInferenceOptions.g.cs | 36 +- .../PassThroughInferenceUpdateOptions.g.cs | 20 +- .../PerPartitionCategorization.g.cs | 91 + .../Types/MachineLearning/Preprocessor.g.cs | 258 + .../QuestionAnsweringInferenceOptions.g.cs | 20 +- ...estionAnsweringInferenceUpdateOptions.g.cs | 20 +- .../RegressionInferenceOptions.g.cs | 15 +- .../Types/MachineLearning/RuleCondition.g.cs | 101 + .../RunningStateSearchInterval.g.cs | 55 + .../TargetMeanEncodingPreprocessor.g.cs | 94 + .../TextClassificationInferenceOptions.g.cs | 20 +- ...tClassificationInferenceUpdateOptions.g.cs | 20 +- .../TextEmbeddingInferenceOptions.g.cs | 20 +- .../TextEmbeddingInferenceUpdateOptions.g.cs | 20 +- .../TextExpansionInferenceOptions.g.cs | 20 +- .../TextExpansionInferenceUpdateOptions.g.cs | 20 +- .../MachineLearning/TokenizationConfig.g.cs | 261 + .../Types/MachineLearning/TopClassEntry.g.cs | 38 + .../TotalFeatureImportance.g.cs | 49 + .../TotalFeatureImportanceClass.g.cs | 43 + .../TotalFeatureImportanceStatistics.g.cs | 49 + .../Types/MachineLearning/TrainedModel.g.cs | 203 + .../TrainedModelAssignment.g.cs | 53 + .../TrainedModelAssignmentRoutingTable.g.cs | 55 + .../TrainedModelAssignmentTaskParameters.g.cs | 75 + .../MachineLearning/TrainedModelConfig.g.cs | 130 + .../TrainedModelConfigInput.g.cs | 37 + .../TrainedModelConfigMetadata.g.cs | 51 + ...rainedModelDeploymentAllocationStatus.g.cs | 49 + .../TrainedModelDeploymentNodesStats.g.cs | 103 + .../TrainedModelDeploymentStats.g.cs | 117 + .../MachineLearning/TrainedModelEntities.g.cs | 42 + .../TrainedModelInferenceClassImportance.g.cs | 36 + ...rainedModelInferenceFeatureImportance.g.cs | 38 + .../TrainedModelInferenceStats.g.cs | 61 + .../MachineLearning/TrainedModelLocation.g.cs | 34 + .../TrainedModelLocationIndex.g.cs | 34 + .../TrainedModelPrefixStrings.g.cs | 91 + .../TrainedModelSizeStats.g.cs | 43 + .../MachineLearning/TrainedModelStats.g.cs | 67 + .../MachineLearning/TrainedModelTree.g.cs | 162 + .../MachineLearning/TrainedModelTreeNode.g.cs | 179 + .../TransformAuthorization.g.cs | 49 + .../{Ml => MachineLearning}/Vocabulary.g.cs | 2 +- .../Types/MachineLearning/Weights.g.cs | 59 + ...eroShotClassificationInferenceOptions.g.cs | 20 +- ...tClassificationInferenceUpdateOptions.g.cs | 20 +- .../AggregateMetricDoubleProperty.g.cs | 34 +- .../Types/Mapping/BinaryProperty.g.cs | 34 +- .../Types/Mapping/BooleanProperty.g.cs | 66 +- .../Types/Mapping/ByteNumberProperty.g.cs | 72 +- .../Types/Mapping/CompletionProperty.g.cs | 118 +- .../Mapping/ConstantKeywordProperty.g.cs | 34 +- .../Types/Mapping/DateNanosProperty.g.cs | 34 +- .../Types/Mapping/DateProperty.g.cs | 66 +- .../Types/Mapping/DateRangeProperty.g.cs | 34 +- .../Mapping/DenseVectorIndexOptions.g.cs | 9 +- .../Types/Mapping/DenseVectorProperty.g.cs | 92 +- .../Types/Mapping/DoubleNumberProperty.g.cs | 54 +- .../Types/Mapping/DoubleRangeProperty.g.cs | 34 +- .../Types/Mapping/DynamicProperty.g.cs | 66 +- .../Types/Mapping/DynamicTemplate.g.cs | 107 + .../Types/Mapping/FieldAliasProperty.g.cs | 40 +- .../Types/Mapping/FlattenedProperty.g.cs | 34 +- .../Types/Mapping/FloatNumberProperty.g.cs | 54 +- .../Types/Mapping/FloatRangeProperty.g.cs | 34 +- .../Types/Mapping/GeoPointProperty.g.cs | 124 +- .../Types/Mapping/GeoShapeProperty.g.cs | 37 +- .../Mapping/HalfFloatNumberProperty.g.cs | 54 +- .../Types/Mapping/HistogramProperty.g.cs | 34 +- .../Types/Mapping/IntegerNumberProperty.g.cs | 54 +- .../Types/Mapping/IntegerRangeProperty.g.cs | 34 +- .../_Generated/Types/Mapping/IpProperty.g.cs | 34 +- .../Types/Mapping/IpRangeProperty.g.cs | 34 +- .../Types/Mapping/JoinProperty.g.cs | 48 +- .../Types/Mapping/KeywordProperty.g.cs | 34 +- .../Types/Mapping/LongNumberProperty.g.cs | 54 +- .../Types/Mapping/LongRangeProperty.g.cs | 34 +- .../Types/Mapping/MatchOnlyTextProperty.g.cs | 24 +- .../Types/Mapping/Murmur3HashProperty.g.cs | 34 +- .../Types/Mapping/NestedProperty.g.cs | 34 +- .../Types/Mapping/ObjectProperty.g.cs | 34 +- .../Types/Mapping/PercolatorProperty.g.cs | 34 +- .../Types/Mapping/PointProperty.g.cs | 34 +- .../_Generated/Types/Mapping/Properties.g.cs | 851 ++- .../Types/Mapping/RankFeatureProperty.g.cs | 34 +- .../Types/Mapping/RankFeaturesProperty.g.cs | 64 +- .../Types/Mapping/RuntimeField.g.cs | 50 +- .../Mapping/RuntimeFieldFetchFields.g.cs | 6 + .../Mapping/ScaledFloatNumberProperty.g.cs | 54 +- .../Mapping/SearchAsYouTypeProperty.g.cs | 34 +- .../Types/Mapping/ShapeProperty.g.cs | 37 +- .../Types/Mapping/ShortNumberProperty.g.cs | 72 +- .../Types/Mapping/SparseVectorProperty.g.cs | 34 +- .../Types/Mapping/SuggestContext.g.cs | 16 +- .../Types/Mapping/TextIndexPrefixes.g.cs | 8 +- .../Types/Mapping/TextProperty.g.cs | 98 +- .../Types/Mapping/TokenCountProperty.g.cs | 34 +- .../_Generated/Types/Mapping/TypeMapping.g.cs | 188 +- .../Mapping/UnsignedLongNumberProperty.g.cs | 54 +- .../Types/Mapping/VersionProperty.g.cs | 34 +- .../Types/Mapping/WildcardProperty.g.cs | 34 +- .../Types/Ml/InferenceConfigCreate.g.cs | 345 - .../Types/Ml/InferenceConfigUpdate.g.cs | 342 - .../Types/Ml/TokenizationConfig.g.cs | 239 - .../_Generated/Types/NestedSortValue.g.cs | 46 +- .../_Generated/Types/NodeShard.g.cs | 4 +- .../Types/Nodes/AdaptiveSelection.g.cs | 73 + .../_Generated/Types/Nodes/Breaker.g.cs | 67 + .../_Generated/Types/Nodes/Cgroup.g.cs | 49 + .../_Generated/Types/Nodes/CgroupCpu.g.cs | 55 + .../_Generated/Types/Nodes/CgroupCpuStat.g.cs | 49 + .../_Generated/Types/Nodes/CgroupMemory.g.cs | 49 + .../_Generated/Types/Nodes/Client.g.cs | 97 + .../Types/Nodes/ClusterAppliedStats.g.cs | 34 + .../Types/Nodes/ClusterStateQueue.g.cs | 49 + .../Types/Nodes/ClusterStateUpdate.g.cs | 121 + .../_Generated/Types/Nodes/Context.g.cs | 40 + .../_Generated/Types/Nodes/Cpu.g.cs | 48 + .../_Generated/Types/Nodes/CpuAcct.g.cs | 43 + .../_Generated/Types/Nodes/DataPathStats.g.cs | 99 + .../Types/Nodes/DeprecationIndexing.g.cs | 34 + .../_Generated/Types/Nodes/Discovery.g.cs | 54 + .../Types/Nodes/ExtendedMemoryStats.g.cs | 79 + .../_Generated/Types/Nodes/FileSystem.g.cs | 55 + .../Types/Nodes/FileSystemTotal.g.cs | 67 + .../Types/Nodes/GarbageCollector.g.cs | 37 + .../Types/Nodes/GarbageCollectorTotal.g.cs | 49 + .../_Generated/Types/Nodes/HotThread.g.cs | 40 + .../_Generated/Types/Nodes/Http.g.cs | 49 + .../Types/Nodes/IndexingPressure.g.cs | 37 + .../Types/Nodes/IndexingPressureMemory.g.cs | 55 + .../_Generated/Types/Nodes/Ingest.g.cs | 43 + .../_Generated/Types/Nodes/IngestTotal.g.cs | 61 + .../_Generated/Types/Nodes/IoStatDevice.g.cs | 67 + .../_Generated/Types/Nodes/IoStats.g.cs | 43 + .../_Generated/Types/Nodes/Jvm.g.cs | 79 + .../_Generated/Types/Nodes/JvmClasses.g.cs | 49 + .../Types/Nodes/JvmMemoryStats.g.cs | 73 + .../_Generated/Types/Nodes/JvmThreads.g.cs | 43 + .../Types/Nodes/KeyedProcessor.g.cs | 36 + .../_Generated/Types/Nodes/MemoryStats.g.cs | 67 + .../Types/Nodes/NodeBufferPool.g.cs | 61 + .../_Generated/Types/Nodes/NodeInfo.g.cs | 112 + .../Types/Nodes/NodeInfoAction.g.cs | 34 + .../Types/Nodes/NodeInfoAggregation.g.cs | 34 + .../Types/Nodes/NodeInfoBootstrap.g.cs | 34 + .../Types/Nodes/NodeInfoClient.g.cs | 34 + .../Types/Nodes/NodeInfoDiscover.g.cs | 89 + .../_Generated/Types/Nodes/NodeInfoHttp.g.cs | 40 + .../Types/Nodes/NodeInfoIngest.g.cs | 34 + .../Types/Nodes/NodeInfoIngestDownloader.g.cs | 34 + .../Types/Nodes/NodeInfoIngestInfo.g.cs | 34 + .../Types/Nodes/NodeInfoIngestProcessor.g.cs | 34 + .../Types/Nodes/NodeInfoJvmMemory.g.cs | 52 + .../Types/Nodes/NodeInfoMemory.g.cs | 36 + .../Types/Nodes/NodeInfoNetwork.g.cs | 36 + .../Types/Nodes/NodeInfoNetworkInterface.g.cs | 38 + .../_Generated/Types/Nodes/NodeInfoOSCPU.g.cs | 48 + .../_Generated/Types/Nodes/NodeInfoPath.g.cs | 40 + .../Types/Nodes/NodeInfoRepositories.g.cs | 34 + .../Types/Nodes/NodeInfoRepositoriesUrl.g.cs | 34 + .../Types/Nodes/NodeInfoScript.g.cs | 36 + .../Types/Nodes/NodeInfoSearch.g.cs | 34 + .../Types/Nodes/NodeInfoSearchRemote.g.cs | 34 + .../Types/Nodes/NodeInfoSettings.g.cs | 62 + .../Types/Nodes/NodeInfoSettingsCluster.g.cs | 42 + .../NodeInfoSettingsClusterElection.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsHttp.g.cs | 40 + .../Types/Nodes/NodeInfoSettingsHttpType.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsIngest.g.cs | 100 + .../Types/Nodes/NodeInfoSettingsNetwork.g.cs | 34 + .../Types/Nodes/NodeInfoSettingsNode.g.cs | 38 + .../Nodes/NodeInfoSettingsTransport.g.cs | 38 + .../NodeInfoSettingsTransportFeatures.g.cs | 34 + .../Nodes/NodeInfoSettingsTransportType.g.cs | 34 + .../Types/Nodes/NodeInfoTransport.g.cs | 38 + .../_Generated/Types/Nodes/NodeInfoXpack.g.cs | 38 + .../Types/Nodes/NodeInfoXpackLicense.g.cs | 34 + .../Types/Nodes/NodeInfoXpackLicenseType.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecurity.g.cs | 40 + .../Nodes/NodeInfoXpackSecurityAuthc.g.cs | 36 + .../NodeInfoXpackSecurityAuthcRealms.g.cs | 38 + ...odeInfoXpackSecurityAuthcRealmsStatus.g.cs | 36 + .../NodeInfoXpackSecurityAuthcToken.g.cs | 34 + .../Types/Nodes/NodeInfoXpackSecuritySsl.g.cs | 34 + .../_Generated/Types/Nodes/NodeJvmInfo.g.cs | 151 + .../Types/Nodes/NodeOperatingSystemInfo.g.cs | 75 + .../Types/Nodes/NodeProcessInfo.g.cs | 49 + .../Types/Nodes/NodeReloadError.g.cs | 36 + .../Types/Nodes/NodeReloadResult.g.cs | 42 + .../Types/Nodes/NodeThreadPoolInfo.g.cs | 44 + .../_Generated/Types/Nodes/NodeUsage.g.cs | 40 + .../Types/Nodes/OperatingSystem.g.cs | 42 + .../_Generated/Types/Nodes/Pool.g.cs | 55 + .../Types/Nodes/PressureMemory.g.cs | 109 + .../_Generated/Types/Nodes/Process.g.cs | 61 + .../_Generated/Types/Nodes/Processor.g.cs | 55 + .../Types/Nodes/PublishedClusterStates.g.cs | 49 + .../_Generated/Types/Nodes/Recording.g.cs | 40 + .../Types/Nodes/RepositoryLocation.g.cs | 46 + .../Nodes/RepositoryMeteringInformation.g.cs | 85 + .../_Generated/Types/Nodes/RequestCounts.g.cs | 97 + .../_Generated/Types/Nodes/ScriptCache.g.cs | 51 + .../_Generated/Types/Nodes/Scripting.g.cs | 57 + .../Types/Nodes/SerializedClusterState.g.cs | 40 + .../Nodes/SerializedClusterStateDetail.g.cs | 42 + .../_Generated/Types/Nodes/Stats.g.cs | 157 + .../_Generated/Types/Nodes/ThreadCount.g.cs | 67 + .../_Generated/Types/Nodes/Transport.g.cs | 91 + .../Types/Nodes/TransportHistogram.g.cs | 49 + .../_Generated/Types/QueryDsl/BoolQuery.g.cs | 147 +- .../Types/QueryDsl/BoostingQuery.g.cs | 59 +- .../Types/QueryDsl/CombinedFieldsQuery.g.cs | 39 +- .../Types/QueryDsl/ConstantScoreQuery.g.cs | 39 +- .../Types/QueryDsl/DateRangeQuery.g.cs | 202 +- .../Types/QueryDsl/DisMaxQuery.g.cs | 51 +- .../Types/QueryDsl/ExistsQuery.g.cs | 28 +- .../Types/QueryDsl/FieldAndFormat.g.cs | 9 + .../FieldValueFactorScoreFunction.g.cs | 11 +- .../Types/QueryDsl/FunctionScore.g.cs | 105 +- .../Types/QueryDsl/FunctionScoreQuery.g.cs | 71 +- .../_Generated/Types/QueryDsl/FuzzyQuery.g.cs | 148 +- .../Types/QueryDsl/GeoBoundingBoxQuery.g.cs | 107 +- .../Types/QueryDsl/GeoDistanceQuery.g.cs | 105 +- .../Types/QueryDsl/GeoPolygonQuery.g.cs | 135 +- .../Types/QueryDsl/HasChildQuery.g.cs | 63 +- .../Types/QueryDsl/HasParentQuery.g.cs | 63 +- .../_Generated/Types/QueryDsl/IdsQuery.g.cs | 16 +- .../_Generated/Types/QueryDsl/Intervals.g.cs | 208 +- .../Types/QueryDsl/IntervalsAllOf.g.cs | 55 +- .../Types/QueryDsl/IntervalsAnyOf.g.cs | 55 +- .../Types/QueryDsl/IntervalsFilter.g.cs | 221 +- .../Types/QueryDsl/IntervalsFuzzy.g.cs | 12 + .../Types/QueryDsl/IntervalsMatch.g.cs | 32 +- .../Types/QueryDsl/IntervalsPrefix.g.cs | 12 + .../Types/QueryDsl/IntervalsQuery.g.cs | 261 +- .../Types/QueryDsl/IntervalsWildcard.g.cs | 12 + .../_Generated/Types/QueryDsl/Like.g.cs | 8 +- .../Types/QueryDsl/LikeDocument.g.cs | 32 +- .../Types/QueryDsl/MatchAllQuery.g.cs | 16 +- .../Types/QueryDsl/MatchBoolPrefixQuery.g.cs | 188 +- .../Types/QueryDsl/MatchNoneQuery.g.cs | 16 +- .../QueryDsl/MatchPhrasePrefixQuery.g.cs | 132 +- .../Types/QueryDsl/MatchPhraseQuery.g.cs | 122 +- .../_Generated/Types/QueryDsl/MatchQuery.g.cs | 230 +- .../Types/QueryDsl/MoreLikeThisQuery.g.cs | 53 +- .../Types/QueryDsl/MultiMatchQuery.g.cs | 37 +- .../Types/QueryDsl/NestedQuery.g.cs | 68 +- .../Types/QueryDsl/NumberRangeQuery.g.cs | 166 +- .../Types/QueryDsl/ParentIdQuery.g.cs | 20 +- .../Types/QueryDsl/PercolateQuery.g.cs | 36 +- .../Types/QueryDsl/PinnedQuery.g.cs | 146 +- .../Types/QueryDsl/PrefixQuery.g.cs | 118 +- .../_Generated/Types/QueryDsl/Query.g.cs | 1226 ++- .../Types/QueryDsl/QueryStringQuery.g.cs | 76 +- .../Types/QueryDsl/RandomScoreFunction.g.cs | 18 +- .../_Generated/Types/QueryDsl/RangeQuery.g.cs | 42 + .../QueryDsl/RankFeatureFunctionLinear.g.cs | 2 + .../Types/QueryDsl/RankFeatureQuery.g.cs | 108 +- .../Types/QueryDsl/RegexpQuery.g.cs | 138 +- .../_Generated/Types/QueryDsl/RuleQuery.g.cs | 39 +- .../Types/QueryDsl/ScriptQuery.g.cs | 16 +- .../Types/QueryDsl/ScriptScoreFunction.g.cs | 2 +- .../Types/QueryDsl/ScriptScoreQuery.g.cs | 39 +- .../QueryDsl/SimpleQueryStringQuery.g.cs | 51 +- .../Types/QueryDsl/SpanContainingQuery.g.cs | 60 +- .../Types/QueryDsl/SpanFieldMaskingQuery.g.cs | 44 +- .../Types/QueryDsl/SpanFirstQuery.g.cs | 38 +- .../Types/QueryDsl/SpanMultiTermQuery.g.cs | 38 +- .../Types/QueryDsl/SpanNearQuery.g.cs | 50 +- .../Types/QueryDsl/SpanNotQuery.g.cs | 58 +- .../Types/QueryDsl/SpanOrQuery.g.cs | 50 +- .../_Generated/Types/QueryDsl/SpanQuery.g.cs | 284 +- .../Types/QueryDsl/SpanTermQuery.g.cs | 89 +- .../Types/QueryDsl/SpanWithinQuery.g.cs | 60 +- .../_Generated/Types/QueryDsl/TermQuery.g.cs | 100 +- .../Types/QueryDsl/TermsLookup.g.cs | 6 + .../_Generated/Types/QueryDsl/TermsQuery.g.cs | 59 +- .../Types/QueryDsl/TermsQueryField.g.cs | 4 +- .../Types/QueryDsl/TermsSetQuery.g.cs | 119 +- .../Types/QueryDsl/TextExpansionQuery.g.cs | 199 +- .../Types/QueryDsl/TokenPruningConfig.g.cs | 113 + .../Types/QueryDsl/WeightedTokensQuery.g.cs | 391 + .../Types/QueryDsl/WildcardQuery.g.cs | 134 +- .../Types/QueryDsl/WrapperQuery.g.cs | 16 +- .../Types/QueryRuleset/QueryRule.g.cs | 188 + .../Types/QueryRuleset/QueryRuleActions.g.cs | 136 + .../Types/QueryRuleset/QueryRuleCriteria.g.cs | 85 + .../QueryRuleset/QueryRulesetListItem.g.cs | 43 + .../_Generated/Types/QueryVectorBuilder.g.cs | 102 +- .../_Generated/Types/Rank.g.cs | 102 +- .../Types/Rollup/DateHistogramGrouping.g.cs | 337 + .../_Generated/Types/Rollup/FieldMetric.g.cs | 159 + .../_Generated/Types/Rollup/Groupings.g.cs | 357 + .../Types/Rollup/HistogramGrouping.g.cs | 123 + .../Types/Rollup/IndexCapabilities.g.cs | 34 + .../Types/Rollup/RollupCapabilities.g.cs | 34 + .../Types/Rollup/RollupCapabilitySummary.g.cs | 41 + .../Types/Rollup/RollupFieldSummary.g.cs | 38 + .../_Generated/Types/Rollup/RollupJob.g.cs | 38 + .../Types/Rollup/RollupJobConfiguration.g.cs | 48 + .../Types/Rollup/RollupJobStats.g.cs | 56 + .../Types/Rollup/RollupJobStatus.g.cs | 38 + .../Types/Rollup/RollupJobSummary.g.cs | 41 + .../Types/Rollup/RollupJobSummaryField.g.cs | 38 + .../Types/Rollup/TermsGrouping.g.cs | 93 + .../_Generated/Types/RrfRank.g.cs | 2 +- .../_Generated/Types/Script.g.cs | 4 +- .../_Generated/Types/ScriptSort.g.cs | 22 +- .../AnalyticsCollection.g.cs | 37 + .../SearchApplication/EventDataStream.g.cs | 34 + .../SearchApplication/SearchApplication.g.cs | 175 + .../SearchApplicationListItem.g.cs | 55 + .../SearchApplicationTemplate.g.cs | 99 + .../SearchableSnapshots/MountedSnapshot.g.cs | 39 + .../Types/SearchableSnapshots/Node.g.cs | 34 + .../Types/SearchableSnapshots/Shared.g.cs | 48 + .../_Generated/Types/SegmentsStats.g.cs | 24 +- .../_Generated/Types/SlicedScroll.g.cs | 6 + .../_Generated/Types/Slices.g.cs | 7 +- .../Types/Snapshot/AzureRepository.g.cs | 144 + .../Snapshot/AzureRepositorySettings.g.cs | 183 + .../Snapshot/CleanupRepositoryResults.g.cs | 43 + .../Types/Snapshot/CompactNodeInfo.g.cs | 34 + .../Snapshot/FileCountSnapshotStats.g.cs | 36 + .../Types/Snapshot/GcsRepository.g.cs | 144 + .../Types/Snapshot/GcsRepositorySettings.g.cs | 179 + .../Types/Snapshot/IndexDetails.g.cs | 40 + .../Types/Snapshot/InfoFeatureState.g.cs | 37 + .../Types/Snapshot/ReadOnlyUrlRepository.g.cs | 144 + .../ReadOnlyUrlRepositorySettings.g.cs | 164 + .../Types/Snapshot/Repositories.g.cs | 161 + .../Types/Snapshot/S3Repository.g.cs | 144 + .../Types/Snapshot/S3RepositorySettings.g.cs | 224 + .../Types/Snapshot/ShardsStats.g.cs | 44 + .../Types/Snapshot/ShardsStatsSummary.g.cs | 42 + .../Snapshot/ShardsStatsSummaryItem.g.cs | 36 + .../Snapshot/SharedFileSystemRepository.g.cs | 144 + .../SharedFileSystemRepositorySettings.g.cs | 149 + .../Types/Snapshot/SnapshotIndexStats.g.cs | 38 + .../Types/Snapshot/SnapshotInfo.g.cs | 75 + .../Types/Snapshot/SnapshotResponseItem.g.cs | 38 + .../Types/Snapshot/SnapshotRestore.g.cs | 38 + .../Types/Snapshot/SnapshotShardFailure.g.cs | 42 + .../Types/Snapshot/SnapshotShardsStatus.g.cs | 36 + .../Types/Snapshot/SnapshotStats.g.cs | 42 + .../Types/Snapshot/SourceOnlyRepository.g.cs | 144 + .../SourceOnlyRepositorySettings.g.cs | 255 + .../_Generated/Types/Snapshot/Status.g.cs | 48 + .../InProgress.g.cs | 40 + .../Invocation.g.cs | 36 + .../Retention.g.cs | 101 + .../SlmConfiguration.g.cs | 179 + .../SlmPolicy.g.cs | 42 + .../SnapshotLifecycle.g.cs | 52 + .../Statistics.g.cs | 135 + .../_Generated/Types/SortOptions.g.cs | 2 +- .../Types/SpecUtils/OverloadOf.g.cs | 35 + .../_Generated/Types/StoredScriptId.g.cs | 7 + .../Types/Synonyms/SynonymRule.g.cs | 87 + .../Types/Synonyms/SynonymRuleRead.g.cs | 43 + .../Types/Synonyms/SynonymsSetItem.g.cs | 43 + .../Types/Tasks/ParentTaskInfo.g.cs | 4 + .../_Generated/Types/Tasks/TaskInfos.g.cs | 4 +- .../_Generated/Types/TextEmbedding.g.cs | 2 +- .../Types/TextStructure/MatchedField.g.cs | 38 + .../Types/TextStructure/MatchedText.g.cs | 36 + .../TransformManagement/CheckpointStats.g.cs | 44 + .../TransformManagement/Checkpointing.g.cs | 44 + .../TransformManagement/Destination.g.cs | 91 + .../Types/TransformManagement/Latest.g.cs | 159 + .../Types/TransformManagement/Pivot.g.cs | 186 + .../TransformManagement/PivotGroupBy.g.cs | 166 +- .../TransformManagement/RetentionPolicy.g.cs | 228 + .../Types/TransformManagement/Settings.g.cs | 185 + .../Types/TransformManagement/Source.g.cs | 229 + .../Types/TransformManagement/Sync.g.cs | 228 + .../TimeRetentionPolicy.g.cs | 161 + .../Types/TransformManagement/TimeSync.g.cs | 169 + .../TransformIndexerStats.g.cs | 66 + .../TransformProgress.g.cs | 42 + .../TransformManagement/TransformStats.g.cs | 46 + .../TransformStatsHealth.g.cs | 34 + .../TransformManagement/TransformSummary.g.cs | 95 + .../_Generated/Types/Xpack/Analytics.g.cs | 38 + .../Types/Xpack/AnalyticsStatistics.g.cs | 50 + .../_Generated/Types/Xpack/Archive.g.cs | 38 + .../_Generated/Types/Xpack/Audit.g.cs | 36 + .../_Generated/Types/Xpack/Base.g.cs | 36 + .../Types/Xpack/BuildInformation.g.cs | 36 + .../_Generated/Types/Xpack/Ccr.g.cs | 40 + .../_Generated/Types/Xpack/Counter.g.cs | 36 + .../_Generated/Types/Xpack/DataStreams.g.cs | 40 + .../Types/Xpack/DataTierPhaseStatistics.g.cs | 52 + .../_Generated/Types/Xpack/DataTiers.g.cs | 46 + .../_Generated/Types/Xpack/Datafeed.g.cs | 34 + .../_Generated/Types/Xpack/Eql.g.cs | 40 + .../_Generated/Types/Xpack/EqlFeatures.g.cs | 46 + .../Types/Xpack/EqlFeaturesJoin.g.cs | 42 + .../Types/Xpack/EqlFeaturesKeys.g.cs | 42 + .../Types/Xpack/EqlFeaturesPipes.g.cs | 36 + .../Types/Xpack/EqlFeaturesSequences.g.cs | 44 + .../_Generated/Types/Xpack/Feature.g.cs | 40 + .../_Generated/Types/Xpack/FeatureToggle.g.cs | 34 + .../_Generated/Types/Xpack/Features.g.cs | 88 + .../_Generated/Types/Xpack/Flattened.g.cs | 38 + .../_Generated/Types/Xpack/FrozenIndices.g.cs | 38 + .../Types/Xpack/HealthStatistics.g.cs | 38 + .../_Generated/Types/Xpack/Ilm.g.cs | 36 + .../Types/Xpack/IlmPolicyStatistics.g.cs | 36 + .../_Generated/Types/Xpack/Invocations.g.cs | 34 + .../_Generated/Types/Xpack/IpFilter.g.cs | 36 + .../_Generated/Types/Xpack/JobUsage.g.cs | 42 + .../Types/Xpack/MachineLearning.g.cs | 50 + .../Xpack/MinimalLicenseInformation.g.cs | 42 + .../_Generated/Types/Xpack/MlCounter.g.cs | 34 + .../Types/Xpack/MlDataFrameAnalyticsJobs.g.cs | 40 + .../MlDataFrameAnalyticsJobsAnalysis.g.cs | 38 + .../Xpack/MlDataFrameAnalyticsJobsCount.g.cs | 34 + .../Xpack/MlDataFrameAnalyticsJobsMemory.g.cs | 34 + .../_Generated/Types/Xpack/MlInference.g.cs | 38 + .../Types/Xpack/MlInferenceDeployments.g.cs | 40 + .../Xpack/MlInferenceDeploymentsTimeMs.g.cs | 34 + .../Xpack/MlInferenceIngestProcessor.g.cs | 40 + .../MlInferenceIngestProcessorCount.g.cs | 38 + .../Types/Xpack/MlInferenceTrainedModels.g.cs | 42 + .../Xpack/MlInferenceTrainedModelsCount.g.cs | 48 + .../Types/Xpack/MlJobForecasts.g.cs | 36 + .../_Generated/Types/Xpack/Monitoring.g.cs | 40 + .../Types/Xpack/NativeCodeInformation.g.cs | 36 + .../_Generated/Types/Xpack/Realm.g.cs | 52 + .../_Generated/Types/Xpack/RealmCache.g.cs | 34 + .../_Generated/Types/Xpack/RoleMapping.g.cs | 36 + .../Types/Xpack/RuntimeFieldTypes.g.cs | 38 + .../Types/Xpack/RuntimeFieldsType.g.cs | 60 + .../Types/Xpack/SearchableSnapshots.g.cs | 42 + .../_Generated/Types/Xpack/Security.g.cs | 60 + .../_Generated/Types/Xpack/SecurityRoles.g.cs | 38 + .../Types/Xpack/SecurityRolesDls.g.cs | 34 + .../Xpack/SecurityRolesDlsBitSetCache.g.cs | 38 + .../Types/Xpack/SecurityRolesFile.g.cs | 38 + .../Types/Xpack/SecurityRolesNative.g.cs | 38 + .../_Generated/Types/Xpack/Slm.g.cs | 40 + .../_Generated/Types/Xpack/Sql.g.cs | 40 + .../_Generated/Types/Xpack/Ssl.g.cs | 36 + .../_Generated/Types/Xpack/Vector.g.cs | 42 + .../_Generated/Types/Xpack/Watcher.g.cs | 42 + .../Types/Xpack/WatcherActionTotals.g.cs | 36 + .../Types/Xpack/WatcherActions.g.cs | 34 + .../_Generated/Types/Xpack/WatcherWatch.g.cs | 40 + .../Types/Xpack/WatcherWatchTrigger.g.cs | 36 + .../Xpack/WatcherWatchTriggerSchedule.g.cs | 40 + .../Types/Xpack/XpackUsageQuery.g.cs | 40 + 3271 files changed, 258121 insertions(+), 73783 deletions(-) create mode 100644 docfx.json create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/{Tasks/GetTasksResponse.g.cs => MachineLearning/UpgradeJobSnapshotResponse.g.cs} (73%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsResponse.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/{Tasks/GetTasksRequest.g.cs => Nodes/NodesUsageRequest.g.cs} (56%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/{Tasks/CancelResponse.g.cs => Snapshot/GetSnapshotResponse.g.cs} (62%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateRequest.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/{Tasks/ListResponse.g.cs => Sql/TranslateResponse.g.cs} (62%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelRequest.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.License.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ml.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Nodes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Slm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Snapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Synonyms.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Tasks.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.TextStructure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Transform.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Xpack.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NormalizeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{AggregateOrderConverter.g.cs => Cluster/ComponentTemplate.g.cs} (79%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Diagnosis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Impact.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{ExpandWildcardsConverter.g.cs => Core/HealthReport/IndicatorNode.g.cs} (82%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Indicators.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestDictionary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.LicenseManagement.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.MachineLearning.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Snapshot.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Tasks.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{StopWordsConverter.g.cs => IndexLifecycleManagement/ForceMergeConfiguration.g.cs} (85%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phase.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phases.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{FeaturesConverter.g.cs => IndexLifecycleManagement/ShrinkConfiguration.g.cs} (82%) delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CharFilterDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FileDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryBytes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryFiles.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Segment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/{SettingsSimilarityScriptedTfidf.g.cs => SettingsSimilarityBoolean.g.cs} (65%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRecovery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsSegment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TokenDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/VerifyIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndicesOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ScriptProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LicenseManagement/LicenseInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AggregateOutput.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisLimits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Anomaly.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyCause.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketInfluencer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Calendar.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CalendarEvent.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Category.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ChunkingConfig.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/ClassificationInferenceOptions.g.cs (86%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataCounts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataDescription.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeed.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeeds.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Defaults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Definition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectionRule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Detector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectorRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Ensemble.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/FillMaskInferenceOptions.g.cs (81%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/FillMaskInferenceUpdateOptions.g.cs (75%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Filter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FilterRef.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/GeoResults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Hyperparameter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influence.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influencer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Input.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Job.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobBlocked.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobTimingStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JvmStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Limits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemMlStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Memory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSizeStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NativeCode.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/NerInferenceOptions.g.cs (70%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/NerInferenceUpdateOptions.g.cs (73%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/NlpBertTokenizationConfig.g.cs (93%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/NlpRobertaTokenizationConfig.g.cs (89%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/NlpTokenizationUpdateOptions.g.cs (88%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucketJob.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Aggregations/TermsPartition.g.cs => MachineLearning/Page.g.cs} (60%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/PassThroughInferenceOptions.g.cs (68%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/PassThroughInferenceUpdateOptions.g.cs (73%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Preprocessor.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/QuestionAnsweringInferenceOptions.g.cs (80%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/QuestionAnsweringInferenceUpdateOptions.g.cs (80%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/RegressionInferenceOptions.g.cs (83%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RuleCondition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextClassificationInferenceOptions.g.cs (80%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextClassificationInferenceUpdateOptions.g.cs (79%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextEmbeddingInferenceOptions.g.cs (77%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextEmbeddingInferenceUpdateOptions.g.cs (72%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextExpansionInferenceOptions.g.cs (74%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/TextExpansionInferenceUpdateOptions.g.cs (72%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TopClassEntry.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTree.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TransformAuthorization.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/Vocabulary.g.cs (97%) create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Weights.g.cs rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/ZeroShotClassificationInferenceOptions.g.cs (83%) rename src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/{Ml => MachineLearning}/ZeroShotClassificationInferenceUpdateOptions.g.cs (78%) delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/AdaptiveSelection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Breaker.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cgroup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpu.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpuStat.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Client.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterAppliedStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateQueue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateUpdate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Context.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cpu.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CpuAcct.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DataPathStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DeprecationIndexing.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Discovery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystemTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/HotThread.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Http.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Ingest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IngestTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStatDevice.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Jvm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmClasses.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmMemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmThreads.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/KeyedProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/MemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeBufferPool.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoClient.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoDiscover.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoHttp.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetwork.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoPath.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositories.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoScript.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoTransport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeJvmInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeProcessInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/OperatingSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Pool.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Process.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Processor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PublishedClusterStates.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Recording.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ScriptCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Scripting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Stats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ThreadCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Transport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/TransportHistogram.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CompactNodeInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/IndexDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/InfoFeatureState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Repositories.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3Repository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3RepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotRestore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Status.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SpecUtils/OverloadOf.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRuleRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymsSetItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedText.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/CheckpointStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Checkpointing.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Destination.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Latest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Pivot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/RetentionPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Settings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Source.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Sync.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeSync.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Analytics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/AnalyticsStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Archive.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Audit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Base.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/BuildInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ccr.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Counter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataStreams.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTiers.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Datafeed.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Eql.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeatures.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Feature.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FeatureToggle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Flattened.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FrozenIndices.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/HealthStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ilm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Invocations.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IpFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/JobUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MachineLearning.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlCounter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInference.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeployments.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlJobForecasts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Monitoring.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/NativeCodeInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Realm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RealmCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RoleMapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldsType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SearchableSnapshots.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Security.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRoles.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDls.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesFile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesNative.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Slm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Sql.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ssl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Vector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Watcher.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActionTotals.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/XpackUsageQuery.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs delete mode 100644 src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.License.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Nodes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Rollup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchApplication.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchableSnapshots.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Slm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Snapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Synonyms.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.TextStructure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Transform.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Xpack.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{ExpandWildcardsConverter.g.cs => Core/HealthReport/IndicatorNode.g.cs} (83%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{AggregateOrderConverter.g.cs => Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs} (81%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{FeaturesConverter.g.cs => CrossClusterReplication/FollowStats.g.cs} (83%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs rename src/{Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs => Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs} (56%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/{Enums.Ml.g.cs => Enums.SearchableSnapshots.g.cs} (61%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Action.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/{SettingsSimilarityScriptedTfidf.g.cs => SettingsSimilarityBoolean.g.cs} (66%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfigContainer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/ClassificationInferenceOptions.g.cs (87%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{StopWordsConverter.g.cs => MachineLearning/Datafeeds.g.cs} (86%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/FillMaskInferenceOptions.g.cs (82%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/FillMaskInferenceUpdateOptions.g.cs (77%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/NerInferenceOptions.g.cs (72%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/NerInferenceUpdateOptions.g.cs (74%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/NlpBertTokenizationConfig.g.cs (94%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/NlpRobertaTokenizationConfig.g.cs (89%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/NlpTokenizationUpdateOptions.g.cs (89%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Aggregations/TermsPartition.g.cs => MachineLearning/Page.g.cs} (60%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/PassThroughInferenceOptions.g.cs (70%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/PassThroughInferenceUpdateOptions.g.cs (75%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/QuestionAnsweringInferenceOptions.g.cs (81%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/QuestionAnsweringInferenceUpdateOptions.g.cs (81%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/RegressionInferenceOptions.g.cs (84%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextClassificationInferenceOptions.g.cs (82%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextClassificationInferenceUpdateOptions.g.cs (80%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextEmbeddingInferenceOptions.g.cs (78%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextEmbeddingInferenceUpdateOptions.g.cs (74%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextExpansionInferenceOptions.g.cs (76%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/TextExpansionInferenceUpdateOptions.g.cs (74%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/Vocabulary.g.cs (97%) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/ZeroShotClassificationInferenceOptions.g.cs (84%) rename src/Elastic.Clients.Elasticsearch/_Generated/Types/{Ml => MachineLearning}/ZeroShotClassificationInferenceUpdateOptions.g.cs (79%) delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigCreate.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigUpdate.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TokenizationConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HotThread.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetwork.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadError.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationListItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecUtils/OverloadOf.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FrozenIndices.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs diff --git a/docfx.json b/docfx.json new file mode 100644 index 00000000000..3b0069106e2 --- /dev/null +++ b/docfx.json @@ -0,0 +1,46 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "./src/Elastic.Clients.Elasticsearch", + "files": [ + "**/*.csproj" + ] + } + ], + "dest": "api" + } + ], + "build": { + "content": [ + { + "files": [ + "**/*.{md,yml}" + ], + "exclude": [ + "_site/**" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "output": "_site", + "template": [ + "default", + "modern" + ], + "globalMetadata": { + "_appName": "Elasticsearch.NET", + "_appTitle": "Elasticsearch.NET", + "_enableSearch": true, + "_disableContribution": true, + "pdf": false + } + } +} \ 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 index f84886bf35a..5aaa3c540a6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs @@ -26,9 +26,14 @@ internal static class ApiUrlLookup internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "_async_search/status/{id}" }); internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "_async_search", "{index}/_async_search" }); internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[] { "_cluster/allocation/explain" }); + internal static ApiUrls ClusterDeleteComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); + internal static ApiUrls ClusterExistsComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); + internal static ApiUrls ClusterGetComponentTemplate = new ApiUrls(new[] { "_component_template", "_component_template/{name}" }); internal static ApiUrls ClusterGetSettings = new ApiUrls(new[] { "_cluster/settings" }); internal static ApiUrls ClusterHealth = new ApiUrls(new[] { "_cluster/health", "_cluster/health/{index}" }); + internal static ApiUrls ClusterInfo = new ApiUrls(new[] { "_info/{target}" }); internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[] { "_cluster/pending_tasks" }); + internal static ApiUrls ClusterPutComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); internal static ApiUrls ClusterStats = new ApiUrls(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" }); internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "_enrich/policy/{name}" }); internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "_enrich/policy/{name}/_execute" }); @@ -40,11 +45,14 @@ internal static class ApiUrlLookup internal static ApiUrls EqlGetStatus = new ApiUrls(new[] { "_eql/search/status/{id}" }); internal static ApiUrls EqlSearch = new ApiUrls(new[] { "{index}/_eql/search" }); internal static ApiUrls GraphExplore = new ApiUrls(new[] { "{index}/_graph/explore" }); + internal static ApiUrls IndexManagementAnalyze = new ApiUrls(new[] { "_analyze", "{index}/_analyze" }); + internal static ApiUrls IndexManagementClearCache = new ApiUrls(new[] { "_cache/clear", "{index}/_cache/clear" }); internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "{index}/_close" }); internal static ApiUrls IndexManagementCreate = new ApiUrls(new[] { "{index}" }); internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "_data_stream/{name}" }); + internal static ApiUrls IndexManagementDataStreamsStats = new ApiUrls(new[] { "_data_stream/_stats", "_data_stream/{name}/_stats" }); internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "{index}" }); - internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{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 IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); @@ -60,25 +68,107 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementGetDataStream = new ApiUrls(new[] { "_data_stream", "_data_stream/{name}" }); 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 IndexManagementGetSettings = new ApiUrls(new[] { "_settings", "{index}/_settings", "{index}/_settings/{name}", "_settings/{name}" }); internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "_data_stream/_migrate/{name}" }); + internal static ApiUrls IndexManagementModifyDataStream = new ApiUrls(new[] { "_data_stream/_modify" }); internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "{index}/_open" }); - internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{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 IndexManagementPutSettings = new ApiUrls(new[] { "_settings", "{index}/_settings" }); internal static ApiUrls IndexManagementPutTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementRecovery = new ApiUrls(new[] { "_recovery", "{index}/_recovery" }); internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "_refresh", "{index}/_refresh" }); + internal static ApiUrls IndexManagementResolveIndex = new ApiUrls(new[] { "_resolve/index/{name}" }); internal static ApiUrls IndexManagementRollover = new ApiUrls(new[] { "{alias}/_rollover", "{alias}/_rollover/{new_index}" }); + internal static ApiUrls IndexManagementSegments = new ApiUrls(new[] { "_segments", "{index}/_segments" }); 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 IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" }); internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" }); + internal static ApiUrls IndexManagementValidateQuery = new ApiUrls(new[] { "_validate/query", "{index}/_validate/query" }); 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 LicenseManagementGet = new ApiUrls(new[] { "_license" }); + internal static ApiUrls MachineLearningClearTrainedModelDeploymentCache = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/cache/_clear" }); + internal static ApiUrls MachineLearningCloseJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_close" }); + internal static ApiUrls MachineLearningDeleteCalendar = new ApiUrls(new[] { "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningDeleteCalendarEvent = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events/{event_id}" }); + internal static ApiUrls MachineLearningDeleteCalendarJob = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/jobs/{job_id}" }); + internal static ApiUrls MachineLearningDeleteDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}" }); + internal static ApiUrls MachineLearningDeleteDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}" }); + internal static ApiUrls MachineLearningDeleteExpiredData = new ApiUrls(new[] { "_ml/_delete_expired_data/{job_id}", "_ml/_delete_expired_data" }); + internal static ApiUrls MachineLearningDeleteFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningDeleteForecast = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_forecast", "_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}" }); + internal static ApiUrls MachineLearningDeleteJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}" }); + internal static ApiUrls MachineLearningDeleteModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}" }); + internal static ApiUrls MachineLearningDeleteTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}" }); + internal static ApiUrls MachineLearningDeleteTrainedModelAlias = new ApiUrls(new[] { "_ml/trained_models/{model_id}/model_aliases/{model_alias}" }); + internal static ApiUrls MachineLearningEstimateModelMemory = new ApiUrls(new[] { "_ml/anomaly_detectors/_estimate_model_memory" }); + internal static ApiUrls MachineLearningEvaluateDataFrame = new ApiUrls(new[] { "_ml/data_frame/_evaluate" }); + internal static ApiUrls MachineLearningExplainDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/_explain", "_ml/data_frame/analytics/{id}/_explain" }); + internal static ApiUrls MachineLearningFlushJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_flush" }); + internal static ApiUrls MachineLearningForecast = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_forecast" }); + internal static ApiUrls MachineLearningGetBuckets = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", "_ml/anomaly_detectors/{job_id}/results/buckets" }); + internal static ApiUrls MachineLearningGetCalendarEvents = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events" }); + internal static ApiUrls MachineLearningGetCalendars = new ApiUrls(new[] { "_ml/calendars", "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningGetCategories = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/categories/{category_id}", "_ml/anomaly_detectors/{job_id}/results/categories" }); + internal static ApiUrls MachineLearningGetDatafeeds = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}", "_ml/datafeeds" }); + internal static ApiUrls MachineLearningGetDatafeedStats = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_stats", "_ml/datafeeds/_stats" }); + internal static ApiUrls MachineLearningGetDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}", "_ml/data_frame/analytics" }); + internal static ApiUrls MachineLearningGetDataFrameAnalyticsStats = new ApiUrls(new[] { "_ml/data_frame/analytics/_stats", "_ml/data_frame/analytics/{id}/_stats" }); + internal static ApiUrls MachineLearningGetFilters = new ApiUrls(new[] { "_ml/filters", "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningGetInfluencers = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/influencers" }); + internal static ApiUrls MachineLearningGetJobs = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}", "_ml/anomaly_detectors" }); + internal static ApiUrls MachineLearningGetJobStats = new ApiUrls(new[] { "_ml/anomaly_detectors/_stats", "_ml/anomaly_detectors/{job_id}/_stats" }); + internal static ApiUrls MachineLearningGetMemoryStats = new ApiUrls(new[] { "_ml/memory/_stats", "_ml/memory/{node_id}/_stats" }); + internal static ApiUrls MachineLearningGetModelSnapshots = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", "_ml/anomaly_detectors/{job_id}/model_snapshots" }); + internal static ApiUrls MachineLearningGetModelSnapshotUpgradeStats = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats" }); + internal static ApiUrls MachineLearningGetOverallBuckets = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/overall_buckets" }); + internal static ApiUrls MachineLearningGetRecords = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/records" }); + internal static ApiUrls MachineLearningGetTrainedModels = new ApiUrls(new[] { "_ml/trained_models/{model_id}", "_ml/trained_models" }); + internal static ApiUrls MachineLearningGetTrainedModelsStats = new ApiUrls(new[] { "_ml/trained_models/{model_id}/_stats", "_ml/trained_models/_stats" }); + internal static ApiUrls MachineLearningInferTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}/_infer" }); + internal static ApiUrls MachineLearningInfo = new ApiUrls(new[] { "_ml/info" }); + internal static ApiUrls MachineLearningOpenJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_open" }); + internal static ApiUrls MachineLearningPostCalendarEvents = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events" }); + internal static ApiUrls MachineLearningPreviewDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/_preview", "_ml/data_frame/analytics/{id}/_preview" }); + internal static ApiUrls MachineLearningPutCalendar = new ApiUrls(new[] { "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningPutCalendarJob = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/jobs/{job_id}" }); + internal static ApiUrls MachineLearningPutDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}" }); + internal static ApiUrls MachineLearningPutDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}" }); + internal static ApiUrls MachineLearningPutFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningPutJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}" }); + internal static ApiUrls MachineLearningPutTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}" }); + internal static ApiUrls MachineLearningPutTrainedModelAlias = new ApiUrls(new[] { "_ml/trained_models/{model_id}/model_aliases/{model_alias}" }); + internal static ApiUrls MachineLearningPutTrainedModelDefinitionPart = new ApiUrls(new[] { "_ml/trained_models/{model_id}/definition/{part}" }); + internal static ApiUrls MachineLearningPutTrainedModelVocabulary = new ApiUrls(new[] { "_ml/trained_models/{model_id}/vocabulary" }); + internal static ApiUrls MachineLearningResetJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_reset" }); + internal static ApiUrls MachineLearningRevertModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert" }); + internal static ApiUrls MachineLearningSetUpgradeMode = new ApiUrls(new[] { "_ml/set_upgrade_mode" }); + internal static ApiUrls MachineLearningStartDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_start" }); + internal static ApiUrls MachineLearningStartDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_start" }); + internal static ApiUrls MachineLearningStartTrainedModelDeployment = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/_start" }); + internal static ApiUrls MachineLearningStopDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_stop" }); + internal static ApiUrls MachineLearningStopDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_stop" }); + internal static ApiUrls MachineLearningStopTrainedModelDeployment = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/_stop" }); + internal static ApiUrls MachineLearningUpdateDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_update" }); + internal static ApiUrls MachineLearningUpdateDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_update" }); + internal static ApiUrls MachineLearningUpdateFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}/_update" }); + internal static ApiUrls MachineLearningUpdateJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_update" }); + internal static ApiUrls MachineLearningUpdateModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update" }); + internal static ApiUrls MachineLearningUpgradeJobSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade" }); + internal static ApiUrls MachineLearningValidate = new ApiUrls(new[] { "_ml/anomaly_detectors/_validate" }); + internal static ApiUrls MachineLearningValidateDetector = new ApiUrls(new[] { "_ml/anomaly_detectors/_validate/detector" }); + internal static ApiUrls NodesHotThreads = new ApiUrls(new[] { "_nodes/hot_threads", "_nodes/{node_id}/hot_threads" }); + internal static ApiUrls NodesInfo = new ApiUrls(new[] { "_nodes", "_nodes/{node_id}", "_nodes/{metric}", "_nodes/{node_id}/{metric}" }); + internal static ApiUrls NodesStats = new ApiUrls(new[] { "_nodes/stats", "_nodes/{node_id}/stats", "_nodes/stats/{metric}", "_nodes/{node_id}/stats/{metric}", "_nodes/stats/{metric}/{index_metric}", "_nodes/{node_id}/stats/{metric}/{index_metric}" }); + internal static ApiUrls NodesUsage = new ApiUrls(new[] { "_nodes/usage", "_nodes/{node_id}/usage", "_nodes/usage/{metric}", "_nodes/{node_id}/usage/{metric}" }); 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" }); @@ -95,12 +185,13 @@ internal static class ApiUrlLookup 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 NoNamespaceHealthReport = new ApiUrls(new[] { "_health_report", "_health_report/{feature}" }); internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[] { "{index}/_doc/{id}", "{index}/_doc" }); internal static ApiUrls NoNamespaceInfo = new ApiUrls(new[] { "" }); - 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 NoNamespaceMultiGet = new ApiUrls(new[] { "_mget", "{index}/_mget" }); + internal static ApiUrls NoNamespaceMultiSearch = new ApiUrls(new[] { "_msearch", "{index}/_msearch" }); + internal static ApiUrls NoNamespaceMultiSearchTemplate = new ApiUrls(new[] { "_msearch/template", "{index}/_msearch/template" }); 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}" }); @@ -110,18 +201,58 @@ internal static class ApiUrlLookup 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 NoNamespaceSearchMvt = new ApiUrls(new[] { "{index}/_mvt/{field}/{zoom}/{x}/{y}" }); 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 NoNamespaceUpdate = new ApiUrls(new[] { "{index}/_update/{id}" }); internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "{index}/_update_by_query" }); internal static ApiUrls NoNamespaceUpdateByQueryRethrottle = new ApiUrls(new[] { "_update_by_query/{task_id}/_rethrottle" }); + internal static ApiUrls SnapshotCleanupRepository = new ApiUrls(new[] { "_snapshot/{repository}/_cleanup" }); + internal static ApiUrls SnapshotClone = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}" }); + internal static ApiUrls SnapshotCreate = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotCreateRepository = new ApiUrls(new[] { "_snapshot/{repository}" }); + internal static ApiUrls SnapshotDelete = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotDeleteRepository = new ApiUrls(new[] { "_snapshot/{repository}" }); + internal static ApiUrls SnapshotGet = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotGetRepository = new ApiUrls(new[] { "_snapshot", "_snapshot/{repository}" }); + internal static ApiUrls SnapshotLifecycleManagementDeleteLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}" }); + internal static ApiUrls SnapshotLifecycleManagementExecuteLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}/_execute" }); + internal static ApiUrls SnapshotLifecycleManagementExecuteRetention = new ApiUrls(new[] { "_slm/_execute_retention" }); + internal static ApiUrls SnapshotLifecycleManagementGetLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}", "_slm/policy" }); + internal static ApiUrls SnapshotLifecycleManagementGetStats = new ApiUrls(new[] { "_slm/stats" }); + internal static ApiUrls SnapshotLifecycleManagementGetStatus = new ApiUrls(new[] { "_slm/status" }); + internal static ApiUrls SnapshotLifecycleManagementPutLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}" }); + internal static ApiUrls SnapshotLifecycleManagementStart = new ApiUrls(new[] { "_slm/start" }); + internal static ApiUrls SnapshotLifecycleManagementStop = new ApiUrls(new[] { "_slm/stop" }); + internal static ApiUrls SnapshotRestore = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_restore" }); + internal static ApiUrls SnapshotStatus = new ApiUrls(new[] { "_snapshot/_status", "_snapshot/{repository}/_status", "_snapshot/{repository}/{snapshot}/_status" }); + internal static ApiUrls SnapshotVerifyRepository = new ApiUrls(new[] { "_snapshot/{repository}/_verify" }); internal static ApiUrls SqlClearCursor = new ApiUrls(new[] { "_sql/close" }); internal static ApiUrls SqlDeleteAsync = new ApiUrls(new[] { "_sql/async/delete/{id}" }); internal static ApiUrls SqlGetAsync = new ApiUrls(new[] { "_sql/async/{id}" }); internal static ApiUrls SqlGetAsyncStatus = new ApiUrls(new[] { "_sql/async/status/{id}" }); internal static ApiUrls SqlQuery = new ApiUrls(new[] { "_sql" }); - internal static ApiUrls TasksCancel = new ApiUrls(new[] { "_tasks/_cancel", "_tasks/{task_id}/_cancel" }); - internal static ApiUrls TasksGet = new ApiUrls(new[] { "_tasks/{task_id}" }); - internal static ApiUrls TasksList = new ApiUrls(new[] { "_tasks" }); + internal static ApiUrls SqlTranslate = new ApiUrls(new[] { "_sql/translate" }); + internal static ApiUrls SynonymsDeleteSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsDeleteSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); + internal static ApiUrls SynonymsGetSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsGetSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); + internal static ApiUrls SynonymsGetSynonymsSets = new ApiUrls(new[] { "_synonyms" }); + internal static ApiUrls SynonymsPutSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsPutSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); + internal static ApiUrls TextStructureTestGrokPattern = new ApiUrls(new[] { "_text_structure/test_grok_pattern" }); + internal static ApiUrls TransformManagementDeleteTransform = new ApiUrls(new[] { "_transform/{transform_id}" }); + internal static ApiUrls TransformManagementGetTransform = new ApiUrls(new[] { "_transform/{transform_id}", "_transform" }); + internal static ApiUrls TransformManagementGetTransformStats = new ApiUrls(new[] { "_transform/{transform_id}/_stats" }); + internal static ApiUrls TransformManagementPreviewTransform = new ApiUrls(new[] { "_transform/{transform_id}/_preview", "_transform/_preview" }); + internal static ApiUrls TransformManagementPutTransform = new ApiUrls(new[] { "_transform/{transform_id}" }); + internal static ApiUrls TransformManagementResetTransform = new ApiUrls(new[] { "_transform/{transform_id}/_reset" }); + internal static ApiUrls TransformManagementScheduleNowTransform = new ApiUrls(new[] { "_transform/{transform_id}/_schedule_now" }); + internal static ApiUrls TransformManagementStartTransform = new ApiUrls(new[] { "_transform/{transform_id}/_start" }); + internal static ApiUrls TransformManagementStopTransform = new ApiUrls(new[] { "_transform/{transform_id}/_stop" }); + internal static ApiUrls TransformManagementUpdateTransform = new ApiUrls(new[] { "_transform/{transform_id}/_update" }); + internal static ApiUrls TransformManagementUpgradeTransforms = new ApiUrls(new[] { "_transform/_upgrade" }); + internal static ApiUrls XpackInfo = new ApiUrls(new[] { "_xpack" }); + internal static ApiUrls XpackUsage = new ApiUrls(new[] { "_xpack/usage" }); } \ 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 index 136f6190675..65bc0c016a4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs @@ -62,10 +62,6 @@ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverle { } - internal AsyncSearchStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverle { } - internal AsyncSearchStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; 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 index 86d5ee90665..73cf40f7f45 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs @@ -39,18 +39,34 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse /// [JsonInclude, JsonPropertyName("completion_status")] public int? CompletionStatus { get; init; } + + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } 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 index 687814bce64..34e6fd301fa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs @@ -62,10 +62,6 @@ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverle { } - internal DeleteAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverle { } - internal DeleteAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index a56a97deed4..dd2b08c8d8d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 08bdbc51b85..05c81be7421 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs @@ -94,10 +94,6 @@ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal GetAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -132,10 +128,6 @@ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal GetAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; 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 index 69f21655b0f..6242022d095 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs @@ -28,18 +28,33 @@ namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse { + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } [JsonInclude, JsonPropertyName("response")] 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 index 922f4980a78..b520e8e6934 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs @@ -194,7 +194,7 @@ public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type ty var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -588,10 +588,10 @@ public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value } } -[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.
///
+[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))] public sealed partial class SubmitAsyncSearchRequest : PlainRequest { public SubmitAsyncSearchRequest() @@ -790,7 +790,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices [JsonIgnore] public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } [JsonInclude, JsonPropertyName("aggregations")] - public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Aggregations { get; set; } [JsonInclude, JsonPropertyName("collapse")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; } @@ -953,6 +953,10 @@ public sealed partial class SubmitAsyncSearchRequestDescriptor : Requ { internal SubmitAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SubmitAsyncSearchRequestDescriptor() { } @@ -1004,91 +1008,71 @@ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Ela 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 IDictionary> AggregationsValue { 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { 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.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } 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.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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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.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 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 Elastic.Clients.Elasticsearch.Serverless.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) + public SubmitAsyncSearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SubmitAsyncSearchRequestDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -1100,7 +1084,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.El return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -1108,7 +1092,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldC return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure) + public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -1128,7 +1112,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection< return Self; } - public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -1137,7 +1121,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.Fie return Self; } - public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action> configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1146,7 +1130,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1185,7 +1169,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -1194,7 +1178,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(QueryDsl.FieldAndFor return Self; } - public SubmitAsyncSearchRequestDescriptor Fields(Action> configure) + public SubmitAsyncSearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1203,7 +1187,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1229,7 +1213,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.E return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1237,7 +1221,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.Highl return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Action> configure) + public SubmitAsyncSearchRequestDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1266,7 +1250,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(ICollection Knn(KnnQueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor descriptor) { KnnValue = null; KnnDescriptorAction = null; @@ -1275,7 +1259,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(KnnQueryDescriptor Knn(Action> configure) + public SubmitAsyncSearchRequestDescriptor Knn(Action> configure) { KnnValue = null; KnnDescriptor = null; @@ -1284,7 +1268,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Action Knn(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Knn(params Action>[] configure) { KnnValue = null; KnnDescriptor = null; @@ -1313,7 +1297,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elastic return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -1321,7 +1305,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTime return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -1337,7 +1321,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients. return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -1345,7 +1329,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDe return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(Action> configure) + public SubmitAsyncSearchRequestDescriptor PostFilter(Action> configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -1370,7 +1354,7 @@ public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elast return Self; } - public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -1378,7 +1362,7 @@ public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescrip return Self; } - public SubmitAsyncSearchRequestDescriptor Query(Action> configure) + public SubmitAsyncSearchRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -1395,7 +1379,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(ICollection Rescore(Core.Search.RescoreDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Rescore(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor descriptor) { RescoreValue = null; RescoreDescriptorAction = null; @@ -1404,7 +1388,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Core.Search.Rescore return Self; } - public SubmitAsyncSearchRequestDescriptor Rescore(Action> configure) + public SubmitAsyncSearchRequestDescriptor Rescore(Action> configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1413,7 +1397,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Action Rescore(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Rescore(params Action>[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1425,18 +1409,18 @@ public SubmitAsyncSearchRequestDescriptor Rescore(params Action /// 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) + public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -1472,7 +1456,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elast return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -1480,7 +1464,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescripto return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(Action> configure) + public SubmitAsyncSearchRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -1497,7 +1481,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1506,7 +1490,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(SortOptionsDescriptor< return Self; } - public SubmitAsyncSearchRequestDescriptor Sort(Action> configure) + public SubmitAsyncSearchRequestDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1515,7 +1499,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(Action Sort(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -1559,7 +1543,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Ela return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -1567,7 +1551,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.Suggest return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + public SubmitAsyncSearchRequestDescriptor Suggest(Action> configure) { SuggestValue = null; SuggestDescriptor = null; @@ -1623,17 +1607,7 @@ public SubmitAsyncSearchRequestDescriptor Version(bool? version = tru 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) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -1647,7 +1621,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -1666,7 +1640,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -1675,7 +1649,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1709,7 +1683,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -1718,7 +1692,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1743,7 +1717,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1765,7 +1739,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -1774,7 +1748,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -1800,7 +1774,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -1816,7 +1790,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -1838,7 +1812,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -1854,7 +1828,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -1863,7 +1837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -1913,7 +1887,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -1929,7 +1903,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -1938,7 +1912,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -1976,7 +1950,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -2025,6 +1999,10 @@ public sealed partial class SubmitAsyncSearchRequestDescriptor : RequestDescript { internal SubmitAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this); + public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SubmitAsyncSearchRequestDescriptor() { } @@ -2076,91 +2054,71 @@ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. 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 IDictionary AggregationsValue { 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { 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.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } 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.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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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.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 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 Elastic.Clients.Elasticsearch.Serverless.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) + public SubmitAsyncSearchRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2172,7 +2130,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -2180,7 +2138,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDesc return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Action configure) + public SubmitAsyncSearchRequestDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -2200,7 +2158,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2218,7 +2176,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action[] configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2257,7 +2215,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2275,7 +2233,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(Action[] configure) + public SubmitAsyncSearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2301,7 +2259,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2309,7 +2267,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescrip return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Action configure) + public SubmitAsyncSearchRequestDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2338,7 +2296,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Knn(Action configure) { KnnValue = null; KnnDescriptor = null; @@ -2356,7 +2314,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Action configu return Self; } - public SubmitAsyncSearchRequestDescriptor Knn(params Action[] configure) + public SubmitAsyncSearchRequestDescriptor Knn(params Action[] configure) { KnnValue = null; KnnDescriptor = null; @@ -2385,7 +2343,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serv return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -2393,7 +2351,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDe return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -2409,7 +2367,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsear return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -2417,7 +2375,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor de return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(Action configure) + public SubmitAsyncSearchRequestDescriptor PostFilter(Action configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -2442,7 +2400,7 @@ public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Se return Self; } - public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -2450,7 +2408,7 @@ public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descrip return Self; } - public SubmitAsyncSearchRequestDescriptor Query(Action configure) + public SubmitAsyncSearchRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -2467,7 +2425,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Rescore(Action configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2485,7 +2443,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Action[] configure) + public SubmitAsyncSearchRequestDescriptor Rescore(params Action[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2497,18 +2455,18 @@ public SubmitAsyncSearchRequestDescriptor Rescore(params Action /// 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) + public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2544,7 +2502,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Se return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -2552,7 +2510,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descripto return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(Action configure) + public SubmitAsyncSearchRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -2569,7 +2527,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -2587,7 +2545,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(Action con return Self; } - public SubmitAsyncSearchRequestDescriptor Sort(params Action[] configure) + public SubmitAsyncSearchRequestDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -2631,7 +2589,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch. return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -2639,7 +2597,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescripto return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) { SuggestValue = null; SuggestDescriptor = null; @@ -2695,17 +2653,7 @@ public SubmitAsyncSearchRequestDescriptor Version(bool? version = true) 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) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -2719,7 +2667,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -2738,7 +2686,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -2747,7 +2695,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2781,7 +2729,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -2790,7 +2738,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2815,7 +2763,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -2837,7 +2785,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -2846,7 +2794,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -2872,7 +2820,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -2888,7 +2836,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -2910,7 +2858,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -2926,7 +2874,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -2935,7 +2883,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -2985,7 +2933,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -3001,7 +2949,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -3010,7 +2958,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -3048,7 +2996,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { 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 index b8efdc88cd3..d3f0f0c91d8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs @@ -28,18 +28,33 @@ namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; public sealed partial class SubmitAsyncSearchResponse : ElasticsearchResponse { + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } [JsonInclude, JsonPropertyName("response")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs index 60a63cc7573..ad0139f367d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkRequest.g.cs @@ -160,6 +160,10 @@ public sealed partial class BulkRequestDescriptor : RequestDescriptor { internal BulkRequestDescriptor(Action> configure) => configure.Invoke(this); + public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public BulkRequestDescriptor() { } @@ -190,6 +194,8 @@ public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serv protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } @@ -200,6 +206,10 @@ public sealed partial class BulkRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public BulkRequestDescriptor() { } @@ -230,5 +240,7 @@ public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.Inde protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ 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 index 8d8a459a777..6540f2c9a6c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs index dd9c7c49031..121e9946eb2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs index 3dadcfa2dbe..e12e0397740 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 7f725186e7e..ce1cf06e5b0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoRequest.g.cs new file mode 100644 index 00000000000..9210d1819d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoRequest.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.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 partial class ClusterInfoRequestParameters : RequestParameters +{ +} + +/// +/// Returns different information about the cluster. +/// +public sealed partial class ClusterInfoRequest : PlainRequest +{ + public ClusterInfoRequest(IReadOnlyCollection target) : base(r => r.Required("target", target)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.info"; +} + +/// +/// Returns different information about the cluster. +/// +public sealed partial class ClusterInfoRequestDescriptor : RequestDescriptor +{ + internal ClusterInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClusterInfoRequestDescriptor(IReadOnlyCollection target) : base(r => r.Required("target", target)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.info"; + + public ClusterInfoRequestDescriptor Target(IReadOnlyCollection target) + { + RouteValues.Required("target", target); + 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/ClusterInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs new file mode 100644 index 00000000000..6c4a5a88c82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class ClusterInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Http? Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Ingest? Ingest { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Scripting? Script { get; init; } + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { 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 index 64384cc1593..50695cbe5a7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -51,7 +51,7 @@ public ClusterStatsRequest() { } - public ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? node_id) : base(r => r.Optional("node_id", node_id)) + public ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) { } @@ -83,6 +83,10 @@ public sealed partial class ClusterStatsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public ClusterStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + public ClusterStatsRequestDescriptor() { } @@ -98,9 +102,9 @@ public ClusterStatsRequestDescriptor() 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) + public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) { - RouteValues.Optional("node_id", node_id); + RouteValues.Optional("node_id", nodeId); return Self; } 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 index 9dd7e4eef08..119e9127b3f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -50,6 +51,10 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse /// [JsonInclude, JsonPropertyName("nodes")] public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterNodes Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// [JsonInclude, JsonPropertyName("_nodes")] public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..f8bf7e8bf8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateRequest.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.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 partial class DeleteComponentTemplateRequestParameters : 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 component templates.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+///
+public sealed partial class DeleteComponentTemplateRequest : PlainRequest +{ + public DeleteComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_component_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 component templates.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+///
+public sealed partial class DeleteComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal DeleteComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_component_template"; + + public DeleteComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteComponentTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteComponentTemplateRequestDescriptor 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/Cluster/DeleteComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..2feae02a660 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class DeleteComponentTemplateResponse : 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/Cluster/ExistsComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..090b8874f29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateRequest.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.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 partial class ExistsComponentTemplateRequestParameters : 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); } + + /// + /// 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 component template exist +/// +public sealed partial class ExistsComponentTemplateRequest : PlainRequest +{ + public ExistsComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterExistsComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.exists_component_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); } + + /// + /// 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 component template exist +/// +public sealed partial class ExistsComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal ExistsComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterExistsComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.exists_component_template"; + + public ExistsComponentTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public ExistsComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExistsComponentTemplateRequestDescriptor 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/Cluster/ExistsComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..b17b21afbd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Cluster; + +public sealed partial class ExistsComponentTemplateResponse : ElasticsearchResponse +{ +} \ 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 index 643c4d2e92c..01f99ea2bce 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..b16be865e9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateRequest.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.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 partial class GetComponentTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return all default configurations for the component template (default: false) + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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); } +} + +/// +/// Retrieves information about component templates. +/// +public sealed partial class GetComponentTemplateRequest : PlainRequest +{ + public GetComponentTemplateRequest() + { + } + + public GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_component_template"; + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return all default configurations for the component template (default: false) + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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); } +} + +/// +/// Retrieves information about component templates. +/// +public sealed partial class GetComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal GetComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + + public GetComponentTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_component_template"; + + public GetComponentTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetComponentTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetComponentTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetComponentTemplateRequestDescriptor 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/Cluster/GetComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..949e435bcb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Cluster; + +public sealed partial class GetComponentTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("component_templates")] + public IReadOnlyCollection ComponentTemplates { 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 index 9792106886b..9d9bd0502bb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthRequest.g.cs @@ -69,7 +69,7 @@ public sealed partial class HealthRequestParameters : RequestParameters /// /// 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); } + public object? 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. @@ -154,7 +154,7 @@ public HealthRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) /// 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); } + public object? 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. @@ -182,6 +182,10 @@ public sealed partial class HealthRequestDescriptor : RequestDescript { internal HealthRequestDescriptor(Action> configure) => configure.Invoke(this); + public HealthRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public HealthRequestDescriptor() { } @@ -201,7 +205,7 @@ public HealthRequestDescriptor() 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 WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForNodes(object? waitForNodes) => Qs("wait_for_nodes", waitForNodes); 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 WaitForStatus(Elastic.Clients.Elasticsearch.Serverless.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); @@ -224,6 +228,10 @@ public sealed partial class HealthRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public HealthRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public HealthRequestDescriptor() { } @@ -243,7 +251,7 @@ public HealthRequestDescriptor() 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 WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForNodes(object? waitForNodes) => Qs("wait_for_nodes", waitForNodes); 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 WaitForStatus(Elastic.Clients.Elasticsearch.Serverless.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); 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 index a5c30753ba4..2e3d68fe7d0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index dcd578fe077..d4cd024db8e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..6d3e9638da7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs @@ -0,0 +1,369 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class PutComponentTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, this request cannot replace or update existing component templates. + /// + 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); } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequest : PlainRequest +{ + public PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + /// + /// If `true`, this request cannot replace or update existing component templates. + /// + [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); } + + /// + /// 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 data streams matching the template must always be explicitly created.
+ ///
+ [JsonInclude, JsonPropertyName("allow_auto_create")] + public bool? AllowAutoCreate { get; set; } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState Template { get; set; } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequestDescriptor : RequestDescriptor, PutComponentTemplateRequestParameters> +{ + internal PutComponentTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + public PutComponentTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public PutComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public PutComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private bool? AllowAutoCreateValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + /// + /// 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 data streams matching the template must always be explicitly created.
+ ///
+ public PutComponentTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ public PutComponentTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ public PutComponentTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor(TemplateDescriptorAction), options); + } + else + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal PutComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + public PutComponentTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public PutComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public PutComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private bool? AllowAutoCreateValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + /// + /// 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 data streams matching the template must always be explicitly created.
+ ///
+ public PutComponentTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ public PutComponentTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ public PutComponentTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexStateDescriptor(TemplateDescriptorAction), options); + } + else + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..e19c2d37da1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; + +public sealed partial class PutComponentTemplateResponse : 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/CountRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs index ce3bd42f5d9..d6fc6a99e76 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountRequest.g.cs @@ -221,11 +221,11 @@ public sealed partial class CountRequestDescriptor : RequestDescripto { internal CountRequestDescriptor(Action> configure) => configure.Invoke(this); - public CountRequestDescriptor() : this(typeof(TDocument)) + public CountRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) { } - public CountRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + public CountRequestDescriptor() { } @@ -259,8 +259,8 @@ public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.S } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -273,7 +273,7 @@ public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Ser return Self; } - public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -281,7 +281,7 @@ public CountRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public CountRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -300,7 +300,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -319,7 +319,7 @@ public sealed partial class CountRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public CountRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + public CountRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) { } @@ -357,8 +357,8 @@ public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.I } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -371,7 +371,7 @@ public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Que return Self; } - public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -379,7 +379,7 @@ public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public CountRequestDescriptor Query(Action configure) + public CountRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -398,7 +398,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs index a21aac40033..f5f128d25bc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CountResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs index a2f99ab8d60..02dd0aaa5f0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateRequest.g.cs @@ -84,9 +84,6 @@ public CreateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, E internal override string OperationName => "create"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// ID of the pipeline to use to preprocess incoming documents.
If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.
If a final pipeline is configured it will always run, regardless of the value of this parameter.
///
@@ -128,6 +125,8 @@ public CreateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, E ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + [JsonIgnore] + public TDocument Document { get; set; } } /// @@ -136,21 +135,17 @@ public CreateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, E public sealed partial class CreateRequestDescriptor : RequestDescriptor, CreateRequestParameters> { internal CreateRequestDescriptor(Action> configure) => configure.Invoke(this); + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("index", index).Required("id", id)) => DocumentValue = document; - 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(document, typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) { } - 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) + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(document, index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) { } - internal CreateRequestDescriptor() + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id id) : this(document, typeof(TDocument), id) { } @@ -184,6 +179,12 @@ public CreateRequestDescriptor Index(Elastic.Clients.Elasticsearch.Se private TDocument DocumentValue { get; set; } + public CreateRequestDescriptor Document(TDocument document) + { + DocumentValue = document; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs index 2d398c5c1be..6cbdb35710c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/CreateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs index b8456275bea..0449464fea4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRequest.g.cs @@ -387,10 +387,6 @@ public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.I { } - internal DeleteByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -436,11 +432,11 @@ public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elastic private long? MaxDocsValue { get; set; } 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.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.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } /// /// The maximum number of documents to delete. @@ -462,7 +458,7 @@ public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticse return Self; } - public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -470,7 +466,7 @@ public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor< return Self; } - public DeleteByQueryRequestDescriptor Query(Action> configure) + public DeleteByQueryRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -489,7 +485,7 @@ public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticse return Self; } - public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -497,7 +493,7 @@ public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public DeleteByQueryRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -522,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -538,7 +534,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -561,10 +557,6 @@ public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.I { } - internal DeleteByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -610,11 +602,11 @@ public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serv private long? MaxDocsValue { get; set; } 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.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.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } /// /// The maximum number of documents to delete. @@ -636,7 +628,7 @@ public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Server return Self; } - public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -644,7 +636,7 @@ public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public DeleteByQueryRequestDescriptor Query(Action configure) + public DeleteByQueryRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -663,7 +655,7 @@ public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Server return Self; } - public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -671,7 +663,7 @@ public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public DeleteByQueryRequestDescriptor Slice(Action configure) + public DeleteByQueryRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -696,7 +688,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -712,7 +704,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs index 2d0b7197d7e..a8cb2a4cddf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs index 6645c8d6c35..629011d8581 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class DeleteByQueryRethrottleRequestParameters : RequestPa /// public sealed partial class DeleteByQueryRethrottleRequest : PlainRequest { - public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id) : base(r => r.Required("task_id", task_id)) + public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.TaskId taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class DeleteByQueryRethrottleRequestDescriptor : RequestDe { internal DeleteByQueryRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal DeleteByQueryRethrottleRequestDescriptor() + public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.TaskId taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal DeleteByQueryRethrottleRequestDescriptor() public DeleteByQueryRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id) + public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.TaskId taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs index a9911ab7330..a6edfad65d3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs index 36179c9fefe..48085c5eb92 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteRequest.g.cs @@ -149,30 +149,6 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } - 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; @@ -218,10 +194,6 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } - internal DeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs index 38a35496fe3..15cc949e689 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs index 09b1af9cd5e..394b0980a05 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptRequest.g.cs @@ -83,10 +83,6 @@ public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal DeleteScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -120,10 +116,6 @@ public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal DeleteScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs index 2311535b967..783d9e7f8d0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/DeleteScriptResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index c9b1666303d..40174816981 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyRequest.g.cs @@ -62,10 +62,6 @@ public DeletePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Na { } - internal DeletePolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichDeletePolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index a7809f2351d..0a8878f34a0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/DeletePolicyResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 8a05c76d9bf..9a6bed4109a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/EnrichStatsResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index f960ec6bd5c..20767adaa5c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs @@ -72,10 +72,6 @@ public ExecutePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.N { } - internal ExecutePolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichExecutePolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; 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 index e70a9bd08b8..456ddb5ba4f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -28,7 +29,7 @@ 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; } + 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 index ec0ae7ccf25..078caefe4d6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyRequest.g.cs @@ -62,6 +62,10 @@ public sealed partial class GetPolicyRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("name", name)) + { + } + public GetPolicyRequestDescriptor() { } 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 index 2436ef2e5c8..a6859836745 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/GetPolicyResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index aad37cbafce..8fb5b72a54c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyRequest.g.cs @@ -80,10 +80,6 @@ public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name { } - internal PutPolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -99,14 +95,14 @@ public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch. } 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.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.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; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action> RangeDescriptorAction { get; set; } /// /// Matches enrich data to incoming documents based on a `geo_shape` query. @@ -119,7 +115,7 @@ public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsea return Self; } - public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { GeoMatchValue = null; GeoMatchDescriptorAction = null; @@ -127,7 +123,7 @@ public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor GeoMatch(Action> configure) + public PutPolicyRequestDescriptor GeoMatch(Action> configure) { GeoMatchValue = null; GeoMatchDescriptor = null; @@ -146,7 +142,7 @@ public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch return Self; } - public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -154,7 +150,7 @@ public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor Match(Action> configure) + public PutPolicyRequestDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -173,7 +169,7 @@ public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch return Self; } - public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { RangeValue = null; RangeDescriptorAction = null; @@ -181,7 +177,7 @@ public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor Range(Action> configure) + public PutPolicyRequestDescriptor Range(Action> configure) { RangeValue = null; RangeDescriptor = null; @@ -200,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GeoMatchDescriptorAction is not null) { writer.WritePropertyName("geo_match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); } else if (GeoMatchValue is not null) { @@ -216,7 +212,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(MatchDescriptorAction), options); } else if (MatchValue is not null) { @@ -232,7 +228,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RangeDescriptorAction is not null) { writer.WritePropertyName("range"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(RangeDescriptorAction), options); } else if (RangeValue is not null) { @@ -255,10 +251,6 @@ public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name { } - internal PutPolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -274,14 +266,14 @@ public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless. } 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.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.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; } + private Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action RangeDescriptorAction { get; set; } /// /// Matches enrich data to incoming documents based on a `geo_shape` query. @@ -294,7 +286,7 @@ public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Serverl return Self; } - public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { GeoMatchValue = null; GeoMatchDescriptorAction = null; @@ -302,7 +294,7 @@ public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor GeoMatch(Action configure) + public PutPolicyRequestDescriptor GeoMatch(Action configure) { GeoMatchValue = null; GeoMatchDescriptor = null; @@ -321,7 +313,7 @@ public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Serverless return Self; } - public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -329,7 +321,7 @@ public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor Match(Action configure) + public PutPolicyRequestDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -348,7 +340,7 @@ public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Serverless return Self; } - public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor descriptor) { RangeValue = null; RangeDescriptorAction = null; @@ -356,7 +348,7 @@ public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor Range(Action configure) + public PutPolicyRequestDescriptor Range(Action configure) { RangeValue = null; RangeDescriptor = null; @@ -375,7 +367,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GeoMatchDescriptorAction is not null) { writer.WritePropertyName("geo_match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); } else if (GeoMatchValue is not null) { @@ -391,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(MatchDescriptorAction), options); } else if (MatchValue is not null) { @@ -407,7 +399,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RangeDescriptorAction is not null) { writer.WritePropertyName("range"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Enrich.EnrichPolicyDescriptor(RangeDescriptorAction), options); } else if (RangeValue is not null) { 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 index 01ffbd691e6..b30cc44ce09 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Enrich/PutPolicyResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteRequest.g.cs index df709f8bdbe..de26b15c866 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteRequest.g.cs @@ -62,10 +62,6 @@ public EqlDeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id { } - internal EqlDeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public EqlDeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id { } - internal EqlDeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteResponse.g.cs index e7a5948b4ff..353ef60d960 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlDeleteResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetRequest.g.cs index 394906f5696..5c52a2926f1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetRequest.g.cs @@ -83,10 +83,6 @@ public EqlGetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : { } - internal EqlGetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -120,10 +116,6 @@ public EqlGetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : { } - internal EqlGetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetResponse.g.cs index fb2096cfade..1cd4a0bb275 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlGetResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchRequest.g.cs index 7fbb6ed5000..4369230c803 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchRequest.g.cs @@ -142,10 +142,6 @@ public EqlSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indic { } - internal EqlSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,18 +164,18 @@ public EqlSearchRequestDescriptor Indices(Elastic.Clients.Elasticsear private Elastic.Clients.Elasticsearch.Serverless.Field? EventCategoryFieldValue { get; set; } private int? FetchSizeValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } private string QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Eql.ResultPosition? ResultPositionValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TiebreakerFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TimestampFieldValue { get; set; } @@ -209,6 +205,15 @@ public EqlSearchRequestDescriptor EventCategoryField(Expressi return Self; } + /// + /// Field containing the event classification, such as process, file, or network. + /// + public EqlSearchRequestDescriptor EventCategoryField(Expression> eventCategoryField) + { + EventCategoryFieldValue = eventCategoryField; + return Self; + } + /// /// Maximum number of events to search at a time for sequence queries. /// @@ -230,7 +235,7 @@ public EqlSearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public EqlSearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -239,7 +244,7 @@ public EqlSearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescr return Self; } - public EqlSearchRequestDescriptor Fields(Action> configure) + public EqlSearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -248,7 +253,7 @@ public EqlSearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public EqlSearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -269,7 +274,7 @@ public EqlSearchRequestDescriptor Filter(ICollection Filter(QueryDsl.QueryDescriptor descriptor) + public EqlSearchRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -278,7 +283,7 @@ public EqlSearchRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public EqlSearchRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -287,7 +292,7 @@ public EqlSearchRequestDescriptor Filter(Action Filter(params Action>[] configure) + public EqlSearchRequestDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -323,9 +328,9 @@ public EqlSearchRequestDescriptor ResultPosition(Elastic.Clients.Elas return Self; } - public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public EqlSearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -356,6 +361,15 @@ public EqlSearchRequestDescriptor TiebreakerField(Expression< return Self; } + /// + /// Field used to sort hits with the same timestamp in ascending order + /// + public EqlSearchRequestDescriptor TiebreakerField(Expression> tiebreakerField) + { + TiebreakerFieldValue = tiebreakerField; + return Self; + } + /// /// Field containing event timestamp. Default "@timestamp" /// @@ -374,6 +388,15 @@ public EqlSearchRequestDescriptor TimestampField(Expression + /// Field containing event timestamp. Default "@timestamp" + /// + public EqlSearchRequestDescriptor TimestampField(Expression> timestampField) + { + TimestampFieldValue = timestampField; + return Self; + } + public EqlSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) { WaitForCompletionTimeoutValue = waitForCompletionTimeout; @@ -409,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldsDescriptorAction is not null) { writer.WritePropertyName("fields"); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); } else if (FieldsDescriptorActions is not null) { @@ -418,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } if (FieldsDescriptorActions.Length > 1) @@ -438,7 +461,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -447,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -524,10 +547,6 @@ public EqlSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indic { } - internal EqlSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -550,18 +569,18 @@ public EqlSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverle private Elastic.Clients.Elasticsearch.Serverless.Field? EventCategoryFieldValue { get; set; } private int? FetchSizeValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } private string QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Eql.ResultPosition? ResultPositionValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TiebreakerFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TimestampFieldValue { get; set; } @@ -621,7 +640,7 @@ public EqlSearchRequestDescriptor Fields(ICollection configure) + public EqlSearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -639,7 +658,7 @@ public EqlSearchRequestDescriptor Fields(Action[] configure) + public EqlSearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -660,7 +679,7 @@ public EqlSearchRequestDescriptor Filter(ICollection configure) + public EqlSearchRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -678,7 +697,7 @@ public EqlSearchRequestDescriptor Filter(Action config return Self; } - public EqlSearchRequestDescriptor Filter(params Action[] configure) + public EqlSearchRequestDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -714,9 +733,9 @@ public EqlSearchRequestDescriptor ResultPosition(Elastic.Clients.Elasticsearch.S return Self; } - public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -818,7 +837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldsDescriptorAction is not null) { writer.WritePropertyName("fields"); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); } else if (FieldsDescriptorActions is not null) { @@ -827,7 +846,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } if (FieldsDescriptorActions.Length > 1) @@ -847,7 +866,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -856,7 +875,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchResponse.g.cs index 0122d30e0bf..0e6dec8a0b4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/EqlSearchResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusRequest.g.cs index 44689bbfe6d..40b291526ef 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusRequest.g.cs @@ -62,10 +62,6 @@ public GetEqlStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal GetEqlStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGetStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public GetEqlStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal GetEqlStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGetStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusResponse.g.cs index d21cfe05b74..37717c5af18 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Eql/GetEqlStatusResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs index cc045bbe675..af089f46235 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsRequest.g.cs @@ -171,30 +171,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } - 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; @@ -242,10 +218,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs index d9657478130..242b97d85f2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,8 +28,4 @@ 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 index 0ad4e2bcf78..9f69b5c1f58 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceRequest.g.cs @@ -160,30 +160,6 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In { } - 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; @@ -230,10 +206,6 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In { } - internal ExistsSourceRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs index d1c31ff4ebe..db25e7ee395 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExistsSourceResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,8 +28,4 @@ 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/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs index 6d04450ae3a..e70bf6c1215 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainRequest.g.cs @@ -199,30 +199,6 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNa { } - public ExplainRequestDescriptor(TDocument document) : this(typeof(TDocument), Serverless.Id.From(document)) - { - } - - public ExplainRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public ExplainRequestDescriptor(TDocument document, IndexName index) : this(index, Serverless.Id.From(document)) - { - } - - public ExplainRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) - { - } - - public ExplainRequestDescriptor(Id id) : this(typeof(TDocument), id) - { - } - - internal ExplainRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -257,8 +233,8 @@ public ExplainRequestDescriptor Index(Elastic.Clients.Elasticsearch.S } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -271,7 +247,7 @@ public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.S return Self; } - public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -279,7 +255,7 @@ public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public ExplainRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -298,7 +274,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -321,10 +297,6 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNa { } - internal ExplainRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -359,8 +331,8 @@ public ExplainRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.I } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -373,7 +345,7 @@ public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -381,7 +353,7 @@ public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public ExplainRequestDescriptor Query(Action configure) + public ExplainRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -400,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainResponse.g.cs index eadb4c450b5..6925c56fc6f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ExplainResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs index 0386ef80ce7..50da60c7d13 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsRequest.g.cs @@ -51,6 +51,11 @@ public sealed partial class FieldCapsRequestParameters : RequestParameters /// public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + /// + /// If false, empty fields are not included in the response. + /// + public bool? IncludeEmptyFields { get => Q("include_empty_fields"); set => Q("include_empty_fields", value); } + /// /// If true, unmapped fields are included in the response. /// @@ -107,6 +112,12 @@ public FieldCapsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indice [JsonIgnore] public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + /// + /// If false, empty fields are not included in the response. + /// + [JsonIgnore] + public bool? IncludeEmptyFields { get => Q("include_empty_fields"); set => Q("include_empty_fields", value); } + /// /// If true, unmapped fields are included in the response. /// @@ -145,6 +156,10 @@ public sealed partial class FieldCapsRequestDescriptor : RequestDescr { internal FieldCapsRequestDescriptor(Action> configure) => configure.Invoke(this); + public FieldCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FieldCapsRequestDescriptor() { } @@ -161,6 +176,7 @@ public FieldCapsRequestDescriptor() 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 IncludeEmptyFields(bool? includeEmptyFields = true) => Qs("include_empty_fields", includeEmptyFields); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); @@ -172,9 +188,9 @@ public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsear private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action> IndexFilterDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } /// /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. @@ -196,7 +212,7 @@ public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elastic return Self; } - public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -204,7 +220,7 @@ public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescripto return Self; } - public FieldCapsRequestDescriptor IndexFilter(Action> configure) + public FieldCapsRequestDescriptor IndexFilter(Action> configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -215,9 +231,9 @@ public FieldCapsRequestDescriptor IndexFilter(Action /// 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) + public FieldCapsRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -238,7 +254,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { @@ -263,6 +279,10 @@ public sealed partial class FieldCapsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public FieldCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FieldCapsRequestDescriptor() { } @@ -279,6 +299,7 @@ public FieldCapsRequestDescriptor() 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 IncludeEmptyFields(bool? includeEmptyFields = true) => Qs("include_empty_fields", includeEmptyFields); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); @@ -290,9 +311,9 @@ public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverle private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action IndexFilterDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } /// /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. @@ -314,7 +335,7 @@ public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serv return Self; } - public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -322,7 +343,7 @@ public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descripto return Self; } - public FieldCapsRequestDescriptor IndexFilter(Action configure) + public FieldCapsRequestDescriptor IndexFilter(Action configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -333,9 +354,9 @@ public FieldCapsRequestDescriptor IndexFilter(Action c /// /// 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) + public FieldCapsRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -356,7 +377,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs index 0976c04926f..b812902de68 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/FieldCapsResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -31,5 +32,6 @@ public sealed partial class FieldCapsResponse : ElasticsearchResponse [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyDictionary))] public IReadOnlyDictionary> Fields { get; init; } [JsonInclude, JsonPropertyName("indices")] - public IReadOnlyCollection Indices { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + 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 index e32f67a87bc..f4d5e4680dd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetRequest.g.cs @@ -171,30 +171,6 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName i { } - 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; @@ -242,10 +218,6 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName i { } - internal GetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs index 0545bae4445..b00ff137c4c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs index a861c4cacec..96368540bb4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptRequest.g.cs @@ -72,10 +72,6 @@ public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id { } - internal GetScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -108,10 +104,6 @@ public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id { } - internal GetScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs index a6a3b25283c..e283ddb5ab6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetScriptResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs index a663be9b941..c502d2e5918 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceRequest.g.cs @@ -163,30 +163,6 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } - 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; @@ -234,10 +210,6 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } - internal GetSourceRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs index 0c1b9284087..fe4055b01b9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/GetSourceResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index d4611c14fd1..f4190a1b601 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreRequest.g.cs @@ -107,10 +107,6 @@ public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices { } - internal ExploreRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -129,18 +125,18 @@ public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch } 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.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.Graph.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 Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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. @@ -153,7 +149,7 @@ public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticse return Self; } - public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -161,7 +157,7 @@ public ExploreRequestDescriptor Connections(HopDescriptor return Self; } - public ExploreRequestDescriptor Connections(Action> configure) + public ExploreRequestDescriptor Connections(Action> configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -180,7 +176,7 @@ public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearc return Self; } - public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControlsDescriptor descriptor) { ControlsValue = null; ControlsDescriptorAction = null; @@ -188,7 +184,7 @@ public ExploreRequestDescriptor Controls(ExploreControlsDescriptor Controls(Action> configure) + public ExploreRequestDescriptor Controls(Action> configure) { ControlsValue = null; ControlsDescriptor = null; @@ -207,7 +203,7 @@ public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.S return Self; } - public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -215,7 +211,7 @@ public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public ExploreRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -235,7 +231,7 @@ public ExploreRequestDescriptor Vertices(ICollection Vertices(VertexDefinitionDescriptor descriptor) + public ExploreRequestDescriptor Vertices(Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor descriptor) { VerticesValue = null; VerticesDescriptorAction = null; @@ -244,7 +240,7 @@ public ExploreRequestDescriptor Vertices(VertexDefinitionDescriptor Vertices(Action> configure) + public ExploreRequestDescriptor Vertices(Action> configure) { VerticesValue = null; VerticesDescriptor = null; @@ -253,7 +249,7 @@ public ExploreRequestDescriptor Vertices(Action Vertices(params Action>[] configure) + public ExploreRequestDescriptor Vertices(params Action>[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -273,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -289,7 +285,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ControlsDescriptorAction is not null) { writer.WritePropertyName("controls"); - JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); } else if (ControlsValue is not null) { @@ -305,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -324,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -333,7 +329,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); @@ -359,10 +355,6 @@ public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices { } - internal ExploreRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -381,18 +373,18 @@ public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless } 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.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.Graph.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 Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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. @@ -405,7 +397,7 @@ public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Server return Self; } - public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -413,7 +405,7 @@ public ExploreRequestDescriptor Connections(HopDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Connections(Action configure) + public ExploreRequestDescriptor Connections(Action configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -432,7 +424,7 @@ public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Serverles return Self; } - public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControlsDescriptor descriptor) { ControlsValue = null; ControlsDescriptorAction = null; @@ -440,7 +432,7 @@ public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Controls(Action configure) + public ExploreRequestDescriptor Controls(Action configure) { ControlsValue = null; ControlsDescriptor = null; @@ -459,7 +451,7 @@ public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -467,7 +459,7 @@ public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Query(Action configure) + public ExploreRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -487,7 +479,7 @@ public ExploreRequestDescriptor Vertices(ICollection configure) + public ExploreRequestDescriptor Vertices(Action configure) { VerticesValue = null; VerticesDescriptor = null; @@ -505,7 +497,7 @@ public ExploreRequestDescriptor Vertices(Action conf return Self; } - public ExploreRequestDescriptor Vertices(params Action[] configure) + public ExploreRequestDescriptor Vertices(params Action[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -525,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -541,7 +533,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ControlsDescriptorAction is not null) { writer.WritePropertyName("controls"); - JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); } else if (ControlsValue is not null) { @@ -557,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -576,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -585,7 +577,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); 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 index 4acdf2edfac..b4c16e5ce14 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Graph/ExploreResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportRequest.g.cs new file mode 100644 index 00000000000..b3ae1e6b331 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportRequest.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.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 partial class HealthReportRequestParameters : RequestParameters +{ + /// + /// Limit the number of affected resources the health report API returns. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Explicit operation timeout. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Opt-in for more information about the health of the system. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns the health of the cluster. +/// +public sealed partial class HealthReportRequest : PlainRequest +{ + public HealthReportRequest() + { + } + + public HealthReportRequest(IReadOnlyCollection? feature) : base(r => r.Optional("feature", feature)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "health_report"; + + /// + /// Limit the number of affected resources the health report API returns. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Explicit operation timeout. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Opt-in for more information about the health of the system. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns the health of the cluster. +/// +public sealed partial class HealthReportRequestDescriptor : RequestDescriptor +{ + internal HealthReportRequestDescriptor(Action configure) => configure.Invoke(this); + + public HealthReportRequestDescriptor(IReadOnlyCollection? feature) : base(r => r.Optional("feature", feature)) + { + } + + public HealthReportRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "health_report"; + + public HealthReportRequestDescriptor Size(int? size) => Qs("size", size); + public HealthReportRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public HealthReportRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public HealthReportRequestDescriptor Feature(IReadOnlyCollection? feature) + { + RouteValues.Optional("feature", feature); + 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/HealthReportResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportResponse.g.cs new file mode 100644 index 00000000000..dc6e11408ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/HealthReportResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +public sealed partial class HealthReportResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("indicators")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.Indicators Indicators { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus? Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs new file mode 100644 index 00000000000..bc8ed7b61c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs @@ -0,0 +1,509 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class AnalyzeIndexRequestParameters : RequestParameters +{ +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequest : PlainRequest +{ + public AnalyzeIndexRequest() + { + } + + public AnalyzeIndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + [JsonInclude, JsonPropertyName("attributes")] + public ICollection? Attributes { get; set; } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + + /// + /// Normalizer to use to convert text into a single token. + /// + [JsonInclude, JsonPropertyName("normalizer")] + public string? Normalizer { get; set; } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ [JsonInclude, JsonPropertyName("text")] + [SingleOrManyCollectionConverter(typeof(string))] + public ICollection? Text { get; set; } + + /// + /// Tokenizer to use to convert text into tokens. + /// + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? Tokenizer { get; set; } +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequestDescriptor : RequestDescriptor, AnalyzeIndexRequestParameters> +{ + internal AnalyzeIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + public AnalyzeIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + public AnalyzeIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private string? AnalyzerValue { get; set; } + private ICollection? AttributesValue { get; set; } + private ICollection? CharFilterValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private ICollection? FilterValue { get; set; } + private string? NormalizerValue { get; set; } + private ICollection? TextValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ public AnalyzeIndexRequestDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + public AnalyzeIndexRequestDescriptor Attributes(ICollection? attributes) + { + AttributesValue = attributes; + return Self; + } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + public AnalyzeIndexRequestDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + public AnalyzeIndexRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + public AnalyzeIndexRequestDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// Normalizer to use to convert text into a single token. + /// + public AnalyzeIndexRequestDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ public AnalyzeIndexRequestDescriptor Text(ICollection? text) + { + TextValue = text; + return Self; + } + + /// + /// Tokenizer to use to convert text into tokens. + /// + public AnalyzeIndexRequestDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? tokenizer) + { + TokenizerValue = tokenizer; + 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 (AttributesValue is not null) + { + writer.WritePropertyName("attributes"); + JsonSerializer.Serialize(writer, AttributesValue, options); + } + + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, 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 (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (TextValue is not null) + { + writer.WritePropertyName("text"); + SingleOrManySerializationHelper.Serialize(TextValue, writer, options); + } + + if (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequestDescriptor : RequestDescriptor +{ + internal AnalyzeIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + public AnalyzeIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + public AnalyzeIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private string? AnalyzerValue { get; set; } + private ICollection? AttributesValue { get; set; } + private ICollection? CharFilterValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private ICollection? FilterValue { get; set; } + private string? NormalizerValue { get; set; } + private ICollection? TextValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ public AnalyzeIndexRequestDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + public AnalyzeIndexRequestDescriptor Attributes(ICollection? attributes) + { + AttributesValue = attributes; + return Self; + } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + public AnalyzeIndexRequestDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + public AnalyzeIndexRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + public AnalyzeIndexRequestDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// Normalizer to use to convert text into a single token. + /// + public AnalyzeIndexRequestDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ public AnalyzeIndexRequestDescriptor Text(ICollection? text) + { + TextValue = text; + return Self; + } + + /// + /// Tokenizer to use to convert text into tokens. + /// + public AnalyzeIndexRequestDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? tokenizer) + { + TokenizerValue = tokenizer; + 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 (AttributesValue is not null) + { + writer.WritePropertyName("attributes"); + JsonSerializer.Serialize(writer, AttributesValue, options); + } + + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, 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 (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (TextValue is not null) + { + writer.WritePropertyName("text"); + SingleOrManySerializationHelper.Serialize(TextValue, writer, options); + } + + if (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs new file mode 100644 index 00000000000..e2a51c4d93c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/AnalyzeIndexResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class AnalyzeIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("detail")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AnalyzeDetail? Detail { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection? Tokens { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs new file mode 100644 index 00000000000..b4bbee1e867 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs @@ -0,0 +1,216 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class ClearCacheRequestParameters : 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`, clears the fields cache.
Use the `fields` parameter to clear the cache of specific fields only.
+ ///
+ public bool? Fielddata { get => Q("fielddata"); set => Q("fielddata", value); } + + /// + /// Comma-separated list of field names used to limit the `fielddata` parameter. + /// + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", 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`, clears the query cache. + /// + public bool? Query { get => Q("query"); set => Q("query", value); } + + /// + /// If `true`, clears the request cache. + /// + public bool? Request { get => Q("request"); set => Q("request", value); } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequest : PlainRequest +{ + public ClearCacheRequest() + { + } + + public ClearCacheRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + /// + /// 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`, clears the fields cache.
Use the `fields` parameter to clear the cache of specific fields only.
+ ///
+ [JsonIgnore] + public bool? Fielddata { get => Q("fielddata"); set => Q("fielddata", value); } + + /// + /// Comma-separated list of field names used to limit the `fielddata` parameter. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get => Q("fields"); set => Q("fields", 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`, clears the query cache. + /// + [JsonIgnore] + public bool? Query { get => Q("query"); set => Q("query", value); } + + /// + /// If `true`, clears the request cache. + /// + [JsonIgnore] + public bool? Request { get => Q("request"); set => Q("request", value); } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor, ClearCacheRequestParameters> +{ + internal ClearCacheRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor Fielddata(bool? fielddata = true) => Qs("fielddata", fielddata); + public ClearCacheRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ClearCacheRequestDescriptor Query(bool? query = true) => Qs("query", query); + public ClearCacheRequestDescriptor Request(bool? request = true) => Qs("request", request); + + public ClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor +{ + internal ClearCacheRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor Fielddata(bool? fielddata = true) => Qs("fielddata", fielddata); + public ClearCacheRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ClearCacheRequestDescriptor Query(bool? query = true) => Qs("query", query); + public ClearCacheRequestDescriptor Request(bool? request = true) => Qs("request", request); + + public ClearCacheRequestDescriptor 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/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs new file mode 100644 index 00000000000..e81d3e2bfdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.IndexManagement; + +public sealed partial class ClearCacheResponse : ElasticsearchResponse +{ + [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/CloseIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs index aa703c0d48d..f253be608e7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs @@ -127,10 +127,6 @@ public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indi { } - internal CloseIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,10 +164,6 @@ public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indi { } - internal CloseIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; 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 index 2ffd3c8b57b..26696939f0e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index be772c5247e..62e64cc5f39 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs @@ -62,10 +62,6 @@ public CreateDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal CreateDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreateDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; 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 index cd979e08988..27c278f250f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index a61b25751d1..960589dd800 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -112,14 +112,6 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - public CreateIndexRequestDescriptor(TDocument document) : this(typeof(TDocument)) - { - } - - internal CreateIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -138,20 +130,20 @@ public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsear return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } /// /// Aliases for the index. /// - public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CreateIndexRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -166,7 +158,7 @@ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elastics return Self; } - public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -174,7 +166,7 @@ public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescr return Self; } - public CreateIndexRequestDescriptor Mappings(Action> configure) + public CreateIndexRequestDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -193,7 +185,7 @@ public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elastics return Self; } - public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -201,7 +193,7 @@ public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor< return Self; } - public CreateIndexRequestDescriptor Settings(Action> configure) + public CreateIndexRequestDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -226,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -242,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -265,10 +257,6 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal CreateIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -287,20 +275,20 @@ public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverle return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } /// /// Aliases for the index. /// - public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CreateIndexRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -315,7 +303,7 @@ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serve return Self; } - public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -323,7 +311,7 @@ public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descr return Self; } - public CreateIndexRequestDescriptor Mappings(Action configure) + public CreateIndexRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -342,7 +330,7 @@ public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serve return Self; } - public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -350,7 +338,7 @@ public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public CreateIndexRequestDescriptor Settings(Action configure) + public CreateIndexRequestDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -375,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -391,7 +379,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { 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 index 9f6bccef6ae..16a1cc6de10 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs new file mode 100644 index 00000000000..975641dd419 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsRequest.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.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 partial class DataStreamsStatsRequestParameters : 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); } +} + +/// +/// Retrieves statistics for one or more data streams. +/// +public sealed partial class DataStreamsStatsRequest : PlainRequest +{ + public DataStreamsStatsRequest() + { + } + + public DataStreamsStatsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDataStreamsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.data_streams_stats"; + + /// + /// 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); } +} + +/// +/// Retrieves statistics for one or more data streams. +/// +public sealed partial class DataStreamsStatsRequestDescriptor : RequestDescriptor +{ + internal DataStreamsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? name) : base(r => r.Optional("name", name)) + { + } + + public DataStreamsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDataStreamsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.data_streams_stats"; + + public DataStreamsStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + + public DataStreamsStatsRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.IndexName? 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/DataStreamsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs new file mode 100644 index 00000000000..babbfbe9a96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DataStreamsStatsResponse.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.IndexManagement; + +public sealed partial class DataStreamsStatsResponse : ElasticsearchResponse +{ + /// + /// Total number of backing indices for the selected data streams. + /// + [JsonInclude, JsonPropertyName("backing_indices")] + public int BackingIndices { get; init; } + + /// + /// Total number of selected data streams. + /// + [JsonInclude, JsonPropertyName("data_stream_count")] + public int DataStreamCount { get; init; } + + /// + /// Contains statistics for the selected data streams. + /// + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } + + /// + /// Contains information about shards that attempted to execute the request. + /// + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + + /// + /// Total size, in bytes, of all shards for the selected data streams. + /// + [JsonInclude, JsonPropertyName("total_store_size_bytes")] + public long TotalStoreSizeBytes { get; init; } + + /// + /// Total size of all shards for the selected data streams.
This property is included only if the `human` query parameter is `true`
+ ///
+ [JsonInclude, JsonPropertyName("total_store_sizes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalStoreSizes { 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 index 797b1d44f11..05805d98e7f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs @@ -83,10 +83,6 @@ public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal DeleteAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -126,10 +122,6 @@ public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal DeleteAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index cdb137df079..6e9e71494a1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 7222cfacdd0..2e1f19a9a18 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs @@ -94,10 +94,6 @@ public DeleteDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Server { } - internal DeleteDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index 261ac7bacd7..5ede64d0ba8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 89c56ab6211..b78767323b1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs @@ -72,10 +72,6 @@ public DeleteDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal DeleteDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index 8345a39148f..bc97eed9dc1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index a6082a3e87e..bfd1821541b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs @@ -116,10 +116,6 @@ public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal DeleteIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -156,10 +152,6 @@ public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal DeleteIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index b7f9ebc6e4b..cc5024e04b2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,6 +28,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class DeleteIndexResponse : 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; } [JsonInclude, JsonPropertyName("_shards")] 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 index da1e6fcc066..6f6e42ad21b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -83,10 +83,6 @@ public DeleteIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Server { } - internal DeleteIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index 63dd3c9ac8c..8703cab35dc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index f6ceacd54e5..180db2d707b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs @@ -105,15 +105,11 @@ public sealed partial class ExistsAliasRequestDescriptor : RequestDes { 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() + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) { } @@ -130,15 +126,15 @@ internal ExistsAliasRequestDescriptor() 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) + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Required("name", name); + RouteValues.Optional("index", indices); return Self; } - public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) { - RouteValues.Optional("index", indices); + RouteValues.Required("name", name); return Self; } @@ -154,15 +150,11 @@ public sealed partial class ExistsAliasRequestDescriptor : RequestDescriptor 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() + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) { } @@ -179,15 +171,15 @@ internal ExistsAliasRequestDescriptor() 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) + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Required("name", name); + RouteValues.Optional("index", indices); return Self; } - public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) { - RouteValues.Optional("index", indices); + RouteValues.Required("name", name); return Self; } 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 index 32a923dd00f..228b5a39e5d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,8 +28,4 @@ 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 index 247572b2fcf..edbbdaa0cc8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs @@ -72,10 +72,6 @@ public ExistsIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Server { } - internal ExistsIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; 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 index aad1ea6bc45..870f4b00dc8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,8 +28,4 @@ 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 index 8947c10b1a9..8fb1becba61 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsRequest.g.cs @@ -127,10 +127,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; @@ -168,10 +164,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; 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 index 94cc7dc0887..3c3e6a3cfcb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExistsResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,8 +28,4 @@ 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/ExplainDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs index fddef20d1bd..8aed8e8823b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs @@ -83,10 +83,6 @@ public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serve { } - internal ExplainDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -120,10 +116,6 @@ public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serve { } - internal ExplainDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; 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 index 8a06c17ca2c..00f3c417846 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushRequest.g.cs index 469faed3a82..fd5bad0326b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushRequest.g.cs @@ -116,6 +116,10 @@ public sealed partial class FlushRequestDescriptor : RequestDescripto { internal FlushRequestDescriptor(Action> configure) => configure.Invoke(this); + public FlushRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FlushRequestDescriptor() { } @@ -152,6 +156,10 @@ public sealed partial class FlushRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public FlushRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FlushRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs index 398dac17275..cd690796910 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/FlushResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs index 969f8b7a4a5..8a03b2d3300 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs @@ -138,6 +138,10 @@ public sealed partial class ForcemergeRequestDescriptor : RequestDesc { internal ForcemergeRequestDescriptor(Action> configure) => configure.Invoke(this); + public ForcemergeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public ForcemergeRequestDescriptor() { } @@ -176,6 +180,10 @@ public sealed partial class ForcemergeRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public ForcemergeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public ForcemergeRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs index 79af39dcbf7..e1098739709 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 7c2127c61e5..8dcc0896981 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetAliasRequest.g.cs @@ -113,15 +113,11 @@ public sealed partial class GetAliasRequestDescriptor : RequestDescri { 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)) + public GetAliasRequestDescriptor() { } @@ -138,15 +134,15 @@ public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice 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) + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Optional("name", name); + RouteValues.Optional("index", indices); return Self; } - public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) { - RouteValues.Optional("index", indices); + RouteValues.Optional("name", name); return Self; } @@ -162,15 +158,11 @@ public sealed partial class GetAliasRequestDescriptor : RequestDescriptor 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)) + public GetAliasRequestDescriptor() { } @@ -187,15 +179,15 @@ public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice 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) + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Optional("name", name); + RouteValues.Optional("index", indices); return Self; } - public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) { - RouteValues.Optional("index", indices); + RouteValues.Optional("name", name); return Self; } 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 index 8c8dae55481..2678c2d8b81 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs @@ -83,10 +83,6 @@ public GetDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal GetDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; 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 index 7d532ae533b..4a0274cceec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 8b54f3d6cf1..ab98fe627c6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs @@ -83,6 +83,10 @@ public sealed partial class GetDataStreamRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames? name) : base(r => r.Optional("name", name)) + { + } + public GetDataStreamRequestDescriptor() { } 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 index 79d069d0209..6ce14db89d9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 68431b282b6..2a253a1dbf4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexRequest.g.cs @@ -149,10 +149,6 @@ public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice { } - internal GetIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -192,10 +188,6 @@ public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice { } - internal GetIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; 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 index 952d8f82f60..b72b10a6b53 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -105,6 +105,10 @@ public sealed partial class GetIndexTemplateRequestDescriptor : RequestDescripto { internal GetIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public GetIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + public GetIndexTemplateRequestDescriptor() { } 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 index 3f51762fad0..101331f8170 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs new file mode 100644 index 00000000000..3bcda543735 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.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.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 partial class GetIndicesSettingsRequestParameters : 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`, 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. 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 setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequest : PlainRequest +{ + public GetIndicesSettingsRequest() + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + /// + /// If `false`, the request returns an error if any wildcard expression, index
alias, or `_all` value targets only missing or closed indices. This
behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index
starts with foo but no index starts with `bar`.
+ ///
+ [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`, 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. 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 setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequestDescriptor : RequestDescriptor, GetIndicesSettingsRequestParameters> +{ + internal GetIndicesSettingsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + public GetIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndicesSettingsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndicesSettingsRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + public GetIndicesSettingsRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequestDescriptor : RequestDescriptor +{ + internal GetIndicesSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + public GetIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndicesSettingsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndicesSettingsRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + public GetIndicesSettingsRequestDescriptor 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/GetIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs new file mode 100644 index 00000000000..022f66617ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.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 GetIndicesSettingsResponse : DictionaryResponse +{ + public GetIndicesSettingsResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetIndicesSettingsResponse() : base() + { + } +} \ 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 index bb3e007369d..5d2e51857e4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/GetMappingRequest.g.cs @@ -116,6 +116,10 @@ public sealed partial class GetMappingRequestDescriptor : RequestDesc { internal GetMappingRequestDescriptor(Action> configure) => configure.Invoke(this); + public GetMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public GetMappingRequestDescriptor() { } @@ -152,6 +156,10 @@ public sealed partial class GetMappingRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public GetMappingRequestDescriptor() { } 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 index b3a6a343eb1..1f5b8b33c89 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs @@ -168,15 +168,11 @@ public sealed partial class IndicesStatsRequestDescriptor : RequestDe { 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)) { } - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + public IndicesStatsRequestDescriptor() { } @@ -198,15 +194,15 @@ public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In 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) + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Optional("metric", metric); + RouteValues.Optional("index", indices); return Self; } - public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) { - RouteValues.Optional("index", indices); + RouteValues.Optional("metric", metric); return Self; } @@ -222,15 +218,11 @@ public sealed partial class IndicesStatsRequestDescriptor : RequestDescriptor 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)) { } - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + public IndicesStatsRequestDescriptor() { } @@ -252,15 +244,15 @@ public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.In 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) + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) { - RouteValues.Optional("metric", metric); + RouteValues.Optional("index", indices); return Self; } - public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) { - RouteValues.Optional("index", indices); + RouteValues.Optional("metric", metric); return Self; } 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 index 79aa69931c3..adfc57c3a06 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index cad604c8723..308fe935c7a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs @@ -62,10 +62,6 @@ public MigrateToDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.Server { } - internal MigrateToDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementMigrateToDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; 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 index 5a1499fb426..57a8369d5d9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs new file mode 100644 index 00000000000..9e8e7df6b07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs @@ -0,0 +1,155 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class ModifyDataStreamRequestParameters : RequestParameters +{ +} + +/// +/// Performs one or more data stream modification actions in a single atomic operation. +/// +public sealed partial class ModifyDataStreamRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementModifyDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.modify_data_stream"; + + /// + /// Actions to perform. + /// + [JsonInclude, JsonPropertyName("actions")] + public ICollection Actions { get; set; } +} + +/// +/// Performs one or more data stream modification actions in a single atomic operation. +/// +public sealed partial class ModifyDataStreamRequestDescriptor : RequestDescriptor +{ + internal ModifyDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public ModifyDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementModifyDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.modify_data_stream"; + + private ICollection ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexModifyDataStreamActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } + + /// + /// Actions to perform. + /// + public ModifyDataStreamRequestDescriptor Actions(ICollection actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsValue = actions; + return Self; + } + + public ModifyDataStreamRequestDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexModifyDataStreamActionDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsDescriptor = descriptor; + return Self; + } + + public ModifyDataStreamRequestDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorActions = null; + ActionsDescriptorAction = configure; + return Self; + } + + public ModifyDataStreamRequestDescriptor 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexModifyDataStreamActionDescriptor(ActionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorActions is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + foreach (var action in ActionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexModifyDataStreamActionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + 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/ModifyDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs new file mode 100644 index 00000000000..0e06a1f331a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ModifyDataStreamResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ModifyDataStreamResponse : 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 index 158bfa4d08e..8c1d979dbe2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs @@ -127,10 +127,6 @@ public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indic { } - internal OpenIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,10 +164,6 @@ public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indic { } - internal OpenIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; 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 index 5c5e6895f99..196b23e35d7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index d8f5a6dad49..5dca31bf93d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasRequest.g.cs @@ -113,10 +113,6 @@ public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice { } - internal PutAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -141,8 +137,8 @@ public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.S } 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.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; } @@ -159,7 +155,7 @@ public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch return Self; } - public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -167,7 +163,7 @@ public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public PutAliasRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -222,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -269,10 +265,6 @@ public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indice { } - internal PutAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -297,8 +289,8 @@ public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.N } 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.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; } @@ -315,7 +307,7 @@ public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless return Self; } - public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -323,7 +315,7 @@ public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public PutAliasRequestDescriptor Filter(Action configure) + public PutAliasRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -378,7 +370,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { 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 index 81793e6e34b..f34988a0278 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutAliasResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 3213f217221..001b217a36e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs @@ -106,10 +106,6 @@ public PutDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal PutDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -130,8 +126,8 @@ public PutDataLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serv private Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetentionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } - private DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } - private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { 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.
@@ -153,7 +149,7 @@ public PutDataLifecycleRequestDescriptor Downsampling(Elastic.Clients.Elasticsea return Self; } - public PutDataLifecycleRequestDescriptor Downsampling(DataStreamLifecycleDownsamplingDescriptor descriptor) + public PutDataLifecycleRequestDescriptor Downsampling(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) { DownsamplingValue = null; DownsamplingDescriptorAction = null; @@ -161,7 +157,7 @@ public PutDataLifecycleRequestDescriptor Downsampling(DataStreamLifecycleDownsam return Self; } - public PutDataLifecycleRequestDescriptor Downsampling(Action configure) + public PutDataLifecycleRequestDescriptor Downsampling(Action configure) { DownsamplingValue = null; DownsamplingDescriptor = null; @@ -186,7 +182,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DownsamplingDescriptorAction is not null) { writer.WritePropertyName("downsampling"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); } else if (DownsamplingValue is not null) { 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 index 73b069879fb..613899cb1b9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index fe69eacdd0c..01ae1244018 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -114,10 +114,6 @@ public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal PutIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -136,14 +132,14 @@ public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elastic 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.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action> TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -166,7 +162,7 @@ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.E return Self; } - public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -174,7 +170,7 @@ public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibil return Self; } - public PutIndexTemplateRequestDescriptor DataStream(Action configure) + public PutIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -220,7 +216,7 @@ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Ela return Self; } - public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -228,7 +224,7 @@ public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappin return Self; } - public PutIndexTemplateRequestDescriptor Template(Action> configure) + public PutIndexTemplateRequestDescriptor Template(Action> configure) { TemplateValue = null; TemplateDescriptor = null; @@ -262,7 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -296,7 +292,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -304,10 +300,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -325,10 +321,6 @@ public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverles { } - internal PutIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -347,14 +339,14 @@ public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serv 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.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -377,7 +369,7 @@ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearc return Self; } - public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -385,7 +377,7 @@ public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescript return Self; } - public PutIndexTemplateRequestDescriptor DataStream(Action configure) + public PutIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -431,7 +423,7 @@ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch. return Self; } - public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -439,7 +431,7 @@ public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor return Self; } - public PutIndexTemplateRequestDescriptor Template(Action configure) + public PutIndexTemplateRequestDescriptor Template(Action configure) { TemplateValue = null; TemplateDescriptor = null; @@ -473,7 +465,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -507,7 +499,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -515,10 +507,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index 3e3324952b4..b247f6a858d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs new file mode 100644 index 00000000000..061b7c36919 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs @@ -0,0 +1,262 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class PutIndicesSettingsRequestParameters : 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`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns settings in flat format. + /// + 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); } + + /// + /// If `true`, existing index settings remain unchanged. + /// + public bool? PreserveExisting { get => Q("preserve_existing"); set => Q("preserve_existing", 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); } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequest : PlainRequest +{ + public PutIndicesSettingsRequest() + { + } + + public PutIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + /// + /// If `false`, the request returns an error if any wildcard expression, index
alias, or `_all` value targets only missing or closed indices. This
behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index
starts with `foo` but no index starts with `bar`.
+ ///
+ [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`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns settings in flat format. + /// + [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); } + + /// + /// If `true`, existing index settings remain unchanged. + /// + [JsonIgnore] + public bool? PreserveExisting { get => Q("preserve_existing"); set => Q("preserve_existing", 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); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings Settings { get; set; } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequestDescriptor : RequestDescriptor, PutIndicesSettingsRequestParameters> +{ + internal PutIndicesSettingsRequestDescriptor(Action> configure) => configure.Invoke(this); + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings, Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) => SettingsValue = settings; + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings) => SettingsValue = settings; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + public PutIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public PutIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutIndicesSettingsRequestDescriptor PreserveExisting(bool? preserveExisting = true) => Qs("preserve_existing", preserveExisting); + public PutIndicesSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequestDescriptor : RequestDescriptor +{ + internal PutIndicesSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings, Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) => SettingsValue = settings; + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings) => SettingsValue = settings; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + public PutIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public PutIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutIndicesSettingsRequestDescriptor PreserveExisting(bool? preserveExisting = true) => Qs("preserve_existing", preserveExisting); + public PutIndicesSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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/PutIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs new file mode 100644 index 00000000000..7cb2c84a174 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class PutIndicesSettingsResponse : 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 index f856850db1c..754f96f880f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingRequest.g.cs @@ -137,7 +137,7 @@ public PutMappingRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indice /// Specify dynamic templates for the mapping. ///
[JsonInclude, JsonPropertyName("dynamic_templates")] - [SingleOrManyCollectionConverter(typeof(IDictionary))] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] public ICollection>? DynamicTemplates { get; set; } /// @@ -195,10 +195,6 @@ public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indi { } - internal PutMappingRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -225,18 +221,18 @@ public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsea private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } - private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary> RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } - private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Controls whether dynamic date detection is enabled. @@ -285,7 +281,7 @@ public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elastic return Self; } - public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -293,7 +289,7 @@ public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesField return Self; } - public PutMappingRequestDescriptor FieldNames(Action configure) + public PutMappingRequestDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -329,23 +325,15 @@ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elastic 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) + public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.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) + public PutMappingRequestDescriptor Properties(Action> configure) { - var descriptor = new Mapping.PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -362,7 +350,7 @@ public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsea return Self; } - public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -370,7 +358,7 @@ public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescri return Self; } - public PutMappingRequestDescriptor Routing(Action configure) + public PutMappingRequestDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -381,9 +369,9 @@ public PutMappingRequestDescriptor Routing(Action /// Mapping of runtime fields for the index. ///
- public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + public PutMappingRequestDescriptor Runtime(Func>, FluentDescriptorDictionary>> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -398,7 +386,7 @@ public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsear return Self; } - public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -406,7 +394,7 @@ public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescript return Self; } - public PutMappingRequestDescriptor Source(Action configure) + public PutMappingRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -449,7 +437,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -483,7 +471,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -505,7 +493,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { @@ -528,10 +516,6 @@ public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indi { } - internal PutMappingRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -558,18 +542,18 @@ public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverl private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } - private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceField? SourceValue { get; set; } - private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Controls whether dynamic date detection is enabled. @@ -618,7 +602,7 @@ public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serv return Self; } - public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -626,7 +610,7 @@ public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor return Self; } - public PutMappingRequestDescriptor FieldNames(Action configure) + public PutMappingRequestDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -662,23 +646,15 @@ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Serv 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) + public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.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) + public PutMappingRequestDescriptor Properties(Action> configure) { - var descriptor = new Mapping.PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -695,7 +671,7 @@ public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverl return Self; } - public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -703,7 +679,7 @@ public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descri return Self; } - public PutMappingRequestDescriptor Routing(Action configure) + public PutMappingRequestDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -714,9 +690,9 @@ public PutMappingRequestDescriptor Routing(Action /// Mapping of runtime fields for the index. ///
- public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + public PutMappingRequestDescriptor Runtime(Func, FluentDescriptorDictionary> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -731,7 +707,7 @@ public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverle return Self; } - public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -739,7 +715,7 @@ public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descript return Self; } - public PutMappingRequestDescriptor Source(Action configure) + public PutMappingRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -782,7 +758,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -816,7 +792,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -838,7 +814,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { 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 index 249d7c4ad4b..95bcf98b310 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutMappingResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -27,6 +28,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class PutMappingResponse : 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; } [JsonInclude, JsonPropertyName("_shards")] 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 index 70235ef5364..0001c3e93eb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -135,15 +135,176 @@ public PutTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : /// /// 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 +public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor, PutTemplateRequestParameters> { - internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + 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 Elastic.Clients.Elasticsearch.Serverless.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>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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(Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.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.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + 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 PutTemplateRequestDescriptor : RequestDescriptor +{ + internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("name", name)) { } @@ -166,11 +327,11 @@ public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverles return Self; } - private IDictionary? AliasesValue { get; set; } + 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -178,9 +339,9 @@ public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverles /// /// Aliases for the index. /// - public PutTemplateRequestDescriptor Aliases(Func, FluentDictionary> selector) + public PutTemplateRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -204,7 +365,7 @@ public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serve return Self; } - public PutTemplateRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -212,7 +373,7 @@ public PutTemplateRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descr return Self; } - public PutTemplateRequestDescriptor Mappings(Action configure) + public PutTemplateRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -271,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -291,10 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index 4e91eb27543..92074809589 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryRequest.g.cs new file mode 100644 index 00000000000..cb122588f09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryRequest.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.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 partial class RecoveryRequestParameters : RequestParameters +{ + /// + /// If `true`, the response only includes ongoing shard recoveries. + /// + public bool? ActiveOnly { get => Q("active_only"); set => Q("active_only", value); } + + /// + /// If `true`, the response includes detailed information about shard recoveries. + /// + public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequest : PlainRequest +{ + public RecoveryRequest() + { + } + + public RecoveryRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + /// + /// If `true`, the response only includes ongoing shard recoveries. + /// + [JsonIgnore] + public bool? ActiveOnly { get => Q("active_only"); set => Q("active_only", value); } + + /// + /// If `true`, the response includes detailed information about shard recoveries. + /// + [JsonIgnore] + public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequestDescriptor : RequestDescriptor, RecoveryRequestParameters> +{ + internal RecoveryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RecoveryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public RecoveryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + public RecoveryRequestDescriptor ActiveOnly(bool? activeOnly = true) => Qs("active_only", activeOnly); + public RecoveryRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + public RecoveryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequestDescriptor : RequestDescriptor +{ + internal RecoveryRequestDescriptor(Action configure) => configure.Invoke(this); + + public RecoveryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public RecoveryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + public RecoveryRequestDescriptor ActiveOnly(bool? activeOnly = true) => Qs("active_only", activeOnly); + public RecoveryRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + public RecoveryRequestDescriptor 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/RecoveryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryResponse.g.cs new file mode 100644 index 00000000000..839cb26c277 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RecoveryResponse.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 RecoveryResponse : DictionaryResponse +{ + public RecoveryResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public RecoveryResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshRequest.g.cs index f58f148f011..cc7834ac5a2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshRequest.g.cs @@ -94,6 +94,10 @@ public sealed partial class RefreshRequestDescriptor : RequestDescrip { internal RefreshRequestDescriptor(Action> configure) => configure.Invoke(this); + public RefreshRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RefreshRequestDescriptor() { } @@ -128,6 +132,10 @@ public sealed partial class RefreshRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public RefreshRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RefreshRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs index d2226eae767..179549b48e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RefreshResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs new file mode 100644 index 00000000000..985b8aee8b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexRequest.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.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 partial class ResolveIndexRequestParameters : RequestParameters +{ + /// + /// 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); } +} + +/// +/// Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveIndexRequest : PlainRequest +{ + public ResolveIndexRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_index"; + + /// + /// 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); } +} + +/// +/// Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveIndexRequestDescriptor : RequestDescriptor +{ + internal ResolveIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResolveIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_index"; + + public ResolveIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + + public ResolveIndexRequestDescriptor 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/ResolveIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs new file mode 100644 index 00000000000..ec8b5501790 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ResolveIndexResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ResolveIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyCollection Aliases { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { 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/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs index e9102d8691f..437a144fd80 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -61,7 +61,7 @@ public RolloverRequest(Elastic.Clients.Elasticsearch.Serverless.IndexAlias 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)) + public RolloverRequest(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Elastic.Clients.Elasticsearch.Serverless.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) { } @@ -125,19 +125,187 @@ public RolloverRequest(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias /// /// Creates a new index for a data stream or index alias. /// -public sealed partial class RolloverRequestDescriptor : RequestDescriptor +public sealed partial class RolloverRequestDescriptor : RequestDescriptor, RolloverRequestParameters> { - internal RolloverRequestDescriptor(Action configure) => configure.Invoke(this); + internal RolloverRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Elastic.Clients.Elasticsearch.Serverless.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) + { + } 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 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? newIndex) + { + RouteValues.Optional("new_index", newIndex); + return Self; + } + + private IDictionary> AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditions? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditionsDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditionsDescriptor descriptor) { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptor = descriptor; + return Self; } - internal RolloverRequestDescriptor() + 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(Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.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(); + } +} + +/// +/// 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, Elastic.Clients.Elasticsearch.Serverless.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) + { + } + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias) : base(r => r.Required("alias", alias)) { } @@ -160,27 +328,27 @@ public RolloverRequestDescriptor Alias(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.Serverless.IndexName? new_index) + public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.Serverless.IndexName? newIndex) { - RouteValues.Optional("new_index", new_index); + RouteValues.Optional("new_index", newIndex); return Self; } - private IDictionary? AliasesValue { get; set; } + 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.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.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) + public RolloverRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -195,7 +363,7 @@ public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.Server return Self; } - public RolloverRequestDescriptor Conditions(RolloverConditionsDescriptor descriptor) + public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditionsDescriptor descriptor) { ConditionsValue = null; ConditionsDescriptorAction = null; @@ -203,7 +371,7 @@ public RolloverRequestDescriptor Conditions(RolloverConditionsDescriptor descrip return Self; } - public RolloverRequestDescriptor Conditions(Action configure) + public RolloverRequestDescriptor Conditions(Action configure) { ConditionsValue = null; ConditionsDescriptor = null; @@ -222,7 +390,7 @@ public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverle return Self; } - public RolloverRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -230,7 +398,7 @@ public RolloverRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descript return Self; } - public RolloverRequestDescriptor Mappings(Action configure) + public RolloverRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -264,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConditionsDescriptorAction is not null) { writer.WritePropertyName("conditions"); - JsonSerializer.Serialize(writer, new RolloverConditionsDescriptor(ConditionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditionsDescriptor(ConditionsDescriptorAction), options); } else if (ConditionsValue is not null) { @@ -280,7 +448,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { 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 index 61018e4ce16..ffdebd2dbda 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/RolloverResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsRequest.g.cs new file mode 100644 index 00000000000..08d029c66c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsRequest.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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 partial class SegmentsRequestParameters : 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 returns a verbose response. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequest : PlainRequest +{ + public SegmentsRequest() + { + } + + public SegmentsRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + /// + /// 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 returns a verbose response. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequestDescriptor : RequestDescriptor, SegmentsRequestParameters> +{ + internal SegmentsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SegmentsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SegmentsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + public SegmentsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SegmentsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SegmentsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SegmentsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SegmentsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequestDescriptor : RequestDescriptor +{ + internal SegmentsRequestDescriptor(Action configure) => configure.Invoke(this); + + public SegmentsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SegmentsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + public SegmentsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SegmentsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SegmentsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SegmentsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SegmentsRequestDescriptor 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/SegmentsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsResponse.g.cs new file mode 100644 index 00000000000..a013b743050 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SegmentsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class SegmentsResponse : ElasticsearchResponse +{ + [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/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs index c02a1e6faf2..79efbc68bc9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -89,7 +89,7 @@ public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Nam /// 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; } + public ICollection? ComposedOf { 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.
@@ -136,10 +136,6 @@ public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serv { } - internal SimulateIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -159,16 +155,16 @@ public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.El } private bool? AllowAutoCreateValue { get; set; } - private ICollection? ComposedOfValue { 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.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action> TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -183,7 +179,7 @@ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? a /// /// 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) + public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) { ComposedOfValue = composedOf; return Self; @@ -200,7 +196,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clie return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -208,7 +204,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVi return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -254,7 +250,7 @@ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Client return Self; } - public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -262,7 +258,7 @@ public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateM return Self; } - public SimulateIndexTemplateRequestDescriptor Template(Action> configure) + public SimulateIndexTemplateRequestDescriptor Template(Action> configure) { TemplateValue = null; TemplateDescriptor = null; @@ -302,7 +298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -336,7 +332,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -344,10 +340,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -362,10 +358,6 @@ public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serv { } - internal SimulateIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -385,16 +377,16 @@ public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch } private bool? AllowAutoCreateValue { get; set; } - private ICollection? ComposedOfValue { 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.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -409,7 +401,7 @@ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCre /// /// 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) + public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) { ComposedOfValue = composedOf; return Self; @@ -426,7 +418,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elastic return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -434,7 +426,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDes return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -480,7 +472,7 @@ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticse return Self; } - public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -488,7 +480,7 @@ public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescr return Self; } - public SimulateIndexTemplateRequestDescriptor Template(Action configure) + public SimulateIndexTemplateRequestDescriptor Template(Action configure) { TemplateValue = null; TemplateDescriptor = null; @@ -528,7 +520,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -562,7 +554,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -570,10 +562,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index a5c1da3114e..4de9f9ad58e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 1c7c82addb7..fdcf88ce839 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -64,7 +64,7 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? na protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - internal override bool SupportsBody => false; + internal override bool SupportsBody => true; internal override string OperationName => "indices.simulate_template"; @@ -85,6 +85,74 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Name? na ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate? Template { get; set; } +} + +/// +/// Returns the index configuration that would be applied by a particular index template. +/// +public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor, SimulateTemplateRequestParameters> +{ + internal SimulateTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SimulateTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + + public SimulateTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + 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; + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } } /// @@ -94,6 +162,10 @@ public sealed partial class SimulateTemplateRequestDescriptor : RequestDescripto { internal SimulateTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public SimulateTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? name) : base(r => r.Optional("name", name)) + { + } + public SimulateTemplateRequestDescriptor() { } @@ -102,7 +174,7 @@ public SimulateTemplateRequestDescriptor() protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - internal override bool SupportsBody => false; + internal override bool SupportsBody => true; internal override string OperationName => "indices.simulate_template"; @@ -116,6 +188,34 @@ public SimulateTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serv return Self; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplate? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { } 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 index 3440141f043..2cc6cb2844c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 632793149da..49c68b1b331 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs @@ -71,7 +71,7 @@ public sealed partial class UpdateAliasesRequest : PlainRequestActions to perform. /// [JsonInclude, JsonPropertyName("actions")] - public ICollection? Actions { get; set; } + public ICollection? Actions { get; set; } } /// @@ -96,15 +96,15 @@ public UpdateAliasesRequestDescriptor() 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; } + private ICollection? ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor ActionsDescriptor { get; set; } + private Action> ActionsDescriptorAction { get; set; } + private Action>[] ActionsDescriptorActions { get; set; } /// /// Actions to perform. /// - public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) { ActionsDescriptor = null; ActionsDescriptorAction = null; @@ -113,7 +113,7 @@ public UpdateAliasesRequestDescriptor Actions(ICollection Actions(ActionDescriptor descriptor) + public UpdateAliasesRequestDescriptor Actions(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor descriptor) { ActionsValue = null; ActionsDescriptorAction = null; @@ -122,7 +122,7 @@ public UpdateAliasesRequestDescriptor Actions(ActionDescriptor Actions(Action> configure) + public UpdateAliasesRequestDescriptor Actions(Action> configure) { ActionsValue = null; ActionsDescriptor = null; @@ -131,7 +131,7 @@ public UpdateAliasesRequestDescriptor Actions(Action Actions(params Action>[] configure) + public UpdateAliasesRequestDescriptor Actions(params Action>[] configure) { ActionsValue = null; ActionsDescriptor = null; @@ -154,7 +154,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("actions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor(ActionsDescriptorAction), options); writer.WriteEndArray(); } else if (ActionsDescriptorActions is not null) @@ -163,7 +163,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ActionsDescriptorActions) { - JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor(action), options); } writer.WriteEndArray(); @@ -200,15 +200,15 @@ public UpdateAliasesRequestDescriptor() 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; } + private ICollection? ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } /// /// Actions to perform. /// - public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) { ActionsDescriptor = null; ActionsDescriptorAction = null; @@ -217,7 +217,7 @@ public UpdateAliasesRequestDescriptor Actions(ICollection configure) + public UpdateAliasesRequestDescriptor Actions(Action configure) { ActionsValue = null; ActionsDescriptor = null; @@ -235,7 +235,7 @@ public UpdateAliasesRequestDescriptor Actions(Action configure return Self; } - public UpdateAliasesRequestDescriptor Actions(params Action[] configure) + public UpdateAliasesRequestDescriptor Actions(params Action[] configure) { ActionsValue = null; ActionsDescriptor = null; @@ -258,7 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("actions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor(ActionsDescriptorAction), options); writer.WriteEndArray(); } else if (ActionsDescriptorActions is not null) @@ -267,7 +267,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ActionsDescriptorActions) { - JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesActionDescriptor(action), options); } writer.WriteEndArray(); 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 index 50663a85e52..123fd553f85 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs new file mode 100644 index 00000000000..4fe608ca493 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryRequest.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.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 partial class ValidateQueryRequestParameters : 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); } + + /// + /// If `true`, the validation is executed on all shards instead of one random shard per index. + /// + public bool? AllShards { get => Q("all_shards"); set => Q("all_shards", 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. + /// + 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); } + + /// + /// 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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, the response returns detailed information if an error has occurred. + /// + public bool? Explain { get => Q("explain"); set => Q("explain", 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. + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Query in the Lucene query string syntax. + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. + /// + public bool? Rewrite { get => Q("rewrite"); set => Q("rewrite", value); } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequest : PlainRequest +{ + public ValidateQueryRequest() + { + } + + public ValidateQueryRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + /// + /// 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); } + + /// + /// If `true`, the validation is executed on all shards instead of one random shard per index. + /// + [JsonIgnore] + public bool? AllShards { get => Q("all_shards"); set => Q("all_shards", 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. + /// + [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); } + + /// + /// 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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, the response returns detailed information if an error has occurred. + /// + [JsonIgnore] + public bool? Explain { get => Q("explain"); set => Q("explain", 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. + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Query in the Lucene query string syntax. + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. + /// + [JsonIgnore] + public bool? Rewrite { get => Q("rewrite"); set => Q("rewrite", value); } + + /// + /// Query in the Lucene query string syntax. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequestDescriptor : RequestDescriptor, ValidateQueryRequestParameters> +{ + internal ValidateQueryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ValidateQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ValidateQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + public ValidateQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ValidateQueryRequestDescriptor AllShards(bool? allShards = true) => Qs("all_shards", allShards); + public ValidateQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public ValidateQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public ValidateQueryRequestDescriptor Df(string? df) => Qs("df", df); + public ValidateQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ValidateQueryRequestDescriptor Explain(bool? explain = true) => Qs("explain", explain); + public ValidateQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ValidateQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public ValidateQueryRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax); + public ValidateQueryRequestDescriptor Rewrite(bool? rewrite = true) => Qs("rewrite", rewrite); + + public ValidateQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + /// + /// Query in the Lucene query string syntax. + /// + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ValidateQueryRequestDescriptor 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequestDescriptor : RequestDescriptor +{ + internal ValidateQueryRequestDescriptor(Action configure) => configure.Invoke(this); + + public ValidateQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ValidateQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + public ValidateQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ValidateQueryRequestDescriptor AllShards(bool? allShards = true) => Qs("all_shards", allShards); + public ValidateQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public ValidateQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public ValidateQueryRequestDescriptor Df(string? df) => Qs("df", df); + public ValidateQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ValidateQueryRequestDescriptor Explain(bool? explain = true) => Qs("explain", explain); + public ValidateQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ValidateQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public ValidateQueryRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax); + public ValidateQueryRequestDescriptor Rewrite(bool? rewrite = true) => Qs("rewrite", rewrite); + + public ValidateQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + /// + /// Query in the Lucene query string syntax. + /// + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ValidateQueryRequestDescriptor 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 Elastic.Clients.Elasticsearch.Serverless.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/IndexManagement/ValidateQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs new file mode 100644 index 00000000000..6d138d626de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexManagement/ValidateQueryResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +public sealed partial class ValidateQueryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + [JsonInclude, JsonPropertyName("explanations")] + public IReadOnlyCollection? Explanations { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("valid")] + public bool Valid { 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 index 316c3c48a1b..b2903384440 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexRequest.g.cs @@ -108,9 +108,6 @@ public IndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : internal override string OperationName => "index"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// Only perform the operation if the document has this primary term. /// @@ -176,6 +173,8 @@ public IndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.Serverless.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + [JsonIgnore] + public TDocument Document { get; set; } } /// @@ -184,25 +183,17 @@ public IndexRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : public sealed partial class IndexRequestDescriptor : RequestDescriptor, IndexRequestParameters> { internal IndexRequestDescriptor(Action> configure) => configure.Invoke(this); + public IndexRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) => DocumentValue = document; - 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(document, typeof(TDocument), Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) { } - 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(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) : this(document, index, Elastic.Clients.Elasticsearch.Serverless.Id.From(document)) { } - public IndexRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName index) : base(r => r.Required("index", index)) - { - } - - internal IndexRequestDescriptor() + public IndexRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Serverless.Id? id) : this(document, typeof(TDocument), id) { } @@ -240,6 +231,12 @@ public IndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ser private TDocument DocumentValue { get; set; } + public IndexRequestDescriptor Document(TDocument document) + { + DocumentValue = document; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs index 1eeb09c52ec..4ae32f9aecf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/IndexResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs index 0eef36535e2..d700df38225 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/InfoResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index e544d8d7fb6..465021f8ed6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineRequest.g.cs @@ -83,10 +83,6 @@ public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal DeletePipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -120,10 +116,6 @@ public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal DeletePipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; 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 index 9ed212dbfd2..88713347b96 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/DeletePipelineResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 98baeee29ac..07620f34dcf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -31,7 +32,7 @@ public sealed partial class GeoIpStatsResponse : ElasticsearchResponse /// Downloaded GeoIP2 databases for each node. /// [JsonInclude, JsonPropertyName("nodes")] - public IReadOnlyDictionary Nodes { get; init; } + public IReadOnlyDictionary Nodes { get; init; } /// /// Download statistics for all GeoIP2 databases. 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 index 3125b3b84b9..fbc44a5ba26 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/GetPipelineRequest.g.cs @@ -83,6 +83,10 @@ public sealed partial class GetPipelineRequestDescriptor : RequestDes { internal GetPipelineRequestDescriptor(Action> configure) => configure.Invoke(this); + public GetPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public GetPipelineRequestDescriptor() { } @@ -116,6 +120,10 @@ public sealed partial class GetPipelineRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public GetPipelineRequestDescriptor() { } 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 index ac4cbd8b13d..ec998cacb5b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index a557b513a63..18ca0dfa72c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineRequest.g.cs @@ -124,10 +124,6 @@ public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal PutPipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -149,13 +145,13 @@ public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch. private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -188,7 +184,7 @@ public PutPipelineRequestDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PutPipelineRequestDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -197,7 +193,7 @@ public PutPipelineRequestDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public PutPipelineRequestDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -206,7 +202,7 @@ public PutPipelineRequestDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PutPipelineRequestDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -227,7 +223,7 @@ public PutPipelineRequestDescriptor Processors(ICollection Processors(ProcessorDescriptor descriptor) + public PutPipelineRequestDescriptor Processors(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { ProcessorsValue = null; ProcessorsDescriptorAction = null; @@ -236,7 +232,7 @@ public PutPipelineRequestDescriptor Processors(ProcessorDescriptor Processors(Action> configure) + public PutPipelineRequestDescriptor Processors(Action> configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -245,7 +241,7 @@ public PutPipelineRequestDescriptor Processors(Action Processors(params Action>[] configure) + public PutPipelineRequestDescriptor Processors(params Action>[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -289,7 +285,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -298,7 +294,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -320,7 +316,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -329,7 +325,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -340,10 +336,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -361,10 +357,6 @@ public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal PutPipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -386,13 +378,13 @@ public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless. private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -425,7 +417,7 @@ public PutPipelineRequestDescriptor OnFailure(ICollection configure) + public PutPipelineRequestDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -443,7 +435,7 @@ public PutPipelineRequestDescriptor OnFailure(Action config return Self; } - public PutPipelineRequestDescriptor OnFailure(params Action[] configure) + public PutPipelineRequestDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -464,7 +456,7 @@ public PutPipelineRequestDescriptor Processors(ICollection configure) + public PutPipelineRequestDescriptor Processors(Action configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -482,7 +474,7 @@ public PutPipelineRequestDescriptor Processors(Action confi return Self; } - public PutPipelineRequestDescriptor Processors(params Action[] configure) + public PutPipelineRequestDescriptor Processors(params Action[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -526,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -535,7 +527,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -557,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -566,7 +558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -577,10 +569,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index 3c2bae1ffa1..35ad144f489 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/PutPipelineResponse.g.cs @@ -20,6 +20,7 @@ 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; 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 index 9dc16af85a2..8ca79dd6b5b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -84,6 +84,10 @@ public sealed partial class SimulateRequestDescriptor : RequestDescri { internal SimulateRequestDescriptor(Action> configure) => configure.Invoke(this); + public SimulateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public SimulateRequestDescriptor() { } @@ -105,12 +109,12 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Ser } private ICollection? DocsValue { get; set; } - private DocumentDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? PipelineValue { get; set; } - private PipelineDescriptor PipelineDescriptor { get; set; } - private Action> PipelineDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor PipelineDescriptor { get; set; } + private Action> PipelineDescriptorAction { get; set; } /// /// Sample documents to test in the pipeline. @@ -124,7 +128,7 @@ public SimulateRequestDescriptor Docs(ICollection Docs(DocumentDescriptor descriptor) + public SimulateRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -133,7 +137,7 @@ public SimulateRequestDescriptor Docs(DocumentDescriptor descriptor) return Self; } - public SimulateRequestDescriptor Docs(Action configure) + public SimulateRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -142,7 +146,7 @@ public SimulateRequestDescriptor Docs(Action conf return Self; } - public SimulateRequestDescriptor Docs(params Action[] configure) + public SimulateRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -162,7 +166,7 @@ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsear return Self; } - public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor descriptor) { PipelineValue = null; PipelineDescriptorAction = null; @@ -170,7 +174,7 @@ public SimulateRequestDescriptor Pipeline(PipelineDescriptor Pipeline(Action> configure) + public SimulateRequestDescriptor Pipeline(Action> configure) { PipelineValue = null; PipelineDescriptor = null; @@ -192,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -201,7 +205,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor(action), options); } writer.WriteEndArray(); @@ -220,7 +224,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PipelineDescriptorAction is not null) { writer.WritePropertyName("pipeline"); - JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor(PipelineDescriptorAction), options); } else if (PipelineValue is not null) { @@ -239,6 +243,10 @@ public sealed partial class SimulateRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public SimulateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public SimulateRequestDescriptor() { } @@ -260,12 +268,12 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? } private ICollection? DocsValue { get; set; } - private DocumentDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.Pipeline? PipelineValue { get; set; } - private PipelineDescriptor PipelineDescriptor { get; set; } - private Action PipelineDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor PipelineDescriptor { get; set; } + private Action PipelineDescriptorAction { get; set; } /// /// Sample documents to test in the pipeline. @@ -279,7 +287,7 @@ public SimulateRequestDescriptor Docs(ICollection configure) + public SimulateRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -297,7 +305,7 @@ public SimulateRequestDescriptor Docs(Action configure) return Self; } - public SimulateRequestDescriptor Docs(params Action[] configure) + public SimulateRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -317,7 +325,7 @@ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverle return Self; } - public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor descriptor) { PipelineValue = null; PipelineDescriptorAction = null; @@ -325,7 +333,7 @@ public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) return Self; } - public SimulateRequestDescriptor Pipeline(Action configure) + public SimulateRequestDescriptor Pipeline(Action configure) { PipelineValue = null; PipelineDescriptor = null; @@ -347,7 +355,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -356,7 +364,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.DocumentDescriptor(action), options); } writer.WriteEndArray(); @@ -375,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PipelineDescriptorAction is not null) { writer.WritePropertyName("pipeline"); - JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineDescriptor(PipelineDescriptorAction), options); } else if (PipelineValue is not null) { 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 index dc6fe27e1cb..6b6ab170490 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs new file mode 100644 index 00000000000..d9a6c108f8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseRequest.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.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.LicenseManagement; + +public sealed partial class GetLicenseRequestParameters : RequestParameters +{ + /// + /// Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// This API returns information about the type of license, when it was issued, and when it expires, for example.
For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
+///
+public sealed partial class GetLicenseRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get"; + + /// + /// Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// This API returns information about the type of license, when it was issued, and when it expires, for example.
For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
+///
+public sealed partial class GetLicenseRequestDescriptor : RequestDescriptor +{ + internal GetLicenseRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetLicenseRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get"; + + public GetLicenseRequestDescriptor Local(bool? local = true) => Qs("local", local); + + 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/LicenseManagement/GetLicenseResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs new file mode 100644 index 00000000000..8fa51607bf7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.LicenseManagement; + +public sealed partial class GetLicenseResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseInformation License { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs new file mode 100644 index 00000000000..b4eb05ebc3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.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.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.MachineLearning; + +public sealed partial class ClearTrainedModelDeploymentCacheRequestParameters : RequestParameters +{ +} + +/// +/// Clears a trained model deployment cache on all nodes where the trained model is assigned.
A trained model deployment may have an inference cache enabled.
As requests are handled by each allocated node, their responses may be cached on that individual node.
Calling this API clears the caches without restarting the deployment.
+///
+public sealed partial class ClearTrainedModelDeploymentCacheRequest : PlainRequest +{ + public ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.clear_trained_model_deployment_cache"; +} + +/// +/// Clears a trained model deployment cache on all nodes where the trained model is assigned.
A trained model deployment may have an inference cache enabled.
As requests are handled by each allocated node, their responses may be cached on that individual node.
Calling this API clears the caches without restarting the deployment.
+///
+public sealed partial class ClearTrainedModelDeploymentCacheRequestDescriptor : RequestDescriptor +{ + internal ClearTrainedModelDeploymentCacheRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearTrainedModelDeploymentCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.clear_trained_model_deployment_cache"; + + public ClearTrainedModelDeploymentCacheRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs new file mode 100644 index 00000000000..85eda28ed17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class ClearTrainedModelDeploymentCacheResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cleared")] + public bool Cleared { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobRequest.g.cs new file mode 100644 index 00000000000..aaee76b3552 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobRequest.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.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.MachineLearning; + +public sealed partial class CloseJobRequestParameters : RequestParameters +{ +} + +/// +/// Closes one or more anomaly detection jobs.
A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.
When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.
If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.
When a datafeed that has a specified end date stops, it automatically closes its associated job.
+///
+public sealed partial class CloseJobRequest : PlainRequest +{ + public CloseJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningCloseJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.close_job"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the descriptiion for the `force` query parameter. + /// + [JsonInclude, JsonPropertyName("force")] + public bool? Force { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } +} + +/// +/// Closes one or more anomaly detection jobs.
A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.
When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.
If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.
When a datafeed that has a specified end date stops, it automatically closes its associated job.
+///
+public sealed partial class CloseJobRequestDescriptor : RequestDescriptor +{ + internal CloseJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public CloseJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningCloseJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.close_job"; + + public CloseJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private bool? ForceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public CloseJobRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the descriptiion for the `force` query parameter. + /// + public CloseJobRequestDescriptor Force(bool? force = true) + { + ForceValue = force; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public CloseJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (ForceValue.HasValue) + { + writer.WritePropertyName("force"); + writer.WriteBooleanValue(ForceValue.Value); + } + + 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/MachineLearning/CloseJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobResponse.g.cs new file mode 100644 index 00000000000..77e3416af09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/CloseJobResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class CloseJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("closed")] + public bool Closed { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs new file mode 100644 index 00000000000..01ce5c83203 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.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.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.MachineLearning; + +public sealed partial class DeleteCalendarEventRequestParameters : RequestParameters +{ +} + +/// +/// Deletes scheduled events from a calendar. +/// +public sealed partial class DeleteCalendarEventRequest : PlainRequest +{ + public DeleteCalendarEventRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id eventId) : base(r => r.Required("calendar_id", calendarId).Required("event_id", eventId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarEvent; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_event"; +} + +/// +/// Deletes scheduled events from a calendar. +/// +public sealed partial class DeleteCalendarEventRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarEventRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarEventRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id eventId) : base(r => r.Required("calendar_id", calendarId).Required("event_id", eventId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarEvent; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_event"; + + public DeleteCalendarEventRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public DeleteCalendarEventRequestDescriptor EventId(Elastic.Clients.Elasticsearch.Serverless.Id eventId) + { + RouteValues.Required("event_id", eventId); + 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/MachineLearning/DeleteCalendarEventResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs new file mode 100644 index 00000000000..f735a8211b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteCalendarEventResponse : 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/MachineLearning/DeleteCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs new file mode 100644 index 00000000000..d8e11d89026 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.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.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.MachineLearning; + +public sealed partial class DeleteCalendarJobRequestParameters : RequestParameters +{ +} + +/// +/// Deletes anomaly detection jobs from a calendar. +/// +public sealed partial class DeleteCalendarJobRequest : PlainRequest +{ + public DeleteCalendarJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Ids jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_job"; +} + +/// +/// Deletes anomaly detection jobs from a calendar. +/// +public sealed partial class DeleteCalendarJobRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Ids jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_job"; + + public DeleteCalendarJobRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public DeleteCalendarJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Ids jobId) + { + RouteValues.Required("job_id", jobId); + 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/MachineLearning/DeleteCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs new file mode 100644 index 00000000000..a82844c284f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteCalendarJobResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs new file mode 100644 index 00000000000..19420077b60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarRequest.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.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.MachineLearning; + +public sealed partial class DeleteCalendarRequestParameters : RequestParameters +{ +} + +/// +/// Removes all scheduled events from a calendar, then deletes it. +/// +public sealed partial class DeleteCalendarRequest : PlainRequest +{ + public DeleteCalendarRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar"; +} + +/// +/// Removes all scheduled events from a calendar, then deletes it. +/// +public sealed partial class DeleteCalendarRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar"; + + public DeleteCalendarRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + 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/MachineLearning/DeleteCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs new file mode 100644 index 00000000000..5c002b69dd5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteCalendarResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteCalendarResponse : 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/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..0a6eab0a2cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.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.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.MachineLearning; + +public sealed partial class DeleteDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// The time to wait for the job to be deleted. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequest : PlainRequest +{ + public DeleteDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + /// + /// If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// The time to wait for the job to be deleted. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequestDescriptor : RequestDescriptor, DeleteDataFrameAnalyticsRequestParameters> +{ + internal DeleteDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + public DeleteDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteDataFrameAnalyticsRequestDescriptor 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 data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal DeleteDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + public DeleteDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteDataFrameAnalyticsRequestDescriptor 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/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..84ad7bbb9ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteDataFrameAnalyticsResponse : 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/MachineLearning/DeleteDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs new file mode 100644 index 00000000000..24b697b980d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedRequest.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.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.MachineLearning; + +public sealed partial class DeleteDatafeedRequestParameters : RequestParameters +{ + /// + /// Use to forcefully delete a started datafeed; this method is quicker than
stopping and deleting the datafeed.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing datafeed. +/// +public sealed partial class DeleteDatafeedRequest : PlainRequest +{ + public DeleteDatafeedRequest(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_datafeed"; + + /// + /// Use to forcefully delete a started datafeed; this method is quicker than
stopping and deleting the datafeed.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing datafeed. +/// +public sealed partial class DeleteDatafeedRequestDescriptor : RequestDescriptor +{ + internal DeleteDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_datafeed"; + + public DeleteDatafeedRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public DeleteDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + 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/MachineLearning/DeleteDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs new file mode 100644 index 00000000000..90ec4a7e54f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteDatafeedResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteDatafeedResponse : 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/MachineLearning/DeleteExpiredDataRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs new file mode 100644 index 00000000000..b2d2cf5f839 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.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.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.MachineLearning; + +public sealed partial class DeleteExpiredDataRequestParameters : RequestParameters +{ +} + +/// +/// Deletes expired and unused machine learning data.
Deletes all job results, model snapshots and forecast data that have exceeded
their retention days period. Machine learning state documents that are not
associated with any job are also deleted.
You can limit the request to a single or set of anomaly detection jobs by
using a job identifier, a group name, a comma-separated list of jobs, or a
wildcard expression. You can delete expired data for all anomaly detection
jobs by using _all, by specifying * as the , or by omitting the
.
+///
+public sealed partial class DeleteExpiredDataRequest : PlainRequest +{ + public DeleteExpiredDataRequest() + { + } + + public DeleteExpiredDataRequest(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteExpiredData; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.delete_expired_data"; + + /// + /// The desired requests per second for the deletion processes. The default
behavior is no throttling.
+ ///
+ [JsonInclude, JsonPropertyName("requests_per_second")] + public float? RequestsPerSecond { get; set; } + + /// + /// How long can the underlying delete processes run until they are canceled. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } +} + +/// +/// Deletes expired and unused machine learning data.
Deletes all job results, model snapshots and forecast data that have exceeded
their retention days period. Machine learning state documents that are not
associated with any job are also deleted.
You can limit the request to a single or set of anomaly detection jobs by
using a job identifier, a group name, a comma-separated list of jobs, or a
wildcard expression. You can delete expired data for all anomaly detection
jobs by using _all, by specifying * as the , or by omitting the
.
+///
+public sealed partial class DeleteExpiredDataRequestDescriptor : RequestDescriptor +{ + internal DeleteExpiredDataRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteExpiredDataRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public DeleteExpiredDataRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteExpiredData; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.delete_expired_data"; + + public DeleteExpiredDataRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + RouteValues.Optional("job_id", jobId); + return Self; + } + + private float? RequestsPerSecondValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// The desired requests per second for the deletion processes. The default
behavior is no throttling.
+ ///
+ public DeleteExpiredDataRequestDescriptor RequestsPerSecond(float? requestsPerSecond) + { + RequestsPerSecondValue = requestsPerSecond; + return Self; + } + + /// + /// How long can the underlying delete processes run until they are canceled. + /// + public DeleteExpiredDataRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestsPerSecondValue.HasValue) + { + writer.WritePropertyName("requests_per_second"); + writer.WriteNumberValue(RequestsPerSecondValue.Value); + } + + 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/MachineLearning/DeleteExpiredDataResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs new file mode 100644 index 00000000000..08048c0922c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class DeleteExpiredDataResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("deleted")] + public bool Deleted { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs new file mode 100644 index 00000000000..b230d569edf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterRequest.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.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.MachineLearning; + +public sealed partial class DeleteFilterRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a filter.
If an anomaly detection job references the filter, you cannot delete the
filter. You must update or delete the job before you can delete the filter.
+///
+public sealed partial class DeleteFilterRequest : PlainRequest +{ + public DeleteFilterRequest(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_filter"; +} + +/// +/// Deletes a filter.
If an anomaly detection job references the filter, you cannot delete the
filter. You must update or delete the job before you can delete the filter.
+///
+public sealed partial class DeleteFilterRequestDescriptor : RequestDescriptor +{ + internal DeleteFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_filter"; + + public DeleteFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Serverless.Id filterId) + { + RouteValues.Required("filter_id", filterId); + 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/MachineLearning/DeleteFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs new file mode 100644 index 00000000000..fc7f0dd4325 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteFilterResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteFilterResponse : 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/MachineLearning/DeleteForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs new file mode 100644 index 00000000000..5e92c925f7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastRequest.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.MachineLearning; + +public sealed partial class DeleteForecastRequestParameters : RequestParameters +{ + /// + /// Specifies whether an error occurs when there are no forecasts. In
particular, if this parameter is set to `false` and there are no
forecasts associated with the job, attempts to delete all forecasts
return an error.
+ ///
+ public bool? AllowNoForecasts { get => Q("allow_no_forecasts"); set => Q("allow_no_forecasts", value); } + + /// + /// Specifies the period of time to wait for the completion of the delete
operation. When this period of time elapses, the API fails and returns an
error.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes forecasts from a machine learning job.
By default, forecasts are retained for 14 days. You can specify a
different retention period with the `expires_in` parameter in the forecast
jobs API. The delete forecast API enables you to delete one or more
forecasts before they expire.
+///
+public sealed partial class DeleteForecastRequest : PlainRequest +{ + public DeleteForecastRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + public DeleteForecastRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id? forecastId) : base(r => r.Required("job_id", jobId).Optional("forecast_id", forecastId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_forecast"; + + /// + /// Specifies whether an error occurs when there are no forecasts. In
particular, if this parameter is set to `false` and there are no
forecasts associated with the job, attempts to delete all forecasts
return an error.
+ ///
+ [JsonIgnore] + public bool? AllowNoForecasts { get => Q("allow_no_forecasts"); set => Q("allow_no_forecasts", value); } + + /// + /// Specifies the period of time to wait for the completion of the delete
operation. When this period of time elapses, the API fails and returns an
error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes forecasts from a machine learning job.
By default, forecasts are retained for 14 days. You can specify a
different retention period with the `expires_in` parameter in the forecast
jobs API. The delete forecast API enables you to delete one or more
forecasts before they expire.
+///
+public sealed partial class DeleteForecastRequestDescriptor : RequestDescriptor +{ + internal DeleteForecastRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id? forecastId) : base(r => r.Required("job_id", jobId).Optional("forecast_id", forecastId)) + { + } + + public DeleteForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_forecast"; + + public DeleteForecastRequestDescriptor AllowNoForecasts(bool? allowNoForecasts = true) => Qs("allow_no_forecasts", allowNoForecasts); + public DeleteForecastRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteForecastRequestDescriptor ForecastId(Elastic.Clients.Elasticsearch.Serverless.Id? forecastId) + { + RouteValues.Optional("forecast_id", forecastId); + return Self; + } + + public DeleteForecastRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/MachineLearning/DeleteForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs new file mode 100644 index 00000000000..6e9d770317f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteForecastResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteForecastResponse : 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/MachineLearning/DeleteJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs new file mode 100644 index 00000000000..c464fd50e74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobRequest.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.MachineLearning; + +public sealed partial class DeleteJobRequestParameters : RequestParameters +{ + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Use to forcefully delete an opened job; this method is quicker than
closing and deleting the job.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Specifies whether the request should return immediately or wait until the
job deletion completes.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Deletes an anomaly detection job. +/// All job configuration, model state and results are deleted.
It is not currently possible to delete multiple jobs using wildcards or a
comma separated list. If you delete a job that has a datafeed, the request
first tries to delete the datafeed. This behavior is equivalent to calling
the delete datafeed API with the same timeout and force parameters as the
delete job request.
+///
+public sealed partial class DeleteJobRequest : PlainRequest +{ + public DeleteJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_job"; + + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ [JsonIgnore] + public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Use to forcefully delete an opened job; this method is quicker than
closing and deleting the job.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Specifies whether the request should return immediately or wait until the
job deletion completes.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Deletes an anomaly detection job. +/// All job configuration, model state and results are deleted.
It is not currently possible to delete multiple jobs using wildcards or a
comma separated list. If you delete a job that has a datafeed, the request
first tries to delete the datafeed. This behavior is equivalent to calling
the delete datafeed API with the same timeout and force parameters as the
delete job request.
+///
+public sealed partial class DeleteJobRequestDescriptor : RequestDescriptor +{ + internal DeleteJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_job"; + + public DeleteJobRequestDescriptor DeleteUserAnnotations(bool? deleteUserAnnotations = true) => Qs("delete_user_annotations", deleteUserAnnotations); + public DeleteJobRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public DeleteJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/MachineLearning/DeleteJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs new file mode 100644 index 00000000000..4eb74ad477f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteJobResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteJobResponse : 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/MachineLearning/DeleteModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..3ac45cef101 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.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.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.MachineLearning; + +public sealed partial class DeleteModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing model snapshot.
You cannot delete the active model snapshot. To delete that snapshot, first
revert to a different one. To identify the active model snapshot, refer to
the `model_snapshot_id` in the results from the get jobs API.
+///
+public sealed partial class DeleteModelSnapshotRequest : PlainRequest +{ + public DeleteModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_model_snapshot"; +} + +/// +/// Deletes an existing model snapshot.
You cannot delete the active model snapshot. To delete that snapshot, first
revert to a different one. To identify the active model snapshot, refer to
the `model_snapshot_id` in the results from the get jobs API.
+///
+public sealed partial class DeleteModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal DeleteModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_model_snapshot"; + + public DeleteModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public DeleteModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/MachineLearning/DeleteModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..e96b54fe6cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteModelSnapshotResponse : 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/MachineLearning/DeleteTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs new file mode 100644 index 00000000000..ac5c2ffa128 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.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.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.MachineLearning; + +public sealed partial class DeleteTrainedModelAliasRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a trained model alias.
This API deletes an existing model alias that refers to a trained model. If
the model alias is missing or refers to a model other than the one identified
by the `model_id`, this API returns an error.
+///
+public sealed partial class DeleteTrainedModelAliasRequest : PlainRequest +{ + public DeleteTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model_alias"; +} + +/// +/// Deletes a trained model alias.
This API deletes an existing model alias that refers to a trained model. If
the model alias is missing or refers to a model other than the one identified
by the `model_id`, this API returns an error.
+///
+public sealed partial class DeleteTrainedModelAliasRequestDescriptor : RequestDescriptor +{ + internal DeleteTrainedModelAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTrainedModelAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model_alias"; + + public DeleteTrainedModelAliasRequestDescriptor ModelAlias(Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) + { + RouteValues.Required("model_alias", modelAlias); + return Self; + } + + public DeleteTrainedModelAliasRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/DeleteTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs new file mode 100644 index 00000000000..d2a780e8327 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteTrainedModelAliasResponse : 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/MachineLearning/DeleteTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs new file mode 100644 index 00000000000..c92107b21ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.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.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.MachineLearning; + +public sealed partial class DeleteTrainedModelRequestParameters : RequestParameters +{ + /// + /// Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing trained inference model that is currently not referenced
by an ingest pipeline.
+///
+public sealed partial class DeleteTrainedModelRequest : PlainRequest +{ + public DeleteTrainedModelRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model"; + + /// + /// Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing trained inference model that is currently not referenced
by an ingest pipeline.
+///
+public sealed partial class DeleteTrainedModelRequestDescriptor : RequestDescriptor +{ + internal DeleteTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model"; + + public DeleteTrainedModelRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public DeleteTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/DeleteTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs new file mode 100644 index 00000000000..1a66b2256b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DeleteTrainedModelResponse : 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/MachineLearning/EstimateModelMemoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs new file mode 100644 index 00000000000..b446bdd8913 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.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.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.MachineLearning; + +public sealed partial class EstimateModelMemoryRequestParameters : RequestParameters +{ +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfig { get; set; } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ [JsonInclude, JsonPropertyName("max_bucket_cardinality")] + public IDictionary? MaxBucketCardinality { get; set; } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ [JsonInclude, JsonPropertyName("overall_cardinality")] + public IDictionary? OverallCardinality { get; set; } +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequestDescriptor : RequestDescriptor, EstimateModelMemoryRequestParameters> +{ + internal EstimateModelMemoryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public EstimateModelMemoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private IDictionary? MaxBucketCardinalityValue { get; set; } + private IDictionary? OverallCardinalityValue { get; set; } + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ public EstimateModelMemoryRequestDescriptor MaxBucketCardinality(Func, FluentDictionary> selector) + { + MaxBucketCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ public EstimateModelMemoryRequestDescriptor OverallCardinality(Func, FluentDictionary> selector) + { + OverallCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (MaxBucketCardinalityValue is not null) + { + writer.WritePropertyName("max_bucket_cardinality"); + JsonSerializer.Serialize(writer, MaxBucketCardinalityValue, options); + } + + if (OverallCardinalityValue is not null) + { + writer.WritePropertyName("overall_cardinality"); + JsonSerializer.Serialize(writer, OverallCardinalityValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequestDescriptor : RequestDescriptor +{ + internal EstimateModelMemoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public EstimateModelMemoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private IDictionary? MaxBucketCardinalityValue { get; set; } + private IDictionary? OverallCardinalityValue { get; set; } + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ public EstimateModelMemoryRequestDescriptor MaxBucketCardinality(Func, FluentDictionary> selector) + { + MaxBucketCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ public EstimateModelMemoryRequestDescriptor OverallCardinality(Func, FluentDictionary> selector) + { + OverallCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (MaxBucketCardinalityValue is not null) + { + writer.WritePropertyName("max_bucket_cardinality"); + JsonSerializer.Serialize(writer, MaxBucketCardinalityValue, options); + } + + if (OverallCardinalityValue is not null) + { + writer.WritePropertyName("overall_cardinality"); + JsonSerializer.Serialize(writer, OverallCardinalityValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs new file mode 100644 index 00000000000..922869af4c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class EstimateModelMemoryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("model_memory_estimate")] + public string ModelMemoryEstimate { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs new file mode 100644 index 00000000000..95ed639c19e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs @@ -0,0 +1,328 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class EvaluateDataFrameRequestParameters : RequestParameters +{ +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + /// + /// Defines the type of evaluation you want to perform. + /// + [JsonInclude, JsonPropertyName("evaluation")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation Evaluation { get; set; } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequestDescriptor : RequestDescriptor, EvaluateDataFrameRequestParameters> +{ + internal EvaluateDataFrameRequestDescriptor(Action> configure) => configure.Invoke(this); + + public EvaluateDataFrameRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation EvaluationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor EvaluationDescriptor { get; set; } + private Action> EvaluationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + /// + /// Defines the type of evaluation you want to perform. + /// + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation evaluation) + { + EvaluationDescriptor = null; + EvaluationDescriptorAction = null; + EvaluationValue = evaluation; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor descriptor) + { + EvaluationValue = null; + EvaluationDescriptorAction = null; + EvaluationDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Action> configure) + { + EvaluationValue = null; + EvaluationDescriptor = null; + EvaluationDescriptorAction = configure; + return Self; + } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + public EvaluateDataFrameRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EvaluationDescriptor is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationDescriptor, options); + } + else if (EvaluationDescriptorAction is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor(EvaluationDescriptorAction), options); + } + else + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationValue, options); + } + + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequestDescriptor : RequestDescriptor +{ + internal EvaluateDataFrameRequestDescriptor(Action configure) => configure.Invoke(this); + + public EvaluateDataFrameRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation EvaluationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor EvaluationDescriptor { get; set; } + private Action EvaluationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + /// + /// Defines the type of evaluation you want to perform. + /// + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation evaluation) + { + EvaluationDescriptor = null; + EvaluationDescriptorAction = null; + EvaluationValue = evaluation; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor descriptor) + { + EvaluationValue = null; + EvaluationDescriptorAction = null; + EvaluationDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Action configure) + { + EvaluationValue = null; + EvaluationDescriptor = null; + EvaluationDescriptorAction = configure; + return Self; + } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + public EvaluateDataFrameRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EvaluationDescriptor is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationDescriptor, options); + } + else if (EvaluationDescriptorAction is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationDescriptor(EvaluationDescriptorAction), options); + } + else + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationValue, options); + } + + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.Serverless.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/MachineLearning/EvaluateDataFrameResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs new file mode 100644 index 00000000000..79a1888b49d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class EvaluateDataFrameResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("classification")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeClassificationSummary? Classification { get; init; } + [JsonInclude, JsonPropertyName("outlier_detection")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeOutlierDetectionSummary? OutlierDetection { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeRegressionSummary? Regression { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..3756849d456 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,674 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class ExplainDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequest : PlainRequest +{ + public ExplainDataFrameAnalyticsRequest() + { + } + + public ExplainDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis? Analysis { get; set; } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination? Dest { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource? Source { get; set; } +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequestDescriptor : RequestDescriptor, ExplainDataFrameAnalyticsRequestParameters> +{ + internal ExplainDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExplainDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public ExplainDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + public ExplainDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis? AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action> DestDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public ExplainDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Action> configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal ExplainDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExplainDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public ExplainDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + public ExplainDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis? AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public ExplainDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + 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/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..9c3180f4131 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class ExplainDataFrameAnalyticsResponse : ElasticsearchResponse +{ + /// + /// An array of objects that explain selection for each field, sorted by the field names. + /// + [JsonInclude, JsonPropertyName("field_selection")] + public IReadOnlyCollection FieldSelection { get; init; } + + /// + /// An array of objects that explain selection for each field, sorted by the field names. + /// + [JsonInclude, JsonPropertyName("memory_estimation")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsMemoryEstimation MemoryEstimation { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobRequest.g.cs new file mode 100644 index 00000000000..c86ba901022 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobRequest.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.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.MachineLearning; + +public sealed partial class FlushJobRequestParameters : RequestParameters +{ +} + +/// +/// Forces any buffered data to be processed by the job.
The flush jobs API is only applicable when sending data for analysis using
the post data API. Depending on the content of the buffer, then it might
additionally calculate new results. Both flush and close operations are
similar, however the flush is more efficient if you are expecting to send
more data for analysis. When flushing, the job remains open and is available
to continue analyzing data. A close operation additionally prunes and
persists the model state to disk and the job must be opened again before
analyzing further data.
+///
+public sealed partial class FlushJobRequest : PlainRequest +{ + public FlushJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningFlushJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.flush_job"; + + /// + /// Refer to the description for the `advance_time` query parameter. + /// + [JsonInclude, JsonPropertyName("advance_time")] + public DateTimeOffset? AdvanceTime { get; set; } + + /// + /// Refer to the description for the `calc_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("calc_interim")] + public bool? CalcInterim { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `skip_time` query parameter. + /// + [JsonInclude, JsonPropertyName("skip_time")] + public DateTimeOffset? SkipTime { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Forces any buffered data to be processed by the job.
The flush jobs API is only applicable when sending data for analysis using
the post data API. Depending on the content of the buffer, then it might
additionally calculate new results. Both flush and close operations are
similar, however the flush is more efficient if you are expecting to send
more data for analysis. When flushing, the job remains open and is available
to continue analyzing data. A close operation additionally prunes and
persists the model state to disk and the job must be opened again before
analyzing further data.
+///
+public sealed partial class FlushJobRequestDescriptor : RequestDescriptor +{ + internal FlushJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public FlushJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningFlushJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.flush_job"; + + public FlushJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private DateTimeOffset? AdvanceTimeValue { get; set; } + private bool? CalcInterimValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private DateTimeOffset? SkipTimeValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `advance_time` query parameter. + /// + public FlushJobRequestDescriptor AdvanceTime(DateTimeOffset? advanceTime) + { + AdvanceTimeValue = advanceTime; + return Self; + } + + /// + /// Refer to the description for the `calc_interim` query parameter. + /// + public FlushJobRequestDescriptor CalcInterim(bool? calcInterim = true) + { + CalcInterimValue = calcInterim; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public FlushJobRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `skip_time` query parameter. + /// + public FlushJobRequestDescriptor SkipTime(DateTimeOffset? skipTime) + { + SkipTimeValue = skipTime; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public FlushJobRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AdvanceTimeValue is not null) + { + writer.WritePropertyName("advance_time"); + JsonSerializer.Serialize(writer, AdvanceTimeValue, options); + } + + if (CalcInterimValue.HasValue) + { + writer.WritePropertyName("calc_interim"); + writer.WriteBooleanValue(CalcInterimValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (SkipTimeValue is not null) + { + writer.WritePropertyName("skip_time"); + JsonSerializer.Serialize(writer, SkipTimeValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobResponse.g.cs new file mode 100644 index 00000000000..19500b55ae4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/FlushJobResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class FlushJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("flushed")] + public bool Flushed { get; init; } + + /// + /// Provides the timestamp (in milliseconds since the epoch) of the end of
the last bucket that was processed.
+ ///
+ [JsonInclude, JsonPropertyName("last_finalized_bucket_end")] + public int? LastFinalizedBucketEnd { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastRequest.g.cs new file mode 100644 index 00000000000..74690d7a614 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastRequest.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.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.MachineLearning; + +public sealed partial class ForecastRequestParameters : RequestParameters +{ +} + +/// +/// Predicts the future behavior of a time series by using its historical
behavior.
+/// Forecasts are not supported for jobs that perform population analysis; an
error occurs if you try to create a forecast for a job that has an
`over_field_name` in its configuration.
+///
+public sealed partial class ForecastRequest : PlainRequest +{ + public ForecastRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.forecast"; + + /// + /// Refer to the description for the `duration` query parameter. + /// + [JsonInclude, JsonPropertyName("duration")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Duration { get; set; } + + /// + /// Refer to the description for the `expires_in` query parameter. + /// + [JsonInclude, JsonPropertyName("expires_in")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ExpiresIn { get; set; } + + /// + /// Refer to the description for the `max_model_memory` query parameter. + /// + [JsonInclude, JsonPropertyName("max_model_memory")] + public string? MaxModelMemory { get; set; } +} + +/// +/// Predicts the future behavior of a time series by using its historical
behavior.
+/// Forecasts are not supported for jobs that perform population analysis; an
error occurs if you try to create a forecast for a job that has an
`over_field_name` in its configuration.
+///
+public sealed partial class ForecastRequestDescriptor : RequestDescriptor +{ + internal ForecastRequestDescriptor(Action configure) => configure.Invoke(this); + + public ForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.forecast"; + + public ForecastRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DurationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? ExpiresInValue { get; set; } + private string? MaxModelMemoryValue { get; set; } + + /// + /// Refer to the description for the `duration` query parameter. + /// + public ForecastRequestDescriptor Duration(Elastic.Clients.Elasticsearch.Serverless.Duration? duration) + { + DurationValue = duration; + return Self; + } + + /// + /// Refer to the description for the `expires_in` query parameter. + /// + public ForecastRequestDescriptor ExpiresIn(Elastic.Clients.Elasticsearch.Serverless.Duration? expiresIn) + { + ExpiresInValue = expiresIn; + return Self; + } + + /// + /// Refer to the description for the `max_model_memory` query parameter. + /// + public ForecastRequestDescriptor MaxModelMemory(string? maxModelMemory) + { + MaxModelMemoryValue = maxModelMemory; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DurationValue is not null) + { + writer.WritePropertyName("duration"); + JsonSerializer.Serialize(writer, DurationValue, options); + } + + if (ExpiresInValue is not null) + { + writer.WritePropertyName("expires_in"); + JsonSerializer.Serialize(writer, ExpiresInValue, options); + } + + if (!string.IsNullOrEmpty(MaxModelMemoryValue)) + { + writer.WritePropertyName("max_model_memory"); + writer.WriteStringValue(MaxModelMemoryValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastResponse.g.cs new file mode 100644 index 00000000000..1e1980755b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ForecastResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class ForecastResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("forecast_id")] + public string ForecastId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs new file mode 100644 index 00000000000..c6613e39a3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs @@ -0,0 +1,559 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetBucketsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of buckets. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of buckets to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequest : PlainRequest +{ + public GetBucketsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + /// + /// Skips the specified number of buckets. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of buckets to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + [JsonInclude, JsonPropertyName("anomaly_score")] + public double? AnomalyScore { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + + /// + /// Refer to the description for the `expand` query parameter. + /// + [JsonInclude, JsonPropertyName("expand")] + public bool? Expand { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequestDescriptor : RequestDescriptor, GetBucketsRequestParameters> +{ + internal GetBucketsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + public GetBucketsRequestDescriptor From(int? from) => Qs("from", from); + public GetBucketsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetBucketsRequestDescriptor Timestamp(DateTimeOffset? timestamp) + { + RouteValues.Optional("timestamp", timestamp); + return Self; + } + + private double? AnomalyScoreValue { get; set; } + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + public GetBucketsRequestDescriptor AnomalyScore(double? anomalyScore) + { + AnomalyScoreValue = anomalyScore; + return Self; + } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetBucketsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `expand` query parameter. + /// + public GetBucketsRequestDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetBucketsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnomalyScoreValue.HasValue) + { + writer.WritePropertyName("anomaly_score"); + writer.WriteNumberValue(AnomalyScoreValue.Value); + } + + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequestDescriptor : RequestDescriptor +{ + internal GetBucketsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + public GetBucketsRequestDescriptor From(int? from) => Qs("from", from); + public GetBucketsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetBucketsRequestDescriptor Timestamp(DateTimeOffset? timestamp) + { + RouteValues.Optional("timestamp", timestamp); + return Self; + } + + private double? AnomalyScoreValue { get; set; } + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + public GetBucketsRequestDescriptor AnomalyScore(double? anomalyScore) + { + AnomalyScoreValue = anomalyScore; + return Self; + } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetBucketsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `expand` query parameter. + /// + public GetBucketsRequestDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetBucketsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnomalyScoreValue.HasValue) + { + writer.WritePropertyName("anomaly_score"); + writer.WriteNumberValue(AnomalyScoreValue.Value); + } + + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs new file mode 100644 index 00000000000..39a5dfa7a94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetBucketsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetBucketsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs new file mode 100644 index 00000000000..f6ba0d764ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsRequest.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.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.MachineLearning; + +public sealed partial class GetCalendarEventsRequestParameters : RequestParameters +{ + /// + /// Specifies to get events with timestamps earlier than this time. + /// + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// Skips the specified number of events. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of `_all` or `*`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get => Q("job_id"); set => Q("job_id", value); } + + /// + /// Specifies the maximum number of events to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies to get events with timestamps after this time. + /// + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves information about the scheduled events in calendars. +/// +public sealed partial class GetCalendarEventsRequest : PlainRequest +{ + public GetCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_calendar_events"; + + /// + /// Specifies to get events with timestamps earlier than this time. + /// + [JsonIgnore] + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// Skips the specified number of events. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of `_all` or `*`. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get => Q("job_id"); set => Q("job_id", value); } + + /// + /// Specifies the maximum number of events to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies to get events with timestamps after this time. + /// + [JsonIgnore] + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves information about the scheduled events in calendars. +/// +public sealed partial class GetCalendarEventsRequestDescriptor : RequestDescriptor +{ + internal GetCalendarEventsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCalendarEventsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_calendar_events"; + + public GetCalendarEventsRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetCalendarEventsRequestDescriptor From(int? from) => Qs("from", from); + public GetCalendarEventsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) => Qs("job_id", jobId); + public GetCalendarEventsRequestDescriptor Size(int? size) => Qs("size", size); + public GetCalendarEventsRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetCalendarEventsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + 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/MachineLearning/GetCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs new file mode 100644 index 00000000000..e283a01a1d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarEventsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetCalendarEventsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("events")] + public IReadOnlyCollection Events { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs new file mode 100644 index 00000000000..caae5056ccc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetCalendarsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for calendars. +/// +public sealed partial class GetCalendarsRequest : PlainRequest +{ + public GetCalendarsRequest() + { + } + + public GetCalendarsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? calendarId) : base(r => r.Optional("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendars; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_calendars"; + + /// + /// Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// This object is supported only when you omit the calendar identifier. + /// + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves configuration information for calendars. +/// +public sealed partial class GetCalendarsRequestDescriptor : RequestDescriptor +{ + internal GetCalendarsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCalendarsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? calendarId) : base(r => r.Optional("calendar_id", calendarId)) + { + } + + public GetCalendarsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendars; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_calendars"; + + public GetCalendarsRequestDescriptor From(int? from) => Qs("from", from); + public GetCalendarsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetCalendarsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id? calendarId) + { + RouteValues.Optional("calendar_id", calendarId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// This object is supported only when you omit the calendar identifier. + /// + public GetCalendarsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetCalendarsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetCalendarsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs new file mode 100644 index 00000000000..afda50d69dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCalendarsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetCalendarsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("calendars")] + public IReadOnlyCollection Calendars { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs new file mode 100644 index 00000000000..ba229b71162 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesRequest.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.MachineLearning; + +public sealed partial class GetCategoriesRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of categories. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Only return categories for the specified partition. + /// + public string? PartitionFieldValue { get => Q("partition_field_value"); set => Q("partition_field_value", value); } + + /// + /// Specifies the maximum number of categories to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more categories. +/// +public sealed partial class GetCategoriesRequest : PlainRequest +{ + public GetCategoriesRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, string? categoryId) : base(r => r.Required("job_id", jobId).Optional("category_id", categoryId)) + { + } + + public GetCategoriesRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCategories; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_categories"; + + /// + /// Skips the specified number of categories. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Only return categories for the specified partition. + /// + [JsonIgnore] + public string? PartitionFieldValue { get => Q("partition_field_value"); set => Q("partition_field_value", value); } + + /// + /// Specifies the maximum number of categories to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more categories. +/// +public sealed partial class GetCategoriesRequestDescriptor : RequestDescriptor +{ + internal GetCategoriesRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCategoriesRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, string? categoryId) : base(r => r.Required("job_id", jobId).Optional("category_id", categoryId)) + { + } + + public GetCategoriesRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCategories; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_categories"; + + public GetCategoriesRequestDescriptor From(int? from) => Qs("from", from); + public GetCategoriesRequestDescriptor PartitionFieldValue(string? partitionFieldValue) => Qs("partition_field_value", partitionFieldValue); + public GetCategoriesRequestDescriptor Size(int? size) => Qs("size", size); + + public GetCategoriesRequestDescriptor CategoryId(string? categoryId) + { + RouteValues.Optional("category_id", categoryId); + return Self; + } + + public GetCategoriesRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetCategoriesRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetCategoriesRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetCategoriesRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs new file mode 100644 index 00000000000..024ea36bf85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetCategoriesResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetCategoriesResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("categories")] + public IReadOnlyCollection Categories { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..b8ea46835d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.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.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.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequest : PlainRequest +{ + public GetDataFrameAnalyticsRequest() + { + } + + public GetDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequestDescriptor : RequestDescriptor, GetDataFrameAnalyticsRequestParameters> +{ + internal GetDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + public GetDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetDataFrameAnalyticsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal GetDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + public GetDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetDataFrameAnalyticsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetDataFrameAnalyticsRequestDescriptor 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/MachineLearning/GetDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..62d0b94ac6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of data frame analytics job resources, which are sorted by the id value in ascending order. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public IReadOnlyCollection DataFrameAnalytics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs new file mode 100644 index 00000000000..283e758f281 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.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.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.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Defines whether the stats response should be verbose. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequest : PlainRequest +{ + public GetDataFrameAnalyticsStatsRequest() + { + } + + public GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Defines whether the stats response should be verbose. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequestDescriptor : RequestDescriptor, GetDataFrameAnalyticsStatsRequestParameters> +{ + internal GetDataFrameAnalyticsStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + public GetDataFrameAnalyticsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsStatsRequestDescriptor Size(int? size) => Qs("size", size); + public GetDataFrameAnalyticsStatsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetDataFrameAnalyticsStatsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequestDescriptor : RequestDescriptor +{ + internal GetDataFrameAnalyticsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + public GetDataFrameAnalyticsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsStatsRequestDescriptor Size(int? size) => Qs("size", size); + public GetDataFrameAnalyticsStatsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetDataFrameAnalyticsStatsRequestDescriptor 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/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs new file mode 100644 index 00000000000..b486c4baed5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public IReadOnlyCollection DataFrameAnalytics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs new file mode 100644 index 00000000000..153716021fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.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.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.MachineLearning; + +public sealed partial class GetDatafeedStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for datafeeds.
You can get statistics for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get statistics for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``. If the datafeed is stopped, the
only information you receive is the `datafeed_id` and the `state`.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedStatsRequest : PlainRequest +{ + public GetDatafeedStatsRequest() + { + } + + public GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeedStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeed_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for datafeeds.
You can get statistics for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get statistics for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``. If the datafeed is stopped, the
only information you receive is the `datafeed_id` and the `state`.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedStatsRequestDescriptor : RequestDescriptor +{ + internal GetDatafeedStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDatafeedStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + public GetDatafeedStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeedStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeed_stats"; + + public GetDatafeedStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetDatafeedStatsRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) + { + RouteValues.Optional("datafeed_id", datafeedId); + 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/MachineLearning/GetDatafeedStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs new file mode 100644 index 00000000000..cc43d913335 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetDatafeedStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyCollection Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs new file mode 100644 index 00000000000..ab800e2708c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsRequest.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.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.MachineLearning; + +public sealed partial class GetDatafeedsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for datafeeds.
You can get information for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get information for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedsRequest : PlainRequest +{ + public GetDatafeedsRequest() + { + } + + public GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeeds"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for datafeeds.
You can get information for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get information for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedsRequestDescriptor : RequestDescriptor +{ + internal GetDatafeedsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDatafeedsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + public GetDatafeedsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeeds"; + + public GetDatafeedsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDatafeedsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + + public GetDatafeedsRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Ids? datafeedId) + { + RouteValues.Optional("datafeed_id", datafeedId); + 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/MachineLearning/GetDatafeedsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs new file mode 100644 index 00000000000..caa45e6562a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetDatafeedsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetDatafeedsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyCollection Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs new file mode 100644 index 00000000000..c351ac06be9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetFiltersRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of filters. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of filters to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves filters.
You can get a single filter or all filters.
+///
+public sealed partial class GetFiltersRequest : PlainRequest +{ + public GetFiltersRequest() + { + } + + public GetFiltersRequest(Elastic.Clients.Elasticsearch.Serverless.Ids? filterId) : base(r => r.Optional("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetFilters; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_filters"; + + /// + /// Skips the specified number of filters. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of filters to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves filters.
You can get a single filter or all filters.
+///
+public sealed partial class GetFiltersRequestDescriptor : RequestDescriptor +{ + internal GetFiltersRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetFiltersRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids? filterId) : base(r => r.Optional("filter_id", filterId)) + { + } + + public GetFiltersRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetFilters; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_filters"; + + public GetFiltersRequestDescriptor From(int? from) => Qs("from", from); + public GetFiltersRequestDescriptor Size(int? size) => Qs("size", size); + + public GetFiltersRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Serverless.Ids? filterId) + { + RouteValues.Optional("filter_id", filterId); + 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/MachineLearning/GetFiltersResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs new file mode 100644 index 00000000000..428014f53fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetFiltersResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetFiltersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("filters")] + public IReadOnlyCollection Filters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs new file mode 100644 index 00000000000..80accaa1352 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs @@ -0,0 +1,321 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetInfluencersRequestParameters : RequestParameters +{ + /// + /// If true, the results are sorted in descending order. + /// + public bool? Desc { get => Q("desc"); set => Q("desc", value); } + + /// + /// Returns influencers with timestamps earlier than this time.
The default value means it is unset and results are not limited to
specific timestamps.
+ ///
+ public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// If true, the output excludes interim results. By default, interim results
are included.
+ ///
+ public bool? ExcludeInterim { get => Q("exclude_interim"); set => Q("exclude_interim", value); } + + /// + /// Skips the specified number of influencers. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Returns influencers with anomaly scores greater than or equal to this
value.
+ ///
+ public double? InfluencerScore { get => Q("influencer_score"); set => Q("influencer_score", value); } + + /// + /// Specifies the maximum number of influencers to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies the sort field for the requested influencers. By default, the
influencers are sorted by the `influencer_score` value.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Returns influencers with timestamps after this time. The default value
means it is unset and results are not limited to specific timestamps.
+ ///
+ public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequest : PlainRequest +{ + public GetInfluencersRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + /// + /// If true, the results are sorted in descending order. + /// + [JsonIgnore] + public bool? Desc { get => Q("desc"); set => Q("desc", value); } + + /// + /// Returns influencers with timestamps earlier than this time.
The default value means it is unset and results are not limited to
specific timestamps.
+ ///
+ [JsonIgnore] + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// If true, the output excludes interim results. By default, interim results
are included.
+ ///
+ [JsonIgnore] + public bool? ExcludeInterim { get => Q("exclude_interim"); set => Q("exclude_interim", value); } + + /// + /// Skips the specified number of influencers. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Returns influencers with anomaly scores greater than or equal to this
value.
+ ///
+ [JsonIgnore] + public double? InfluencerScore { get => Q("influencer_score"); set => Q("influencer_score", value); } + + /// + /// Specifies the maximum number of influencers to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies the sort field for the requested influencers. By default, the
influencers are sorted by the `influencer_score` value.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Field? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Returns influencers with timestamps after this time. The default value
means it is unset and results are not limited to specific timestamps.
+ ///
+ [JsonIgnore] + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequestDescriptor : RequestDescriptor, GetInfluencersRequestParameters> +{ + internal GetInfluencersRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetInfluencersRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + public GetInfluencersRequestDescriptor Desc(bool? desc = true) => Qs("desc", desc); + public GetInfluencersRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetInfluencersRequestDescriptor ExcludeInterim(bool? excludeInterim = true) => Qs("exclude_interim", excludeInterim); + public GetInfluencersRequestDescriptor From(int? from) => Qs("from", from); + public GetInfluencersRequestDescriptor InfluencerScore(double? influencerScore) => Qs("influencer_score", influencerScore); + public GetInfluencersRequestDescriptor Size(int? size) => Qs("size", size); + public GetInfluencersRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) => Qs("sort", sort); + public GetInfluencersRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetInfluencersRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequestDescriptor : RequestDescriptor +{ + internal GetInfluencersRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetInfluencersRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + public GetInfluencersRequestDescriptor Desc(bool? desc = true) => Qs("desc", desc); + public GetInfluencersRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetInfluencersRequestDescriptor ExcludeInterim(bool? excludeInterim = true) => Qs("exclude_interim", excludeInterim); + public GetInfluencersRequestDescriptor From(int? from) => Qs("from", from); + public GetInfluencersRequestDescriptor InfluencerScore(double? influencerScore) => Qs("influencer_score", influencerScore); + public GetInfluencersRequestDescriptor Size(int? size) => Qs("size", size); + public GetInfluencersRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) => Qs("sort", sort); + public GetInfluencersRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetInfluencersRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs new file mode 100644 index 00000000000..cc5f7cffd68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetInfluencersResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetInfluencersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// Array of influencer objects + /// + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs new file mode 100644 index 00000000000..d7626f9d975 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsRequest.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.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.MachineLearning; + +public sealed partial class GetJobStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If `true`, the API returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If `false`, the API returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection jobs. +/// +public sealed partial class GetJobStatsRequest : PlainRequest +{ + public GetJobStatsRequest() + { + } + + public GetJobStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_job_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If `true`, the API returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If `false`, the API returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection jobs. +/// +public sealed partial class GetJobStatsRequestDescriptor : RequestDescriptor +{ + internal GetJobStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetJobStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public GetJobStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_job_stats"; + + public GetJobStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetJobStatsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + RouteValues.Optional("job_id", jobId); + 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/MachineLearning/GetJobStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs new file mode 100644 index 00000000000..52145377e72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetJobStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsRequest.g.cs new file mode 100644 index 00000000000..e014c800e2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsRequest.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.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.MachineLearning; + +public sealed partial class GetJobsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If this parameter is `false`, the request returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for anomaly detection jobs.
You can get information for multiple anomaly detection jobs in a single API
request by using a group name, a comma-separated list of jobs, or a wildcard
expression. You can get information for all anomaly detection jobs by using
`_all`, by specifying `*` as the ``, or by omitting the ``.
+///
+public sealed partial class GetJobsRequest : PlainRequest +{ + public GetJobsRequest() + { + } + + public GetJobsRequest(Elastic.Clients.Elasticsearch.Serverless.Ids? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_jobs"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If this parameter is `false`, the request returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for anomaly detection jobs.
You can get information for multiple anomaly detection jobs in a single API
request by using a group name, a comma-separated list of jobs, or a wildcard
expression. You can get information for all anomaly detection jobs by using
`_all`, by specifying `*` as the ``, or by omitting the ``.
+///
+public sealed partial class GetJobsRequestDescriptor : RequestDescriptor +{ + internal GetJobsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetJobsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public GetJobsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_jobs"; + + public GetJobsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetJobsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + + public GetJobsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Ids? jobId) + { + RouteValues.Optional("job_id", jobId); + 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/MachineLearning/GetJobsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsResponse.g.cs new file mode 100644 index 00000000000..c49c0f0fc55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetJobsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetJobsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs new file mode 100644 index 00000000000..19d06374b9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetMemoryStatsRequestParameters : 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); } +} + +/// +/// Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
+///
+public sealed partial class GetMemoryStatsRequest : PlainRequest +{ + public GetMemoryStatsRequest() + { + } + + public GetMemoryStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetMemoryStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_memory_stats"; + + /// + /// 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); } +} + +/// +/// Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
+///
+public sealed partial class GetMemoryStatsRequestDescriptor : RequestDescriptor +{ + internal GetMemoryStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetMemoryStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public GetMemoryStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetMemoryStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_memory_stats"; + + public GetMemoryStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetMemoryStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public GetMemoryStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.Id? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/MachineLearning/GetMemoryStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs new file mode 100644 index 00000000000..5160f398936 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetMemoryStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetMemoryStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics NodeStatistics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs new file mode 100644 index 00000000000..4cdb0468e27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.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.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.MachineLearning; + +public sealed partial class GetModelSnapshotUpgradeStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no jobs that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty jobs array when there are no matches and the subset of results
when there are partial matches. If this parameter is false, the request returns a 404 status code when there are
no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection job model snapshot upgrades. +/// +public sealed partial class GetModelSnapshotUpgradeStatsRequest : PlainRequest +{ + public GetModelSnapshotUpgradeStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshotUpgradeStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_model_snapshot_upgrade_stats"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no jobs that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty jobs array when there are no matches and the subset of results
when there are partial matches. If this parameter is false, the request returns a 404 status code when there are
no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection job model snapshot upgrades. +/// +public sealed partial class GetModelSnapshotUpgradeStatsRequestDescriptor : RequestDescriptor +{ + internal GetModelSnapshotUpgradeStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetModelSnapshotUpgradeStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshotUpgradeStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_model_snapshot_upgrade_stats"; + + public GetModelSnapshotUpgradeStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetModelSnapshotUpgradeStatsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotUpgradeStatsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs new file mode 100644 index 00000000000..da5c014af7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetModelSnapshotUpgradeStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_upgrades")] + public IReadOnlyCollection ModelSnapshotUpgrades { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs new file mode 100644 index 00000000000..e78f9daa3dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs @@ -0,0 +1,445 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetModelSnapshotsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of snapshots. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of snapshots to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequest : PlainRequest +{ + public GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + /// + /// Skips the specified number of snapshots. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of snapshots to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the description for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequestDescriptor : RequestDescriptor, GetModelSnapshotsRequestParameters> +{ + internal GetModelSnapshotsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + public GetModelSnapshotsRequestDescriptor From(int? from) => Qs("from", from); + public GetModelSnapshotsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetModelSnapshotsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id? snapshotId) + { + RouteValues.Optional("snapshot_id", snapshotId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetModelSnapshotsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequestDescriptor : RequestDescriptor +{ + internal GetModelSnapshotsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + public GetModelSnapshotsRequestDescriptor From(int? from) => Qs("from", from); + public GetModelSnapshotsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetModelSnapshotsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id? snapshotId) + { + RouteValues.Optional("snapshot_id", snapshotId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetModelSnapshotsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs new file mode 100644 index 00000000000..080fdc6766e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetModelSnapshotsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("model_snapshots")] + public IReadOnlyCollection ModelSnapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs new file mode 100644 index 00000000000..ac767207b2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs @@ -0,0 +1,241 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class GetOverallBucketsRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves overall bucket results that summarize the bucket results of
multiple anomaly detection jobs.
+/// The `overall_score` is calculated by combining the scores of all the
buckets within the overall bucket span. First, the maximum
`anomaly_score` per anomaly detection job in the overall bucket is
calculated. Then the `top_n` of those scores are averaged to result in
the `overall_score`. This means that you can fine-tune the
`overall_score` so that it is more or less sensitive to the number of
jobs that detect an anomaly at the same time. For example, if you set
`top_n` to `1`, the `overall_score` is the maximum bucket score in the
overall bucket. Alternatively, if you set `top_n` to the number of jobs,
the `overall_score` is high only when all jobs detect anomalies in that
overall bucket. If you set the `bucket_span` parameter (to a value
greater than its default), the `overall_score` is the maximum
`overall_score` of the overall buckets that have a span equal to the
jobs' largest bucket span.
+///
+public sealed partial class GetOverallBucketsRequest : PlainRequest +{ + public GetOverallBucketsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetOverallBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_overall_buckets"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the description for the `bucket_span` query parameter. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BucketSpan { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + + /// + /// Refer to the description for the `overall_score` query parameter. + /// + [JsonInclude, JsonPropertyName("overall_score")] + public object? OverallScore { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } + + /// + /// Refer to the description for the `top_n` query parameter. + /// + [JsonInclude, JsonPropertyName("top_n")] + public int? TopN { get; set; } +} + +/// +/// Retrieves overall bucket results that summarize the bucket results of
multiple anomaly detection jobs.
+/// The `overall_score` is calculated by combining the scores of all the
buckets within the overall bucket span. First, the maximum
`anomaly_score` per anomaly detection job in the overall bucket is
calculated. Then the `top_n` of those scores are averaged to result in
the `overall_score`. This means that you can fine-tune the
`overall_score` so that it is more or less sensitive to the number of
jobs that detect an anomaly at the same time. For example, if you set
`top_n` to `1`, the `overall_score` is the maximum bucket score in the
overall bucket. Alternatively, if you set `top_n` to the number of jobs,
the `overall_score` is high only when all jobs detect anomalies in that
overall bucket. If you set the `bucket_span` parameter (to a value
greater than its default), the `overall_score` is the maximum
`overall_score` of the overall buckets that have a span equal to the
jobs' largest bucket span.
+///
+public sealed partial class GetOverallBucketsRequestDescriptor : RequestDescriptor +{ + internal GetOverallBucketsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetOverallBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetOverallBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_overall_buckets"; + + public GetOverallBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? BucketSpanValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private object? OverallScoreValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + private int? TopNValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public GetOverallBucketsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the description for the `bucket_span` query parameter. + /// + public GetOverallBucketsRequestDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Serverless.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetOverallBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetOverallBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `overall_score` query parameter. + /// + public GetOverallBucketsRequestDescriptor OverallScore(object? overallScore) + { + OverallScoreValue = overallScore; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetOverallBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + /// + /// Refer to the description for the `top_n` query parameter. + /// + public GetOverallBucketsRequestDescriptor TopN(int? topN) + { + TopNValue = topN; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (OverallScoreValue is not null) + { + writer.WritePropertyName("overall_score"); + JsonSerializer.Serialize(writer, OverallScoreValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + if (TopNValue.HasValue) + { + writer.WritePropertyName("top_n"); + writer.WriteNumberValue(TopNValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs new file mode 100644 index 00000000000..5415cf2c3bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetOverallBucketsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetOverallBucketsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// Array of overall bucket objects + /// + [JsonInclude, JsonPropertyName("overall_buckets")] + public IReadOnlyCollection OverallBuckets { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs new file mode 100644 index 00000000000..5ddd46f69d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsRequest.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.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.MachineLearning; + +public sealed partial class GetRecordsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of records. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of records to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequest : PlainRequest +{ + public GetRecordsRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + /// + /// Skips the specified number of records. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of records to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + [JsonInclude, JsonPropertyName("record_score")] + public double? RecordScore { get; set; } + + /// + /// Refer to the description for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequestDescriptor : RequestDescriptor, GetRecordsRequestParameters> +{ + internal GetRecordsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetRecordsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + public GetRecordsRequestDescriptor From(int? from) => Qs("from", from); + public GetRecordsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetRecordsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private double? RecordScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetRecordsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetRecordsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetRecordsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetRecordsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + public GetRecordsRequestDescriptor RecordScore(double? recordScore) + { + RecordScoreValue = recordScore; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetRecordsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (RecordScoreValue.HasValue) + { + writer.WritePropertyName("record_score"); + writer.WriteNumberValue(RecordScoreValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequestDescriptor : RequestDescriptor +{ + internal GetRecordsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRecordsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + public GetRecordsRequestDescriptor From(int? from) => Qs("from", from); + public GetRecordsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetRecordsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private double? RecordScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetRecordsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetRecordsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetRecordsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetRecordsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + public GetRecordsRequestDescriptor RecordScore(double? recordScore) + { + RecordScoreValue = recordScore; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetRecordsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (RecordScoreValue.HasValue) + { + writer.WritePropertyName("record_score"); + writer.WriteNumberValue(RecordScoreValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs new file mode 100644 index 00000000000..a7e647c1031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetRecordsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetRecordsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("records")] + public IReadOnlyCollection Records { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs new file mode 100644 index 00000000000..fbd7d5fe602 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsRequest.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.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.MachineLearning; + +public sealed partial class GetTrainedModelsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Specifies whether the included model definition should be returned as a
JSON map (true) or in a custom compressed format (false).
+ ///
+ public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of models. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// A comma delimited string of optional fields to include in the response
body.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Include? Include { get => Q("include"); set => Q("include", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or
none. When supplied, only trained models that contain all the supplied
tags are returned.
+ ///
+ public string? Tags { get => Q("tags"); set => Q("tags", value); } +} + +/// +/// Retrieves configuration information for a trained model. +/// +public sealed partial class GetTrainedModelsRequest : PlainRequest +{ + public GetTrainedModelsRequest() + { + } + + public GetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModels; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Specifies whether the included model definition should be returned as a
JSON map (true) or in a custom compressed format (false).
+ ///
+ [JsonIgnore] + public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of models. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// A comma delimited string of optional fields to include in the response
body.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Include? Include { get => Q("include"); set => Q("include", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or
none. When supplied, only trained models that contain all the supplied
tags are returned.
+ ///
+ [JsonIgnore] + public string? Tags { get => Q("tags"); set => Q("tags", value); } +} + +/// +/// Retrieves configuration information for a trained model. +/// +public sealed partial class GetTrainedModelsRequestDescriptor : RequestDescriptor +{ + internal GetTrainedModelsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTrainedModelsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + public GetTrainedModelsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModels; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models"; + + public GetTrainedModelsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTrainedModelsRequestDescriptor DecompressDefinition(bool? decompressDefinition = true) => Qs("decompress_definition", decompressDefinition); + public GetTrainedModelsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetTrainedModelsRequestDescriptor From(int? from) => Qs("from", from); + public GetTrainedModelsRequestDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Include? include) => Qs("include", include); + public GetTrainedModelsRequestDescriptor Size(int? size) => Qs("size", size); + public GetTrainedModelsRequestDescriptor Tags(string? tags) => Qs("tags", tags); + + public GetTrainedModelsRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id? modelId) + { + RouteValues.Optional("model_id", modelId); + 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/MachineLearning/GetTrainedModelsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs new file mode 100644 index 00000000000..bfc56d151b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetTrainedModelsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of trained model resources, which are sorted by the model_id value in ascending order. + /// + [JsonInclude, JsonPropertyName("trained_model_configs")] + public IReadOnlyCollection TrainedModelConfigs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs new file mode 100644 index 00000000000..27db37b2c80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.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.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.MachineLearning; + +public sealed partial class GetTrainedModelsStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of models. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves usage information for trained models. You can get usage information for multiple trained
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.
+///
+public sealed partial class GetTrainedModelsStatsRequest : PlainRequest +{ + public GetTrainedModelsStatsRequest() + { + } + + public GetTrainedModelsStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Ids? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModelsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models_stats"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of models. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves usage information for trained models. You can get usage information for multiple trained
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.
+///
+public sealed partial class GetTrainedModelsStatsRequestDescriptor : RequestDescriptor +{ + internal GetTrainedModelsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTrainedModelsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ids? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + public GetTrainedModelsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModelsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models_stats"; + + public GetTrainedModelsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTrainedModelsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetTrainedModelsStatsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetTrainedModelsStatsRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Ids? modelId) + { + RouteValues.Optional("model_id", modelId); + 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/MachineLearning/GetTrainedModelsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs new file mode 100644 index 00000000000..5d7ef041ab6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class GetTrainedModelsStatsResponse : ElasticsearchResponse +{ + /// + /// The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of trained model statistics, which are sorted by the model_id value in ascending order. + /// + [JsonInclude, JsonPropertyName("trained_model_stats")] + public IReadOnlyCollection TrainedModelStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs new file mode 100644 index 00000000000..7f62dcaa1b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelRequest.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.MachineLearning; + +public sealed partial class InferTrainedModelRequestParameters : RequestParameters +{ + /// + /// Controls the amount of time to wait for inference results. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequest : PlainRequest +{ + public InferTrainedModelRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + /// + /// Controls the amount of time to wait for inference results. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ [JsonInclude, JsonPropertyName("docs")] + public ICollection> Docs { get; set; } + + /// + /// The inference configuration updates to apply on the API call + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate? InferenceConfig { get; set; } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequestDescriptor : RequestDescriptor, InferTrainedModelRequestParameters> +{ + internal InferTrainedModelRequestDescriptor(Action> configure) => configure.Invoke(this); + + public InferTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + public InferTrainedModelRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public InferTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection> DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ public InferTrainedModelRequestDescriptor Docs(ICollection> docs) + { + DocsValue = docs; + return Self; + } + + /// + /// The inference configuration updates to apply on the API call + /// + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequestDescriptor : RequestDescriptor +{ + internal InferTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public InferTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + public InferTrainedModelRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public InferTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection> DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ public InferTrainedModelRequestDescriptor Docs(ICollection> docs) + { + DocsValue = docs; + return Self; + } + + /// + /// The inference configuration updates to apply on the API call + /// + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs new file mode 100644 index 00000000000..098482e4cab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class InferTrainedModelResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("inference_results")] + public IReadOnlyCollection InferenceResults { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoRequest.g.cs new file mode 100644 index 00000000000..508adef0ad5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoRequest.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.MachineLearning; + +public sealed partial class MlInfoRequestParameters : RequestParameters +{ +} + +/// +/// Returns defaults and limits used by machine learning.
This endpoint is designed to be used by a user interface that needs to fully
understand machine learning configurations where some options are not
specified, meaning that the defaults should be used. This endpoint may be
used to find out what those defaults are. It also provides information about
the maximum size of machine learning jobs that could run in the current
cluster configuration.
+///
+public sealed partial class MlInfoRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.info"; +} + +/// +/// Returns defaults and limits used by machine learning.
This endpoint is designed to be used by a user interface that needs to fully
understand machine learning configurations where some options are not
specified, meaning that the defaults should be used. This endpoint may be
used to find out what those defaults are. It also provides information about
the maximum size of machine learning jobs that could run in the current
cluster configuration.
+///
+public sealed partial class MlInfoRequestDescriptor : RequestDescriptor +{ + internal MlInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public MlInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.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/MachineLearning/MlInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoResponse.g.cs new file mode 100644 index 00000000000..259dbfea229 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/MlInfoResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class MlInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("defaults")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Defaults Defaults { get; init; } + [JsonInclude, JsonPropertyName("limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Limits Limits { get; init; } + [JsonInclude, JsonPropertyName("native_code")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NativeCode NativeCode { get; init; } + [JsonInclude, JsonPropertyName("upgrade_mode")] + public bool UpgradeMode { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobRequest.g.cs new file mode 100644 index 00000000000..8d28fac6259 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobRequest.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.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.MachineLearning; + +public sealed partial class OpenJobRequestParameters : RequestParameters +{ +} + +/// +/// Opens one or more anomaly detection jobs.
An anomaly detection job must be opened in order for it to be ready to
receive and analyze data. It can be opened and closed multiple times
throughout its lifecycle.
When you open a new job, it starts with an empty model.
When you open an existing job, the most recent model state is automatically
loaded. The job is ready to resume its analysis from where it left off, once
new data is received.
+///
+public sealed partial class OpenJobRequest : PlainRequest +{ + public OpenJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningOpenJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.open_job"; + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } +} + +/// +/// Opens one or more anomaly detection jobs.
An anomaly detection job must be opened in order for it to be ready to
receive and analyze data. It can be opened and closed multiple times
throughout its lifecycle.
When you open a new job, it starts with an empty model.
When you open an existing job, the most recent model state is automatically
loaded. The job is ready to resume its analysis from where it left off, once
new data is received.
+///
+public sealed partial class OpenJobRequestDescriptor : RequestDescriptor +{ + internal OpenJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public OpenJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningOpenJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.open_job"; + + public OpenJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public OpenJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/MachineLearning/OpenJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobResponse.g.cs new file mode 100644 index 00000000000..e30acf43546 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/OpenJobResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class OpenJobResponse : ElasticsearchResponse +{ + /// + /// The ID of the node that the job was started on. In serverless this will be the "serverless".
If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
+ ///
+ [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("opened")] + public bool Opened { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs new file mode 100644 index 00000000000..98344aff9b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsRequest.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.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.MachineLearning; + +public sealed partial class PostCalendarEventsRequestParameters : RequestParameters +{ +} + +/// +/// Adds scheduled events to a calendar. +/// +public sealed partial class PostCalendarEventsRequest : PlainRequest +{ + public PostCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPostCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.post_calendar_events"; + + /// + /// A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("events")] + public ICollection Events { get; set; } +} + +/// +/// Adds scheduled events to a calendar. +/// +public sealed partial class PostCalendarEventsRequestDescriptor : RequestDescriptor +{ + internal PostCalendarEventsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostCalendarEventsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPostCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.post_calendar_events"; + + public PostCalendarEventsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + private ICollection EventsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CalendarEventDescriptor EventsDescriptor { get; set; } + private Action EventsDescriptorAction { get; set; } + private Action[] EventsDescriptorActions { get; set; } + + /// + /// A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. + /// + public PostCalendarEventsRequestDescriptor Events(ICollection events) + { + EventsDescriptor = null; + EventsDescriptorAction = null; + EventsDescriptorActions = null; + EventsValue = events; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CalendarEventDescriptor descriptor) + { + EventsValue = null; + EventsDescriptorAction = null; + EventsDescriptorActions = null; + EventsDescriptor = descriptor; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(Action configure) + { + EventsValue = null; + EventsDescriptor = null; + EventsDescriptorActions = null; + EventsDescriptorAction = configure; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(params Action[] configure) + { + EventsValue = null; + EventsDescriptor = null; + EventsDescriptorAction = null; + EventsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EventsDescriptor is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, EventsDescriptor, options); + writer.WriteEndArray(); + } + else if (EventsDescriptorAction is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CalendarEventDescriptor(EventsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (EventsDescriptorActions is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + foreach (var action in EventsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CalendarEventDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("events"); + JsonSerializer.Serialize(writer, EventsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs new file mode 100644 index 00000000000..f667f11c4bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class PostCalendarEventsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("events")] + public IReadOnlyCollection Events { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..19d58446e65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class PreviewDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequest : PlainRequest +{ + public PreviewDataFrameAnalyticsRequest() + { + } + + public PreviewDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfig? Config { get; set; } +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequestDescriptor : RequestDescriptor, PreviewDataFrameAnalyticsRequestParameters> +{ + internal PreviewDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PreviewDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public PreviewDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + public PreviewDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfig? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor ConfigDescriptor { get; set; } + private Action> ConfigDescriptorAction { get; set; } + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfig? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Action> configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal PreviewDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PreviewDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + + public PreviewDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + public PreviewDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfig? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfig? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframePreviewConfigDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..952972cb93a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PreviewDataFrameAnalyticsResponse : ElasticsearchResponse +{ + /// + /// An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training. + /// + [JsonInclude, JsonPropertyName("feature_values")] + public IReadOnlyCollection> FeatureValues { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs new file mode 100644 index 00000000000..9ecbe8e5abc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobRequest.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.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.MachineLearning; + +public sealed partial class PutCalendarJobRequestParameters : RequestParameters +{ +} + +/// +/// Adds an anomaly detection job to a calendar. +/// +public sealed partial class PutCalendarJobRequest : PlainRequest +{ + public PutCalendarJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_calendar_job"; +} + +/// +/// Adds an anomaly detection job to a calendar. +/// +public sealed partial class PutCalendarJobRequestDescriptor : RequestDescriptor +{ + internal PutCalendarJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutCalendarJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_calendar_job"; + + public PutCalendarJobRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public PutCalendarJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/MachineLearning/PutCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs new file mode 100644 index 00000000000..d9e6e160fa6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarJobResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutCalendarJobResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs new file mode 100644 index 00000000000..f395cb2c869 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarRequest.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.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.MachineLearning; + +public sealed partial class PutCalendarRequestParameters : RequestParameters +{ +} + +/// +/// Creates a calendar. +/// +public sealed partial class PutCalendarRequest : PlainRequest +{ + public PutCalendarRequest(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_calendar"; + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An array of anomaly detection job identifiers. + /// + [JsonInclude, JsonPropertyName("job_ids")] + public ICollection? JobIds { get; set; } +} + +/// +/// Creates a calendar. +/// +public sealed partial class PutCalendarRequestDescriptor : RequestDescriptor +{ + internal PutCalendarRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutCalendarRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_calendar"; + + public PutCalendarRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + private string? DescriptionValue { get; set; } + private ICollection? JobIdsValue { get; set; } + + /// + /// A description of the calendar. + /// + public PutCalendarRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of anomaly detection job identifiers. + /// + public PutCalendarRequestDescriptor JobIds(ICollection? jobIds) + { + JobIdsValue = jobIds; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdsValue is not null) + { + writer.WritePropertyName("job_ids"); + JsonSerializer.Serialize(writer, JobIdsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs new file mode 100644 index 00000000000..85c887c9b97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutCalendarResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutCalendarResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..558c77d721c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,718 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class PutDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequest : PlainRequest +{ + public PutDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis Analysis { get; set; } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination configuration. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } + [JsonInclude, JsonPropertyName("headers")] + public IDictionary>>? Headers { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + + /// + /// The configuration of how to source the analysis data. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource Source { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequestDescriptor : RequestDescriptor, PutDataFrameAnalyticsRequestParameters> +{ + internal PutDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + public PutDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action> DestDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private string? VersionValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration. + /// + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Action> configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. + /// + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (!string.IsNullOrEmpty(VersionValue)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(VersionValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal PutDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + public PutDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private string? VersionValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration. + /// + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. + /// + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (!string.IsNullOrEmpty(VersionValue)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(VersionValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..85881875396 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.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.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource Source { 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/Api/MachineLearning/PutDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs new file mode 100644 index 00000000000..e0292dd3687 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs @@ -0,0 +1,1117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class PutDatafeedRequestParameters : RequestParameters +{ + /// + /// If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`
string or when no indices are specified.
+ ///
+ 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.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, unavailable indices (missing or closed) are ignored. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +internal sealed partial class PutDatafeedRequestConverter : JsonConverter +{ + public override PutDatafeedRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new PutDatafeedRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations") + { + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "headers") + { + variant.Headers = JsonSerializer.Deserialize>>?>(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, PutDatafeedRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Headers is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, value.Headers, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+[JsonConverter(typeof(PutDatafeedRequestConverter))] +public sealed partial class PutDatafeedRequest : PlainRequest +{ + public PutDatafeedRequest(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + public PutDatafeedRequest() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + /// + /// If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`
string or when no indices are specified.
+ ///
+ [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.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, unavailable indices (missing or closed) are ignored. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + [JsonInclude, JsonPropertyName("headers")] + public IDictionary>>? Headers { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search + /// + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; set; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ [JsonInclude, JsonPropertyName("scroll_size")] + public int? ScrollSize { get; set; } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+public sealed partial class PutDatafeedRequestDescriptor : RequestDescriptor, PutDatafeedRequestParameters> +{ + internal PutDatafeedRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + public PutDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public PutDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ public PutDatafeedRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ public PutDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + public PutDatafeedRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public PutDatafeedRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search + /// + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + /// + /// Identifier for the anomaly detection job. + /// + public PutDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public PutDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public PutDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public PutDatafeedRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public PutDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ public PutDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+public sealed partial class PutDatafeedRequestDescriptor : RequestDescriptor +{ + internal PutDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + public PutDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public PutDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ public PutDatafeedRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ public PutDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + public PutDatafeedRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public PutDatafeedRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search + /// + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + /// + /// Identifier for the anomaly detection job. + /// + public PutDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public PutDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public PutDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public PutDatafeedRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public PutDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ public PutDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs new file mode 100644 index 00000000000..ddabcb1e4ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutDatafeedResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig ChunkingConfig { get; init; } + [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; init; } + [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration QueryDelay { get; init; } + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IReadOnlyDictionary? RuntimeMappings { get; init; } + [JsonInclude, JsonPropertyName("script_fields")] + public IReadOnlyDictionary? ScriptFields { get; init; } + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterRequest.g.cs new file mode 100644 index 00000000000..1803b304e16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterRequest.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.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.MachineLearning; + +public sealed partial class PutFilterRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates a filter.
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
Specifically, filters are referenced in the `custom_rules` property of detector configuration objects.
+///
+public sealed partial class PutFilterRequest : PlainRequest +{ + public PutFilterRequest(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_filter"; + + /// + /// A description of the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.
Up to 10000 items are allowed in each filter.
+ ///
+ [JsonInclude, JsonPropertyName("items")] + public ICollection? Items { get; set; } +} + +/// +/// Instantiates a filter.
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
Specifically, filters are referenced in the `custom_rules` property of detector configuration objects.
+///
+public sealed partial class PutFilterRequestDescriptor : RequestDescriptor +{ + internal PutFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_filter"; + + public PutFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Serverless.Id filterId) + { + RouteValues.Required("filter_id", filterId); + return Self; + } + + private string? DescriptionValue { get; set; } + private ICollection? ItemsValue { get; set; } + + /// + /// A description of the filter. + /// + public PutFilterRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.
Up to 10000 items are allowed in each filter.
+ ///
+ public PutFilterRequestDescriptor Items(ICollection? items) + { + ItemsValue = items; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (ItemsValue is not null) + { + writer.WritePropertyName("items"); + JsonSerializer.Serialize(writer, ItemsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterResponse.g.cs new file mode 100644 index 00000000000..20f12bc44f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutFilterResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutFilterResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobRequest.g.cs new file mode 100644 index 00000000000..a6ca89f4552 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobRequest.g.cs @@ -0,0 +1,988 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class PutJobRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequest : PlainRequest +{ + public PutJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig AnalysisConfig { get; set; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimits { get; set; } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistInterval { get; set; } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; set; } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescription { get; set; } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfig? DatafeedConfig { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + [JsonInclude, JsonPropertyName("groups")] + public ICollection? Groups { get; set; } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; set; } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + [JsonInclude, JsonPropertyName("results_index_name")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexName { get; set; } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; set; } +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor, PutJobRequestParameters> +{ + internal PutJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + public PutJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistIntervalValue { get; set; } + private object? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action> DataDescriptionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfig? DatafeedConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor DatafeedConfigDescriptor { get; set; } + private Action> DatafeedConfigDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action> ModelPlotConfigDescriptorAction { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexNameValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + public PutJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + public PutJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + public PutJobRequestDescriptor CustomSettings(object? customSettings) + { + CustomSettingsValue = customSettings; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + public PutJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Action> configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfig? datafeedConfig) + { + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigValue = datafeedConfig; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor descriptor) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Action> configure) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public PutJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Action> configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + public PutJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + public PutJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + public PutJobRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.Serverless.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + public PutJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (DatafeedConfigDescriptor is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigDescriptor, options); + } + else if (DatafeedConfigDescriptorAction is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor(DatafeedConfigDescriptorAction), options); + } + else if (DatafeedConfigValue is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor +{ + internal PutJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + public PutJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistIntervalValue { get; set; } + private object? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action DataDescriptionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfig? DatafeedConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor DatafeedConfigDescriptor { get; set; } + private Action DatafeedConfigDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action ModelPlotConfigDescriptorAction { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexNameValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + public PutJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + public PutJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + public PutJobRequestDescriptor CustomSettings(object? customSettings) + { + CustomSettingsValue = customSettings; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + public PutJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Action configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfig? datafeedConfig) + { + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigValue = datafeedConfig; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor descriptor) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Action configure) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public PutJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Action configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + public PutJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + public PutJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + public PutJobRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.Serverless.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + public PutJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (DatafeedConfigDescriptor is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigDescriptor, options); + } + else if (DatafeedConfigDescriptorAction is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedConfigDescriptor(DatafeedConfigDescriptorAction), options); + } + else if (DatafeedConfigValue is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobResponse.g.cs new file mode 100644 index 00000000000..4046c33265f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutJobResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigRead AnalysisConfig { get; init; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits AnalysisLimits { get; init; } + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset CreateTime { get; init; } + [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescription { get; init; } + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Datafeed? DatafeedConfig { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("job_type")] + public string JobType { get; init; } + [JsonInclude, JsonPropertyName("job_version")] + public string JobVersion { get; init; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs new file mode 100644 index 00000000000..cd3776f551b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.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.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.MachineLearning; + +public sealed partial class PutTrainedModelAliasRequestParameters : RequestParameters +{ + /// + /// Specifies whether the alias gets reassigned to the specified trained
model if it is already assigned to a different model. If the alias is
already assigned and this parameter is false, the API returns an error.
+ ///
+ public bool? Reassign { get => Q("reassign"); set => Q("reassign", value); } +} + +/// +/// Creates or updates a trained model alias. A trained model alias is a logical
name used to reference a single trained model.
You can use aliases instead of trained model identifiers to make it easier to
reference your models. For example, you can use aliases in inference
aggregations and processors.
An alias must be unique and refer to only a single trained model. However,
you can have multiple aliases for each trained model.
If you use this API to update an alias such that it references a different
trained model ID and the model uses a different type of data frame analytics,
an error occurs. For example, this situation occurs if you have a trained
model for regression analysis and a trained model for classification
analysis; you cannot reassign an alias from one type of trained model to
another.
If you use this API to update an alias and there are very few input fields in
common between the old and new trained models for the model alias, the API
returns a warning.
+///
+public sealed partial class PutTrainedModelAliasRequest : PlainRequest +{ + public PutTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_trained_model_alias"; + + /// + /// Specifies whether the alias gets reassigned to the specified trained
model if it is already assigned to a different model. If the alias is
already assigned and this parameter is false, the API returns an error.
+ ///
+ [JsonIgnore] + public bool? Reassign { get => Q("reassign"); set => Q("reassign", value); } +} + +/// +/// Creates or updates a trained model alias. A trained model alias is a logical
name used to reference a single trained model.
You can use aliases instead of trained model identifiers to make it easier to
reference your models. For example, you can use aliases in inference
aggregations and processors.
An alias must be unique and refer to only a single trained model. However,
you can have multiple aliases for each trained model.
If you use this API to update an alias such that it references a different
trained model ID and the model uses a different type of data frame analytics,
an error occurs. For example, this situation occurs if you have a trained
model for regression analysis and a trained model for classification
analysis; you cannot reassign an alias from one type of trained model to
another.
If you use this API to update an alias and there are very few input fields in
common between the old and new trained models for the model alias, the API
returns a warning.
+///
+public sealed partial class PutTrainedModelAliasRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_trained_model_alias"; + + public PutTrainedModelAliasRequestDescriptor Reassign(bool? reassign = true) => Qs("reassign", reassign); + + public PutTrainedModelAliasRequestDescriptor ModelAlias(Elastic.Clients.Elasticsearch.Serverless.Name modelAlias) + { + RouteValues.Required("model_alias", modelAlias); + return Self; + } + + public PutTrainedModelAliasRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/PutTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs new file mode 100644 index 00000000000..9e578e5f1ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutTrainedModelAliasResponse : 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/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs new file mode 100644 index 00000000000..18093abd56e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.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.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.MachineLearning; + +public sealed partial class PutTrainedModelDefinitionPartRequestParameters : RequestParameters +{ +} + +/// +/// Creates part of a trained model definition. +/// +public sealed partial class PutTrainedModelDefinitionPartRequest : PlainRequest +{ + public PutTrainedModelDefinitionPartRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId, int part) : base(r => r.Required("model_id", modelId).Required("part", part)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelDefinitionPart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_definition_part"; + + /// + /// The definition part for the model. Must be a base64 encoded string. + /// + [JsonInclude, JsonPropertyName("definition")] + public string Definition { get; set; } + + /// + /// The total uncompressed definition length in bytes. Not base64 encoded. + /// + [JsonInclude, JsonPropertyName("total_definition_length")] + public long TotalDefinitionLength { get; set; } + + /// + /// The total number of parts that will be uploaded. Must be greater than 0. + /// + [JsonInclude, JsonPropertyName("total_parts")] + public int TotalParts { get; set; } +} + +/// +/// Creates part of a trained model definition. +/// +public sealed partial class PutTrainedModelDefinitionPartRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelDefinitionPartRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelDefinitionPartRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId, int part) : base(r => r.Required("model_id", modelId).Required("part", part)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelDefinitionPart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_definition_part"; + + public PutTrainedModelDefinitionPartRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + public PutTrainedModelDefinitionPartRequestDescriptor Part(int part) + { + RouteValues.Required("part", part); + return Self; + } + + private string DefinitionValue { get; set; } + private long TotalDefinitionLengthValue { get; set; } + private int TotalPartsValue { get; set; } + + /// + /// The definition part for the model. Must be a base64 encoded string. + /// + public PutTrainedModelDefinitionPartRequestDescriptor Definition(string definition) + { + DefinitionValue = definition; + return Self; + } + + /// + /// The total uncompressed definition length in bytes. Not base64 encoded. + /// + public PutTrainedModelDefinitionPartRequestDescriptor TotalDefinitionLength(long totalDefinitionLength) + { + TotalDefinitionLengthValue = totalDefinitionLength; + return Self; + } + + /// + /// The total number of parts that will be uploaded. Must be greater than 0. + /// + public PutTrainedModelDefinitionPartRequestDescriptor TotalParts(int totalParts) + { + TotalPartsValue = totalParts; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("definition"); + writer.WriteStringValue(DefinitionValue); + writer.WritePropertyName("total_definition_length"); + writer.WriteNumberValue(TotalDefinitionLengthValue); + writer.WritePropertyName("total_parts"); + writer.WriteNumberValue(TotalPartsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs new file mode 100644 index 00000000000..5f00a738b65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutTrainedModelDefinitionPartResponse : 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/MachineLearning/PutTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs new file mode 100644 index 00000000000..5e09722bcf2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs @@ -0,0 +1,803 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class PutTrainedModelRequestParameters : RequestParameters +{ + /// + /// If set to `true` and a `compressed_definition` is provided,
the request defers definition decompression and skips relevant
validations.
+ ///
+ public bool? DeferDefinitionDecompression { get => Q("defer_definition_decompression"); set => Q("defer_definition_decompression", value); } + + /// + /// Whether to wait for all child operations (e.g. model download)
to complete.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequest : PlainRequest +{ + public PutTrainedModelRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + /// + /// If set to `true` and a `compressed_definition` is provided,
the request defers definition decompression and skips relevant
validations.
+ ///
+ [JsonIgnore] + public bool? DeferDefinitionDecompression { get => Q("defer_definition_decompression"); set => Q("defer_definition_decompression", value); } + + /// + /// Whether to wait for all child operations (e.g. model download)
to complete.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; set; } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ [JsonInclude, JsonPropertyName("definition")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Definition? Definition { get; set; } + + /// + /// A human-readable description of the inference trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? InferenceConfig { get; set; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Input? Input { get; set; } + + /// + /// An object map that contains metadata about the model. + /// + [JsonInclude, JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ [JsonInclude, JsonPropertyName("model_size_bytes")] + public long? ModelSizeBytes { get; set; } + + /// + /// The model type. + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? ModelType { get; set; } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ [JsonInclude, JsonPropertyName("platform_architecture")] + public string? PlatformArchitecture { get; set; } + + /// + /// Optional prefix strings applied at inference + /// + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; set; } + + /// + /// An array of tags to organize the model. + /// + [JsonInclude, JsonPropertyName("tags")] + public ICollection? Tags { get; set; } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequestDescriptor : RequestDescriptor, PutTrainedModelRequestParameters> +{ + internal PutTrainedModelRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + public PutTrainedModelRequestDescriptor DeferDefinitionDecompression(bool? deferDefinitionDecompression = true) => Qs("defer_definition_decompression", deferDefinitionDecompression); + public PutTrainedModelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public PutTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private string? CompressedDefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Definition? DefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor DefinitionDescriptor { get; set; } + private Action DefinitionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Input? InputValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor InputDescriptor { get; set; } + private Action InputDescriptorAction { get; set; } + private object? MetadataValue { get; set; } + private long? ModelSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? ModelTypeValue { get; set; } + private string? PlatformArchitectureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? PrefixStringsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor PrefixStringsDescriptor { get; set; } + private Action PrefixStringsDescriptorAction { get; set; } + private ICollection? TagsValue { get; set; } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ public PutTrainedModelRequestDescriptor CompressedDefinition(string? compressedDefinition) + { + CompressedDefinitionValue = compressedDefinition; + return Self; + } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Definition? definition) + { + DefinitionDescriptor = null; + DefinitionDescriptorAction = null; + DefinitionValue = definition; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor descriptor) + { + DefinitionValue = null; + DefinitionDescriptorAction = null; + DefinitionDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Action configure) + { + DefinitionValue = null; + DefinitionDescriptor = null; + DefinitionDescriptorAction = configure; + return Self; + } + + /// + /// A human-readable description of the inference trained model. + /// + public PutTrainedModelRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + /// + /// The input field names for the model definition. + /// + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Input? input) + { + InputDescriptor = null; + InputDescriptorAction = null; + InputValue = input; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor descriptor) + { + InputValue = null; + InputDescriptorAction = null; + InputDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Action configure) + { + InputValue = null; + InputDescriptor = null; + InputDescriptorAction = configure; + return Self; + } + + /// + /// An object map that contains metadata about the model. + /// + public PutTrainedModelRequestDescriptor Metadata(object? metadata) + { + MetadataValue = metadata; + return Self; + } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ public PutTrainedModelRequestDescriptor ModelSizeBytes(long? modelSizeBytes) + { + ModelSizeBytesValue = modelSizeBytes; + return Self; + } + + /// + /// The model type. + /// + public PutTrainedModelRequestDescriptor ModelType(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? modelType) + { + ModelTypeValue = modelType; + return Self; + } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ public PutTrainedModelRequestDescriptor PlatformArchitecture(string? platformArchitecture) + { + PlatformArchitectureValue = platformArchitecture; + return Self; + } + + /// + /// Optional prefix strings applied at inference + /// + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? prefixStrings) + { + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = null; + PrefixStringsValue = prefixStrings; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor descriptor) + { + PrefixStringsValue = null; + PrefixStringsDescriptorAction = null; + PrefixStringsDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Action configure) + { + PrefixStringsValue = null; + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = configure; + return Self; + } + + /// + /// An array of tags to organize the model. + /// + public PutTrainedModelRequestDescriptor Tags(ICollection? tags) + { + TagsValue = tags; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CompressedDefinitionValue)) + { + writer.WritePropertyName("compressed_definition"); + writer.WriteStringValue(CompressedDefinitionValue); + } + + if (DefinitionDescriptor is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionDescriptor, options); + } + else if (DefinitionDescriptorAction is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor(DefinitionDescriptorAction), options); + } + else if (DefinitionValue is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (InputDescriptor is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputDescriptor, options); + } + else if (InputDescriptorAction is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor(InputDescriptorAction), options); + } + else if (InputValue is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (ModelSizeBytesValue.HasValue) + { + writer.WritePropertyName("model_size_bytes"); + writer.WriteNumberValue(ModelSizeBytesValue.Value); + } + + if (ModelTypeValue is not null) + { + writer.WritePropertyName("model_type"); + JsonSerializer.Serialize(writer, ModelTypeValue, options); + } + + if (!string.IsNullOrEmpty(PlatformArchitectureValue)) + { + writer.WritePropertyName("platform_architecture"); + writer.WriteStringValue(PlatformArchitectureValue); + } + + if (PrefixStringsDescriptor is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsDescriptor, options); + } + else if (PrefixStringsDescriptorAction is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor(PrefixStringsDescriptorAction), options); + } + else if (PrefixStringsValue is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsValue, options); + } + + if (TagsValue is not null) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, TagsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + public PutTrainedModelRequestDescriptor DeferDefinitionDecompression(bool? deferDefinitionDecompression = true) => Qs("defer_definition_decompression", deferDefinitionDecompression); + public PutTrainedModelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public PutTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private string? CompressedDefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Definition? DefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor DefinitionDescriptor { get; set; } + private Action DefinitionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Input? InputValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor InputDescriptor { get; set; } + private Action InputDescriptorAction { get; set; } + private object? MetadataValue { get; set; } + private long? ModelSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? ModelTypeValue { get; set; } + private string? PlatformArchitectureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? PrefixStringsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor PrefixStringsDescriptor { get; set; } + private Action PrefixStringsDescriptorAction { get; set; } + private ICollection? TagsValue { get; set; } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ public PutTrainedModelRequestDescriptor CompressedDefinition(string? compressedDefinition) + { + CompressedDefinitionValue = compressedDefinition; + return Self; + } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Definition? definition) + { + DefinitionDescriptor = null; + DefinitionDescriptorAction = null; + DefinitionValue = definition; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor descriptor) + { + DefinitionValue = null; + DefinitionDescriptorAction = null; + DefinitionDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Action configure) + { + DefinitionValue = null; + DefinitionDescriptor = null; + DefinitionDescriptorAction = configure; + return Self; + } + + /// + /// A human-readable description of the inference trained model. + /// + public PutTrainedModelRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + /// + /// The input field names for the model definition. + /// + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Input? input) + { + InputDescriptor = null; + InputDescriptorAction = null; + InputValue = input; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor descriptor) + { + InputValue = null; + InputDescriptorAction = null; + InputDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Action configure) + { + InputValue = null; + InputDescriptor = null; + InputDescriptorAction = configure; + return Self; + } + + /// + /// An object map that contains metadata about the model. + /// + public PutTrainedModelRequestDescriptor Metadata(object? metadata) + { + MetadataValue = metadata; + return Self; + } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ public PutTrainedModelRequestDescriptor ModelSizeBytes(long? modelSizeBytes) + { + ModelSizeBytesValue = modelSizeBytes; + return Self; + } + + /// + /// The model type. + /// + public PutTrainedModelRequestDescriptor ModelType(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? modelType) + { + ModelTypeValue = modelType; + return Self; + } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ public PutTrainedModelRequestDescriptor PlatformArchitecture(string? platformArchitecture) + { + PlatformArchitectureValue = platformArchitecture; + return Self; + } + + /// + /// Optional prefix strings applied at inference + /// + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? prefixStrings) + { + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = null; + PrefixStringsValue = prefixStrings; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor descriptor) + { + PrefixStringsValue = null; + PrefixStringsDescriptorAction = null; + PrefixStringsDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Action configure) + { + PrefixStringsValue = null; + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = configure; + return Self; + } + + /// + /// An array of tags to organize the model. + /// + public PutTrainedModelRequestDescriptor Tags(ICollection? tags) + { + TagsValue = tags; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CompressedDefinitionValue)) + { + writer.WritePropertyName("compressed_definition"); + writer.WriteStringValue(CompressedDefinitionValue); + } + + if (DefinitionDescriptor is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionDescriptor, options); + } + else if (DefinitionDescriptorAction is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DefinitionDescriptor(DefinitionDescriptorAction), options); + } + else if (DefinitionValue is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (InputDescriptor is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputDescriptor, options); + } + else if (InputDescriptorAction is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InputDescriptor(InputDescriptorAction), options); + } + else if (InputValue is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (ModelSizeBytesValue.HasValue) + { + writer.WritePropertyName("model_size_bytes"); + writer.WriteNumberValue(ModelSizeBytesValue.Value); + } + + if (ModelTypeValue is not null) + { + writer.WritePropertyName("model_type"); + JsonSerializer.Serialize(writer, ModelTypeValue, options); + } + + if (!string.IsNullOrEmpty(PlatformArchitectureValue)) + { + writer.WritePropertyName("platform_architecture"); + writer.WriteStringValue(PlatformArchitectureValue); + } + + if (PrefixStringsDescriptor is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsDescriptor, options); + } + else if (PrefixStringsDescriptorAction is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStringsDescriptor(PrefixStringsDescriptorAction), options); + } + else if (PrefixStringsValue is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsValue, options); + } + + if (TagsValue is not null) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, TagsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs new file mode 100644 index 00000000000..e92cc562529 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutTrainedModelResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; init; } + + /// + /// Information on the creator of the trained model. + /// + [JsonInclude, JsonPropertyName("created_by")] + public string? CreatedBy { get; init; } + + /// + /// The time when the trained model was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Any field map described in the inference configuration takes precedence. + /// + [JsonInclude, JsonPropertyName("default_field_map")] + public IReadOnlyDictionary? DefaultFieldMap { get; init; } + + /// + /// The free-text description of the trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The estimated heap usage in bytes to keep the trained model in memory. + /// + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public int? EstimatedHeapMemoryUsageBytes { get; init; } + + /// + /// The estimated number of operations to use the trained model. + /// + [JsonInclude, JsonPropertyName("estimated_operations")] + public int? EstimatedOperations { get; init; } + + /// + /// True if the full model definition is present. + /// + [JsonInclude, JsonPropertyName("fully_defined")] + public bool? FullyDefined { get; init; } + + /// + /// The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required. + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? InferenceConfig { get; init; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelConfigInput Input { get; init; } + + /// + /// The license level of the trained model. + /// + [JsonInclude, JsonPropertyName("license_level")] + public string? LicenseLevel { get; init; } + [JsonInclude, JsonPropertyName("location")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelLocation? Location { get; init; } + + /// + /// An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects. + /// + [JsonInclude, JsonPropertyName("metadata")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelConfigMetadata? Metadata { get; init; } + + /// + /// Identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ModelSizeBytes { get; init; } + + /// + /// The model type + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? ModelType { get; init; } + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; init; } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or none. + /// + [JsonInclude, JsonPropertyName("tags")] + public IReadOnlyCollection Tags { get; init; } + + /// + /// The Elasticsearch version number in which the trained model was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs new file mode 100644 index 00000000000..e7f1ebfc331 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.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.MachineLearning; + +public sealed partial class PutTrainedModelVocabularyRequestParameters : RequestParameters +{ +} + +/// +/// Creates a trained model vocabulary.
This API is supported only for natural language processing (NLP) models.
The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition.
+///
+public sealed partial class PutTrainedModelVocabularyRequest : PlainRequest +{ + public PutTrainedModelVocabularyRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelVocabulary; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_vocabulary"; + + /// + /// The optional model merges if required by the tokenizer. + /// + [JsonInclude, JsonPropertyName("merges")] + public ICollection? Merges { get; set; } + + /// + /// The optional vocabulary value scores if required by the tokenizer. + /// + [JsonInclude, JsonPropertyName("scores")] + public ICollection? Scores { get; set; } + + /// + /// The model vocabulary, which must not be empty. + /// + [JsonInclude, JsonPropertyName("vocabulary")] + public ICollection Vocabulary { get; set; } +} + +/// +/// Creates a trained model vocabulary.
This API is supported only for natural language processing (NLP) models.
The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition.
+///
+public sealed partial class PutTrainedModelVocabularyRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelVocabularyRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelVocabularyRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelVocabulary; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_vocabulary"; + + public PutTrainedModelVocabularyRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection? MergesValue { get; set; } + private ICollection? ScoresValue { get; set; } + private ICollection VocabularyValue { get; set; } + + /// + /// The optional model merges if required by the tokenizer. + /// + public PutTrainedModelVocabularyRequestDescriptor Merges(ICollection? merges) + { + MergesValue = merges; + return Self; + } + + /// + /// The optional vocabulary value scores if required by the tokenizer. + /// + public PutTrainedModelVocabularyRequestDescriptor Scores(ICollection? scores) + { + ScoresValue = scores; + return Self; + } + + /// + /// The model vocabulary, which must not be empty. + /// + public PutTrainedModelVocabularyRequestDescriptor Vocabulary(ICollection vocabulary) + { + VocabularyValue = vocabulary; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MergesValue is not null) + { + writer.WritePropertyName("merges"); + JsonSerializer.Serialize(writer, MergesValue, options); + } + + if (ScoresValue is not null) + { + writer.WritePropertyName("scores"); + JsonSerializer.Serialize(writer, ScoresValue, options); + } + + 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/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs new file mode 100644 index 00000000000..78dd66b652c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class PutTrainedModelVocabularyResponse : 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/MachineLearning/ResetJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobRequest.g.cs new file mode 100644 index 00000000000..a780ab75c79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobRequest.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.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.MachineLearning; + +public sealed partial class ResetJobRequestParameters : RequestParameters +{ + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Should this request wait until the operation has completed before
returning.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Resets an anomaly detection job.
All model state and results are deleted. The job is ready to start over as if
it had just been created.
It is not currently possible to reset multiple jobs using wildcards or a
comma separated list.
+///
+public sealed partial class ResetJobRequest : PlainRequest +{ + public ResetJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.reset_job"; + + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ [JsonIgnore] + public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Should this request wait until the operation has completed before
returning.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Resets an anomaly detection job.
All model state and results are deleted. The job is ready to start over as if
it had just been created.
It is not currently possible to reset multiple jobs using wildcards or a
comma separated list.
+///
+public sealed partial class ResetJobRequestDescriptor : RequestDescriptor +{ + internal ResetJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResetJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.reset_job"; + + public ResetJobRequestDescriptor DeleteUserAnnotations(bool? deleteUserAnnotations = true) => Qs("delete_user_annotations", deleteUserAnnotations); + public ResetJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public ResetJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/MachineLearning/ResetJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobResponse.g.cs new file mode 100644 index 00000000000..aa0af2f69f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ResetJobResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class ResetJobResponse : 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/MachineLearning/RevertModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..cca4d0b1da3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.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.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.MachineLearning; + +public sealed partial class RevertModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Reverts to a specific snapshot.
The machine learning features react quickly to anomalous input, learning new
behaviors in data. Highly anomalous input increases the variance in the
models whilst the system learns whether this is a new step-change in behavior
or a one-off event. In the case where this anomalous input is known to be a
one-off, then it might be appropriate to reset the model state to a time
before this event. For example, you might consider reverting to a saved
snapshot after Black Friday or a critical system failure.
+///
+public sealed partial class RevertModelSnapshotRequest : PlainRequest +{ + public RevertModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningRevertModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.revert_model_snapshot"; + + /// + /// Refer to the description for the `delete_intervening_results` query parameter. + /// + [JsonInclude, JsonPropertyName("delete_intervening_results")] + public bool? DeleteInterveningResults { get; set; } +} + +/// +/// Reverts to a specific snapshot.
The machine learning features react quickly to anomalous input, learning new
behaviors in data. Highly anomalous input increases the variance in the
models whilst the system learns whether this is a new step-change in behavior
or a one-off event. In the case where this anomalous input is known to be a
one-off, then it might be appropriate to reset the model state to a time
before this event. For example, you might consider reverting to a saved
snapshot after Black Friday or a critical system failure.
+///
+public sealed partial class RevertModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal RevertModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public RevertModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningRevertModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.revert_model_snapshot"; + + public RevertModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public RevertModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + return Self; + } + + private bool? DeleteInterveningResultsValue { get; set; } + + /// + /// Refer to the description for the `delete_intervening_results` query parameter. + /// + public RevertModelSnapshotRequestDescriptor DeleteInterveningResults(bool? deleteInterveningResults = true) + { + DeleteInterveningResultsValue = deleteInterveningResults; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DeleteInterveningResultsValue.HasValue) + { + writer.WritePropertyName("delete_intervening_results"); + writer.WriteBooleanValue(DeleteInterveningResultsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..019c156ac8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class RevertModelSnapshotResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("model")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelSnapshot Model { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs new file mode 100644 index 00000000000..31a3522b0e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeRequest.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.MachineLearning; + +public sealed partial class SetUpgradeModeRequestParameters : RequestParameters +{ + /// + /// When `true`, it enables `upgrade_mode` which temporarily halts all job
and datafeed tasks and prohibits new job and datafeed tasks from
starting.
+ ///
+ public bool? Enabled { get => Q("enabled"); set => Q("enabled", value); } + + /// + /// The time to wait for the request to be completed. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Sets a cluster wide upgrade_mode setting that prepares machine learning
indices for an upgrade.
When upgrading your cluster, in some circumstances you must restart your
nodes and reindex your machine learning indices. In those circumstances,
there must be no machine learning jobs running. You can close the machine
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
you can use this API to temporarily halt tasks associated with the jobs and
datafeeds and prevent new jobs from opening. You can also use this API
during upgrades that do not require you to reindex your machine learning
indices, though stopping jobs is not a requirement in that case.
You can see the current value for the upgrade_mode setting by using the get
machine learning info API.
+///
+public sealed partial class SetUpgradeModeRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningSetUpgradeMode; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.set_upgrade_mode"; + + /// + /// When `true`, it enables `upgrade_mode` which temporarily halts all job
and datafeed tasks and prohibits new job and datafeed tasks from
starting.
+ ///
+ [JsonIgnore] + public bool? Enabled { get => Q("enabled"); set => Q("enabled", value); } + + /// + /// The time to wait for the request to be completed. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Sets a cluster wide upgrade_mode setting that prepares machine learning
indices for an upgrade.
When upgrading your cluster, in some circumstances you must restart your
nodes and reindex your machine learning indices. In those circumstances,
there must be no machine learning jobs running. You can close the machine
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
you can use this API to temporarily halt tasks associated with the jobs and
datafeeds and prevent new jobs from opening. You can also use this API
during upgrades that do not require you to reindex your machine learning
indices, though stopping jobs is not a requirement in that case.
You can see the current value for the upgrade_mode setting by using the get
machine learning info API.
+///
+public sealed partial class SetUpgradeModeRequestDescriptor : RequestDescriptor +{ + internal SetUpgradeModeRequestDescriptor(Action configure) => configure.Invoke(this); + + public SetUpgradeModeRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningSetUpgradeMode; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.set_upgrade_mode"; + + public SetUpgradeModeRequestDescriptor Enabled(bool? enabled = true) => Qs("enabled", enabled); + public SetUpgradeModeRequestDescriptor 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/MachineLearning/SetUpgradeModeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs new file mode 100644 index 00000000000..e5257412c43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/SetUpgradeModeResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class SetUpgradeModeResponse : 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/MachineLearning/StartDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..637b78d6c0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.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.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.MachineLearning; + +public sealed partial class StartDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Controls the amount of time to wait until the data frame analytics job
starts.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequest : PlainRequest +{ + public StartDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + /// + /// Controls the amount of time to wait until the data frame analytics job
starts.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequestDescriptor : RequestDescriptor, StartDataFrameAnalyticsRequestParameters> +{ + internal StartDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StartDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + public StartDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public StartDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal StartDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + public StartDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public StartDataFrameAnalyticsRequestDescriptor 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/MachineLearning/StartDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..7a17db9eb46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class StartDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + + /// + /// The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
The node ID of the node the job has been assigned to, or
an empty string if it hasn't been assigned to a node. In
serverless if the job has been assigned to run then the
node ID will be "serverless".
+ ///
+ [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs new file mode 100644 index 00000000000..d1a3c53ec69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedRequest.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.MachineLearning; + +public sealed partial class StartDatafeedRequestParameters : RequestParameters +{ +} + +/// +/// Starts one or more datafeeds. +/// A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+/// Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. +/// If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.
+/// When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
authorization headers when you created or updated the datafeed, those credentials are used instead.
+///
+public sealed partial class StartDatafeedRequest : PlainRequest +{ + public StartDatafeedRequest(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.start_datafeed"; + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } +} + +/// +/// Starts one or more datafeeds. +/// A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+/// Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. +/// If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.
+/// When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
authorization headers when you created or updated the datafeed, those credentials are used instead.
+///
+public sealed partial class StartDatafeedRequestDescriptor : RequestDescriptor +{ + internal StartDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.start_datafeed"; + + public StartDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private DateTimeOffset? EndValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + public StartDatafeedRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public StartDatafeedRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public StartDatafeedRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + 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/MachineLearning/StartDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs new file mode 100644 index 00000000000..b5c2223b839 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartDatafeedResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class StartDatafeedResponse : ElasticsearchResponse +{ + /// + /// The ID of the node that the job was started on. In serverless this will be the "serverless".
If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
+ ///
+ [JsonInclude, JsonPropertyName("node")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Node { get; init; } + + /// + /// For a successful response, this value is always `true`. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("started")] + public bool Started { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs new file mode 100644 index 00000000000..39ace65e17a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.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.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.MachineLearning; + +public sealed partial class StartTrainedModelDeploymentRequestParameters : RequestParameters +{ + /// + /// The inference cache size (in memory outside the JVM heap) per node for the model.
The default value is the same size as the `model_size_bytes`. To disable the cache,
`0b` can be provided.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.ByteSize? CacheSize { get => Q("cache_size"); set => Q("cache_size", value); } + + /// + /// The number of model allocations on each node where the model is deployed.
All allocations on a node share the same copy of the model in memory but use
a separate set of threads to evaluate the model.
Increasing this value generally increases the throughput.
If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ public int? NumberOfAllocations { get => Q("number_of_allocations"); set => Q("number_of_allocations", value); } + + /// + /// The deployment priority. + /// + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainingPriority? Priority { get => Q("priority"); set => Q("priority", value); } + + /// + /// Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
this value, new requests are rejected with a 429 error.
+ ///
+ public int? QueueCapacity { get => Q("queue_capacity"); set => Q("queue_capacity", value); } + + /// + /// Sets the number of threads used by each model allocation during inference. This generally increases
the inference speed. The inference process is a compute-bound process; any number
greater than the number of available hardware threads on the machine does not increase the
inference speed. If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ public int? ThreadsPerAllocation { get => Q("threads_per_allocation"); set => Q("threads_per_allocation", value); } + + /// + /// Specifies the amount of time to wait for the model to deploy. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specifies the allocation status to wait for before returning. + /// + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentAllocationState? WaitFor { get => Q("wait_for"); set => Q("wait_for", value); } +} + +/// +/// Starts a trained model deployment, which allocates the model to every machine learning node. +/// +public sealed partial class StartTrainedModelDeploymentRequest : PlainRequest +{ + public StartTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_trained_model_deployment"; + + /// + /// The inference cache size (in memory outside the JVM heap) per node for the model.
The default value is the same size as the `model_size_bytes`. To disable the cache,
`0b` can be provided.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? CacheSize { get => Q("cache_size"); set => Q("cache_size", value); } + + /// + /// The number of model allocations on each node where the model is deployed.
All allocations on a node share the same copy of the model in memory but use
a separate set of threads to evaluate the model.
Increasing this value generally increases the throughput.
If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ [JsonIgnore] + public int? NumberOfAllocations { get => Q("number_of_allocations"); set => Q("number_of_allocations", value); } + + /// + /// The deployment priority. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainingPriority? Priority { get => Q("priority"); set => Q("priority", value); } + + /// + /// Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
this value, new requests are rejected with a 429 error.
+ ///
+ [JsonIgnore] + public int? QueueCapacity { get => Q("queue_capacity"); set => Q("queue_capacity", value); } + + /// + /// Sets the number of threads used by each model allocation during inference. This generally increases
the inference speed. The inference process is a compute-bound process; any number
greater than the number of available hardware threads on the machine does not increase the
inference speed. If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ [JsonIgnore] + public int? ThreadsPerAllocation { get => Q("threads_per_allocation"); set => Q("threads_per_allocation", value); } + + /// + /// Specifies the amount of time to wait for the model to deploy. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specifies the allocation status to wait for before returning. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentAllocationState? WaitFor { get => Q("wait_for"); set => Q("wait_for", value); } +} + +/// +/// Starts a trained model deployment, which allocates the model to every machine learning node. +/// +public sealed partial class StartTrainedModelDeploymentRequestDescriptor : RequestDescriptor +{ + internal StartTrainedModelDeploymentRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartTrainedModelDeploymentRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_trained_model_deployment"; + + public StartTrainedModelDeploymentRequestDescriptor CacheSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? cacheSize) => Qs("cache_size", cacheSize); + public StartTrainedModelDeploymentRequestDescriptor NumberOfAllocations(int? numberOfAllocations) => Qs("number_of_allocations", numberOfAllocations); + public StartTrainedModelDeploymentRequestDescriptor Priority(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainingPriority? priority) => Qs("priority", priority); + public StartTrainedModelDeploymentRequestDescriptor QueueCapacity(int? queueCapacity) => Qs("queue_capacity", queueCapacity); + public StartTrainedModelDeploymentRequestDescriptor ThreadsPerAllocation(int? threadsPerAllocation) => Qs("threads_per_allocation", threadsPerAllocation); + public StartTrainedModelDeploymentRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public StartTrainedModelDeploymentRequestDescriptor WaitFor(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentAllocationState? waitFor) => Qs("wait_for", waitFor); + + public StartTrainedModelDeploymentRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/StartTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs new file mode 100644 index 00000000000..0dd0ac3a36d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class StartTrainedModelDeploymentResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("assignment")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelAssignment Assignment { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..99848b36ca0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,156 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class StopDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty data_frame_analytics
array when there are no matches and the subset of results when there are
partial matches. If this parameter is false, the request returns a 404
status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If true, the data frame analytics job is stopped forcefully. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Controls the amount of time to wait until the data frame analytics job
stops. Defaults to 20 seconds.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequest : PlainRequest +{ + public StopDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty data_frame_analytics
array when there are no matches and the subset of results when there are
partial matches. If this parameter is false, the request returns a 404
status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If true, the data frame analytics job is stopped forcefully. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Controls the amount of time to wait until the data frame analytics job
stops. Defaults to 20 seconds.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequestDescriptor : RequestDescriptor, StopDataFrameAnalyticsRequestParameters> +{ + internal StopDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StopDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + public StopDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public StopDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal StopDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + public StopDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public StopDataFrameAnalyticsRequestDescriptor 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/MachineLearning/StopDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..1617f80e0a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class StopDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs new file mode 100644 index 00000000000..65ba8ed10d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedRequest.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.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.MachineLearning; + +public sealed partial class StopDatafeedRequestParameters : RequestParameters +{ +} + +/// +/// Stops one or more datafeeds.
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+///
+public sealed partial class StopDatafeedRequest : PlainRequest +{ + public StopDatafeedRequest(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.stop_datafeed"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the description for the `force` query parameter. + /// + [JsonInclude, JsonPropertyName("force")] + public bool? Force { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get; set; } +} + +/// +/// Stops one or more datafeeds.
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+///
+public sealed partial class StopDatafeedRequestDescriptor : RequestDescriptor +{ + internal StopDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.stop_datafeed"; + + public StopDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private bool? ForceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public StopDatafeedRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the description for the `force` query parameter. + /// + public StopDatafeedRequestDescriptor Force(bool? force = true) + { + ForceValue = force; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public StopDatafeedRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (ForceValue.HasValue) + { + writer.WritePropertyName("force"); + writer.WriteBooleanValue(ForceValue.Value); + } + + 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/MachineLearning/StopDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs new file mode 100644 index 00000000000..0b7e5f25c34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class StopDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs new file mode 100644 index 00000000000..0235ac43401 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.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.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.MachineLearning; + +public sealed partial class StopTrainedModelDeploymentRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and
there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
If `false`, the request returns a 404 status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you
restart the model deployment.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Stops a trained model deployment. +/// +public sealed partial class StopTrainedModelDeploymentRequest : PlainRequest +{ + public StopTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_trained_model_deployment"; + + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and
there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
If `false`, the request returns a 404 status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you
restart the model deployment.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Stops a trained model deployment. +/// +public sealed partial class StopTrainedModelDeploymentRequestDescriptor : RequestDescriptor +{ + internal StopTrainedModelDeploymentRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopTrainedModelDeploymentRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_trained_model_deployment"; + + public StopTrainedModelDeploymentRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopTrainedModelDeploymentRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public StopTrainedModelDeploymentRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/MachineLearning/StopTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs new file mode 100644 index 00000000000..76069cdce24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.MachineLearning; + +public sealed partial class StopTrainedModelDeploymentResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..a3e9d39fbfb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.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.MachineLearning; + +public sealed partial class UpdateDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequest : PlainRequest +{ + public UpdateDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequestDescriptor : RequestDescriptor, UpdateDataFrameAnalyticsRequestParameters> +{ + internal UpdateDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + public UpdateDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private string? DescriptionValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal UpdateDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + public UpdateDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private string? DescriptionValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..0f44712ded6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.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.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class UpdateDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource Source { 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/Api/MachineLearning/UpdateDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs new file mode 100644 index 00000000000..d6e4c153e7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs @@ -0,0 +1,1069 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class UpdateDatafeedRequestParameters : RequestParameters +{ + /// + /// If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the
`_all` string or when no indices are specified.
+ ///
+ 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. Valid values are:
+ /// * `all`: Match any data stream or index, including hidden ones.
* `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
* `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or both.
* `none`: Wildcard patterns are not accepted.
* `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, unavailable indices (missing or closed) are ignored. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +internal sealed partial class UpdateDatafeedRequestConverter : JsonConverter +{ + public override UpdateDatafeedRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new UpdateDatafeedRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations") + { + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, UpdateDatafeedRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+[JsonConverter(typeof(UpdateDatafeedRequestConverter))] +public sealed partial class UpdateDatafeedRequest : PlainRequest +{ + public UpdateDatafeedRequest(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + public UpdateDatafeedRequest() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + /// + /// If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the
`_all` string or when no indices are specified.
+ ///
+ [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. Valid values are:
+ /// * `all`: Match any data stream or index, including hidden ones.
* `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
* `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or both.
* `none`: Wildcard patterns are not accepted.
* `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, unavailable indices (missing or closed) are ignored. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public ICollection? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search. + /// + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; set; } + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ [JsonInclude, JsonPropertyName("scroll_size")] + public int? ScrollSize { get; set; } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+public sealed partial class UpdateDatafeedRequestDescriptor : RequestDescriptor, UpdateDatafeedRequestParameters> +{ + internal UpdateDatafeedRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + public UpdateDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public UpdateDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ public UpdateDatafeedRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ public UpdateDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public UpdateDatafeedRequestDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public UpdateDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public UpdateDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public UpdateDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public UpdateDatafeedRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public UpdateDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ public UpdateDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+public sealed partial class UpdateDatafeedRequestDescriptor : RequestDescriptor +{ + internal UpdateDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + public UpdateDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public UpdateDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ public UpdateDatafeedRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ public UpdateDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public UpdateDatafeedRequestDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public UpdateDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public UpdateDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public UpdateDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public UpdateDatafeedRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public UpdateDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ public UpdateDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs new file mode 100644 index 00000000000..dd2d54e3dd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateDatafeedResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class UpdateDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig ChunkingConfig { get; init; } + [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; init; } + [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration QueryDelay { get; init; } + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IReadOnlyDictionary? RuntimeMappings { get; init; } + [JsonInclude, JsonPropertyName("script_fields")] + public IReadOnlyDictionary? ScriptFields { get; init; } + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs new file mode 100644 index 00000000000..1e2b7894840 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterRequest.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.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.MachineLearning; + +public sealed partial class UpdateFilterRequestParameters : RequestParameters +{ +} + +/// +/// Updates the description of a filter, adds items, or removes items from the list. +/// +public sealed partial class UpdateFilterRequest : PlainRequest +{ + public UpdateFilterRequest(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_filter"; + + /// + /// The items to add to the filter. + /// + [JsonInclude, JsonPropertyName("add_items")] + public ICollection? AddItems { get; set; } + + /// + /// A description for the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The items to remove from the filter. + /// + [JsonInclude, JsonPropertyName("remove_items")] + public ICollection? RemoveItems { get; set; } +} + +/// +/// Updates the description of a filter, adds items, or removes items from the list. +/// +public sealed partial class UpdateFilterRequestDescriptor : RequestDescriptor +{ + internal UpdateFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_filter"; + + public UpdateFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Serverless.Id filterId) + { + RouteValues.Required("filter_id", filterId); + return Self; + } + + private ICollection? AddItemsValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? RemoveItemsValue { get; set; } + + /// + /// The items to add to the filter. + /// + public UpdateFilterRequestDescriptor AddItems(ICollection? addItems) + { + AddItemsValue = addItems; + return Self; + } + + /// + /// A description for the filter. + /// + public UpdateFilterRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The items to remove from the filter. + /// + public UpdateFilterRequestDescriptor RemoveItems(ICollection? removeItems) + { + RemoveItemsValue = removeItems; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AddItemsValue is not null) + { + writer.WritePropertyName("add_items"); + JsonSerializer.Serialize(writer, AddItemsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (RemoveItemsValue is not null) + { + writer.WritePropertyName("remove_items"); + JsonSerializer.Serialize(writer, RemoveItemsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs new file mode 100644 index 00000000000..bb37ade045d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateFilterResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class UpdateFilterResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs new file mode 100644 index 00000000000..112973d07ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs @@ -0,0 +1,944 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.MachineLearning; + +public sealed partial class UpdateJobRequestParameters : RequestParameters +{ +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequest : PlainRequest +{ + public UpdateJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimit? AnalysisLimits { get; set; } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistInterval { get; set; } + [JsonInclude, JsonPropertyName("categorization_filters")] + public ICollection? CategorizationFilters { get; set; } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ [JsonInclude, JsonPropertyName("custom_settings")] + public IDictionary? CustomSettings { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An array of detector update objects. + /// + [JsonInclude, JsonPropertyName("detectors")] + public ICollection? Detectors { get; set; } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + [JsonInclude, JsonPropertyName("groups")] + public ICollection? Groups { get; set; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } + [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindow { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; set; } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; set; } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; set; } +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequestDescriptor : RequestDescriptor, UpdateJobRequestParameters> +{ + internal UpdateJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + public UpdateJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimit? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistIntervalValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private IDictionary? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action> DetectorsDescriptorAction { get; set; } + private Action>[] DetectorsDescriptorActions { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action> ModelPlotConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ public UpdateJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimit? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ public UpdateJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + public UpdateJobRequestDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ public UpdateJobRequestDescriptor CustomSettings(Func, FluentDictionary> selector) + { + CustomSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ public UpdateJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of detector update objects. + /// + public UpdateJobRequestDescriptor Detectors(ICollection? detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Action> configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(params Action>[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public UpdateJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Action> configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Serverless.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ public UpdateJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ public UpdateJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ public UpdateJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DetectorsValue is not null) + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequestDescriptor : RequestDescriptor +{ + internal UpdateJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + public UpdateJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimit? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistIntervalValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private IDictionary? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action DetectorsDescriptorAction { get; set; } + private Action[] DetectorsDescriptorActions { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action ModelPlotConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ public UpdateJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimit? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ public UpdateJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Serverless.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + public UpdateJobRequestDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ public UpdateJobRequestDescriptor CustomSettings(Func, FluentDictionary> selector) + { + CustomSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ public UpdateJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of detector update objects. + /// + public UpdateJobRequestDescriptor Detectors(ICollection? detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Action configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(params Action[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public UpdateJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Action configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Serverless.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ public UpdateJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ public UpdateJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ public UpdateJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisMemoryLimitDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DetectorsValue is not null) + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs new file mode 100644 index 00000000000..3ed5d32ed5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateJobResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class UpdateJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigRead AnalysisConfig { get; init; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits AnalysisLimits { get; init; } + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("custom_settings")] + public IReadOnlyDictionary? CustomSettings { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescription { get; init; } + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Datafeed? DatafeedConfig { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("finished_time")] + public long? FinishedTime { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("job_type")] + public string JobType { get; init; } + [JsonInclude, JsonPropertyName("job_version")] + public string JobVersion { get; init; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..ccab0e08031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.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.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.MachineLearning; + +public sealed partial class UpdateModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Updates certain properties of a snapshot. +/// +public sealed partial class UpdateModelSnapshotRequest : PlainRequest +{ + public UpdateModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_model_snapshot"; + + /// + /// A description of the model snapshot. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// If `true`, this snapshot will not be deleted during automatic cleanup of
snapshots older than `model_snapshot_retention_days`. However, this
snapshot will be deleted when the job is deleted.
+ ///
+ [JsonInclude, JsonPropertyName("retain")] + public bool? Retain { get; set; } +} + +/// +/// Updates certain properties of a snapshot. +/// +public sealed partial class UpdateModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal UpdateModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_model_snapshot"; + + public UpdateModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public UpdateModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + return Self; + } + + private string? DescriptionValue { get; set; } + private bool? RetainValue { get; set; } + + /// + /// A description of the model snapshot. + /// + public UpdateModelSnapshotRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// If `true`, this snapshot will not be deleted during automatic cleanup of
snapshots older than `model_snapshot_retention_days`. However, this
snapshot will be deleted when the job is deleted.
+ ///
+ public UpdateModelSnapshotRequestDescriptor Retain(bool? retain = true) + { + RetainValue = retain; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (RetainValue.HasValue) + { + writer.WritePropertyName("retain"); + writer.WriteBooleanValue(RetainValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..b9b8e2ac13c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class UpdateModelSnapshotResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("model")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelSnapshot Model { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs new file mode 100644 index 00000000000..7fa112ddb84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.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.MachineLearning; + +public sealed partial class UpgradeJobSnapshotRequestParameters : RequestParameters +{ + /// + /// Controls the time to wait for the request to complete. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// When true, the API won’t respond until the upgrade is complete.
Otherwise, it responds as soon as the upgrade task is assigned to a node.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Upgrades an anomaly detection model snapshot to the latest major version.
Over time, older snapshot formats are deprecated and removed. Anomaly
detection jobs support only snapshots that are from the current or previous
major version.
This API provides a means to upgrade a snapshot to the current major version.
This aids in preparing the cluster for an upgrade to the next major version.
Only one snapshot per anomaly detection job can be upgraded at a time and the
upgraded snapshot cannot be the current snapshot of the anomaly detection
job.
+///
+public sealed partial class UpgradeJobSnapshotRequest : PlainRequest +{ + public UpgradeJobSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpgradeJobSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.upgrade_job_snapshot"; + + /// + /// Controls the time to wait for the request to complete. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// When true, the API won’t respond until the upgrade is complete.
Otherwise, it responds as soon as the upgrade task is assigned to a node.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Upgrades an anomaly detection model snapshot to the latest major version.
Over time, older snapshot formats are deprecated and removed. Anomaly
detection jobs support only snapshots that are from the current or previous
major version.
This API provides a means to upgrade a snapshot to the current major version.
This aids in preparing the cluster for an upgrade to the next major version.
Only one snapshot per anomaly detection job can be upgraded at a time and the
upgraded snapshot cannot be the current snapshot of the anomaly detection
job.
+///
+public sealed partial class UpgradeJobSnapshotRequestDescriptor : RequestDescriptor +{ + internal UpgradeJobSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpgradeJobSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpgradeJobSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.upgrade_job_snapshot"; + + public UpgradeJobSnapshotRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public UpgradeJobSnapshotRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public UpgradeJobSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public UpgradeJobSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/Tasks/GetTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/GetTasksResponse.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs index 0f3d7487a5a..8bdade8e7e2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/GetTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs @@ -20,20 +20,23 @@ 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.Tasks; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// -public sealed partial class GetTasksResponse : ElasticsearchResponse +public sealed partial class UpgradeJobSnapshotResponse : ElasticsearchResponse { + /// + /// When true, this means the task is complete. When false, it is still running. + /// [JsonInclude, JsonPropertyName("completed")] public bool Completed { get; init; } - [JsonInclude, JsonPropertyName("response")] - public object? Response { get; init; } - [JsonInclude, JsonPropertyName("task")] - public Elastic.Clients.Elasticsearch.Serverless.Tasks.TaskInfo Task { get; init; } + + /// + /// The ID of the node that the upgrade task was started on if it is still running. In serverless this will be the "serverless". + /// + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs new file mode 100644 index 00000000000..1f848b1b449 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorRequest.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.MachineLearning; + +public sealed partial class ValidateDetectorRequestParameters : RequestParameters +{ +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector Detector { get; set; } +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequestDescriptor : RequestDescriptor, ValidateDetectorRequestParameters> +{ + internal ValidateDetectorRequestDescriptor(Action> configure) => configure.Invoke(this); + public ValidateDetectorRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector) => DetectorValue = detector; + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector DetectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorDescriptor { get; set; } + private Action> DetectorDescriptorAction { get; set; } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector) + { + DetectorDescriptor = null; + DetectorDescriptorAction = null; + DetectorValue = detector; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorValue = null; + DetectorDescriptorAction = null; + DetectorDescriptor = descriptor; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Action> configure) + { + DetectorValue = null; + DetectorDescriptor = null; + DetectorDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequestDescriptor : RequestDescriptor +{ + internal ValidateDetectorRequestDescriptor(Action configure) => configure.Invoke(this); + public ValidateDetectorRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector) => DetectorValue = detector; + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector DetectorValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorDescriptor { get; set; } + private Action DetectorDescriptorAction { get; set; } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector) + { + DetectorDescriptor = null; + DetectorDescriptorAction = null; + DetectorValue = detector; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorValue = null; + DetectorDescriptorAction = null; + DetectorDescriptor = descriptor; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Action configure) + { + DetectorValue = null; + DetectorDescriptor = null; + DetectorDescriptorAction = configure; + 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/MachineLearning/ValidateDetectorResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs new file mode 100644 index 00000000000..5778b842494 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateDetectorResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class ValidateDetectorResponse : 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/MachineLearning/ValidateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateRequest.g.cs new file mode 100644 index 00000000000..7eaa61c0f57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateRequest.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.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.MachineLearning; + +public sealed partial class ValidateRequestParameters : RequestParameters +{ +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfig { get; set; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimits { get; set; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription? DataDescription { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get; set; } + [JsonInclude, JsonPropertyName("model_plot")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlot { get; set; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? ModelSnapshotId { get; set; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + [JsonInclude, JsonPropertyName("results_index_name")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexName { get; set; } +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequestDescriptor : RequestDescriptor, ValidateRequestParameters> +{ + internal ValidateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ValidateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription? DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action> DataDescriptionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotDescriptor { get; set; } + private Action> ModelPlotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? ModelSnapshotIdValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexNameValue { get; set; } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription? dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Action> configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public ValidateRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlot) + { + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = null; + ModelPlotValue = modelPlot; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotValue = null; + ModelPlotDescriptorAction = null; + ModelPlotDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Action> configure) + { + ModelPlotValue = null; + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id? modelSnapshotId) + { + ModelSnapshotIdValue = modelSnapshotId; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + public ValidateRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.Serverless.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else if (DataDescriptionValue is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (ModelPlotDescriptor is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotDescriptor, options); + } + else if (ModelPlotDescriptorAction is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotDescriptorAction), options); + } + else if (ModelPlotValue is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotValue, options); + } + + if (ModelSnapshotIdValue is not null) + { + writer.WritePropertyName("model_snapshot_id"); + JsonSerializer.Serialize(writer, ModelSnapshotIdValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequestDescriptor : RequestDescriptor +{ + internal ValidateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ValidateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription? DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action DataDescriptionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor ModelPlotDescriptor { get; set; } + private Action ModelPlotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? ModelSnapshotIdValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName? ResultsIndexNameValue { get; set; } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription? dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Action configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public ValidateRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? modelPlot) + { + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = null; + ModelPlotValue = modelPlot; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotValue = null; + ModelPlotDescriptorAction = null; + ModelPlotDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Action configure) + { + ModelPlotValue = null; + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotId(Elastic.Clients.Elasticsearch.Serverless.Id? modelSnapshotId) + { + ModelSnapshotIdValue = modelSnapshotId; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + public ValidateRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.Serverless.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else if (DataDescriptionValue is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (ModelPlotDescriptor is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotDescriptor, options); + } + else if (ModelPlotDescriptorAction is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfigDescriptor(ModelPlotDescriptorAction), options); + } + else if (ModelPlotValue is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotValue, options); + } + + if (ModelSnapshotIdValue is not null) + { + writer.WritePropertyName("model_snapshot_id"); + JsonSerializer.Serialize(writer, ModelSnapshotIdValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateResponse.g.cs new file mode 100644 index 00000000000..68cfeb3a832 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MachineLearning/ValidateResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class ValidateResponse : 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/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs index 20f22fca824..93e1bdd7cf0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetRequest.g.cs @@ -85,7 +85,7 @@ public MultiGetRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName? index { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -161,11 +161,15 @@ public sealed partial class MultiGetRequestDescriptor : RequestDescri { internal MultiGetRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiGetRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -189,9 +193,9 @@ public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch. } 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.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; } /// @@ -206,7 +210,7 @@ public MultiGetRequestDescriptor Docs(ICollection Docs(Core.MGet.MultiGetOperationDescriptor descriptor) + public MultiGetRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetOperationDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -215,7 +219,7 @@ public MultiGetRequestDescriptor Docs(Core.MGet.MultiGetOperationDesc return Self; } - public MultiGetRequestDescriptor Docs(Action configure) + public MultiGetRequestDescriptor Docs(Action> configure) { DocsValue = null; DocsDescriptor = null; @@ -224,7 +228,7 @@ public MultiGetRequestDescriptor Docs(Action Docs(params Action[] configure) + public MultiGetRequestDescriptor Docs(params Action>[] configure) { DocsValue = null; DocsDescriptor = null; @@ -256,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -265,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetOperationDescriptor(action), options); } writer.WriteEndArray(); @@ -293,11 +297,15 @@ public sealed partial class MultiGetRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiGetRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -321,9 +329,9 @@ public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless. } 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.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; } /// @@ -338,7 +346,7 @@ public MultiGetRequestDescriptor Docs(ICollection configure) + public MultiGetRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -356,7 +364,7 @@ public MultiGetRequestDescriptor Docs(Action[] configure) + public MultiGetRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -388,7 +396,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -397,7 +405,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetOperationDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs index 6170c5b757a..9f71d27fc58 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiGetResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs index 49f8236ca81..14e063d3a16 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchRequest.g.cs @@ -107,7 +107,7 @@ public MultiSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indi { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -186,7 +186,7 @@ public MultiSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indi /// [JsonIgnore] public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } - public List Searches { get; set; } + public List Searches { get; set; } void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) { @@ -214,15 +214,19 @@ async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClien /// /// Allows to execute several search operations in one request. /// -public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, MultiSearchRequestParameters>, IStreamSerializable +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, MultiSearchRequestParameters> { internal MultiSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -253,33 +257,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + public MultiSearchRequestDescriptor AddSearches(Elastic.Clients.Elasticsearch.Serverless.Core.MSearch.SearchRequestItem searches) { - _items.Add(search); + _items.Add(searches); return this; } } @@ -287,15 +269,19 @@ public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequ /// /// Allows to execute several search operations in one request. /// -public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, IStreamSerializable +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor { internal MultiSearchRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -326,33 +312,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + public MultiSearchRequestDescriptor AddSearches(Elastic.Clients.Elasticsearch.Serverless.Core.MSearch.SearchRequestItem searches) { - _items.Add(search); + _items.Add(searches); 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 index 04a419f5dc9..740fdd5233f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs index 2fcc02a2304..03288d65dc0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateRequest.g.cs @@ -72,7 +72,7 @@ public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Indic { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -109,7 +109,7 @@ public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Indic /// [JsonIgnore] public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } - public List SearchTemplates { get; set; } + public List SearchTemplates { get; set; } void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) { @@ -137,15 +137,19 @@ async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClien /// /// Runs multiple templated searches with a single request. /// -public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, MultiSearchTemplateRequestParameters>, IStreamSerializable +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, MultiSearchTemplateRequestParameters> { internal MultiSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchTemplateRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -169,33 +173,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + public MultiSearchTemplateRequestDescriptor AddSearchTemplates(Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates) { - _items.Add(item); + _items.Add(searchTemplates); return this; } } @@ -203,15 +185,19 @@ public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate. /// /// Runs multiple templated searches with a single request. /// -public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, IStreamSerializable +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor { internal MultiSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchTemplateRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -235,33 +221,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + public MultiSearchTemplateRequestDescriptor AddSearchTemplates(Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates) { - _items.Add(item); + _items.Add(searchTemplates); 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 index 6b54d68f7fc..8c59f80a1ab 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiSearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs index e78c226fca8..3452519e2fc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -194,6 +194,10 @@ public sealed partial class MultiTermVectorsRequestDescriptor : Reque { internal MultiTermVectorsRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiTermVectorsRequestDescriptor() { } @@ -225,9 +229,9 @@ public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasti } private ICollection? DocsValue { get; set; } - private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } - private Action> DocsDescriptorAction { get; set; } - private Action>[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action> DocsDescriptorAction { get; set; } + private Action>[] DocsDescriptorActions { get; set; } private ICollection? IdsValue { get; set; } /// @@ -242,7 +246,7 @@ public MultiTermVectorsRequestDescriptor Docs(ICollection Docs(Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) + public MultiTermVectorsRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -251,7 +255,7 @@ public MultiTermVectorsRequestDescriptor Docs(Core.Mtermvectors.Multi return Self; } - public MultiTermVectorsRequestDescriptor Docs(Action> configure) + public MultiTermVectorsRequestDescriptor Docs(Action> configure) { DocsValue = null; DocsDescriptor = null; @@ -260,7 +264,7 @@ public MultiTermVectorsRequestDescriptor Docs(Action Docs(params Action>[] configure) + public MultiTermVectorsRequestDescriptor Docs(params Action>[] configure) { DocsValue = null; DocsDescriptor = null; @@ -292,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -301,7 +305,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); } writer.WriteEndArray(); @@ -329,6 +333,10 @@ public sealed partial class MultiTermVectorsRequestDescriptor : RequestDescripto { internal MultiTermVectorsRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiTermVectorsRequestDescriptor() { } @@ -360,9 +368,9 @@ public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ser } private ICollection? DocsValue { get; set; } - private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private ICollection? IdsValue { get; set; } /// @@ -377,7 +385,7 @@ public MultiTermVectorsRequestDescriptor Docs(ICollection configure) + public MultiTermVectorsRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -395,7 +403,7 @@ public MultiTermVectorsRequestDescriptor Docs(Action[] configure) + public MultiTermVectorsRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -427,7 +435,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -436,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs index b9a5a33512b..49360764fd3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/MultiTermVectorsResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsRequest.g.cs new file mode 100644 index 00000000000..a392bfc028c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsRequest.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.Nodes; + +public sealed partial class HotThreadsRequestParameters : RequestParameters +{ + /// + /// If true, known idle threads (e.g. waiting in a socket select, or to get
a task from an empty queue) are filtered out.
+ ///
+ public bool? IgnoreIdleThreads { get => Q("ignore_idle_threads"); set => Q("ignore_idle_threads", value); } + + /// + /// The interval to do the second sampling of threads. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Interval { get => Q("interval"); set => Q("interval", 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); } + + /// + /// Number of samples of thread stacktrace. + /// + public long? Snapshots { get => Q("snapshots"); set => Q("snapshots", value); } + + /// + /// The sort order for 'cpu' type (default: total) + /// + public Elastic.Clients.Elasticsearch.Serverless.ThreadType? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Specifies the number of hot threads to provide information for. + /// + public long? Threads { get => Q("threads"); set => Q("threads", 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 type to sample. + /// + public Elastic.Clients.Elasticsearch.Serverless.ThreadType? Type { get => Q("type"); set => Q("type", value); } +} + +/// +/// This API yields a breakdown of the hot threads on each selected node in the cluster.
The output is plain text with a breakdown of each node’s top hot threads.
+///
+public sealed partial class HotThreadsRequest : PlainRequest +{ + public HotThreadsRequest() + { + } + + public HotThreadsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesHotThreads; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.hot_threads"; + + /// + /// If true, known idle threads (e.g. waiting in a socket select, or to get
a task from an empty queue) are filtered out.
+ ///
+ [JsonIgnore] + public bool? IgnoreIdleThreads { get => Q("ignore_idle_threads"); set => Q("ignore_idle_threads", value); } + + /// + /// The interval to do the second sampling of threads. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Interval { get => Q("interval"); set => Q("interval", 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); } + + /// + /// Number of samples of thread stacktrace. + /// + [JsonIgnore] + public long? Snapshots { get => Q("snapshots"); set => Q("snapshots", value); } + + /// + /// The sort order for 'cpu' type (default: total) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.ThreadType? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Specifies the number of hot threads to provide information for. + /// + [JsonIgnore] + public long? Threads { get => Q("threads"); set => Q("threads", 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 type to sample. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.ThreadType? Type { get => Q("type"); set => Q("type", value); } +} + +/// +/// This API yields a breakdown of the hot threads on each selected node in the cluster.
The output is plain text with a breakdown of each node’s top hot threads.
+///
+public sealed partial class HotThreadsRequestDescriptor : RequestDescriptor +{ + internal HotThreadsRequestDescriptor(Action configure) => configure.Invoke(this); + + public HotThreadsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public HotThreadsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesHotThreads; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.hot_threads"; + + public HotThreadsRequestDescriptor IgnoreIdleThreads(bool? ignoreIdleThreads = true) => Qs("ignore_idle_threads", ignoreIdleThreads); + public HotThreadsRequestDescriptor Interval(Elastic.Clients.Elasticsearch.Serverless.Duration? interval) => Qs("interval", interval); + public HotThreadsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public HotThreadsRequestDescriptor Snapshots(long? snapshots) => Qs("snapshots", snapshots); + public HotThreadsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.ThreadType? sort) => Qs("sort", sort); + public HotThreadsRequestDescriptor Threads(long? threads) => Qs("threads", threads); + public HotThreadsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public HotThreadsRequestDescriptor Type(Elastic.Clients.Elasticsearch.Serverless.ThreadType? type) => Qs("type", type); + + public HotThreadsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/Nodes/HotThreadsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsResponse.g.cs new file mode 100644 index 00000000000..2ff84f8c9c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/HotThreadsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Nodes; + +public sealed partial class HotThreadsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("hot_threads")] + public IReadOnlyCollection HotThreads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoRequest.g.cs new file mode 100644 index 00000000000..5be40417b3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoRequest.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.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.Nodes; + +public sealed partial class NodesInfoRequestParameters : RequestParameters +{ + /// + /// 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); } +} + +/// +/// Returns cluster nodes information. +/// +public sealed partial class NodesInfoRequest : PlainRequest +{ + public NodesInfoRequest() + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.info"; + + /// + /// 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); } +} + +/// +/// Returns cluster nodes information. +/// +public sealed partial class NodesInfoRequestDescriptor : RequestDescriptor +{ + internal NodesInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public NodesInfoRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + public NodesInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.info"; + + public NodesInfoRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public NodesInfoRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesInfoRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public NodesInfoRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesInfoRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/Nodes/NodesInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoResponse.g.cs new file mode 100644 index 00000000000..664213a26e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesInfoResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; + +public sealed partial class NodesInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsRequest.g.cs new file mode 100644 index 00000000000..c3b10797cc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsRequest.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.Nodes; + +public sealed partial class NodesStatsRequestParameters : 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); } + + /// + /// 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); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + public bool? 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); } + + /// + /// 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 comma-separated list of document types for the indexing index metric. + /// + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequest : PlainRequest +{ + public NodesStatsRequest() + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric, Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) : base(r => r.Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric, Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.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); } + + /// + /// 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); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + [JsonIgnore] + public bool? 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); } + + /// + /// 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 comma-separated list of document types for the indexing index metric. + /// + [JsonIgnore] + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequestDescriptor : RequestDescriptor, NodesStatsRequestParameters> +{ + internal NodesStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public NodesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric, Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.stats"; + + public NodesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Serverless.Fields? completionFields) => Qs("completion_fields", completionFields); + public NodesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Serverless.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public NodesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public NodesStatsRequestDescriptor Groups(bool? groups = true) => Qs("groups", groups); + public NodesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public NodesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + public NodesStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public NodesStatsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public NodesStatsRequestDescriptor IndexMetric(Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) + { + RouteValues.Optional("index_metric", indexMetric); + return Self; + } + + public NodesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequestDescriptor : RequestDescriptor +{ + internal NodesStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public NodesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric, Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.stats"; + + public NodesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Serverless.Fields? completionFields) => Qs("completion_fields", completionFields); + public NodesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Serverless.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public NodesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) => Qs("fields", fields); + public NodesStatsRequestDescriptor Groups(bool? groups = true) => Qs("groups", groups); + public NodesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public NodesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Serverless.Level? level) => Qs("level", level); + public NodesStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public NodesStatsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public NodesStatsRequestDescriptor IndexMetric(Elastic.Clients.Elasticsearch.Serverless.Metrics? indexMetric) + { + RouteValues.Optional("index_metric", indexMetric); + return Self; + } + + public NodesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/Nodes/NodesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsResponse.g.cs new file mode 100644 index 00000000000..56845d07a1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; + +public sealed partial class NodesStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string? ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/GetTasksRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageRequest.g.cs similarity index 56% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/GetTasksRequest.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageRequest.g.cs index d9f51ab75c7..ddb86ad3215 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/GetTasksRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageRequest.g.cs @@ -27,82 +27,86 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Tasks; +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; -public sealed partial class GetTasksRequestParameters : RequestParameters +public sealed partial class NodesUsageRequestParameters : RequestParameters { /// /// 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 request blocks until the task has completed. - /// - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// Returns information about a task. +/// Returns information on the usage of features. /// -public sealed partial class GetTasksRequest : PlainRequest +public sealed partial class NodesUsageRequest : PlainRequest { - public GetTasksRequest(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) + public NodesUsageRequest() + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) { } - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksGet; + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesUsage; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "tasks.get"; + internal override string OperationName => "nodes.usage"; /// /// 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 request blocks until the task has completed. - /// - [JsonIgnore] - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// Returns information about a task. +/// Returns information on the usage of features. /// -public sealed partial class GetTasksRequestDescriptor : RequestDescriptor +public sealed partial class NodesUsageRequestDescriptor : RequestDescriptor { - internal GetTasksRequestDescriptor(Action configure) => configure.Invoke(this); + internal NodesUsageRequestDescriptor(Action configure) => configure.Invoke(this); - public GetTasksRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) + public NodesUsageRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) { } - internal GetTasksRequestDescriptor() + public NodesUsageRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksGet; + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesUsage; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; internal override bool SupportsBody => false; - internal override string OperationName => "tasks.get"; + internal override string OperationName => "nodes.usage"; + + public NodesUsageRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); - public GetTasksRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); - public GetTasksRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + public NodesUsageRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } - public GetTasksRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.Id task_id) + public NodesUsageRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Serverless.NodeIds? nodeId) { - RouteValues.Required("task_id", task_id); + RouteValues.Optional("node_id", nodeId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageResponse.g.cs new file mode 100644 index 00000000000..9862d4ae212 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Nodes/NodesUsageResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; + +public sealed partial class NodesUsageResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { 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 index ea6137b3be9..d9498006e8a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeRequest.g.cs @@ -116,10 +116,6 @@ public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless { } - internal OpenPointInTimeRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -156,10 +152,6 @@ public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless { } - internal OpenPointInTimeRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs index 20935f77048..6094b36e7d1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/OpenPointInTimeResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs index 8d21c41bd23..7768d59ac25 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PingResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs index ae7dbd4a3a5..29720f9ecd8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptRequest.g.cs @@ -89,15 +89,11 @@ public sealed partial class PutScriptRequestDescriptor : RequestDescr { 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() + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) { } @@ -112,21 +108,21 @@ internal PutScriptRequestDescriptor() 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) + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) { - RouteValues.Required("id", id); + RouteValues.Optional("context", context); return Self; } - public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) { - RouteValues.Optional("context", context); + RouteValues.Required("id", id); return Self; } private Elastic.Clients.Elasticsearch.Serverless.StoredScript ScriptValue { get; set; } - private StoredScriptDescriptor ScriptDescriptor { get; set; } - private Action ScriptDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } /// /// Contains the script or search template, its parameters, and its language. @@ -139,7 +135,7 @@ public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearc return Self; } - public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor descriptor) { ScriptValue = null; ScriptDescriptorAction = null; @@ -147,7 +143,7 @@ public PutScriptRequestDescriptor Script(StoredScriptDescriptor descr return Self; } - public PutScriptRequestDescriptor Script(Action configure) + public PutScriptRequestDescriptor Script(Action configure) { ScriptValue = null; ScriptDescriptor = null; @@ -166,7 +162,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptDescriptorAction is not null) { writer.WritePropertyName("script"); - JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor(ScriptDescriptorAction), options); } else { @@ -185,15 +181,11 @@ public sealed partial class PutScriptRequestDescriptor : RequestDescriptor 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() + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) { } @@ -208,21 +200,21 @@ internal PutScriptRequestDescriptor() 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) + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) { - RouteValues.Required("id", id); + RouteValues.Optional("context", context); return Self; } - public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Serverless.Name? context) + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) { - RouteValues.Optional("context", context); + RouteValues.Required("id", id); return Self; } private Elastic.Clients.Elasticsearch.Serverless.StoredScript ScriptValue { get; set; } - private StoredScriptDescriptor ScriptDescriptor { get; set; } - private Action ScriptDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } /// /// Contains the script or search template, its parameters, and its language. @@ -235,7 +227,7 @@ public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverles return Self; } - public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor descriptor) { ScriptValue = null; ScriptDescriptorAction = null; @@ -243,7 +235,7 @@ public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) return Self; } - public PutScriptRequestDescriptor Script(Action configure) + public PutScriptRequestDescriptor Script(Action configure) { ScriptValue = null; ScriptDescriptor = null; @@ -262,7 +254,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptDescriptorAction is not null) { writer.WritePropertyName("script"); - JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.StoredScriptDescriptor(ScriptDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs index 4b6ecb4b85c..c968ddd6e6e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/PutScriptResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs index 14eb3b2d769..ee1f94c4a7a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalRequest.g.cs @@ -117,6 +117,10 @@ public sealed partial class RankEvalRequestDescriptor : RequestDescri { internal RankEvalRequestDescriptor(Action> configure) => configure.Invoke(this); + public RankEvalRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RankEvalRequestDescriptor() { } @@ -141,12 +145,12 @@ public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearc } private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? MetricValue { get; set; } - private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } - private Action MetricDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } 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.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action> RequestsDescriptorAction { get; set; } + private Action>[] RequestsDescriptorActions { get; set; } /// /// Definition of the evaluation metric to calculate. @@ -159,7 +163,7 @@ public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch return Self; } - public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor descriptor) { MetricValue = null; MetricDescriptorAction = null; @@ -167,7 +171,7 @@ public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricD return Self; } - public RankEvalRequestDescriptor Metric(Action configure) + public RankEvalRequestDescriptor Metric(Action configure) { MetricValue = null; MetricDescriptor = null; @@ -187,7 +191,7 @@ public RankEvalRequestDescriptor Requests(ICollection Requests(Core.RankEval.RankEvalRequestItemDescriptor descriptor) + public RankEvalRequestDescriptor Requests(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalRequestItemDescriptor descriptor) { RequestsValue = null; RequestsDescriptorAction = null; @@ -196,7 +200,7 @@ public RankEvalRequestDescriptor Requests(Core.RankEval.RankEvalReque return Self; } - public RankEvalRequestDescriptor Requests(Action> configure) + public RankEvalRequestDescriptor Requests(Action> configure) { RequestsValue = null; RequestsDescriptor = null; @@ -205,7 +209,7 @@ public RankEvalRequestDescriptor Requests(Action Requests(params Action>[] configure) + public RankEvalRequestDescriptor Requests(params Action>[] configure) { RequestsValue = null; RequestsDescriptor = null; @@ -225,7 +229,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricDescriptorAction is not null) { writer.WritePropertyName("metric"); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); } else if (MetricValue is not null) { @@ -244,7 +248,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("requests"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); writer.WriteEndArray(); } else if (RequestsDescriptorActions is not null) @@ -253,7 +257,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RequestsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalRequestItemDescriptor(action), options); } writer.WriteEndArray(); @@ -275,6 +279,10 @@ public sealed partial class RankEvalRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public RankEvalRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RankEvalRequestDescriptor() { } @@ -299,12 +307,12 @@ public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverles } private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetric? MetricValue { get; set; } - private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } - private Action MetricDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } 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.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action RequestsDescriptorAction { get; set; } + private Action[] RequestsDescriptorActions { get; set; } /// /// Definition of the evaluation metric to calculate. @@ -317,7 +325,7 @@ public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless return Self; } - public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor descriptor) { MetricValue = null; MetricDescriptorAction = null; @@ -325,7 +333,7 @@ public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor d return Self; } - public RankEvalRequestDescriptor Metric(Action configure) + public RankEvalRequestDescriptor Metric(Action configure) { MetricValue = null; MetricDescriptor = null; @@ -345,7 +353,7 @@ public RankEvalRequestDescriptor Requests(ICollection configure) + public RankEvalRequestDescriptor Requests(Action configure) { RequestsValue = null; RequestsDescriptor = null; @@ -363,7 +371,7 @@ public RankEvalRequestDescriptor Requests(Action[] configure) + public RankEvalRequestDescriptor Requests(params Action[] configure) { RequestsValue = null; RequestsDescriptor = null; @@ -383,7 +391,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricDescriptorAction is not null) { writer.WritePropertyName("metric"); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); } else if (MetricValue is not null) { @@ -402,7 +410,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("requests"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); writer.WriteEndArray(); } else if (RequestsDescriptorActions is not null) @@ -411,7 +419,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RequestsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalRequestItemDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs index 57577b65517..c7ea3961fbc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RankEvalResponse.g.cs @@ -20,6 +20,7 @@ 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; @@ -31,7 +32,7 @@ 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; } + public IReadOnlyDictionary Details { get; init; } [JsonInclude, JsonPropertyName("failures")] public IReadOnlyDictionary Failures { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRequest.g.cs index c3e974d0e8a..5701163cc95 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRequest.g.cs @@ -196,14 +196,14 @@ public ReindexRequestDescriptor() private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Destination DestValue { get; set; } - private Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } - private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private long? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Source SourceValue { get; set; } - private Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } - private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } /// /// Set to proceed to continue reindexing even if there are conflicts. @@ -225,7 +225,7 @@ public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Se return Self; } - public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descriptor) + public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor descriptor) { DestValue = null; DestDescriptorAction = null; @@ -233,7 +233,7 @@ public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescript return Self; } - public ReindexRequestDescriptor Dest(Action configure) + public ReindexRequestDescriptor Dest(Action configure) { DestValue = null; DestDescriptor = null; @@ -276,7 +276,7 @@ public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch. return Self; } - public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) + public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -284,7 +284,7 @@ public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor< return Self; } - public ReindexRequestDescriptor Source(Action> configure) + public ReindexRequestDescriptor Source(Action> configure) { SourceValue = null; SourceDescriptor = null; @@ -309,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DestDescriptorAction is not null) { writer.WritePropertyName("dest"); - JsonSerializer.Serialize(writer, new Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); } else { @@ -343,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("source"); - JsonSerializer.Serialize(writer, new Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); } else { @@ -385,14 +385,14 @@ public ReindexRequestDescriptor() private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Destination DestValue { get; set; } - private Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } - private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private long? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Source SourceValue { get; set; } - private Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Set to proceed to continue reindexing even if there are conflicts. @@ -414,7 +414,7 @@ public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.Co return Self; } - public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descriptor) + public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor descriptor) { DestValue = null; DestDescriptorAction = null; @@ -422,7 +422,7 @@ public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descript return Self; } - public ReindexRequestDescriptor Dest(Action configure) + public ReindexRequestDescriptor Dest(Action configure) { DestValue = null; DestDescriptor = null; @@ -465,7 +465,7 @@ public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) + public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -473,7 +473,7 @@ public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) return Self; } - public ReindexRequestDescriptor Source(Action configure) + public ReindexRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -498,7 +498,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DestDescriptorAction is not null) { writer.WritePropertyName("dest"); - JsonSerializer.Serialize(writer, new Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); } else { @@ -532,7 +532,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("source"); - JsonSerializer.Serialize(writer, new Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexResponse.g.cs index 606a9ad676a..b6ff9020f2f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleRequest.g.cs index c209d9fb9c6..1fef35a8ec1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class ReindexRethrottleRequestParameters : RequestParamete /// public sealed partial class ReindexRethrottleRequest : PlainRequest { - public ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) + public ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class ReindexRethrottleRequestDescriptor : RequestDescript { internal ReindexRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public ReindexRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal ReindexRethrottleRequestDescriptor() + public ReindexRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal ReindexRethrottleRequestDescriptor() public ReindexRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public ReindexRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.Id task_id) + public ReindexRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.Id taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleResponse.g.cs index d773d734cd4..19f4f37fe97 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ReindexRethrottleResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs index 5db025f3840..2a1b2d897cf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateRequest.g.cs @@ -77,6 +77,10 @@ public sealed partial class RenderSearchTemplateRequestDescriptor : R { internal RenderSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public RenderSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public RenderSearchTemplateRequestDescriptor() { } @@ -155,6 +159,10 @@ public sealed partial class RenderSearchTemplateRequestDescriptor : RequestDescr { internal RenderSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public RenderSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Optional("id", id)) + { + } + public RenderSearchTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs index 5a0a5c3f420..0ca6fcf6f2f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/RenderSearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs index 2f8ead2c596..3a5ffc51772 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ScrollResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtRequest.g.cs new file mode 100644 index 00000000000..723b8947184 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtRequest.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.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 partial class SearchMvtRequestParameters : RequestParameters +{ +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequest : PlainRequest +{ + public SearchMvtRequest(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ [JsonInclude, JsonPropertyName("aggs")] + public IDictionary? Aggs { get; set; } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ [JsonInclude, JsonPropertyName("buffer")] + public int? Buffer { get; set; } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ [JsonInclude, JsonPropertyName("exact_bounds")] + public bool? ExactBounds { get; set; } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + [JsonInclude, JsonPropertyName("extent")] + public int? Extent { get; set; } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + + /// + /// Aggregation used to create a grid for the `field`. + /// + [JsonInclude, JsonPropertyName("grid_agg")] + public Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridAggregationType? GridAgg { get; set; } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ [JsonInclude, JsonPropertyName("grid_precision")] + public int? GridPrecision { get; set; } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ [JsonInclude, JsonPropertyName("grid_type")] + public Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridType? GridType { get; set; } + + /// + /// Query DSL used to filter documents for the search. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { 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; } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] + public ICollection? Sort { 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; } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ [JsonInclude, JsonPropertyName("with_labels")] + public bool? WithLabels { get; set; } +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequestDescriptor : RequestDescriptor, SearchMvtRequestParameters> +{ + internal SearchMvtRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SearchMvtRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + public SearchMvtRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + RouteValues.Required("field", field); + return Self; + } + + public SearchMvtRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public SearchMvtRequestDescriptor x(int x) + { + RouteValues.Required("x", x); + return Self; + } + + public SearchMvtRequestDescriptor y(int y) + { + RouteValues.Required("y", y); + return Self; + } + + public SearchMvtRequestDescriptor Zoom(int zoom) + { + RouteValues.Required("zoom", zoom); + return Self; + } + + private IDictionary> AggsValue { get; set; } + private int? BufferValue { get; set; } + private bool? ExactBoundsValue { get; set; } + private int? ExtentValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridAggregationType? GridAggValue { get; set; } + private int? GridPrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridType? GridTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? WithLabelsValue { get; set; } + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ public SearchMvtRequestDescriptor Aggs(Func>, FluentDescriptorDictionary>> selector) + { + AggsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ public SearchMvtRequestDescriptor Buffer(int? buffer) + { + BufferValue = buffer; + return Self; + } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ public SearchMvtRequestDescriptor ExactBounds(bool? exactBounds = true) + { + ExactBoundsValue = exactBounds; + return Self; + } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + public SearchMvtRequestDescriptor Extent(int? extent) + { + ExtentValue = extent; + return Self; + } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ public SearchMvtRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Aggregation used to create a grid for the `field`. + /// + public SearchMvtRequestDescriptor GridAgg(Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridAggregationType? gridAgg) + { + GridAggValue = gridAgg; + return Self; + } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ public SearchMvtRequestDescriptor GridPrecision(int? gridPrecision) + { + GridPrecisionValue = gridPrecision; + return Self; + } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ public SearchMvtRequestDescriptor GridType(Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridType? gridType) + { + GridTypeValue = gridType; + return Self; + } + + /// + /// Query DSL used to filter documents for the search. + /// + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = 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 SearchMvtRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ public SearchMvtRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ public SearchMvtRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchMvtRequestDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + 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 SearchMvtRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ public SearchMvtRequestDescriptor WithLabels(bool? withLabels = true) + { + WithLabelsValue = withLabels; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggsValue is not null) + { + writer.WritePropertyName("aggs"); + JsonSerializer.Serialize(writer, AggsValue, options); + } + + if (BufferValue.HasValue) + { + writer.WritePropertyName("buffer"); + writer.WriteNumberValue(BufferValue.Value); + } + + if (ExactBoundsValue.HasValue) + { + writer.WritePropertyName("exact_bounds"); + writer.WriteBooleanValue(ExactBoundsValue.Value); + } + + if (ExtentValue.HasValue) + { + writer.WritePropertyName("extent"); + writer.WriteNumberValue(ExtentValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (GridAggValue is not null) + { + writer.WritePropertyName("grid_agg"); + JsonSerializer.Serialize(writer, GridAggValue, options); + } + + if (GridPrecisionValue.HasValue) + { + writer.WritePropertyName("grid_precision"); + writer.WriteNumberValue(GridPrecisionValue.Value); + } + + if (GridTypeValue is not null) + { + writer.WritePropertyName("grid_type"); + JsonSerializer.Serialize(writer, GridTypeValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (WithLabelsValue.HasValue) + { + writer.WritePropertyName("with_labels"); + writer.WriteBooleanValue(WithLabelsValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequestDescriptor : RequestDescriptor +{ + internal SearchMvtRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchMvtRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + public SearchMvtRequestDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + RouteValues.Required("field", field); + return Self; + } + + public SearchMvtRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public SearchMvtRequestDescriptor x(int x) + { + RouteValues.Required("x", x); + return Self; + } + + public SearchMvtRequestDescriptor y(int y) + { + RouteValues.Required("y", y); + return Self; + } + + public SearchMvtRequestDescriptor Zoom(int zoom) + { + RouteValues.Required("zoom", zoom); + return Self; + } + + private IDictionary AggsValue { get; set; } + private int? BufferValue { get; set; } + private bool? ExactBoundsValue { get; set; } + private int? ExtentValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridAggregationType? GridAggValue { get; set; } + private int? GridPrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridType? GridTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? WithLabelsValue { get; set; } + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ public SearchMvtRequestDescriptor Aggs(Func, FluentDescriptorDictionary> selector) + { + AggsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ public SearchMvtRequestDescriptor Buffer(int? buffer) + { + BufferValue = buffer; + return Self; + } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ public SearchMvtRequestDescriptor ExactBounds(bool? exactBounds = true) + { + ExactBoundsValue = exactBounds; + return Self; + } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + public SearchMvtRequestDescriptor Extent(int? extent) + { + ExtentValue = extent; + return Self; + } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ public SearchMvtRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Aggregation used to create a grid for the `field`. + /// + public SearchMvtRequestDescriptor GridAgg(Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridAggregationType? gridAgg) + { + GridAggValue = gridAgg; + return Self; + } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ public SearchMvtRequestDescriptor GridPrecision(int? gridPrecision) + { + GridPrecisionValue = gridPrecision; + return Self; + } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ public SearchMvtRequestDescriptor GridType(Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt.GridType? gridType) + { + GridTypeValue = gridType; + return Self; + } + + /// + /// Query DSL used to filter documents for the search. + /// + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = 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 SearchMvtRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ public SearchMvtRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ public SearchMvtRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchMvtRequestDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + 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 SearchMvtRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ public SearchMvtRequestDescriptor WithLabels(bool? withLabels = true) + { + WithLabelsValue = withLabels; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggsValue is not null) + { + writer.WritePropertyName("aggs"); + JsonSerializer.Serialize(writer, AggsValue, options); + } + + if (BufferValue.HasValue) + { + writer.WritePropertyName("buffer"); + writer.WriteNumberValue(BufferValue.Value); + } + + if (ExactBoundsValue.HasValue) + { + writer.WritePropertyName("exact_bounds"); + writer.WriteBooleanValue(ExactBoundsValue.Value); + } + + if (ExtentValue.HasValue) + { + writer.WritePropertyName("extent"); + writer.WriteNumberValue(ExtentValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (GridAggValue is not null) + { + writer.WritePropertyName("grid_agg"); + JsonSerializer.Serialize(writer, GridAggValue, options); + } + + if (GridPrecisionValue.HasValue) + { + writer.WritePropertyName("grid_precision"); + writer.WriteNumberValue(GridPrecisionValue.Value); + } + + if (GridTypeValue is not null) + { + writer.WritePropertyName("grid_type"); + JsonSerializer.Serialize(writer, GridTypeValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (WithLabelsValue.HasValue) + { + writer.WritePropertyName("with_labels"); + writer.WriteBooleanValue(WithLabelsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtResponse.g.cs new file mode 100644 index 00000000000..440b5b72c18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchMvtResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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; + +public sealed partial class SearchMvtResponse : ElasticsearchResponse +{ +} \ 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 index 9f69c163b63..88f54cfbc76 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs @@ -191,7 +191,7 @@ public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -597,10 +597,10 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria } } -[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.
///
+[JsonConverter(typeof(SearchRequestConverter))] public partial class SearchRequest : PlainRequest { public SearchRequest() @@ -797,7 +797,7 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) /// 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; } + public IDictionary? Aggregations { get; set; } /// /// Collapses search results the values of the specified field. @@ -995,16 +995,6 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) public bool? Version { 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.
///
@@ -1012,11 +1002,11 @@ public sealed partial class SearchRequestDescriptor : RequestDescript { internal SearchRequestDescriptor(Action> configure) => configure.Invoke(this); - public SearchRequestDescriptor() : this(typeof(TDocument)) + public SearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) { } - public SearchRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + public SearchRequestDescriptor() { } @@ -1064,67 +1054,65 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. 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 IDictionary> AggregationsValue { 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { 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.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Rank? RankValue { get; set; } - private RankDescriptor RankDescriptor { get; set; } - private Action RankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { 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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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.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 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -1134,27 +1122,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. /// /// 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) + public SearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SearchRequestDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -1169,7 +1139,7 @@ public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -1177,7 +1147,7 @@ public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDesc return Self; } - public SearchRequestDescriptor Collapse(Action> configure) + public SearchRequestDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -1197,7 +1167,7 @@ public SearchRequestDescriptor DocvalueFields(ICollection DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SearchRequestDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -1206,7 +1176,7 @@ public SearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormat return Self; } - public SearchRequestDescriptor DocvalueFields(Action> configure) + public SearchRequestDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1215,7 +1185,7 @@ public SearchRequestDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public SearchRequestDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1254,7 +1224,7 @@ public SearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -1263,7 +1233,7 @@ public SearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescript return Self; } - public SearchRequestDescriptor Fields(Action> configure) + public SearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1272,7 +1242,7 @@ public SearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public SearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1301,7 +1271,7 @@ public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1309,7 +1279,7 @@ public SearchRequestDescriptor Highlight(Core.Search.HighlightDescrip return Self; } - public SearchRequestDescriptor Highlight(Action> configure) + public SearchRequestDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1338,7 +1308,7 @@ public SearchRequestDescriptor Knn(ICollection Knn(KnnQueryDescriptor descriptor) + public SearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor descriptor) { KnnValue = null; KnnDescriptorAction = null; @@ -1347,7 +1317,7 @@ public SearchRequestDescriptor Knn(KnnQueryDescriptor desc return Self; } - public SearchRequestDescriptor Knn(Action> configure) + public SearchRequestDescriptor Knn(Action> configure) { KnnValue = null; KnnDescriptor = null; @@ -1356,7 +1326,7 @@ public SearchRequestDescriptor Knn(Action Knn(params Action>[] configure) + public SearchRequestDescriptor Knn(params Action>[] configure) { KnnValue = null; KnnDescriptor = null; @@ -1385,7 +1355,7 @@ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serv return Self; } - public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -1393,7 +1363,7 @@ public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDe return Self; } - public SearchRequestDescriptor Pit(Action configure) + public SearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -1412,7 +1382,7 @@ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsear return Self; } - public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -1420,7 +1390,7 @@ public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor PostFilter(Action> configure) + public SearchRequestDescriptor PostFilter(Action> configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -1448,7 +1418,7 @@ public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Se return Self; } - public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -1456,7 +1426,7 @@ public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public SearchRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -1475,7 +1445,7 @@ public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Ser return Self; } - public SearchRequestDescriptor Rank(RankDescriptor descriptor) + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Serverless.RankDescriptor descriptor) { RankValue = null; RankDescriptorAction = null; @@ -1483,7 +1453,7 @@ public SearchRequestDescriptor Rank(RankDescriptor descriptor) return Self; } - public SearchRequestDescriptor Rank(Action configure) + public SearchRequestDescriptor Rank(Action configure) { RankValue = null; RankDescriptor = null; @@ -1503,7 +1473,7 @@ public SearchRequestDescriptor Rescore(ICollection Rescore(Core.Search.RescoreDescriptor descriptor) + public SearchRequestDescriptor Rescore(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor descriptor) { RescoreValue = null; RescoreDescriptorAction = null; @@ -1512,7 +1482,7 @@ public SearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor< return Self; } - public SearchRequestDescriptor Rescore(Action> configure) + public SearchRequestDescriptor Rescore(Action> configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1521,7 +1491,7 @@ public SearchRequestDescriptor Rescore(Action Rescore(params Action>[] configure) + public SearchRequestDescriptor Rescore(params Action>[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1533,18 +1503,18 @@ public SearchRequestDescriptor Rescore(params Action /// 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) + public SearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -1586,7 +1556,7 @@ public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Se return Self; } - public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -1594,7 +1564,7 @@ public SearchRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public SearchRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -1614,7 +1584,7 @@ public SearchRequestDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SearchRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1623,7 +1593,7 @@ public SearchRequestDescriptor Sort(SortOptionsDescriptor return Self; } - public SearchRequestDescriptor Sort(Action> configure) + public SearchRequestDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1632,7 +1602,7 @@ public SearchRequestDescriptor Sort(Action Sort(params Action>[] configure) + public SearchRequestDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -1679,7 +1649,7 @@ public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch. return Self; } - public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -1687,7 +1657,7 @@ public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescripto return Self; } - public SearchRequestDescriptor Suggest(Action configure) + public SearchRequestDescriptor Suggest(Action> configure) { SuggestValue = null; SuggestDescriptor = null; @@ -1743,17 +1713,7 @@ public SearchRequestDescriptor Version(bool? version = true) 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) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -1767,7 +1727,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -1786,7 +1746,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -1795,7 +1755,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1829,7 +1789,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -1838,7 +1798,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1863,7 +1823,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1885,7 +1845,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -1894,7 +1854,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -1920,7 +1880,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -1936,7 +1896,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -1958,7 +1918,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -1974,7 +1934,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RankDescriptorAction is not null) { writer.WritePropertyName("rank"); - JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.RankDescriptor(RankDescriptorAction), options); } else if (RankValue is not null) { @@ -1990,7 +1950,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -1999,7 +1959,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -2049,7 +2009,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -2065,7 +2025,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -2074,7 +2034,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -2112,7 +2072,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -2161,7 +2121,7 @@ public sealed partial class SearchRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public SearchRequestDescriptor(Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + public SearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) { } @@ -2213,67 +2173,65 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless. 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 IDictionary AggregationsValue { 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { 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.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Rank? RankValue { get; set; } - private RankDescriptor RankDescriptor { get; set; } - private Action RankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { 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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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.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 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -2283,27 +2241,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless. /// /// 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) + public SearchRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2318,7 +2258,7 @@ public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless return Self; } - public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -2326,7 +2266,7 @@ public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor desc return Self; } - public SearchRequestDescriptor Collapse(Action configure) + public SearchRequestDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -2346,7 +2286,7 @@ public SearchRequestDescriptor DocvalueFields(ICollection configure) + public SearchRequestDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2364,7 +2304,7 @@ public SearchRequestDescriptor DocvalueFields(Action[] configure) + public SearchRequestDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2403,7 +2343,7 @@ public SearchRequestDescriptor Fields(ICollection configure) + public SearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2421,7 +2361,7 @@ public SearchRequestDescriptor Fields(Action return Self; } - public SearchRequestDescriptor Fields(params Action[] configure) + public SearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2450,7 +2390,7 @@ public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverles return Self; } - public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2458,7 +2398,7 @@ public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descrip return Self; } - public SearchRequestDescriptor Highlight(Action configure) + public SearchRequestDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2487,7 +2427,7 @@ public SearchRequestDescriptor Knn(ICollection configure) + public SearchRequestDescriptor Knn(Action configure) { KnnValue = null; KnnDescriptor = null; @@ -2505,7 +2445,7 @@ public SearchRequestDescriptor Knn(Action configure) return Self; } - public SearchRequestDescriptor Knn(params Action[] configure) + public SearchRequestDescriptor Knn(params Action[] configure) { KnnValue = null; KnnDescriptor = null; @@ -2534,7 +2474,7 @@ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core return Self; } - public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -2542,7 +2482,7 @@ public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor de return Self; } - public SearchRequestDescriptor Pit(Action configure) + public SearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -2561,7 +2501,7 @@ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverle return Self; } - public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -2569,7 +2509,7 @@ public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) return Self; } - public SearchRequestDescriptor PostFilter(Action configure) + public SearchRequestDescriptor PostFilter(Action configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -2597,7 +2537,7 @@ public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Qu return Self; } - public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -2605,7 +2545,7 @@ public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public SearchRequestDescriptor Query(Action configure) + public SearchRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -2624,7 +2564,7 @@ public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Serverless.Ran return Self; } - public SearchRequestDescriptor Rank(RankDescriptor descriptor) + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Serverless.RankDescriptor descriptor) { RankValue = null; RankDescriptorAction = null; @@ -2632,7 +2572,7 @@ public SearchRequestDescriptor Rank(RankDescriptor descriptor) return Self; } - public SearchRequestDescriptor Rank(Action configure) + public SearchRequestDescriptor Rank(Action configure) { RankValue = null; RankDescriptor = null; @@ -2652,7 +2592,7 @@ public SearchRequestDescriptor Rescore(ICollection configure) + public SearchRequestDescriptor Rescore(Action configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2670,7 +2610,7 @@ public SearchRequestDescriptor Rescore(Action con return Self; } - public SearchRequestDescriptor Rescore(params Action[] configure) + public SearchRequestDescriptor Rescore(params Action[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2682,18 +2622,18 @@ public SearchRequestDescriptor Rescore(params Action /// 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) + public SearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2735,7 +2675,7 @@ public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.Sl return Self; } - public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -2743,7 +2683,7 @@ public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public SearchRequestDescriptor Slice(Action configure) + public SearchRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -2763,7 +2703,7 @@ public SearchRequestDescriptor Sort(ICollection configure) + public SearchRequestDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -2781,7 +2721,7 @@ public SearchRequestDescriptor Sort(Action configure) return Self; } - public SearchRequestDescriptor Sort(params Action[] configure) + public SearchRequestDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -2828,7 +2768,7 @@ public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -2836,7 +2776,7 @@ public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descripto return Self; } - public SearchRequestDescriptor Suggest(Action configure) + public SearchRequestDescriptor Suggest(Action configure) { SuggestValue = null; SuggestDescriptor = null; @@ -2892,17 +2832,7 @@ public SearchRequestDescriptor Version(bool? version = true) 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) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -2916,7 +2846,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -2935,7 +2865,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -2944,7 +2874,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2978,7 +2908,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -2987,7 +2917,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -3012,7 +2942,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -3034,7 +2964,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -3043,7 +2973,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -3069,7 +2999,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -3085,7 +3015,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -3107,7 +3037,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -3123,7 +3053,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RankDescriptorAction is not null) { writer.WritePropertyName("rank"); - JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.RankDescriptor(RankDescriptorAction), options); } else if (RankValue is not null) { @@ -3139,7 +3069,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -3148,7 +3078,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -3198,7 +3128,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -3214,7 +3144,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -3223,7 +3153,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -3261,7 +3191,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -3301,4 +3231,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 7a83ad970b0..151530f6fec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs index 6144b2c675f..e8ea4bcab4e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateRequest.g.cs @@ -212,6 +212,10 @@ public sealed partial class SearchTemplateRequestDescriptor : Request { internal SearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public SearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchTemplateRequestDescriptor() { } @@ -337,6 +341,10 @@ public sealed partial class SearchTemplateRequestDescriptor : RequestDescriptor< { internal SearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public SearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs index c9ece6b884f..16e9c64ac63 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs new file mode 100644 index 00000000000..1bf200a80a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryRequest.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.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.Snapshot; + +public sealed partial class CleanupRepositoryRequestParameters : RequestParameters +{ + /// + /// Period to wait for a connection to the master node. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. +/// +public sealed partial class CleanupRepositoryRequest : PlainRequest +{ + public CleanupRepositoryRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCleanupRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.cleanup_repository"; + + /// + /// Period to wait for a connection to the master node. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. +/// +public sealed partial class CleanupRepositoryRequestDescriptor : RequestDescriptor +{ + internal CleanupRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public CleanupRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCleanupRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.cleanup_repository"; + + public CleanupRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CleanupRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public CleanupRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("repository", 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/Snapshot/CleanupRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs new file mode 100644 index 00000000000..557ac8f6305 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CleanupRepositoryResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class CleanupRepositoryResponse : ElasticsearchResponse +{ + /// + /// Statistics for cleanup operations. + /// + [JsonInclude, JsonPropertyName("results")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.CleanupRepositoryResults Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs new file mode 100644 index 00000000000..96b7cc71605 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotRequest.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.Snapshot; + +public sealed partial class CloneSnapshotRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Clones indices from one snapshot into another snapshot in the same repository. +/// +public sealed partial class CloneSnapshotRequest : PlainRequest +{ + public CloneSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Elastic.Clients.Elasticsearch.Serverless.Name targetSnapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot).Required("target_snapshot", targetSnapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotClone; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.clone"; + + /// + /// 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); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + [JsonInclude, JsonPropertyName("indices")] + public string Indices { get; set; } +} + +/// +/// Clones indices from one snapshot into another snapshot in the same repository. +/// +public sealed partial class CloneSnapshotRequestDescriptor : RequestDescriptor +{ + internal CloneSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public CloneSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Elastic.Clients.Elasticsearch.Serverless.Name targetSnapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot).Required("target_snapshot", targetSnapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotClone; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.clone"; + + public CloneSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CloneSnapshotRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public CloneSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public CloneSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + public CloneSnapshotRequestDescriptor TargetSnapshot(Elastic.Clients.Elasticsearch.Serverless.Name targetSnapshot) + { + RouteValues.Required("target_snapshot", targetSnapshot); + return Self; + } + + private string IndicesValue { get; set; } + + public CloneSnapshotRequestDescriptor Indices(string indices) + { + IndicesValue = indices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("indices"); + writer.WriteStringValue(IndicesValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs new file mode 100644 index 00000000000..c5110a0e38a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CloneSnapshotResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class CloneSnapshotResponse : 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/Snapshot/CreateRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs new file mode 100644 index 00000000000..f32fd809df5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryRequest.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.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.Snapshot; + +public sealed partial class CreateRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + 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); } + + /// + /// Whether to verify the repository after creation + /// + public bool? Verify { get => Q("verify"); set => Q("verify", value); } +} + +/// +/// Creates a repository. +/// +public sealed partial class CreateRepositoryRequest : PlainRequest +{ + public CreateRepositoryRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreateRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create_repository"; + + /// + /// 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); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Whether to verify the repository after creation + /// + [JsonIgnore] + public bool? Verify { get => Q("verify"); set => Q("verify", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.IRepository Repository { get; set; } +} + +/// +/// Creates a repository. +/// +public sealed partial class CreateRepositoryRequestDescriptor : RequestDescriptor +{ + internal CreateRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + public CreateRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Snapshot.IRepository repository, Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) => RepositoryValue = repository; + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreateRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create_repository"; + + public CreateRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public CreateRepositoryRequestDescriptor Verify(bool? verify = true) => Qs("verify", verify); + + public CreateRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("repository", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.IRepository RepositoryValue { get; set; } + + public CreateRepositoryRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Snapshot.IRepository repository) + { + RepositoryValue = repository; + 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/Snapshot/CreateRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs new file mode 100644 index 00000000000..b91dcf5fe51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateRepositoryResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class CreateRepositoryResponse : 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/Snapshot/CreateSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs new file mode 100644 index 00000000000..c5f4e5666df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotRequest.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.Snapshot; + +public sealed partial class CreateSnapshotRequestParameters : 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); } + + /// + /// If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Creates a snapshot in a repository. +/// +public sealed partial class CreateSnapshotRequest : PlainRequest +{ + public CreateSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.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); } + + /// + /// If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + + /// + /// Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. + /// + [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + + /// + /// If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + + /// + /// If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`). + /// + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + + /// + /// Data streams and indices to include in the snapshot. Supports multi-target syntax. Includes all data streams and indices by default. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytes. This map is not automatically generated by Elasticsearch. + /// + [JsonInclude, JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + + /// + /// If `true`, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } +} + +/// +/// Creates a snapshot in a repository. +/// +public sealed partial class CreateSnapshotRequestDescriptor : RequestDescriptor +{ + internal CreateSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public CreateSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create"; + + public CreateSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateSnapshotRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public CreateSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public CreateSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private IDictionary? MetadataValue { get; set; } + private bool? PartialValue { get; set; } + + /// + /// Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. + /// + public CreateSnapshotRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + /// + /// If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. + /// + public CreateSnapshotRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + /// + /// If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`). + /// + public CreateSnapshotRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + /// + /// Data streams and indices to include in the snapshot. Supports multi-target syntax. Includes all data streams and indices by default. + /// + public CreateSnapshotRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytes. This map is not automatically generated by Elasticsearch. + /// + public CreateSnapshotRequestDescriptor Metadata(Func, FluentDictionary> selector) + { + MetadataValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If `true`, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + public CreateSnapshotRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs new file mode 100644 index 00000000000..f70080c70a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/CreateSnapshotResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class CreateSnapshotResponse : ElasticsearchResponse +{ + /// + /// Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false` + /// + [JsonInclude, JsonPropertyName("accepted")] + public bool? Accepted { get; init; } + + /// + /// Snapshot information. Present when the request had `wait_for_completion` set to `true` + /// + [JsonInclude, JsonPropertyName("snapshot")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotInfo? Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs new file mode 100644 index 00000000000..ad90ed2ae43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryRequest.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.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.Snapshot; + +public sealed partial class DeleteRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + 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 repository. +/// +public sealed partial class DeleteRepositoryRequest : PlainRequest +{ + public DeleteRepositoryRequest(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDeleteRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete_repository"; + + /// + /// 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); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a repository. +/// +public sealed partial class DeleteRepositoryRequestDescriptor : RequestDescriptor +{ + internal DeleteRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDeleteRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete_repository"; + + public DeleteRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names name) + { + RouteValues.Required("repository", 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/Snapshot/DeleteRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs new file mode 100644 index 00000000000..98a2b6b89aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteRepositoryResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class DeleteRepositoryResponse : 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/Snapshot/DeleteSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs new file mode 100644 index 00000000000..8d8bfb8160a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotRequest.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.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.Snapshot; + +public sealed partial class DeleteSnapshotRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Deletes one or more snapshots. +/// +public sealed partial class DeleteSnapshotRequest : PlainRequest +{ + public DeleteSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete"; + + /// + /// 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); } +} + +/// +/// Deletes one or more snapshots. +/// +public sealed partial class DeleteSnapshotRequestDescriptor : RequestDescriptor +{ + internal DeleteSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete"; + + public DeleteSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public DeleteSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public DeleteSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + 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/Snapshot/DeleteSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs new file mode 100644 index 00000000000..1bafca1cb8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/DeleteSnapshotResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class DeleteSnapshotResponse : 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/Snapshot/GetRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs new file mode 100644 index 00000000000..1bbc0fea9e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.Snapshot; + +public sealed partial class GetRepositoryRequestParameters : RequestParameters +{ + /// + /// 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 a repository. +/// +public sealed partial class GetRepositoryRequest : PlainRequest +{ + public GetRepositoryRequest() + { + } + + public GetRepositoryRequest(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGetRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get_repository"; + + /// + /// 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 a repository. +/// +public sealed partial class GetRepositoryRequestDescriptor : RequestDescriptor +{ + internal GetRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names? name) : base(r => r.Optional("repository", name)) + { + } + + public GetRepositoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGetRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get_repository"; + + public GetRepositoryRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Names? name) + { + RouteValues.Optional("repository", 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/Snapshot/GetRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs new file mode 100644 index 00000000000..c1909d68426 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetRepositoryResponse.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.Snapshot; + +public sealed partial class GetRepositoryResponse : DictionaryResponse +{ + public GetRepositoryResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetRepositoryResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs new file mode 100644 index 00000000000..ccdf4b93018 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs @@ -0,0 +1,244 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.Snapshot; + +public sealed partial class GetSnapshotRequestParameters : RequestParameters +{ + /// + /// Offset identifier to start pagination from as returned by the next field in the response body. + /// + public string? After { get => Q("after"); set => Q("after", value); } + + /// + /// Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count. + /// + public string? FromSortValue { get => Q("from_sort_value"); set => Q("from_sort_value", value); } + + /// + /// If false, the request returns an error for any snapshots that are unavailable. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, returns the repository name in each snapshot. + /// + public bool? IncludeRepository { get => Q("include_repository"); set => Q("include_repository", value); } + + /// + /// If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted. + /// + public bool? IndexDetails { get => Q("index_details"); set => Q("index_details", value); } + + /// + /// If true, returns the name of each index in each snapshot. + /// + public bool? IndexNames { get => Q("index_names"); set => Q("index_names", 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); } + + /// + /// Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. + /// + public int? Offset { get => Q("offset"); set => Q("offset", value); } + + /// + /// Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order. + /// + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get => Q("order"); set => Q("order", value); } + + /// + /// Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy. + /// + public Elastic.Clients.Elasticsearch.Serverless.Name? SlmPolicyFilter { get => Q("slm_policy_filter"); set => Q("slm_policy_filter", value); } + + /// + /// Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp. + /// + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotSort? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns information about a snapshot. +/// +public sealed partial class GetSnapshotRequest : PlainRequest +{ + public GetSnapshotRequest(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Names snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get"; + + /// + /// Offset identifier to start pagination from as returned by the next field in the response body. + /// + [JsonIgnore] + public string? After { get => Q("after"); set => Q("after", value); } + + /// + /// Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count. + /// + [JsonIgnore] + public string? FromSortValue { get => Q("from_sort_value"); set => Q("from_sort_value", value); } + + /// + /// If false, the request returns an error for any snapshots that are unavailable. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, returns the repository name in each snapshot. + /// + [JsonIgnore] + public bool? IncludeRepository { get => Q("include_repository"); set => Q("include_repository", value); } + + /// + /// If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted. + /// + [JsonIgnore] + public bool? IndexDetails { get => Q("index_details"); set => Q("index_details", value); } + + /// + /// If true, returns the name of each index in each snapshot. + /// + [JsonIgnore] + public bool? IndexNames { get => Q("index_names"); set => Q("index_names", 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); } + + /// + /// Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. + /// + [JsonIgnore] + public int? Offset { get => Q("offset"); set => Q("offset", value); } + + /// + /// Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get => Q("order"); set => Q("order", value); } + + /// + /// Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Name? SlmPolicyFilter { get => Q("slm_policy_filter"); set => Q("slm_policy_filter", value); } + + /// + /// Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotSort? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns information about a snapshot. +/// +public sealed partial class GetSnapshotRequestDescriptor : RequestDescriptor +{ + internal GetSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Names snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get"; + + public GetSnapshotRequestDescriptor After(string? after) => Qs("after", after); + public GetSnapshotRequestDescriptor FromSortValue(string? fromSortValue) => Qs("from_sort_value", fromSortValue); + public GetSnapshotRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetSnapshotRequestDescriptor IncludeRepository(bool? includeRepository = true) => Qs("include_repository", includeRepository); + public GetSnapshotRequestDescriptor IndexDetails(bool? indexDetails = true) => Qs("index_details", indexDetails); + public GetSnapshotRequestDescriptor IndexNames(bool? indexNames = true) => Qs("index_names", indexNames); + public GetSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetSnapshotRequestDescriptor Offset(int? offset) => Qs("offset", offset); + public GetSnapshotRequestDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) => Qs("order", order); + public GetSnapshotRequestDescriptor Size(int? size) => Qs("size", size); + public GetSnapshotRequestDescriptor SlmPolicyFilter(Elastic.Clients.Elasticsearch.Serverless.Name? slmPolicyFilter) => Qs("slm_policy_filter", slmPolicyFilter); + public GetSnapshotRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotSort? sort) => Qs("sort", sort); + public GetSnapshotRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public GetSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Names snapshot) + { + RouteValues.Required("snapshot", snapshot); + 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/Tasks/CancelResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs similarity index 62% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelResponse.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs index 34493053f8d..89c5596de5a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs @@ -20,30 +20,27 @@ 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.Tasks; +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// -public sealed partial class CancelResponse : ElasticsearchResponse +public sealed partial class GetSnapshotResponse : ElasticsearchResponse { - [JsonInclude, JsonPropertyName("node_failures")] - public IReadOnlyCollection? NodeFailures { get; init; } - /// - /// Task information grouped by node, if `group_by` was set to `node` (the default). + /// The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the next field value. /// - [JsonInclude, JsonPropertyName("nodes")] - public IReadOnlyDictionary? Nodes { get; init; } - [JsonInclude, JsonPropertyName("task_failures")] - public IReadOnlyCollection? TaskFailures { get; init; } + [JsonInclude, JsonPropertyName("remaining")] + public int Remaining { get; init; } + [JsonInclude, JsonPropertyName("responses")] + public IReadOnlyCollection? Responses { get; init; } + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection? Snapshots { get; init; } /// - /// Either a flat list of tasks if `group_by` was set to `none`, or grouped by parents if
`group_by` was set to `parents`.
+ /// The total number of snapshots that match the request when ignoring size limit or after query parameter. ///
- [JsonInclude, JsonPropertyName("tasks")] - public Elastic.Clients.Elasticsearch.Serverless.Tasks.TaskInfos? Tasks { 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/Api/Snapshot/RestoreRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreRequest.g.cs new file mode 100644 index 00000000000..a6440300859 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreRequest.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.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.Snapshot; + +public sealed partial class RestoreRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Should this request wait until the operation has completed before returning + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequest : PlainRequest +{ + public RestoreRequest(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + /// + /// 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); } + + /// + /// Should this request wait until the operation has completed before returning + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + [JsonInclude, JsonPropertyName("ignore_index_settings")] + public ICollection? IgnoreIndexSettings { get; set; } + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + [JsonInclude, JsonPropertyName("include_aliases")] + public bool? IncludeAliases { get; set; } + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + [JsonInclude, JsonPropertyName("index_settings")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? IndexSettings { get; set; } + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } + [JsonInclude, JsonPropertyName("rename_pattern")] + public string? RenamePattern { get; set; } + [JsonInclude, JsonPropertyName("rename_replacement")] + public string? RenameReplacement { get; set; } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequestDescriptor : RequestDescriptor, RestoreRequestParameters> +{ + internal RestoreRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RestoreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + public RestoreRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RestoreRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public RestoreRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public RestoreRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private ICollection? IgnoreIndexSettingsValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeAliasesValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor IndexSettingsDescriptor { get; set; } + private Action> IndexSettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? PartialValue { get; set; } + private string? RenamePatternValue { get; set; } + private string? RenameReplacementValue { get; set; } + + public RestoreRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + public RestoreRequestDescriptor IgnoreIndexSettings(ICollection? ignoreIndexSettings) + { + IgnoreIndexSettingsValue = ignoreIndexSettings; + return Self; + } + + public RestoreRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + public RestoreRequestDescriptor IncludeAliases(bool? includeAliases = true) + { + IncludeAliasesValue = includeAliases; + return Self; + } + + public RestoreRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? indexSettings) + { + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = null; + IndexSettingsValue = indexSettings; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + IndexSettingsValue = null; + IndexSettingsDescriptorAction = null; + IndexSettingsDescriptor = descriptor; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Action> configure) + { + IndexSettingsValue = null; + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = configure; + return Self; + } + + public RestoreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + public RestoreRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + public RestoreRequestDescriptor RenamePattern(string? renamePattern) + { + RenamePatternValue = renamePattern; + return Self; + } + + public RestoreRequestDescriptor RenameReplacement(string? renameReplacement) + { + RenameReplacementValue = renameReplacement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreIndexSettingsValue is not null) + { + writer.WritePropertyName("ignore_index_settings"); + JsonSerializer.Serialize(writer, IgnoreIndexSettingsValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeAliasesValue.HasValue) + { + writer.WritePropertyName("include_aliases"); + writer.WriteBooleanValue(IncludeAliasesValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndexSettingsDescriptor is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsDescriptor, options); + } + else if (IndexSettingsDescriptorAction is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(IndexSettingsDescriptorAction), options); + } + else if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + if (!string.IsNullOrEmpty(RenamePatternValue)) + { + writer.WritePropertyName("rename_pattern"); + writer.WriteStringValue(RenamePatternValue); + } + + if (!string.IsNullOrEmpty(RenameReplacementValue)) + { + writer.WritePropertyName("rename_replacement"); + writer.WriteStringValue(RenameReplacementValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequestDescriptor : RequestDescriptor +{ + internal RestoreRequestDescriptor(Action configure) => configure.Invoke(this); + + public RestoreRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + public RestoreRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RestoreRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public RestoreRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public RestoreRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private ICollection? IgnoreIndexSettingsValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeAliasesValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor IndexSettingsDescriptor { get; set; } + private Action IndexSettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private bool? PartialValue { get; set; } + private string? RenamePatternValue { get; set; } + private string? RenameReplacementValue { get; set; } + + public RestoreRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + public RestoreRequestDescriptor IgnoreIndexSettings(ICollection? ignoreIndexSettings) + { + IgnoreIndexSettingsValue = ignoreIndexSettings; + return Self; + } + + public RestoreRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + public RestoreRequestDescriptor IncludeAliases(bool? includeAliases = true) + { + IncludeAliasesValue = includeAliases; + return Self; + } + + public RestoreRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? indexSettings) + { + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = null; + IndexSettingsValue = indexSettings; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + IndexSettingsValue = null; + IndexSettingsDescriptorAction = null; + IndexSettingsDescriptor = descriptor; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Action configure) + { + IndexSettingsValue = null; + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = configure; + return Self; + } + + public RestoreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + public RestoreRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + public RestoreRequestDescriptor RenamePattern(string? renamePattern) + { + RenamePatternValue = renamePattern; + return Self; + } + + public RestoreRequestDescriptor RenameReplacement(string? renameReplacement) + { + RenameReplacementValue = renameReplacement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreIndexSettingsValue is not null) + { + writer.WritePropertyName("ignore_index_settings"); + JsonSerializer.Serialize(writer, IgnoreIndexSettingsValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeAliasesValue.HasValue) + { + writer.WritePropertyName("include_aliases"); + writer.WriteBooleanValue(IncludeAliasesValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndexSettingsDescriptor is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsDescriptor, options); + } + else if (IndexSettingsDescriptorAction is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(IndexSettingsDescriptorAction), options); + } + else if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + if (!string.IsNullOrEmpty(RenamePatternValue)) + { + writer.WritePropertyName("rename_pattern"); + writer.WriteStringValue(RenamePatternValue); + } + + if (!string.IsNullOrEmpty(RenameReplacementValue)) + { + writer.WritePropertyName("rename_replacement"); + writer.WriteStringValue(RenameReplacementValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs new file mode 100644 index 00000000000..aa37bbc1b03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/RestoreResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Snapshot; + +public sealed partial class RestoreResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshot")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotRestore Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs new file mode 100644 index 00000000000..72f4b2f7f5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusRequest.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.Snapshot; + +public sealed partial class SnapshotStatusRequestParameters : RequestParameters +{ + /// + /// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", 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 the status of a snapshot. +/// +public sealed partial class SnapshotStatusRequest : PlainRequest +{ + public SnapshotStatusRequest() + { + } + + public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Name? repository) : base(r => r.Optional("repository", repository)) + { + } + + public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Name? repository, Elastic.Clients.Elasticsearch.Serverless.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.status"; + + /// + /// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", 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 the status of a snapshot. +/// +public sealed partial class SnapshotStatusRequestDescriptor : RequestDescriptor +{ + internal SnapshotStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public SnapshotStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name? repository, Elastic.Clients.Elasticsearch.Serverless.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot)) + { + } + + public SnapshotStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.status"; + + public SnapshotStatusRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SnapshotStatusRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SnapshotStatusRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Serverless.Name? repository) + { + RouteValues.Optional("repository", repository); + return Self; + } + + public SnapshotStatusRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Serverless.Names? snapshot) + { + RouteValues.Optional("snapshot", snapshot); + 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/Snapshot/SnapshotStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs new file mode 100644 index 00000000000..ce5388ec913 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Snapshot; + +public sealed partial class SnapshotStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection Snapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs new file mode 100644 index 00000000000..ab3c5550a24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryRequest.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.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.Snapshot; + +public sealed partial class VerifyRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + 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); } +} + +/// +/// Verifies a repository. +/// +public sealed partial class VerifyRepositoryRequest : PlainRequest +{ + public VerifyRepositoryRequest(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotVerifyRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.verify_repository"; + + /// + /// 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); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Verifies a repository. +/// +public sealed partial class VerifyRepositoryRequestDescriptor : RequestDescriptor +{ + internal VerifyRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public VerifyRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotVerifyRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.verify_repository"; + + public VerifyRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public VerifyRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public VerifyRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) + { + RouteValues.Required("repository", 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/Snapshot/VerifyRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs new file mode 100644 index 00000000000..8c3de92f9ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.Snapshot; + +public sealed partial class VerifyRepositoryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs new file mode 100644 index 00000000000..65a8350d2e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.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.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.SnapshotLifecycleManagement; + +public sealed partial class DeleteLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing snapshot lifecycle policy. +/// +public sealed partial class DeleteLifecycleRequest : PlainRequest +{ + public DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.delete_lifecycle"; +} + +/// +/// Deletes an existing snapshot lifecycle policy. +/// +public sealed partial class DeleteLifecycleRequestDescriptor : RequestDescriptor +{ + internal DeleteLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.delete_lifecycle"; + + public DeleteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Serverless.Name policyId) + { + RouteValues.Required("policy_id", policyId); + 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/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs new file mode 100644 index 00000000000..1c239e6133d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class DeleteLifecycleResponse : 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/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs new file mode 100644 index 00000000000..57a63d4eb70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.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.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.SnapshotLifecycleManagement; + +public sealed partial class ExecuteLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. +/// +public sealed partial class ExecuteLifecycleRequest : PlainRequest +{ + public ExecuteLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_lifecycle"; +} + +/// +/// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. +/// +public sealed partial class ExecuteLifecycleRequestDescriptor : RequestDescriptor +{ + internal ExecuteLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExecuteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_lifecycle"; + + public ExecuteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Serverless.Name policyId) + { + RouteValues.Required("policy_id", policyId); + 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/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs new file mode 100644 index 00000000000..c3b46581b3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.SnapshotLifecycleManagement; + +public sealed partial class ExecuteLifecycleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshot_name")] + public string SnapshotName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs new file mode 100644 index 00000000000..7a3fda69346 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.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.SnapshotLifecycleManagement; + +public sealed partial class ExecuteRetentionRequestParameters : RequestParameters +{ +} + +/// +/// Deletes any snapshots that are expired according to the policy's retention rules. +/// +public sealed partial class ExecuteRetentionRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteRetention; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_retention"; +} + +/// +/// Deletes any snapshots that are expired according to the policy's retention rules. +/// +public sealed partial class ExecuteRetentionRequestDescriptor : RequestDescriptor +{ + internal ExecuteRetentionRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExecuteRetentionRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteRetention; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_retention"; + + 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/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs new file mode 100644 index 00000000000..0b6e97aa675 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class ExecuteRetentionResponse : 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/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs new file mode 100644 index 00000000000..56a7ecfdad8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.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.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.SnapshotLifecycleManagement; + +public sealed partial class GetLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. +/// +public sealed partial class GetLifecycleRequest : PlainRequest +{ + public GetLifecycleRequest() + { + } + + public GetLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.Names? policyId) : base(r => r.Optional("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_lifecycle"; +} + +/// +/// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. +/// +public sealed partial class GetLifecycleRequestDescriptor : RequestDescriptor +{ + internal GetLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names? policyId) : base(r => r.Optional("policy_id", policyId)) + { + } + + public GetLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_lifecycle"; + + public GetLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Serverless.Names? policyId) + { + RouteValues.Optional("policy_id", policyId); + 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/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs new file mode 100644 index 00000000000..ec6663c071f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.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.SnapshotLifecycleManagement; + +public sealed partial class GetLifecycleResponse : DictionaryResponse +{ + public GetLifecycleResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetLifecycleResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs new file mode 100644 index 00000000000..eafb0160f8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.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.SnapshotLifecycleManagement; + +public sealed partial class GetSlmStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves the status of snapshot lifecycle management (SLM). +/// +public sealed partial class GetSlmStatusRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_status"; +} + +/// +/// Retrieves the status of snapshot lifecycle management (SLM). +/// +public sealed partial class GetSlmStatusRequestDescriptor : RequestDescriptor +{ + internal GetSlmStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSlmStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_status"; + + 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/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs new file mode 100644 index 00000000000..65874614e4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.SnapshotLifecycleManagement; + +public sealed partial class GetSlmStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("operation_mode")] + public Elastic.Clients.Elasticsearch.Serverless.LifecycleOperationMode OperationMode { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs new file mode 100644 index 00000000000..462f850e638 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.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.SnapshotLifecycleManagement; + +public sealed partial class GetStatsRequestParameters : RequestParameters +{ +} + +/// +/// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. +/// +public sealed partial class GetStatsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_stats"; +} + +/// +/// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. +/// +public sealed partial class GetStatsRequestDescriptor : RequestDescriptor +{ + internal GetStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_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/SnapshotLifecycleManagement/GetStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs new file mode 100644 index 00000000000..3306a7ae841 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.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.SnapshotLifecycleManagement; + +public sealed partial class GetStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("policy_stats")] + public IReadOnlyCollection PolicyStats { get; init; } + [JsonInclude, JsonPropertyName("retention_deletion_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration RetentionDeletionTime { get; init; } + [JsonInclude, JsonPropertyName("retention_deletion_time_millis")] + public long RetentionDeletionTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("retention_failed")] + public long RetentionFailed { get; init; } + [JsonInclude, JsonPropertyName("retention_runs")] + public long RetentionRuns { get; init; } + [JsonInclude, JsonPropertyName("retention_timed_out")] + public long RetentionTimedOut { get; init; } + [JsonInclude, JsonPropertyName("total_snapshot_deletion_failures")] + public long TotalSnapshotDeletionFailures { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_deleted")] + public long TotalSnapshotsDeleted { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_failed")] + public long TotalSnapshotsFailed { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_taken")] + public long TotalSnapshotsTaken { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs new file mode 100644 index 00000000000..33ac529fe76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs @@ -0,0 +1,279 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.SnapshotLifecycleManagement; + +public sealed partial class PutLifecycleRequestParameters : 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); } +} + +/// +/// Creates or updates a snapshot lifecycle policy. +/// +public sealed partial class PutLifecycleRequest : PlainRequest +{ + public PutLifecycleRequest(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "slm.put_lifecycle"; + + /// + /// 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); } + + /// + /// Configuration for each snapshot created by the policy. + /// + [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfiguration? Config { get; set; } + + /// + /// Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name. + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Serverless.Name? Name { get; set; } + + /// + /// Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. + /// + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; set; } + + /// + /// Retention rules used to retain and delete snapshots created by the policy. + /// + [JsonInclude, JsonPropertyName("retention")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Retention? Retention { get; set; } + + /// + /// Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. + /// + [JsonInclude, JsonPropertyName("schedule")] + public string? Schedule { get; set; } +} + +/// +/// Creates or updates a snapshot lifecycle policy. +/// +public sealed partial class PutLifecycleRequestDescriptor : RequestDescriptor +{ + internal PutLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "slm.put_lifecycle"; + + public PutLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Serverless.Name policyId) + { + RouteValues.Required("policy_id", policyId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfiguration? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfigurationDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } + private string? RepositoryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Retention? RetentionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.RetentionDescriptor RetentionDescriptor { get; set; } + private Action RetentionDescriptorAction { get; set; } + private string? ScheduleValue { get; set; } + + /// + /// Configuration for each snapshot created by the policy. + /// + public PutLifecycleRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfiguration? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PutLifecycleRequestDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfigurationDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PutLifecycleRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + /// + /// Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name. + /// + public PutLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? name) + { + NameValue = name; + return Self; + } + + /// + /// Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. + /// + public PutLifecycleRequestDescriptor Repository(string? repository) + { + RepositoryValue = repository; + return Self; + } + + /// + /// Retention rules used to retain and delete snapshots created by the policy. + /// + public PutLifecycleRequestDescriptor Retention(Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Retention? retention) + { + RetentionDescriptor = null; + RetentionDescriptorAction = null; + RetentionValue = retention; + return Self; + } + + public PutLifecycleRequestDescriptor Retention(Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.RetentionDescriptor descriptor) + { + RetentionValue = null; + RetentionDescriptorAction = null; + RetentionDescriptor = descriptor; + return Self; + } + + public PutLifecycleRequestDescriptor Retention(Action configure) + { + RetentionValue = null; + RetentionDescriptor = null; + RetentionDescriptorAction = configure; + return Self; + } + + /// + /// Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. + /// + public PutLifecycleRequestDescriptor Schedule(string? schedule) + { + ScheduleValue = schedule; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfigurationDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(RepositoryValue)) + { + writer.WritePropertyName("repository"); + writer.WriteStringValue(RepositoryValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.RetentionDescriptor(RetentionDescriptorAction), options); + } + else if (RetentionValue is not null) + { + writer.WritePropertyName("retention"); + JsonSerializer.Serialize(writer, RetentionValue, options); + } + + if (!string.IsNullOrEmpty(ScheduleValue)) + { + writer.WritePropertyName("schedule"); + writer.WriteStringValue(ScheduleValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs new file mode 100644 index 00000000000..953965ec996 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class PutLifecycleResponse : 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/SnapshotLifecycleManagement/StartSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs new file mode 100644 index 00000000000..dcf894c9db2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.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.SnapshotLifecycleManagement; + +public sealed partial class StartSlmRequestParameters : RequestParameters +{ +} + +/// +/// Turns on snapshot lifecycle management (SLM). +/// +public sealed partial class StartSlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.start"; +} + +/// +/// Turns on snapshot lifecycle management (SLM). +/// +public sealed partial class StartSlmRequestDescriptor : RequestDescriptor +{ + internal StartSlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartSlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.start"; + + 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/SnapshotLifecycleManagement/StartSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs new file mode 100644 index 00000000000..93638085bee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class StartSlmResponse : 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/SnapshotLifecycleManagement/StopSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs new file mode 100644 index 00000000000..dec8526f0a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.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.SnapshotLifecycleManagement; + +public sealed partial class StopSlmRequestParameters : RequestParameters +{ +} + +/// +/// Turns off snapshot lifecycle management (SLM). +/// +public sealed partial class StopSlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.stop"; +} + +/// +/// Turns off snapshot lifecycle management (SLM). +/// +public sealed partial class StopSlmRequestDescriptor : RequestDescriptor +{ + internal StopSlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopSlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.stop"; + + 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/SnapshotLifecycleManagement/StopSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs new file mode 100644 index 00000000000..93085cefd2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class StopSlmResponse : 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/Sql/ClearCursorResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/ClearCursorResponse.g.cs index 9d9b0ae35eb..821827b04e5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/ClearCursorResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/ClearCursorResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncRequest.g.cs index a0993c6a9aa..38eb5c99b16 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncRequest.g.cs @@ -62,10 +62,6 @@ public DeleteAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal DeleteAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlDeleteAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public DeleteAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id { } - internal DeleteAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlDeleteAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncResponse.g.cs index 0f90d6b6328..1d4fe6f738f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/DeleteAsyncResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncRequest.g.cs index 9290746bb2f..52aa3fbf11d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncRequest.g.cs @@ -105,10 +105,6 @@ public GetAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) { } - internal GetAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -144,10 +140,6 @@ public GetAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) { } - internal GetAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncResponse.g.cs index cb6fbd104b9..3603d74dd53 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs index 8eb3a72ff37..572db65f77f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs @@ -62,10 +62,6 @@ public GetAsyncStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal GetAsyncStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsyncStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public GetAsyncStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless. { } - internal GetAsyncStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsyncStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs index 3e4013f89fc..efc2638c4c8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryRequest.g.cs index 5896cac457e..3b0de3cd822 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryRequest.g.cs @@ -31,6 +31,10 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Sql; public sealed partial class QueryRequestParameters : RequestParameters { + /// + /// Format for the response. + /// + public string? Format { get => Q("format"); set => Q("format", value); } } /// @@ -46,6 +50,12 @@ public sealed partial class QueryRequest : PlainRequest internal override string OperationName => "sql.query"; + /// + /// Format for the response. + /// + [JsonIgnore] + public string? Format { get => Q("format"); set => Q("format", value); } + /// /// Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. /// @@ -162,14 +172,16 @@ public QueryRequestDescriptor() internal override string OperationName => "sql.query"; + public QueryRequestDescriptor Format(string? format) => Qs("format", format); + private string? CatalogValue { get; set; } private bool? ColumnarValue { get; set; } private string? CursorValue { get; set; } private int? FetchSizeValue { get; set; } private bool? FieldMultiValueLeniencyValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private bool? IndexUsingFrozenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } @@ -177,7 +189,7 @@ public QueryRequestDescriptor() private IDictionary? ParamsValue { get; set; } private string? QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? RequestTimeoutValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeoutValue { get; set; } @@ -237,7 +249,7 @@ public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Se return Self; } - public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -245,7 +257,7 @@ public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public QueryRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -319,9 +331,9 @@ public QueryRequestDescriptor RequestTimeout(Elastic.Clients.Elastics /// /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
///
- public QueryRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public QueryRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -384,7 +396,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -440,10 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (WaitForCompletionTimeoutValue is not null) @@ -475,14 +487,16 @@ public QueryRequestDescriptor() internal override string OperationName => "sql.query"; + public QueryRequestDescriptor Format(string? format) => Qs("format", format); + private string? CatalogValue { get; set; } private bool? ColumnarValue { get; set; } private string? CursorValue { get; set; } private int? FetchSizeValue { get; set; } private bool? FieldMultiValueLeniencyValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private bool? IndexUsingFrozenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } @@ -490,7 +504,7 @@ public QueryRequestDescriptor() private IDictionary? ParamsValue { get; set; } private string? QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? RequestTimeoutValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeoutValue { get; set; } @@ -550,7 +564,7 @@ public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Qu return Self; } - public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -558,7 +572,7 @@ public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public QueryRequestDescriptor Filter(Action configure) + public QueryRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -632,9 +646,9 @@ public QueryRequestDescriptor RequestTimeout(Elastic.Clients.Elasticsearch.Serve /// /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
///
- public QueryRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public QueryRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -697,7 +711,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -753,10 +767,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (WaitForCompletionTimeoutValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryResponse.g.cs index 1cbb64370b5..071d362d93f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/QueryResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateRequest.g.cs new file mode 100644 index 00000000000..d66b32806af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateRequest.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.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.Sql; + +public sealed partial class TranslateRequestParameters : RequestParameters +{ +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + [JsonInclude, JsonPropertyName("fetch_size")] + public int? FetchSize { get; set; } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + + /// + /// SQL query to run. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// ISO-8601 time zone ID for the search. + /// + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequestDescriptor : RequestDescriptor, TranslateRequestParameters> +{ + internal TranslateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public TranslateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + private int? FetchSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private string QueryValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + public TranslateRequestDescriptor FetchSize(int? fetchSize) + { + FetchSizeValue = fetchSize; + return Self; + } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TranslateRequestDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// SQL query to run. + /// + public TranslateRequestDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// ISO-8601 time zone ID for the search. + /// + public TranslateRequestDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchSizeValue.HasValue) + { + writer.WritePropertyName("fetch_size"); + writer.WriteNumberValue(FetchSizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequestDescriptor : RequestDescriptor +{ + internal TranslateRequestDescriptor(Action configure) => configure.Invoke(this); + + public TranslateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + private int? FetchSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private string QueryValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + public TranslateRequestDescriptor FetchSize(int? fetchSize) + { + FetchSizeValue = fetchSize; + return Self; + } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TranslateRequestDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// SQL query to run. + /// + public TranslateRequestDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// ISO-8601 time zone ID for the search. + /// + public TranslateRequestDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchSizeValue.HasValue) + { + writer.WritePropertyName("fetch_size"); + writer.WriteNumberValue(FetchSizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateResponse.g.cs similarity index 62% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListResponse.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateResponse.g.cs index e359024b36f..99fbe12d829 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Sql/TranslateResponse.g.cs @@ -20,30 +20,25 @@ 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.Tasks; +namespace Elastic.Clients.Elasticsearch.Serverless.Sql; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// -public sealed partial class ListResponse : ElasticsearchResponse +public sealed partial class TranslateResponse : ElasticsearchResponse { - [JsonInclude, JsonPropertyName("node_failures")] - public IReadOnlyCollection? NodeFailures { get; init; } - - /// - /// Task information grouped by node, if `group_by` was set to `node` (the default). - /// - [JsonInclude, JsonPropertyName("nodes")] - public IReadOnlyDictionary? Nodes { get; init; } - [JsonInclude, JsonPropertyName("task_failures")] - public IReadOnlyCollection? TaskFailures { get; init; } - - /// - /// Either a flat list of tasks if `group_by` was set to `none`, or grouped by parents if
`group_by` was set to `parents`.
- ///
- [JsonInclude, JsonPropertyName("tasks")] - public Elastic.Clients.Elasticsearch.Serverless.Tasks.TaskInfos? Tasks { get; init; } + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyCollection? Fields { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long? Size { get; init; } + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] + public IReadOnlyCollection? Sort { get; init; } + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs new file mode 100644 index 00000000000..d3929942076 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRequest.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.Synonyms; + +public sealed partial class DeleteSynonymRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a synonym set +/// +public sealed partial class DeleteSynonymRequest : PlainRequest +{ + public DeleteSynonymRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; +} + +/// +/// Deletes a synonym set +/// +public sealed partial class DeleteSynonymRequestDescriptor : RequestDescriptor, DeleteSynonymRequestParameters> +{ + internal DeleteSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; + + public DeleteSynonymRequestDescriptor 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 synonym set +/// +public sealed partial class DeleteSynonymRequestDescriptor : RequestDescriptor +{ + internal DeleteSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; + + public DeleteSynonymRequestDescriptor 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/Synonyms/DeleteSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs new file mode 100644 index 00000000000..a1ed28894bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class DeleteSynonymResponse : 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/Synonyms/DeleteSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..7e90ec003e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.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.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.Synonyms; + +public sealed partial class DeleteSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a synonym rule in a synonym set +/// +public sealed partial class DeleteSynonymRuleRequest : PlainRequest +{ + public DeleteSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym_rule"; +} + +/// +/// Deletes a synonym rule in a synonym set +/// +public sealed partial class DeleteSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal DeleteSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym_rule"; + + public DeleteSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public DeleteSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Serverless.Id setId) + { + RouteValues.Required("set_id", setId); + 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/Synonyms/DeleteSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..6e133b1bded --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class DeleteSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Updating synonyms in a synonym set reloads the associated analyzers.
This is the analyzers reloading result
+ ///
+ [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ReloadResult ReloadAnalyzersDetails { get; init; } + + /// + /// Update operation result + /// + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRequest.g.cs new file mode 100644 index 00000000000..09e85b1f821 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRequest.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.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.Synonyms; + +public sealed partial class GetSynonymRequestParameters : RequestParameters +{ + /// + /// Starting offset for query rules to be retrieved + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of query rules to retrieve + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequest : PlainRequest +{ + public GetSynonymRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + /// + /// Starting offset for query rules to be retrieved + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of query rules to retrieve + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequestDescriptor : RequestDescriptor, GetSynonymRequestParameters> +{ + internal GetSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + public GetSynonymRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymRequestDescriptor Size(int? size) => Qs("size", size); + + public GetSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequestDescriptor : RequestDescriptor +{ + internal GetSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + public GetSynonymRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymRequestDescriptor Size(int? size) => Qs("size", size); + + public GetSynonymRequestDescriptor 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/Synonyms/GetSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymResponse.g.cs new file mode 100644 index 00000000000..b9a0e5a1d26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class GetSynonymResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("synonyms_set")] + public IReadOnlyCollection SynonymsSet { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..574166d6ff1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleRequest.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.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.Synonyms; + +public sealed partial class GetSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves a synonym rule from a synonym set +/// +public sealed partial class GetSynonymRuleRequest : PlainRequest +{ + public GetSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym_rule"; +} + +/// +/// Retrieves a synonym rule from a synonym set +/// +public sealed partial class GetSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal GetSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym_rule"; + + public GetSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public GetSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Serverless.Id setId) + { + RouteValues.Required("set_id", setId); + 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/Synonyms/GetSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..d010730a552 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymRuleResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class GetSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs new file mode 100644 index 00000000000..b545a2b71fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsRequest.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.Synonyms; + +public sealed partial class GetSynonymsSetsRequestParameters : RequestParameters +{ + /// + /// Starting offset + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a summary of all defined synonym sets +/// +public sealed partial class GetSynonymsSetsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymsSets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonyms_sets"; + + /// + /// Starting offset + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a summary of all defined synonym sets +/// +public sealed partial class GetSynonymsSetsRequestDescriptor : RequestDescriptor +{ + internal GetSynonymsSetsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymsSetsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymsSets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonyms_sets"; + + public GetSynonymsSetsRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymsSetsRequestDescriptor Size(int? size) => Qs("size", size); + + 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/Synonyms/GetSynonymsSetsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs new file mode 100644 index 00000000000..d995d7a68a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/GetSynonymsSetsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class GetSynonymsSetsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("results")] + public IReadOnlyCollection Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRequest.g.cs new file mode 100644 index 00000000000..4c27c3210a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRequest.g.cs @@ -0,0 +1,272 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.Synonyms; + +public sealed partial class PutSynonymRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequest : PlainRequest +{ + public PutSynonymRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + /// + /// The synonym set information to update + /// + [JsonInclude, JsonPropertyName("synonyms_set")] + public ICollection SynonymsSet { get; set; } +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequestDescriptor : RequestDescriptor, PutSynonymRequestParameters> +{ + internal PutSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + public PutSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection SynonymsSetValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor SynonymsSetDescriptor { get; set; } + private Action SynonymsSetDescriptorAction { get; set; } + private Action[] SynonymsSetDescriptorActions { get; set; } + + /// + /// The synonym set information to update + /// + public PutSynonymRequestDescriptor SynonymsSet(ICollection synonymsSet) + { + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetValue = synonymsSet; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor descriptor) + { + SynonymsSetValue = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptor = descriptor; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Action configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptorAction = configure; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(params Action[] configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SynonymsSetDescriptor is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorAction is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorActions is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + foreach (var action in SynonymsSetDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("synonyms_set"); + JsonSerializer.Serialize(writer, SynonymsSetValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequestDescriptor : RequestDescriptor +{ + internal PutSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + public PutSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection SynonymsSetValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor SynonymsSetDescriptor { get; set; } + private Action SynonymsSetDescriptorAction { get; set; } + private Action[] SynonymsSetDescriptorActions { get; set; } + + /// + /// The synonym set information to update + /// + public PutSynonymRequestDescriptor SynonymsSet(ICollection synonymsSet) + { + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetValue = synonymsSet; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor descriptor) + { + SynonymsSetValue = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptor = descriptor; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Action configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptorAction = configure; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(params Action[] configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SynonymsSetDescriptor is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorAction is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorActions is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + foreach (var action in SynonymsSetDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Synonyms.SynonymRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("synonyms_set"); + JsonSerializer.Serialize(writer, SynonymsSetValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymResponse.g.cs new file mode 100644 index 00000000000..92df385340c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class PutSynonymResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ReloadDetails ReloadAnalyzersDetails { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..0aa6ba769a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleRequest.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.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.Synonyms; + +public sealed partial class PutSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a synonym rule in a synonym set +/// +public sealed partial class PutSynonymRuleRequest : PlainRequest +{ + public PutSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym_rule"; + + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; set; } +} + +/// +/// Creates or updates a synonym rule in a synonym set +/// +public sealed partial class PutSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal PutSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym_rule"; + + public PutSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Serverless.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public PutSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Serverless.Id setId) + { + RouteValues.Required("set_id", setId); + return Self; + } + + private string SynonymsValue { get; set; } + + public PutSynonymRuleRequestDescriptor Synonyms(string synonyms) + { + SynonymsValue = synonyms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("synonyms"); + writer.WriteStringValue(SynonymsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..89557b91831 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Synonyms/PutSynonymRuleResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public sealed partial class PutSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Updating synonyms in a synonym set reloads the associated analyzers.
This is the analyzers reloading result
+ ///
+ [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ReloadResult ReloadAnalyzersDetails { get; init; } + + /// + /// Update operation result + /// + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Serverless.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelRequest.g.cs deleted file mode 100644 index 96b73260772..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/CancelRequest.g.cs +++ /dev/null @@ -1,136 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This 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.Tasks; - -public sealed partial class CancelRequestParameters : RequestParameters -{ - /// - /// Comma-separated list or wildcard expression of actions used to limit the request. - /// - public ICollection? Actions { get => Q?>("actions"); set => Q("actions", value); } - - /// - /// Comma-separated list of node IDs or names used to limit the request. - /// - public ICollection? Nodes { get => Q?>("nodes"); set => Q("nodes", value); } - - /// - /// Parent task ID used to limit the tasks. - /// - public string? ParentTaskId { get => Q("parent_task_id"); set => Q("parent_task_id", value); } - - /// - /// Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false - /// - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } -} - -/// -/// 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. -/// -public sealed partial class CancelRequest : PlainRequest -{ - public CancelRequest() - { - } - - public CancelRequest(Elastic.Clients.Elasticsearch.Serverless.TaskId? task_id) : base(r => r.Optional("task_id", task_id)) - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksCancel; - - protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - - internal override bool SupportsBody => false; - - internal override string OperationName => "tasks.cancel"; - - /// - /// Comma-separated list or wildcard expression of actions used to limit the request. - /// - [JsonIgnore] - public ICollection? Actions { get => Q?>("actions"); set => Q("actions", value); } - - /// - /// Comma-separated list of node IDs or names used to limit the request. - /// - [JsonIgnore] - public ICollection? Nodes { get => Q?>("nodes"); set => Q("nodes", value); } - - /// - /// Parent task ID used to limit the tasks. - /// - [JsonIgnore] - public string? ParentTaskId { get => Q("parent_task_id"); set => Q("parent_task_id", value); } - - /// - /// Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false - /// - [JsonIgnore] - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } -} - -/// -/// 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. -/// -public sealed partial class CancelRequestDescriptor : RequestDescriptor -{ - internal CancelRequestDescriptor(Action configure) => configure.Invoke(this); - - public CancelRequestDescriptor() - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksCancel; - - protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - - internal override bool SupportsBody => false; - - internal override string OperationName => "tasks.cancel"; - - public CancelRequestDescriptor Actions(ICollection? actions) => Qs("actions", actions); - public CancelRequestDescriptor Nodes(ICollection? nodes) => Qs("nodes", nodes); - public CancelRequestDescriptor ParentTaskId(string? parentTaskId) => Qs("parent_task_id", parentTaskId); - public CancelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); - - public CancelRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.TaskId? task_id) - { - RouteValues.Optional("task_id", task_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/Tasks/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListRequest.g.cs deleted file mode 100644 index 0ee9bb49f6b..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Tasks/ListRequest.g.cs +++ /dev/null @@ -1,170 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This 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.Tasks; - -public sealed partial class ListRequestParameters : RequestParameters -{ - /// - /// Comma-separated list or wildcard expression of actions used to limit the request. - /// - public ICollection? Actions { get => Q?>("actions"); set => Q("actions", value); } - - /// - /// If `true`, the response includes detailed information about shard recoveries. - /// - public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } - - /// - /// Key used to group tasks in the response. - /// - public Elastic.Clients.Elasticsearch.Serverless.Tasks.GroupBy? GroupBy { get => Q("group_by"); set => Q("group_by", 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); } - - /// - /// Comma-separated list of node IDs or names used to limit returned information. - /// - public ICollection? NodeId { get => Q?>("node_id"); set => Q("node_id", value); } - - /// - /// Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`. - /// - public Elastic.Clients.Elasticsearch.Serverless.Id? ParentTaskId { get => Q("parent_task_id"); set => Q("parent_task_id", 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 request blocks until the operation is complete. - /// - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } -} - -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// The task management API returns information about tasks currently executing on one or more nodes in the cluster. -/// -public sealed partial class ListRequest : PlainRequest -{ - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksList; - - protected override HttpMethod StaticHttpMethod => HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "tasks.list"; - - /// - /// Comma-separated list or wildcard expression of actions used to limit the request. - /// - [JsonIgnore] - public ICollection? Actions { get => Q?>("actions"); set => Q("actions", value); } - - /// - /// If `true`, the response includes detailed information about shard recoveries. - /// - [JsonIgnore] - public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } - - /// - /// Key used to group tasks in the response. - /// - [JsonIgnore] - public Elastic.Clients.Elasticsearch.Serverless.Tasks.GroupBy? GroupBy { get => Q("group_by"); set => Q("group_by", 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); } - - /// - /// Comma-separated list of node IDs or names used to limit returned information. - /// - [JsonIgnore] - public ICollection? NodeId { get => Q?>("node_id"); set => Q("node_id", value); } - - /// - /// Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`. - /// - [JsonIgnore] - public Elastic.Clients.Elasticsearch.Serverless.Id? ParentTaskId { get => Q("parent_task_id"); set => Q("parent_task_id", 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 request blocks until the operation is complete. - /// - [JsonIgnore] - public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } -} - -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// The task management API returns information about tasks currently executing on one or more nodes in the cluster. -/// -public sealed partial class ListRequestDescriptor : RequestDescriptor -{ - internal ListRequestDescriptor(Action configure) => configure.Invoke(this); - - public ListRequestDescriptor() - { - } - - internal override ApiUrls ApiUrls => ApiUrlLookup.TasksList; - - protected override HttpMethod StaticHttpMethod => HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "tasks.list"; - - public ListRequestDescriptor Actions(ICollection? actions) => Qs("actions", actions); - public ListRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); - public ListRequestDescriptor GroupBy(Elastic.Clients.Elasticsearch.Serverless.Tasks.GroupBy? groupBy) => Qs("group_by", groupBy); - public ListRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); - public ListRequestDescriptor NodeId(ICollection? nodeId) => Qs("node_id", nodeId); - public ListRequestDescriptor ParentTaskId(Elastic.Clients.Elasticsearch.Serverless.Id? parentTaskId) => Qs("parent_task_id", parentTaskId); - public ListRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); - public ListRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); - - 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/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs index cd75f782b59..e2c112551e1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsRequest.g.cs @@ -108,9 +108,6 @@ public TermVectorsRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName ind internal override string OperationName => "termvectors"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// Comma-separated list or wildcard expressions of fields to include in the statistics.
Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
///
@@ -203,16 +200,7 @@ public sealed partial class TermVectorsRequestDescriptor : RequestDes { 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, Elastic.Clients.Elasticsearch.Serverless.Id? id) : base(r => r.Required("index", index).Optional("id", id)) { } @@ -220,10 +208,6 @@ public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Ind { } - internal TermVectorsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -258,10 +242,9 @@ public TermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsear 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 Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } - private TDocument DocumentValue { get; set; } /// /// An artificial document (a document not present in the index) for which you want to retrieve term vectors. @@ -283,7 +266,7 @@ public TermVectorsRequestDescriptor Filter(Elastic.Clients.Elasticsea return Self; } - public TermVectorsRequestDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public TermVectorsRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -291,7 +274,7 @@ public TermVectorsRequestDescriptor Filter(Core.TermVectors.FilterDes return Self; } - public TermVectorsRequestDescriptor Filter(Action configure) + public TermVectorsRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -325,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs index 0254a348cb5..27e97ebc74c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermVectorsResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs index fbd3c0bf93c..daf16223971 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumRequest.g.cs @@ -100,14 +100,6 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } - public TermsEnumRequestDescriptor(TDocument document) : this(typeof(TDocument)) - { - } - - internal TermsEnumRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -125,8 +117,8 @@ public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } 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.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } private string? SearchAfterValue { get; set; } private int? SizeValue { get; set; } private string? StringValue { get; set; } @@ -159,6 +151,15 @@ public TermsEnumRequestDescriptor Field(Expression + /// 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; + } + /// /// Allows to filter an index shard if the provided query rewrites to match_none. /// @@ -170,7 +171,7 @@ public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elastic return Self; } - public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -178,7 +179,7 @@ public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescripto return Self; } - public TermsEnumRequestDescriptor IndexFilter(Action> configure) + public TermsEnumRequestDescriptor IndexFilter(Action> configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -238,7 +239,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { @@ -285,10 +286,6 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Index { } - internal TermsEnumRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -306,8 +303,8 @@ public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch.Serverless private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } 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.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } private string? SearchAfterValue { get; set; } private int? SizeValue { get; set; } private string? StringValue { get; set; } @@ -360,7 +357,7 @@ public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serv return Self; } - public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -368,7 +365,7 @@ public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descripto return Self; } - public TermsEnumRequestDescriptor IndexFilter(Action configure) + public TermsEnumRequestDescriptor IndexFilter(Action configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -428,7 +425,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs index a6eca53a974..622d36f7f49 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TermsEnumResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs new file mode 100644 index 00000000000..649f9a97484 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternRequest.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.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.TextStructure; + +public sealed partial class TestGrokPatternRequestParameters : RequestParameters +{ + /// + /// The mode of compatibility with ECS compliant Grok patterns (disabled or v1, default: disabled). + /// + public string? EcsCompatibility { get => Q("ecs_compatibility"); set => Q("ecs_compatibility", value); } +} + +/// +/// Tests a Grok pattern on some text. +/// +public sealed partial class TestGrokPatternRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.TextStructureTestGrokPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "text_structure.test_grok_pattern"; + + /// + /// The mode of compatibility with ECS compliant Grok patterns (disabled or v1, default: disabled). + /// + [JsonIgnore] + public string? EcsCompatibility { get => Q("ecs_compatibility"); set => Q("ecs_compatibility", value); } + + /// + /// Grok pattern to run on the text. + /// + [JsonInclude, JsonPropertyName("grok_pattern")] + public string GrokPattern { get; set; } + + /// + /// Lines of text to run the Grok pattern on. + /// + [JsonInclude, JsonPropertyName("text")] + public ICollection Text { get; set; } +} + +/// +/// Tests a Grok pattern on some text. +/// +public sealed partial class TestGrokPatternRequestDescriptor : RequestDescriptor +{ + internal TestGrokPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public TestGrokPatternRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TextStructureTestGrokPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "text_structure.test_grok_pattern"; + + public TestGrokPatternRequestDescriptor EcsCompatibility(string? ecsCompatibility) => Qs("ecs_compatibility", ecsCompatibility); + + private string GrokPatternValue { get; set; } + private ICollection TextValue { get; set; } + + /// + /// Grok pattern to run on the text. + /// + public TestGrokPatternRequestDescriptor GrokPattern(string grokPattern) + { + GrokPatternValue = grokPattern; + return Self; + } + + /// + /// Lines of text to run the Grok pattern on. + /// + public TestGrokPatternRequestDescriptor Text(ICollection text) + { + TextValue = text; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("grok_pattern"); + writer.WriteStringValue(GrokPatternValue); + writer.WritePropertyName("text"); + JsonSerializer.Serialize(writer, TextValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs new file mode 100644 index 00000000000..6eafe234525 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is 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.TextStructure; + +public sealed partial class TestGrokPatternResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("matches")] + public IReadOnlyCollection Matches { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs new file mode 100644 index 00000000000..eb990db8b59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformRequest.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.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.TransformManagement; + +public sealed partial class DeleteTransformRequestParameters : RequestParameters +{ + /// + /// If this value is true, the destination index is deleted together with the transform. If false, the destination
index will not be deleted
+ ///
+ public bool? DeleteDestIndex { get => Q("delete_dest_index"); set => Q("delete_dest_index", value); } + + /// + /// If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
deleted regardless of its current state.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", 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 transform. +/// +public sealed partial class DeleteTransformRequest : PlainRequest +{ + public DeleteTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementDeleteTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.delete_transform"; + + /// + /// If this value is true, the destination index is deleted together with the transform. If false, the destination
index will not be deleted
+ ///
+ [JsonIgnore] + public bool? DeleteDestIndex { get => Q("delete_dest_index"); set => Q("delete_dest_index", value); } + + /// + /// If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
deleted regardless of its current state.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", 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 transform. +/// +public sealed partial class DeleteTransformRequestDescriptor : RequestDescriptor +{ + internal DeleteTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementDeleteTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.delete_transform"; + + public DeleteTransformRequestDescriptor DeleteDestIndex(bool? deleteDestIndex = true) => Qs("delete_dest_index", deleteDestIndex); + public DeleteTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public DeleteTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/DeleteTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs new file mode 100644 index 00000000000..b96bafac0fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/DeleteTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class DeleteTransformResponse : 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/TransformManagement/GetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformRequest.g.cs new file mode 100644 index 00000000000..0279a803a73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformRequest.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.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.TransformManagement; + +public sealed partial class GetTransformRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Excludes fields that were automatically added when creating the
transform. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of transforms. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for transforms. +/// +public sealed partial class GetTransformRequest : PlainRequest +{ + public GetTransformRequest() + { + } + + public GetTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Names? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Excludes fields that were automatically added when creating the
transform. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of transforms. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for transforms. +/// +public sealed partial class GetTransformRequestDescriptor : RequestDescriptor +{ + internal GetTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public GetTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform"; + + public GetTransformRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTransformRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetTransformRequestDescriptor From(int? from) => Qs("from", from); + public GetTransformRequestDescriptor Size(int? size) => Qs("size", size); + + public GetTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Names? transformId) + { + RouteValues.Optional("transform_id", transformId); + 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/TransformManagement/GetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformResponse.g.cs new file mode 100644 index 00000000000..44e4b3afaa7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class GetTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("transforms")] + public IReadOnlyCollection Transforms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs new file mode 100644 index 00000000000..f8b44fb1f7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsRequest.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.TransformManagement; + +public sealed partial class GetTransformStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of transforms. + /// + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + public long? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Controls the time to wait for the stats + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves usage information for transforms. +/// +public sealed partial class GetTransformStatsRequest : PlainRequest +{ + public GetTransformStatsRequest(Elastic.Clients.Elasticsearch.Serverless.Names transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransformStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of transforms. + /// + [JsonIgnore] + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + [JsonIgnore] + public long? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Controls the time to wait for the stats + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves usage information for transforms. +/// +public sealed partial class GetTransformStatsRequestDescriptor : RequestDescriptor +{ + internal GetTransformStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTransformStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Names transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransformStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform_stats"; + + public GetTransformStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTransformStatsRequestDescriptor From(long? from) => Qs("from", from); + public GetTransformStatsRequestDescriptor Size(long? size) => Qs("size", size); + public GetTransformStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public GetTransformStatsRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Names transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/GetTransformStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs new file mode 100644 index 00000000000..ad4f91559ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/GetTransformStatsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class GetTransformStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("transforms")] + public IReadOnlyCollection Transforms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs new file mode 100644 index 00000000000..71907527f46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs @@ -0,0 +1,909 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.TransformManagement; + +public sealed partial class PreviewTransformRequestParameters : RequestParameters +{ + /// + /// 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); } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequest : PlainRequest +{ + public PreviewTransformRequest() + { + } + + public PreviewTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + /// + /// 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); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? Latest { get; set; } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? Pivot { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequestDescriptor : RequestDescriptor, PreviewTransformRequestParameters> +{ + internal PreviewTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PreviewTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public PreviewTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + public PreviewTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PreviewTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id? transformId) + { + RouteValues.Optional("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action> LatestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action> PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PreviewTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public PreviewTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Action> configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Action> configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequestDescriptor : RequestDescriptor +{ + internal PreviewTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public PreviewTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public PreviewTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + public PreviewTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PreviewTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id? transformId) + { + RouteValues.Optional("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action LatestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PreviewTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public PreviewTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Action configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Action configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs new file mode 100644 index 00000000000..83b1131f2bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PreviewTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class PreviewTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("generated_dest_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexState GeneratedDestIndex { get; init; } + [JsonInclude, JsonPropertyName("preview")] + public IReadOnlyCollection Preview { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformRequest.g.cs new file mode 100644 index 00000000000..d4ee2175c10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformRequest.g.cs @@ -0,0 +1,957 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.TransformManagement; + +public sealed partial class PutTransformRequestParameters : RequestParameters +{ + /// + /// When the transform is created, a series of validations occur to ensure its success. For example, there is a
check for the existence of the source indices and a check that the destination index is not part of the source
index pattern. You can use this parameter to skip the checks, for example when the source index does not exist
until after the transform is created. The validations are always run when you start the transform, however, with
the exception of privilege checks.
+ ///
+ public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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 a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequest : PlainRequest +{ + public PutTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + /// + /// When the transform is created, a series of validations occur to ensure its success. For example, there is a
check for the existence of the source indices and a check that the destination index is not part of the source
index pattern. You can use this parameter to skip the checks, for example when the source index does not exist
until after the transform is created. The validations are always run when you start the transform, however, with
the exception of privilege checks.
+ ///
+ [JsonIgnore] + public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? Latest { get; set; } + + /// + /// Defines optional transform metadata. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? Pivot { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Creates a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequestDescriptor : RequestDescriptor, PutTransformRequestParameters> +{ + internal PutTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + public PutTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public PutTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action> LatestDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action> PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PutTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ public PutTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Latest(Action> configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public PutTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Action> configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequestDescriptor : RequestDescriptor +{ + internal PutTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + public PutTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public PutTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public PutTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action LatestDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PutTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ public PutTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Latest(Action configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public PutTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Action configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformResponse.g.cs new file mode 100644 index 00000000000..b249e53d43a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/PutTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class PutTransformResponse : 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/TransformManagement/ResetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs new file mode 100644 index 00000000000..f626fe41ac8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformRequest.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.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.TransformManagement; + +public sealed partial class ResetTransformRequestParameters : RequestParameters +{ + /// + /// If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform
must be stopped before it can be reset.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Resets a transform.
Before you can reset it, you must stop it; alternatively, use the `force` query parameter.
If the destination index was created by the transform, it is deleted.
+///
+public sealed partial class ResetTransformRequest : PlainRequest +{ + public ResetTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementResetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.reset_transform"; + + /// + /// If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform
must be stopped before it can be reset.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Resets a transform.
Before you can reset it, you must stop it; alternatively, use the `force` query parameter.
If the destination index was created by the transform, it is deleted.
+///
+public sealed partial class ResetTransformRequestDescriptor : RequestDescriptor +{ + internal ResetTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResetTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementResetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.reset_transform"; + + public ResetTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public ResetTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/ResetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs new file mode 100644 index 00000000000..fb4ed2eb3ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ResetTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class ResetTransformResponse : 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/TransformManagement/ScheduleNowTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs new file mode 100644 index 00000000000..a5df259de06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.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.TransformManagement; + +public sealed partial class ScheduleNowTransformRequestParameters : RequestParameters +{ + /// + /// Controls the time to wait for the scheduling to take place + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Schedules now a transform. +/// If you _schedule_now a transform, it will process the new data instantly,
without waiting for the configured frequency interval. After _schedule_now API is called,
the transform will be processed again at now + frequency unless _schedule_now API
is called again in the meantime.
+///
+public sealed partial class ScheduleNowTransformRequest : PlainRequest +{ + public ScheduleNowTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementScheduleNowTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.schedule_now_transform"; + + /// + /// Controls the time to wait for the scheduling to take place + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Schedules now a transform. +/// If you _schedule_now a transform, it will process the new data instantly,
without waiting for the configured frequency interval. After _schedule_now API is called,
the transform will be processed again at now + frequency unless _schedule_now API
is called again in the meantime.
+///
+public sealed partial class ScheduleNowTransformRequestDescriptor : RequestDescriptor +{ + internal ScheduleNowTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public ScheduleNowTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementScheduleNowTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.schedule_now_transform"; + + public ScheduleNowTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public ScheduleNowTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/ScheduleNowTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs new file mode 100644 index 00000000000..53bcf08486b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class ScheduleNowTransformResponse : 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/TransformManagement/StartTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformRequest.g.cs new file mode 100644 index 00000000000..c25c624a377 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformRequest.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.TransformManagement; + +public sealed partial class StartTransformRequestParameters : RequestParameters +{ + /// + /// Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. + /// + public string? From { get => Q("from"); set => Q("from", 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); } +} + +/// +/// Starts a transform. +/// When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is
set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping
definitions for the destination index from the source indices and the transform aggregations. If fields in the
destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations),
the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
in a pivot transform.
+/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
created the transform, they occur when you start the transform—​with the exception of privilege checks. When
Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
time of creation and uses those same roles. If those roles do not have the required privileges on the source and
destination indices, the transform fails when it attempts unauthorized operations.
+///
+public sealed partial class StartTransformRequest : PlainRequest +{ + public StartTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStartTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.start_transform"; + + /// + /// Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. + /// + [JsonIgnore] + public string? From { get => Q("from"); set => Q("from", 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); } +} + +/// +/// Starts a transform. +/// When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is
set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping
definitions for the destination index from the source indices and the transform aggregations. If fields in the
destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations),
the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
in a pivot transform.
+/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
created the transform, they occur when you start the transform—​with the exception of privilege checks. When
Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
time of creation and uses those same roles. If those roles do not have the required privileges on the source and
destination indices, the transform fails when it attempts unauthorized operations.
+///
+public sealed partial class StartTransformRequestDescriptor : RequestDescriptor +{ + internal StartTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStartTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.start_transform"; + + public StartTransformRequestDescriptor From(string? from) => Qs("from", from); + public StartTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public StartTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/StartTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformResponse.g.cs new file mode 100644 index 00000000000..61a4125aaa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StartTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class StartTransformResponse : 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/TransformManagement/StopTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformRequest.g.cs new file mode 100644 index 00000000000..f88a9e48d0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformRequest.g.cs @@ -0,0 +1,146 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.TransformManagement; + +public sealed partial class StopTransformRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;
contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there
are only partial matches.
+ /// If it is true, the API returns a successful acknowledgement message when there are no matches. When there are
only partial matches, the API stops the appropriate transforms.
+ /// If it is false, the request returns a 404 status code when there are no matches or only partial matches. + ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If it is true, the API forcefully stops the transforms. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the
timeout expires, the request returns a timeout exception. However, the request continues processing and
eventually moves the transform to a STOPPED state.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,
the transform stops as soon as possible.
+ ///
+ public bool? WaitForCheckpoint { get => Q("wait_for_checkpoint"); set => Q("wait_for_checkpoint", value); } + + /// + /// If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns
immediately and the indexer is stopped asynchronously in the background.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops one or more transforms. +/// +public sealed partial class StopTransformRequest : PlainRequest +{ + public StopTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Name transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStopTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.stop_transform"; + + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;
contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there
are only partial matches.
+ /// If it is true, the API returns a successful acknowledgement message when there are no matches. When there are
only partial matches, the API stops the appropriate transforms.
+ /// If it is false, the request returns a 404 status code when there are no matches or only partial matches. + ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If it is true, the API forcefully stops the transforms. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the
timeout expires, the request returns a timeout exception. However, the request continues processing and
eventually moves the transform to a STOPPED state.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,
the transform stops as soon as possible.
+ ///
+ [JsonIgnore] + public bool? WaitForCheckpoint { get => Q("wait_for_checkpoint"); set => Q("wait_for_checkpoint", value); } + + /// + /// If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns
immediately and the indexer is stopped asynchronously in the background.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops one or more transforms. +/// +public sealed partial class StopTransformRequestDescriptor : RequestDescriptor +{ + internal StopTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Name transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStopTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.stop_transform"; + + public StopTransformRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + public StopTransformRequestDescriptor WaitForCheckpoint(bool? waitForCheckpoint = true) => Qs("wait_for_checkpoint", waitForCheckpoint); + public StopTransformRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public StopTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Name transformId) + { + RouteValues.Required("transform_id", transformId); + 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/TransformManagement/StopTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformResponse.g.cs new file mode 100644 index 00000000000..815fb2c711c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/StopTransformResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class StopTransformResponse : 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/TransformManagement/UpdateTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs new file mode 100644 index 00000000000..5235568ebaf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs @@ -0,0 +1,752 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This 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.TransformManagement; + +public sealed partial class UpdateTransformRequestParameters : RequestParameters +{ + /// + /// When true, deferrable validations are not run. This behavior may be
desired if the source index does not exist until after the transform is
created.
+ ///
+ public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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); } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequest : PlainRequest +{ + public UpdateTransformRequest(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + /// + /// When true, deferrable validations are not run. This behavior may be
desired if the source index does not exist until after the transform is
created.
+ ///
+ [JsonIgnore] + public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + + /// + /// Defines optional transform metadata. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequestDescriptor : RequestDescriptor, UpdateTransformRequestParameters> +{ + internal UpdateTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + public UpdateTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public UpdateTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public UpdateTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public UpdateTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public UpdateTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public UpdateTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequestDescriptor : RequestDescriptor +{ + internal UpdateTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + public UpdateTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public UpdateTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Serverless.Duration? timeout) => Qs("timeout", timeout); + + public UpdateTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Serverless.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public UpdateTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public UpdateTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public UpdateTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs new file mode 100644 index 00000000000..3d804e206b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpdateTransformResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class UpdateTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TransformAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Destination Dest { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? Latest { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? Pivot { get; init; } + [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicy { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings Settings { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Source Source { get; init; } + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? Sync { 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/Api/TransformManagement/UpgradeTransformsRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs new file mode 100644 index 00000000000..08eae0c5f66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsRequest.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.TransformManagement; + +public sealed partial class UpgradeTransformsRequestParameters : RequestParameters +{ + /// + /// When true, the request checks for updates but does not run them. + /// + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", 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); } +} + +/// +/// Upgrades all transforms.
This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
Elasticsearch security features are enabled; the role used to read source data and write to the destination index
remains unchanged.
+///
+public sealed partial class UpgradeTransformsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpgradeTransforms; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.upgrade_transforms"; + + /// + /// When true, the request checks for updates but does not run them. + /// + [JsonIgnore] + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", 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); } +} + +/// +/// Upgrades all transforms.
This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
Elasticsearch security features are enabled; the role used to read source data and write to the destination index
remains unchanged.
+///
+public sealed partial class UpgradeTransformsRequestDescriptor : RequestDescriptor +{ + internal UpgradeTransformsRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpgradeTransformsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpgradeTransforms; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.upgrade_transforms"; + + public UpgradeTransformsRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun); + public UpgradeTransformsRequestDescriptor 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/TransformManagement/UpgradeTransformsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs new file mode 100644 index 00000000000..c60f735bdac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/TransformManagement/UpgradeTransformsResponse.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; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class UpgradeTransformsResponse : ElasticsearchResponse +{ + /// + /// The number of transforms that need to be upgraded. + /// + [JsonInclude, JsonPropertyName("needs_update")] + public int NeedsUpdate { get; init; } + + /// + /// The number of transforms that don’t require upgrading. + /// + [JsonInclude, JsonPropertyName("no_action")] + public int NoAction { get; init; } + + /// + /// The number of transforms that have been upgraded. + /// + [JsonInclude, JsonPropertyName("updated")] + public int Updated { 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 index 7504c8c5e39..b909b3e56da 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRequest.g.cs @@ -399,10 +399,6 @@ public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.I { } - internal UpdateByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -449,12 +445,12 @@ public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elastic private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } private long? MaxDocsValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { 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.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } /// /// What to do if update by query hits version conflicts: `abort` or `proceed`. @@ -485,7 +481,7 @@ public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticse return Self; } - public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -493,7 +489,7 @@ public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor< return Self; } - public UpdateByQueryRequestDescriptor Query(Action> configure) + public UpdateByQueryRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -521,7 +517,7 @@ public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticse return Self; } - public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -529,7 +525,7 @@ public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public UpdateByQueryRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -560,7 +556,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -582,7 +578,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -605,10 +601,6 @@ public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.I { } - internal UpdateByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -655,12 +647,12 @@ public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serv private Elastic.Clients.Elasticsearch.Serverless.Conflicts? ConflictsValue { get; set; } private long? MaxDocsValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { 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.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } /// /// What to do if update by query hits version conflicts: `abort` or `proceed`. @@ -691,7 +683,7 @@ public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Server return Self; } - public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -699,7 +691,7 @@ public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public UpdateByQueryRequestDescriptor Query(Action configure) + public UpdateByQueryRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -727,7 +719,7 @@ public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Server return Self; } - public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -735,7 +727,7 @@ public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public UpdateByQueryRequestDescriptor Slice(Action configure) + public UpdateByQueryRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -766,7 +758,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -788,7 +780,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs index 1f724261c93..e5772ccd603 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs index c792f8309aa..c50986e2fa2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class UpdateByQueryRethrottleRequestParameters : RequestPa /// public sealed partial class UpdateByQueryRethrottleRequest : PlainRequest { - public UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) + public UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serverless.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class UpdateByQueryRethrottleRequestDescriptor : RequestDe { internal UpdateByQueryRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public UpdateByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal UpdateByQueryRethrottleRequestDescriptor() + public UpdateByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal UpdateByQueryRethrottleRequestDescriptor() public UpdateByQueryRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public UpdateByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.Id task_id) + public UpdateByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Serverless.Id taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs index 9bc71216018..14c964850d0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs index a7fc1b18643..fcaac5ce875 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateRequest.g.cs @@ -180,7 +180,6 @@ public UpdateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, E /// A partial update to an existing document. /// [JsonInclude, JsonPropertyName("doc")] - [SourceConverter] public TPartialDocument? Doc { get; set; } /// @@ -211,7 +210,6 @@ public UpdateRequest(Elastic.Clients.Elasticsearch.Serverless.IndexName index, E /// 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; } } @@ -226,30 +224,6 @@ public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.IndexNam { } - 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; @@ -365,7 +339,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (DocValue is not null) { writer.WritePropertyName("doc"); - SourceSerialization.Serialize(DocValue, writer, settings); + JsonSerializer.Serialize(writer, DocValue, options); } if (DocAsUpsertValue.HasValue) @@ -395,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (UpsertValue is not null) { writer.WritePropertyName("upsert"); - SourceSerialization.Serialize(UpsertValue, writer, settings); + JsonSerializer.Serialize(writer, UpsertValue, options); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs index ae4b4cf4093..be92ceb3e30 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/UpdateResponse.g.cs @@ -20,6 +20,7 @@ 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; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoRequest.g.cs new file mode 100644 index 00000000000..27ef2927712 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoRequest.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.Xpack; + +public sealed partial class XpackInfoRequestParameters : RequestParameters +{ + /// + /// If this param is used it must be set to true + /// + public bool? AcceptEnterprise { get => Q("accept_enterprise"); set => Q("accept_enterprise", value); } + + /// + /// A comma-separated list of the information categories to include in the response. For example, `build,license,features`. + /// + public ICollection? Categories { get => Q?>("categories"); set => Q("categories", value); } +} + +/// +/// Provides general information about the installed X-Pack features. +/// +public sealed partial class XpackInfoRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.info"; + + /// + /// If this param is used it must be set to true + /// + [JsonIgnore] + public bool? AcceptEnterprise { get => Q("accept_enterprise"); set => Q("accept_enterprise", value); } + + /// + /// A comma-separated list of the information categories to include in the response. For example, `build,license,features`. + /// + [JsonIgnore] + public ICollection? Categories { get => Q?>("categories"); set => Q("categories", value); } +} + +/// +/// Provides general information about the installed X-Pack features. +/// +public sealed partial class XpackInfoRequestDescriptor : RequestDescriptor +{ + internal XpackInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public XpackInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.info"; + + public XpackInfoRequestDescriptor AcceptEnterprise(bool? acceptEnterprise = true) => Qs("accept_enterprise", acceptEnterprise); + public XpackInfoRequestDescriptor Categories(ICollection? categories) => Qs("categories", categories); + + 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/Xpack/XpackInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoResponse.g.cs new file mode 100644 index 00000000000..a189fb4d492 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackInfoResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Xpack; + +public sealed partial class XpackInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("build")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.BuildInformation Build { get; init; } + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Features Features { get; init; } + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MinimalLicenseInformation License { get; init; } + [JsonInclude, JsonPropertyName("tagline")] + public string Tagline { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageRequest.g.cs new file mode 100644 index 00000000000..269e1054876 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageRequest.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.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.Xpack; + +public sealed partial class XpackUsageRequestParameters : 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); } +} + +/// +/// This API provides information about which features are currently enabled and available under the current license and some usage statistics. +/// +public sealed partial class XpackUsageRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.usage"; + + /// + /// 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); } +} + +/// +/// This API provides information about which features are currently enabled and available under the current license and some usage statistics. +/// +public sealed partial class XpackUsageRequestDescriptor : RequestDescriptor +{ + internal XpackUsageRequestDescriptor(Action configure) => configure.Invoke(this); + + public XpackUsageRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.usage"; + + public XpackUsageRequestDescriptor 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/Xpack/XpackUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageResponse.g.cs new file mode 100644 index 00000000000..37622ed3d43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Xpack/XpackUsageResponse.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 Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Xpack; + +public sealed partial class XpackUsageResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregate_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base AggregateMetric { get; init; } + [JsonInclude, JsonPropertyName("analytics")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Analytics Analytics { get; init; } + [JsonInclude, JsonPropertyName("archive")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Archive Archive { get; init; } + [JsonInclude, JsonPropertyName("ccr")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Ccr Ccr { get; init; } + [JsonInclude, JsonPropertyName("data_frame")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base? DataFrame { get; init; } + [JsonInclude, JsonPropertyName("data_science")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base? DataScience { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataStreams? DataStreams { get; init; } + [JsonInclude, JsonPropertyName("data_tiers")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTiers DataTiers { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base? Enrich { get; init; } + [JsonInclude, JsonPropertyName("eql")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Eql Eql { get; init; } + [JsonInclude, JsonPropertyName("flattened")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Flattened? Flattened { get; init; } + [JsonInclude, JsonPropertyName("frozen_indices")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FrozenIndices FrozenIndices { get; init; } + [JsonInclude, JsonPropertyName("graph")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base Graph { get; init; } + [JsonInclude, JsonPropertyName("health_api")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.HealthStatistics? HealthApi { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Ilm Ilm { get; init; } + [JsonInclude, JsonPropertyName("logstash")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base Logstash { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MachineLearning Ml { get; init; } + [JsonInclude, JsonPropertyName("monitoring")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Monitoring Monitoring { get; init; } + [JsonInclude, JsonPropertyName("rollup")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base Rollup { get; init; } + [JsonInclude, JsonPropertyName("runtime_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.RuntimeFieldTypes? RuntimeFields { get; init; } + [JsonInclude, JsonPropertyName("searchable_snapshots")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SearchableSnapshots SearchableSnapshots { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Security Security { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Slm Slm { get; init; } + [JsonInclude, JsonPropertyName("spatial")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base Spatial { get; init; } + [JsonInclude, JsonPropertyName("sql")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Sql Sql { get; init; } + [JsonInclude, JsonPropertyName("transform")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base Transform { get; init; } + [JsonInclude, JsonPropertyName("vectors")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Vector? Vectors { get; init; } + [JsonInclude, JsonPropertyName("voting_only")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base VotingOnly { get; init; } + [JsonInclude, JsonPropertyName("watcher")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Watcher Watcher { 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 index b0e114774af..98edbcf13d5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch; public partial class AsyncSearchNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected AsyncSearchNamespacedClient() : base() { @@ -36,139 +37,9 @@ 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request) { @@ -178,7 +49,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,62 +59,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. - /// - 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { @@ -254,7 +70,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 +80,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.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -274,31 +90,9 @@ public virtual Task DeleteAsync(Elastic.Clients.Elast 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequest request) { @@ -308,7 +102,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,126 +112,113 @@ 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.Serverless.Id id) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + return DoRequestAsync, 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. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) + public virtual Task> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + return DoRequestAsync, 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. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); + return DoRequestAsync, 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. + /// 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> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// 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> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task StatusAsync(AsyncSearchStatusRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Retrieves the results of a previously submitted async search request given its ID. - /// Learn more about this API in the Elasticsearch documentation. + /// 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> GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); - configureRequest?.Invoke(descriptor); + var descriptor = new AsyncSearchStatusRequestDescriptor(id); 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); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// 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> SubmitAsync(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default) + public virtual Task StatusAsync(AsyncSearchStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, SubmitAsyncSearchRequestParameters>(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Executes a search request asynchronously. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves the status of a previously submitted async search request given its ID. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SubmitAsyncSearchResponse Submit() + public virtual Task StatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SubmitAsyncSearchRequestDescriptor(); + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequest request) { - descriptor.BeforeRequest(); - return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest, SubmitAsyncSearchRequestParameters>(request); } /// /// 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) + public virtual Task> SubmitAsync(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default) { - var descriptor = new SubmitAsyncSearchRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, SubmitAsyncSearchResponse, SubmitAsyncSearchRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync, SubmitAsyncSearchRequestParameters>(request, cancellationToken); } /// /// 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 +229,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 +239,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.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs index 5935ec66cb9..94f5a6b19ae 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Cluster.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; public partial class ClusterNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected ClusterNamespacedClient() : base() { @@ -38,7 +39,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 +49,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,212 +59,219 @@ 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() + public virtual Task AllocationExplainAsync(CancellationToken cancellationToken = default) { var descriptor = new AllocationExplainRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task AllocationExplainAsync(AllocationExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task AllocationExplainAsync(Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new AllocationExplainRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task AllocationExplainAsync(CancellationToken cancellationToken = default) + public virtual DeleteComponentTemplateResponse DeleteComponentTemplate(DeleteComponentTemplateRequest request) { - var descriptor = new AllocationExplainRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task AllocationExplainAsync(AllocationExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(DeleteComponentTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) { + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides explanations for shard allocations in the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task AllocationExplainAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(DeleteComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new AllocationExplainRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) + public virtual Task DeleteComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); + 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. + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(ClusterStatsRequest request, CancellationToken cancellationToken = default) + public virtual ExistsComponentTemplateResponse ExistsComponentTemplate(ExistsComponentTemplateRequest request) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequest(request); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats() + public virtual Task ExistsComponentTemplateAsync(ExistsComponentTemplateRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats(ClusterStatsRequestDescriptor descriptor) + public virtual Task ExistsComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) { + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats(Action configureRequest) + public virtual Task ExistsComponentTemplateAsync(ExistsComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(CancellationToken cancellationToken = default) + public virtual Task ExistsComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(ClusterStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual GetComponentTemplateResponse GetComponentTemplate(GetComponentTemplateRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetComponentTemplateAsync(GetComponentTemplateRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequest request) + public virtual Task GetComponentTemplateAsync(CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new GetComponentTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetSettingsAsync(GetClusterSettingsRequest request, CancellationToken cancellationToken = default) + public virtual Task GetComponentTemplateAsync(GetComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns cluster settings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetClusterSettingsResponse GetSettings() + public virtual Task GetComponentTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetClusterSettingsRequestDescriptor(); + var descriptor = new GetComponentTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// 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) + public virtual Task GetSettingsAsync(GetClusterSettingsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetClusterSettingsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// /// 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 +282,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 +292,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 +304,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 +314,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,197 +324,257 @@ 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() + public virtual Task HealthAsync(CancellationToken cancellationToken = default) { var descriptor = new HealthRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task HealthAsync(Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new HealthRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual HealthResponse Health(HealthRequestDescriptor descriptor) + public virtual ClusterInfoResponse Info(ClusterInfoRequest request) { - descriptor.BeforeRequest(); - return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual HealthResponse Health(Action> configureRequest) + public virtual Task InfoAsync(ClusterInfoRequest request, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(CancellationToken cancellationToken = default) + public virtual Task InfoAsync(IReadOnlyCollection target, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); + var descriptor = new ClusterInfoRequestDescriptor(target); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(ClusterInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(IReadOnlyCollection target, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); + var descriptor = new ClusterInfoRequestDescriptor(target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + 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 Task PendingTasksAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PendingTasksRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 HealthAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PendingTasksAsync(PendingTasksRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + 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. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual PendingTasksResponse PendingTasks(PendingTasksRequest request) + public virtual Task PendingTasksAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PendingTasksRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutComponentTemplateResponse PutComponentTemplate(PutComponentTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + 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. + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task PendingTasksAsync(PendingTasksRequest request, CancellationToken cancellationToken = default) + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + 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. + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual PendingTasksResponse PendingTasks() + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new PendingTasksRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual PendingTasksResponse PendingTasks(PendingTasksRequestDescriptor descriptor) + public virtual Task PutComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new PutComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual PendingTasksResponse PendingTasks(Action configureRequest) + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new PendingTasksRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutComponentTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(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. + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task PendingTasksAsync(CancellationToken cancellationToken = default) + public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) { - var descriptor = new PendingTasksRequestDescriptor(); + 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 Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ClusterStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task PendingTasksAsync(PendingTasksRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task StatsAsync(ClusterStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Returns high-level overview of cluster statistics. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task PendingTasksAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PendingTasksRequestDescriptor(); + var descriptor = new ClusterStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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 index 90684d0e24a..d64a823011d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Enrich.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; public partial class EnrichNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected EnrichNamespacedClient() : base() { @@ -56,39 +57,6 @@ public virtual Task DeletePolicyAsync(DeletePolicyRequest 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. @@ -122,95 +90,9 @@ public virtual Task DeletePolicyAsync(Elastic.Clients.Elas 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequest request) { @@ -220,7 +102,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,40 +112,7 @@ public virtual Task ExecutePolicyAsync(ExecutePolicyReque /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExecutePolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) { @@ -274,7 +123,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 +133,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.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) { @@ -314,39 +163,6 @@ public virtual Task GetPolicyAsync(GetPolicyRequest request, 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. @@ -382,7 +198,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 +208,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,89 +218,98 @@ 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) + public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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.Serverless.Name name, Action configureRequest) + 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 DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, PutPolicyResponse, PutPolicyRequestParameters>(descriptor); + return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); } /// /// 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.Serverless.Name name, Action> configureRequest) + 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 DoRequest, PutPolicyResponse, PutPolicyRequestParameters>(descriptor); + return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); } /// - /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual EnrichStatsResponse Stats(EnrichStatsRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutPolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task StatsAsync(EnrichStatsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new PutPolicyRequestDescriptor(name); - configureRequest?.Invoke(descriptor); + 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 Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new EnrichStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutPolicyAsync(PutPolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task StatsAsync(EnrichStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a new enrich policy. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutPolicyAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutPolicyRequestDescriptor(name); + var descriptor = new EnrichStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Eql.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Eql.g.cs index 49bdd2f831a..a6f67009558 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Eql.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Eql; public partial class EqlNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected EqlNamespacedClient() : base() { @@ -56,61 +57,6 @@ public virtual Task DeleteAsync(EqlDeleteRequest request, Can return DoRequestAsync(request, cancellationToken); } - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id) - { - var descriptor = new EqlDeleteRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(EqlDeleteRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) - { - var descriptor = new EqlDeleteRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(EqlDeleteRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor); - } - - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) - { - var descriptor = new EqlDeleteRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor); - } - /// /// Deletes an async EQL 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. @@ -144,31 +90,9 @@ public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Deletes an async EQL 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(EqlDeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Deletes an async EQL 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 EqlDeleteRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor, cancellationToken); - } - /// /// 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 +102,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,40 +112,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. - /// - public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id) - { - var descriptor = new EqlGetRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest, EqlGetRequestParameters>(descriptor); - } - - /// - /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlGetResponse Get(EqlGetRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, EqlGetRequestParameters>(descriptor); - } - - /// - /// Returns async results from previously executed Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) - { - var descriptor = new EqlGetRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, EqlGetRequestParameters>(descriptor); - } - - /// - /// 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.Serverless.Id id, CancellationToken cancellationToken = default) { @@ -232,7 +123,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 +133,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.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -252,95 +143,9 @@ public virtual Task> GetAsync(Elastic.Clients.Ela return DoRequestAsync, EqlGetRequestParameters>(descriptor, cancellationToken); } - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlSearchResponse Search(EqlSearchRequest request) - { - request.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(request); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> SearchAsync(EqlSearchRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(request, cancellationToken); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Serverless.Indices indices) - { - var descriptor = new EqlSearchRequestDescriptor(indices); - descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlSearchResponse Search(EqlSearchRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) - { - var descriptor = new EqlSearchRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) - { - var descriptor = new EqlSearchRequestDescriptor(indices); - descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> SearchAsync(EqlSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new EqlSearchRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); - } - /// /// 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 +155,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,111 +165,87 @@ 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.Serverless.Id id) + public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { var descriptor = new GetEqlStatusRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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.Serverless.Id id, Action configureRequest) + public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetEqlStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) - { - var descriptor = new GetEqlStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual EqlSearchResponse Search(EqlSearchRequest request) { - var descriptor = new GetEqlStatusRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest, EqlSearchRequestParameters>(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. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(EqlSearchRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync, EqlSearchRequestParameters>(request, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new GetEqlStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); + var descriptor = new EqlSearchRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(EqlSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetEqlStatusRequestDescriptor(id); + var descriptor = new EqlSearchRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(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 index 8de15603ac4..38443557dad 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Graph.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Graph; public partial class GraphNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected GraphNamespacedClient() : base() { @@ -38,7 +39,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 +49,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,62 +59,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. - /// - 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ExploreAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { @@ -124,7 +70,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 +80,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.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { @@ -146,7 +92,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 +102,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.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { 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 index cba778b8d1c..7d9ce57012b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public partial class IndicesNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected IndicesNamespacedClient() : base() { @@ -37,224 +38,211 @@ internal IndicesNamespacedClient(ElasticsearchClient client) : base(client) } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequest request) + public virtual AnalyzeIndexResponse Analyze(AnalyzeIndexRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task AnalyzeAsync(AnalyzeIndexRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + public virtual Task AnalyzeAsync(CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new AnalyzeIndexRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + public virtual Task AnalyzeAsync(AnalyzeIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + public virtual Task AnalyzeAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new AnalyzeIndexRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + public virtual Task AnalyzeAsync(AnalyzeIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + return DoRequestAsync, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + public virtual Task AnalyzeAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new AnalyzeIndexRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + return DoRequestAsync, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) + public virtual ClearCacheResponse ClearCache(ClearCacheRequest request) { - var descriptor = new CloseIndexRequestDescriptor(indices); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(ClearCacheRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); + var descriptor = new ClearCacheRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(ClearCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, CloseIndexResponse, CloseIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new ClearCacheRequestDescriptor(); 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); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(CreateDataStreamRequest request, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(ClearCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync, ClearCacheResponse, ClearCacheRequestParameters>(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name) + public virtual Task ClearCacheAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, ClearCacheResponse, ClearCacheRequestParameters>(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequestDescriptor descriptor) + public virtual CloseIndexResponse Close(CloseIndexRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, Action configureRequest) + public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, CancellationToken cancellationToken = default) + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new CloseIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(CreateDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new CloseIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) { @@ -264,7 +252,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) { @@ -274,233 +262,236 @@ 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.Serverless.IndexName index) + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) { var descriptor = new CreateIndexRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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.Serverless.IndexName index, Action configureRequest) + 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 DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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() + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } /// /// 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) + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + var descriptor = new CreateIndexRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) + public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequest request) { - descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + public virtual Task CreateDataStreamAsync(CreateDataStreamRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(index); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(index); + var descriptor = new CreateDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(CreateDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamName name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(index); + var descriptor = new CreateDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(CancellationToken cancellationToken = default) + public virtual DataStreamsStatsResponse DataStreamsStats(DataStreamsStatsRequest request) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); - descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(DataStreamsStatsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); - configureRequest?.Invoke(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DataStreamsStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new DataStreamsStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(DataStreamsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(index); + var descriptor = new DataStreamsStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequest request) + public virtual DeleteIndexResponse Delete(DeleteIndexRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(DeleteAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(DeleteIndexRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// 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) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); + var descriptor = new DeleteIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// 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) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); + var descriptor = new DeleteIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes an alias. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequest request) { - descriptor.BeforeRequest(); - return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// 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) + public virtual Task DeleteAliasAsync(DeleteAliasRequest request, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -536,28 +527,6 @@ public virtual Task DeleteAliasAsync(Elastic.Clients.Elasti 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); - } - /// /// Deletes the data stream lifecycle of the selected data streams. /// Learn more about this API in the Elasticsearch documentation. @@ -582,121 +551,55 @@ public virtual Task DeleteDataLifecycleAsync(Delete /// Deletes the data stream 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) + public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) { var descriptor = new DeleteDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes the data stream lifecycle of the selected data streams. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequestDescriptor descriptor) + public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes the data stream 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) + 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 DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequest request) { - var descriptor = new DeleteDataLifecycleRequestDescriptor(name); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Deletes the data stream 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) + 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. @@ -730,136 +633,6 @@ public virtual Task DeleteDataStreamAsync(Elastic.Clie 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. @@ -880,39 +653,6 @@ public virtual Task DeleteIndexTemplateAsync(Delete 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. @@ -921,1142 +661,367 @@ public virtual Task DeleteIndexTemplateAsync(Elasti { 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); - } - - /// - /// 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Retrieves information about the index's current data stream 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); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush(FlushRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(FlushRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush() - { - var descriptor = new FlushRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush(Action configureRequest) - { - var descriptor = new FlushRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, FlushResponse, FlushRequestParameters>(descriptor); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual FlushResponse Flush(Action> configureRequest) - { - var descriptor = new FlushRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, FlushResponse, FlushRequestParameters>(descriptor); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(CancellationToken cancellationToken = default) - { - var descriptor = new FlushRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new FlushRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, FlushResponse, FlushRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task FlushAsync(Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new FlushRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, FlushResponse, FlushRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(ForcemergeRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge() - { - var descriptor = new ForcemergeRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge(Action configureRequest) - { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, ForcemergeResponse, ForcemergeRequestParameters>(descriptor); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ForcemergeResponse Forcemerge(Action> configureRequest) - { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ForcemergeResponse, ForcemergeRequestParameters>(descriptor); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(CancellationToken cancellationToken = default) - { - var descriptor = new ForcemergeRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, ForcemergeResponse, ForcemergeRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ForcemergeAsync(Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, ForcemergeResponse, ForcemergeRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequest request) + public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias() + public virtual ExistsResponse Exists(ExistsRequest request) { - var descriptor = new GetAliasRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + public virtual Task ExistsAsync(ExistsRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(Action configureRequest) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new ExistsRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(Action> configureRequest) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); + var descriptor = new ExistsRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. + /// Returns information about whether a particular alias exists. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(CancellationToken cancellationToken = default) + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequest request) { - var descriptor = new GetAliasRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns an alias. + /// Returns information about whether a particular alias exists. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ExistsAliasAsync(ExistsAliasRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an alias. + /// Returns information about whether a particular alias exists. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new ExistsAliasRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. + /// Returns information about whether a particular alias exists. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ExistsAliasAsync(ExistsAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. + /// Returns information about whether a particular alias exists. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); + var descriptor = new ExistsAliasRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequest request) + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(ExistsIndexTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequest request, CancellationToken cancellationToken = default) + public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name) + public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequestDescriptor descriptor) + public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular index template exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest) + public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new ExistsIndexTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) + public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLifecycleRequest request) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); - configureRequest?.Invoke(descriptor); + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); 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); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(GetDataStreamRequest request, CancellationToken cancellationToken = default) + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream() + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequestDescriptor descriptor) + public virtual FlushResponse Flush(FlushRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream(Action configureRequest) + public virtual Task FlushAsync(FlushRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(CancellationToken cancellationToken = default) + public virtual Task FlushAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new FlushRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(GetDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task FlushAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new FlushRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(GetIndexRequest request) + public virtual ForcemergeResponse Forcemerge(ForcemergeRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task ForcemergeAsync(ForcemergeRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + public virtual Task ForcemergeAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new ForcemergeRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the force merge operation on 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) + public virtual Task ForcemergeAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new ForcemergeRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Returns information about one or more indices. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + public virtual GetIndexResponse Get(GetIndexRequest request) { - descriptor.BeforeRequest(); - return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// 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) + public virtual Task GetAsync(GetIndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -2093,371 +1058,321 @@ public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Ser } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual GetAliasResponse GetAlias(GetAliasRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetAliasAsync(GetAliasRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest request) + public virtual Task GetAliasAsync(CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new GetAliasRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate() + public virtual Task GetAliasAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexTemplateRequestDescriptor(); + var descriptor = new GetAliasRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequestDescriptor descriptor) + public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(Action configureRequest) + public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexTemplateRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexTemplateRequestDescriptor(); + var descriptor = new GetDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexTemplateRequestDescriptor(); + var descriptor = new GetDataLifecycleRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequest request) + public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(GetMappingRequest request, CancellationToken cancellationToken = default) + public virtual Task GetDataStreamAsync(GetDataStreamRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping() + public virtual Task GetDataStreamAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); + var descriptor = new GetDataStreamRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + public virtual Task GetDataStreamAsync(GetDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(Action configureRequest) + public virtual Task GetDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); + var descriptor = new GetDataStreamRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest request) { - descriptor.BeforeRequest(); - return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(Action> configureRequest) + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(CancellationToken cancellationToken = default) + public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); + var descriptor = new GetIndexTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); + var descriptor = new GetIndexTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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) + public virtual GetMappingResponse GetMapping(GetMappingRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(descriptor, cancellationToken); + 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(Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetMappingRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(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) + public virtual Task GetMappingAsync(GetMappingRequest 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); + return DoRequestAsync(request, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(Action configureRequest) - { - var descriptor = new IndicesStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); + public virtual Task GetMappingAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetMappingRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) + public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(Action> configureRequest) + public virtual Task GetMappingAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new IndicesStatsRequestDescriptor(); + var descriptor = new GetMappingRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(CancellationToken cancellationToken = default) + public virtual GetIndicesSettingsResponse GetSettings(GetIndicesSettingsRequest request) { - var descriptor = new IndicesStatsRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(GetIndicesSettingsRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(CancellationToken cancellationToken = default) { - var descriptor = new IndicesStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new GetIndicesSettingsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(GetIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new IndicesStatsRequestDescriptor(); + var descriptor = new GetIndicesSettingsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -2480,39 +1395,6 @@ public virtual Task MigrateToDataStreamAsync(Migrat 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. @@ -2547,78 +1429,65 @@ public virtual Task MigrateToDataStreamAsync(Elasti } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequest request) + public virtual ModifyDataStreamResponse ModifyDataStream(ModifyDataStreamRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(OpenIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task ModifyDataStreamAsync(ModifyDataStreamRequest 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); + return DoRequestAsync(request, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + public virtual Task ModifyDataStreamAsync(ModifyDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + public virtual Task ModifyDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new OpenIndexRequestDescriptor(indices); + var descriptor = new ModifyDataStreamRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Opens an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + public virtual OpenIndexResponse Open(OpenIndexRequest request) { - descriptor.BeforeRequest(); - return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// Opens an index. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + public virtual Task OpenAsync(OpenIndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new OpenIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -2654,28 +1523,6 @@ public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.S 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. @@ -2696,61 +1543,6 @@ public virtual Task PutAliasAsync(PutAliasRequest request, Can 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. @@ -2826,39 +1618,6 @@ public virtual Task PutDataLifecycleAsync(PutDataLifec return DoRequestAsync(request, cancellationToken); } - /// - /// Updates the data stream 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); - } - - /// - /// Updates the data stream 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); - } - - /// - /// Updates the data stream 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); - } - /// /// Updates the data stream lifecycle of the selected data streams. /// Learn more about this API in the Elasticsearch documentation. @@ -2912,50 +1671,6 @@ public virtual Task PutIndexTemplateAsync(PutIndexTemp 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. @@ -3024,88 +1739,108 @@ public virtual Task PutMappingAsync(PutMappingRequest reques /// Updates the index mappings. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + 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 DoRequest(descriptor); + 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 PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + 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); + } + + /// + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutIndicesSettingsResponse PutSettings(PutIndicesSettingsRequest request) { - descriptor.BeforeRequest(); - return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new PutMappingRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutMappingRequestDescriptor(indices); + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings settings, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutMappingRequestDescriptor(indices); + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor, cancellationToken); } /// @@ -3132,119 +1867,117 @@ public virtual Task PutTemplateAsync(PutTemplateRequest req /// Creates or updates an index template. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor descriptor) + public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + 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 DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Creates or updates an index template. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(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) + public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutTemplateRequestDescriptor(name); + var descriptor = new PutTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(RefreshRequest request) + public virtual RecoveryResponse Recovery(RecoveryRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(RefreshRequest request, CancellationToken cancellationToken = default) + public virtual Task RecoveryAsync(RecoveryRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh() + public virtual Task RecoveryAsync(CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new RecoveryRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(RefreshRequestDescriptor descriptor) + public virtual Task RecoveryAsync(RecoveryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(Action configureRequest) + public virtual Task RecoveryAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new RecoveryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Performs the refresh operation in one or more indices. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(RefreshRequestDescriptor descriptor) + public virtual RefreshResponse Refresh(RefreshRequest request) { - descriptor.BeforeRequest(); - return DoRequest, RefreshResponse, RefreshRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// Performs the refresh operation in one or more indices. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(Action> configureRequest) + public virtual Task RefreshAsync(RefreshRequest request, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, RefreshResponse, RefreshRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -3281,30 +2014,61 @@ public virtual Task RefreshAsync(Action - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResolveIndexResponse ResolveIndex(ResolveIndexRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResolveIndexAsync(ResolveIndexRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(RefreshRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ResolveIndexAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) { + var descriptor = new ResolveIndexRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync, RefreshResponse, RefreshRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResolveIndexAsync(ResolveIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ResolveIndexAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new ResolveIndexRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, RefreshResponse, RefreshRequestParameters>(descriptor, cancellationToken); + 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. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual RolloverResponse Rollover(RolloverRequest request) { @@ -3314,7 +2078,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) { @@ -3324,143 +2088,130 @@ 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.Serverless.IndexAlias alias) + public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, CancellationToken cancellationToken = default) { var descriptor = new RolloverRequestDescriptor(alias); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) + public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Action configureRequest) + 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 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. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, RolloverResponse, RolloverRequestParameters>(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. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.Serverless.IndexAlias alias, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RolloverRequestDescriptor(alias); + var descriptor = new RolloverRequestDescriptor(alias); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, RolloverResponse, RolloverRequestParameters>(descriptor, cancellationToken); } /// - /// Simulate matching the given index name against the index templates in the system - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequest request) + public virtual SegmentsResponse Segments(SegmentsRequest request) { request.BeforeRequest(); - return DoRequest(request); + 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. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task SegmentsAsync(SegmentsRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + 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. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name) + public virtual Task SegmentsAsync(CancellationToken cancellationToken = default) { - var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + var descriptor = new SegmentsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequestDescriptor descriptor) + public virtual Task SegmentsAsync(SegmentsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest) + public virtual Task SegmentsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SimulateIndexTemplateRequestDescriptor(name); + var descriptor = new SegmentsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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(SimulateIndexTemplateRequestDescriptor descriptor) + public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequest request) { - descriptor.BeforeRequest(); - return DoRequest, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor); + 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 SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Serverless.Name name, Action> configureRequest) + public virtual Task SimulateIndexTemplateAsync(SimulateIndexTemplateRequest request, CancellationToken cancellationToken = default) { - var descriptor = new SimulateIndexTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, SimulateIndexTemplateResponse, SimulateIndexTemplateRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -3542,66 +2293,130 @@ public virtual Task SimulateTemplateAsync(SimulateTemp /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateTemplateResponse SimulateTemplate() + public virtual Task SimulateTemplateAsync(CancellationToken cancellationToken = default) { var descriptor = new SimulateTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequestDescriptor descriptor) + public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SimulateTemplateResponse SimulateTemplate(Action configureRequest) + public virtual Task SimulateTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new SimulateTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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(CancellationToken cancellationToken = default) + public virtual Task SimulateTemplateAsync(SimulateTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new SimulateTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SimulateTemplateResponse, SimulateTemplateRequestParameters>(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) + public virtual Task SimulateTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new SimulateTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SimulateTemplateResponse, SimulateTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Simulate resolving the given template name or body - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task SimulateTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual IndicesStatsResponse Stats(IndicesStatsRequest request) { - var descriptor = new SimulateTemplateRequestDescriptor(); + 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 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); + 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); } /// @@ -3628,87 +2443,118 @@ public virtual Task UpdateAliasesAsync(UpdateAliasesReque /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) + public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateAliasesResponse UpdateAliases(Action configureRequest) + public virtual Task UpdateAliasesAsync(Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new UpdateAliasesRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) + public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor); + return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); } /// /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateAliasesResponse UpdateAliases(Action> configureRequest) + public virtual Task UpdateAliasesAsync(Action> configureRequest, CancellationToken cancellationToken = default) { var descriptor = new UpdateAliasesRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor); + return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); } /// - /// Updates index aliases. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual ValidateQueryResponse ValidateQuery(ValidateQueryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(ValidateQueryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(CancellationToken cancellationToken = default) { + var descriptor = new ValidateQueryRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates index aliases. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateAliasesAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ValidateQueryAsync(ValidateQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new UpdateAliasesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateQueryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates index aliases. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateAliasesAsync(UpdateAliasesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ValidateQueryAsync(ValidateQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ValidateQueryResponse, ValidateQueryRequestParameters>(descriptor, cancellationToken); } /// - /// Updates index aliases. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateAliasesAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ValidateQueryAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new UpdateAliasesRequestDescriptor(); + var descriptor = new ValidateQueryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ValidateQueryResponse, ValidateQueryRequestParameters>(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 index 07bb2570eb9..eff52e3cbcb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public partial class IngestNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected IngestNamespacedClient() : base() { @@ -56,61 +57,6 @@ public virtual Task DeletePipelineAsync(DeletePipelineRe 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. @@ -144,31 +90,9 @@ public virtual Task DeletePipelineAsync(Elastic.Clients. 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequest request) { @@ -178,7 +102,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,40 +112,7 @@ public virtual Task GeoIpStatsAsync(GeoIpStatsRequest reques /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task GeoIpStatsAsync(CancellationToken cancellationToken = default) { @@ -232,7 +123,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 +133,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) { @@ -272,61 +163,6 @@ public virtual Task GetPipelineAsync(GetPipelineRequest req 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. @@ -360,31 +196,9 @@ public virtual Task GetPipelineAsync(Action(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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequest request) { @@ -394,7 +208,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,40 +218,7 @@ public virtual Task ProcessorGrokAsync(ProcessorGrokReque /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ProcessorGrokAsync(CancellationToken cancellationToken = default) { @@ -448,7 +229,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 +239,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 +251,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 +261,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,51 +271,7 @@ public virtual Task PutPipelineAsync(PutPipelineRequest req /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task PutPipelineAsync(PutPipelineRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -544,7 +281,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.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { @@ -556,7 +293,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 +303,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.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { @@ -596,61 +333,6 @@ public virtual Task SimulateAsync(SimulateRequest request, Can 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. diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.License.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.License.g.cs new file mode 100644 index 00000000000..add937c1016 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.License.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.LicenseManagement; + +public partial class LicenseManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected LicenseManagementNamespacedClient() : base() + { + } + + internal LicenseManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetLicenseResponse Get(GetLicenseRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetLicenseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetLicenseRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetLicenseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetLicenseRequestDescriptor(); + 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.Ml.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ml.g.cs new file mode 100644 index 00000000000..7b7682b46e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Ml.g.cs @@ -0,0 +1,3925 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public partial class MachineLearningNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected MachineLearningNamespacedClient() : base() + { + } + + internal MachineLearningNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearTrainedModelDeploymentCacheResponse ClearTrainedModelDeploymentCache(ClearTrainedModelDeploymentCacheRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(ClearTrainedModelDeploymentCacheRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(ClearTrainedModelDeploymentCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseJobResponse CloseJob(CloseJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(CloseJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(CloseJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarResponse DeleteCalendar(DeleteCalendarRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(DeleteCalendarRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(DeleteCalendarRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarEventResponse DeleteCalendarEvent(DeleteCalendarEventRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(DeleteCalendarEventRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id eventId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(DeleteCalendarEventRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id eventId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarJobResponse DeleteCalendarJob(DeleteCalendarJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(DeleteCalendarJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Ids jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(DeleteCalendarJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Ids jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDatafeedResponse DeleteDatafeed(DeleteDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(DeleteDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(DeleteDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataFrameAnalyticsResponse DeleteDataFrameAnalytics(DeleteDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(DeleteDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(DeleteDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteExpiredDataResponse DeleteExpiredData(DeleteExpiredDataRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(DeleteExpiredDataRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(CancellationToken cancellationToken = default) + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(DeleteExpiredDataRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteFilterResponse DeleteFilter(DeleteFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(DeleteFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(Elastic.Clients.Elasticsearch.Serverless.Id filterId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(DeleteFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(Elastic.Clients.Elasticsearch.Serverless.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteForecastResponse DeleteForecast(DeleteForecastRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(DeleteForecastRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(DeleteForecastRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteJobResponse DeleteJob(DeleteJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteModelSnapshotResponse DeleteModelSnapshot(DeleteModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(DeleteModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(DeleteModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTrainedModelResponse DeleteTrainedModel(DeleteTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(DeleteTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(DeleteTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTrainedModelAliasResponse DeleteTrainedModelAlias(DeleteTrainedModelAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(DeleteTrainedModelAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(DeleteTrainedModelAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EstimateModelMemoryResponse EstimateModelMemory(EstimateModelMemoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EvaluateDataFrameResponse EvaluateDataFrame(EvaluateDataFrameRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(ExplainDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FlushJobResponse FlushJob(FlushJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(FlushJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(FlushJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ForecastResponse Forecast(ForecastRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(ForecastRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new ForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(ForecastRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetBucketsResponse GetBuckets(GetBucketsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetBucketsResponse, GetBucketsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetBucketsResponse, GetBucketsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCalendarEventsResponse GetCalendarEvents(GetCalendarEventsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(GetCalendarEventsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(GetCalendarEventsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCalendarsResponse GetCalendars(GetCalendarsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(GetCalendarsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(GetCalendarsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCategoriesResponse GetCategories(GetCategoriesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(GetCategoriesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(GetCategoriesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDatafeedsResponse GetDatafeeds(GetDatafeedsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(GetDatafeedsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(GetDatafeedsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDatafeedStatsResponse GetDatafeedStats(GetDatafeedStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(GetDatafeedStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(GetDatafeedStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataFrameAnalyticsResponse GetDataFrameAnalytics(GetDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(GetDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(GetDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataFrameAnalyticsStatsResponse GetDataFrameAnalyticsStats(GetDataFrameAnalyticsStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(GetDataFrameAnalyticsStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(GetDataFrameAnalyticsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetFiltersResponse GetFilters(GetFiltersRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(GetFiltersRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetFiltersRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(GetFiltersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetFiltersRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetInfluencersResponse GetInfluencers(GetInfluencersRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetJobsResponse GetJobs(GetJobsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetJobStatsResponse GetJobStats(GetJobStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(GetJobStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetJobStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(GetJobStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetJobStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMemoryStatsResponse GetMemoryStats(GetMemoryStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(GetMemoryStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(GetMemoryStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetModelSnapshotsResponse GetModelSnapshots(GetModelSnapshotsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetModelSnapshotUpgradeStatsResponse GetModelSnapshotUpgradeStats(GetModelSnapshotUpgradeStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(GetModelSnapshotUpgradeStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(GetModelSnapshotUpgradeStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetOverallBucketsResponse GetOverallBuckets(GetOverallBucketsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(GetOverallBucketsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(GetOverallBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRecordsResponse GetRecords(GetRecordsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetRecordsResponse, GetRecordsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetRecordsResponse, GetRecordsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTrainedModelsResponse GetTrainedModels(GetTrainedModelsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(GetTrainedModelsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(GetTrainedModelsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTrainedModelsStatsResponse GetTrainedModelsStats(GetTrainedModelsStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(GetTrainedModelsStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(GetTrainedModelsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InferTrainedModelResponse InferTrainedModel(InferTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MlInfoResponse Info(MlInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(MlInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MlInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(MlInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MlInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenJobResponse OpenJob(OpenJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(OpenJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(OpenJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostCalendarEventsResponse PostCalendarEvents(PostCalendarEventsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(PostCalendarEventsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(PostCalendarEventsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(PreviewDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutCalendarResponse PutCalendar(PutCalendarRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(PutCalendarRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(PutCalendarRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutCalendarJobResponse PutCalendarJob(PutCalendarJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(PutCalendarJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(PutCalendarJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id calendarId, Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDatafeedResponse PutDatafeed(PutDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(PutDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutFilterResponse PutFilter(PutFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(PutFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(PutFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(Elastic.Clients.Elasticsearch.Serverless.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutJobResponse PutJob(PutJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelResponse PutTrainedModel(PutTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelAliasResponse PutTrainedModelAlias(PutTrainedModelAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(PutTrainedModelAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(PutTrainedModelAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Elastic.Clients.Elasticsearch.Serverless.Name modelAlias, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelDefinitionPartResponse PutTrainedModelDefinitionPart(PutTrainedModelDefinitionPartRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(PutTrainedModelDefinitionPartRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(PutTrainedModelDefinitionPartRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, int part, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelDefinitionPartRequestDescriptor(modelId, part); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelVocabularyResponse PutTrainedModelVocabulary(PutTrainedModelVocabularyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(PutTrainedModelVocabularyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(PutTrainedModelVocabularyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelVocabularyRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResetJobResponse ResetJob(ResetJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(ResetJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(ResetJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RevertModelSnapshotResponse RevertModelSnapshot(RevertModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(RevertModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(RevertModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SetUpgradeModeResponse SetUpgradeMode(SetUpgradeModeRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(SetUpgradeModeRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(SetUpgradeModeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartDatafeedResponse StartDatafeed(StartDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(StartDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(StartDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartDataFrameAnalyticsResponse StartDataFrameAnalytics(StartDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(StartDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(StartDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartTrainedModelDeploymentResponse StartTrainedModelDeployment(StartTrainedModelDeploymentRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(StartTrainedModelDeploymentRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(StartTrainedModelDeploymentRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopDatafeedResponse StopDatafeed(StopDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(StopDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(StopDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopDataFrameAnalyticsResponse StopDataFrameAnalytics(StopDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(StopDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(StopDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopTrainedModelDeploymentResponse StopTrainedModelDeployment(StopTrainedModelDeploymentRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(StopTrainedModelDeploymentRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(StopTrainedModelDeploymentRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Serverless.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateDatafeedResponse UpdateDatafeed(UpdateDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(Elastic.Clients.Elasticsearch.Serverless.Id datafeedId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateDataFrameAnalyticsResponse UpdateDataFrameAnalytics(UpdateDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(UpdateDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(UpdateDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateFilterResponse UpdateFilter(UpdateFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(UpdateFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(UpdateFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(Elastic.Clients.Elasticsearch.Serverless.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateJobResponse, UpdateJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateJobResponse, UpdateJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateModelSnapshotResponse UpdateModelSnapshot(UpdateModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(UpdateModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(UpdateModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpgradeJobSnapshotResponse UpgradeJobSnapshot(UpgradeJobSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(UpgradeJobSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(UpgradeJobSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(Elastic.Clients.Elasticsearch.Serverless.Id jobId, Elastic.Clients.Elasticsearch.Serverless.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ValidateResponse Validate(ValidateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateResponse, ValidateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateResponse, ValidateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ValidateDetectorResponse ValidateDetector(ValidateDetectorRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Detector detector, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Nodes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Nodes.g.cs new file mode 100644 index 00000000000..53862089210 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Nodes.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; + +public partial class NodesNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected NodesNamespacedClient() : base() + { + } + + internal NodesNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HotThreadsResponse HotThreads(HotThreadsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(HotThreadsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new HotThreadsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(HotThreadsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new HotThreadsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesInfoResponse Info(NodesInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(NodesInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(NodesInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesStatsResponse Stats(NodesStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, NodesStatsResponse, NodesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, NodesStatsResponse, NodesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesUsageResponse Usage(NodesUsageRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(NodesUsageRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(NodesUsageRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesUsageRequestDescriptor(); + 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.Slm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Slm.g.cs new file mode 100644 index 00000000000..402024a0487 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Slm.g.cs @@ -0,0 +1,516 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public partial class SnapshotLifecycleManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SnapshotLifecycleManagementNamespacedClient() : base() + { + } + + internal SnapshotLifecycleManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteLifecycleResponse DeleteLifecycle(DeleteLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecuteLifecycleResponse ExecuteLifecycle(ExecuteLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(ExecuteLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(ExecuteLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecuteRetentionResponse ExecuteRetention(ExecuteRetentionRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(ExecuteRetentionRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(ExecuteRetentionRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetLifecycleResponse GetLifecycle(GetLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetStatsResponse GetStats(GetStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(GetStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(GetStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSlmStatusResponse GetStatus(GetSlmStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetSlmStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetSlmStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetSlmStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSlmStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutLifecycleResponse PutLifecycle(PutLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Serverless.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartSlmResponse Start(StartSlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartSlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StartSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartSlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartSlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopSlmResponse Stop(StopSlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopSlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StopSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopSlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopSlmRequestDescriptor(); + 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.Snapshot.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Snapshot.g.cs new file mode 100644 index 00000000000..4fdf79ffdaa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Snapshot.g.cs @@ -0,0 +1,622 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public partial class SnapshotNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SnapshotNamespacedClient() : base() + { + } + + internal SnapshotNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CleanupRepositoryResponse CleanupRepository(CleanupRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(CleanupRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(CleanupRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloneSnapshotResponse Clone(CloneSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(CloneSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(CloneSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Elastic.Clients.Elasticsearch.Serverless.Name targetSnapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloneSnapshotRequestDescriptor(repository, snapshot, targetSnapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateSnapshotResponse Create(CreateSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateRepositoryResponse CreateRepository(CreateRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(CreateRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(CreateRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Snapshot.IRepository repository, Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateRepositoryRequestDescriptor(repository, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSnapshotResponse Delete(DeleteSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteRepositoryResponse DeleteRepository(DeleteRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(DeleteRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(DeleteRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSnapshotResponse Get(GetSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Names snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Names snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRepositoryResponse GetRepository(GetRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(GetRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(GetRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RestoreResponse Restore(RestoreRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, RestoreResponse, RestoreRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Serverless.Name repository, Elastic.Clients.Elasticsearch.Serverless.Name snapshot, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RestoreResponse, RestoreRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SnapshotStatusResponse Status(SnapshotStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(SnapshotStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SnapshotStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(SnapshotStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SnapshotStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual VerifyRepositoryResponse VerifyRepository(VerifyRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(VerifyRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(VerifyRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + 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.Sql.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Sql.g.cs index 43681d85dcb..cb78088308b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Sql.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Sql.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Sql; public partial class SqlNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected SqlNamespacedClient() : base() { @@ -56,28 +57,6 @@ public virtual Task ClearCursorAsync(ClearCursorRequest req return DoRequestAsync(request, cancellationToken); } - /// - /// Clears the SQL cursor - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ClearCursorResponse ClearCursor(ClearCursorRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Clears the SQL cursor - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ClearCursorResponse ClearCursor(Action configureRequest) - { - var descriptor = new ClearCursorRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - /// /// Clears the SQL cursor /// Learn more about this API in the Elasticsearch documentation. @@ -104,7 +83,7 @@ public virtual Task ClearCursorAsync(ActionDeletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequest request) + public virtual DeleteAsyncResponse DeleteAsync(DeleteAsyncRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -114,7 +93,7 @@ public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequest request) /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(DeleteAsyncRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -124,62 +103,7 @@ public virtual Task DeleteAsyncSearchAsync(DeleteAsyncReque /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { var descriptor = new DeleteAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -190,7 +114,7 @@ public virtual Task DeleteAsyncSearchAsync(Elastic.Clients. /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -200,7 +124,7 @@ public virtual Task DeleteAsyncSearchAsync(DeleteAsyncReque /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new DeleteAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -208,33 +132,11 @@ public virtual Task DeleteAsyncSearchAsync(Elastic.Clients. return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor, cancellationToken); - } - /// /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequest request) + public virtual GetAsyncResponse GetAsync(GetAsyncRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -244,7 +146,7 @@ public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequest request) /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchAsync(GetAsyncRequest request, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(GetAsyncRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -254,62 +156,7 @@ public virtual Task GetAsyncSearchAsync(GetAsyncRequest reques /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id) - { - var descriptor = new GetAsyncRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) - { - var descriptor = new GetAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, GetAsyncResponse, GetAsyncRequestParameters>(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) - { - var descriptor = new GetAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetAsyncResponse, GetAsyncRequestParameters>(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -320,7 +167,7 @@ public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasti /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -330,7 +177,7 @@ public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescrip /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -338,33 +185,11 @@ public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasti return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncResponse, GetAsyncRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncResponse, GetAsyncRequestParameters>(descriptor, cancellationToken); - } - /// /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequest request) + public virtual GetAsyncStatusResponse GetAsyncStatus(GetAsyncStatusRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -374,7 +199,7 @@ public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequest /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequest request, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(GetAsyncStatusRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -384,62 +209,7 @@ public virtual Task GetAsyncSearchStatusAsync(GetAsyncSt /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Serverless.Id id) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncStatusRequestDescriptor(id); descriptor.BeforeRequest(); @@ -450,7 +220,7 @@ public virtual Task GetAsyncSearchStatusAsync(Elastic.Cl /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -460,7 +230,7 @@ public virtual Task GetAsyncSearchStatusAsync(GetAsyncSt /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -468,28 +238,6 @@ public virtual Task GetAsyncSearchStatusAsync(Elastic.Cl return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor, cancellationToken); - } - /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. @@ -514,109 +262,129 @@ public virtual Task QueryAsync(QueryRequest request, Cancellation /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// - public virtual QueryResponse Query() + public virtual Task QueryAsync(CancellationToken cancellationToken = default) { var descriptor = new QueryRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// - public virtual QueryResponse Query(QueryRequestDescriptor descriptor) + public virtual Task QueryAsync(QueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// - public virtual QueryResponse Query(Action configureRequest) + public virtual Task QueryAsync(Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new QueryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// - public virtual QueryResponse Query(QueryRequestDescriptor descriptor) + public virtual Task QueryAsync(QueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, QueryResponse, QueryRequestParameters>(descriptor); + return DoRequestAsync, QueryResponse, QueryRequestParameters>(descriptor, cancellationToken); } /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// - public virtual QueryResponse Query(Action> configureRequest) + public virtual Task QueryAsync(Action> configureRequest, CancellationToken cancellationToken = default) { var descriptor = new QueryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, QueryResponse, QueryRequestParameters>(descriptor); + return DoRequestAsync, QueryResponse, QueryRequestParameters>(descriptor, cancellationToken); } /// - /// Executes a SQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task QueryAsync(CancellationToken cancellationToken = default) + public virtual TranslateResponse Translate(TranslateRequest request) { - var descriptor = new QueryRequestDescriptor(); + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(TranslateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TranslateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Executes a SQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task QueryAsync(QueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task TranslateAsync(TranslateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Executes a SQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task QueryAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task TranslateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new QueryRequestDescriptor(); + var descriptor = new TranslateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Executes a SQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task QueryAsync(QueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task TranslateAsync(TranslateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, QueryResponse, QueryRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, TranslateResponse, TranslateRequestParameters>(descriptor, cancellationToken); } /// - /// Executes a SQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task QueryAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task TranslateAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new QueryRequestDescriptor(); + var descriptor = new TranslateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, QueryResponse, QueryRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, TranslateResponse, TranslateRequestParameters>(descriptor, cancellationToken); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Synonyms.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Synonyms.g.cs new file mode 100644 index 00000000000..96fb43c09a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Synonyms.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Synonyms; + +public partial class SynonymsNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SynonymsNamespacedClient() : base() + { + } + + internal SynonymsNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSynonymResponse DeleteSynonym(DeleteSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(DeleteSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(DeleteSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSynonymRuleResponse DeleteSynonymRule(DeleteSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(DeleteSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(DeleteSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymResponse GetSynonym(GetSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(GetSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(GetSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymRuleResponse GetSynonymRule(GetSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(GetSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(GetSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymsSetsResponse GetSynonymsSets(GetSynonymsSetsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(GetSynonymsSetsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(GetSynonymsSetsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutSynonymResponse PutSynonym(PutSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(PutSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(PutSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutSynonymRuleResponse PutSynonymRule(PutSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(PutSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(PutSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(Elastic.Clients.Elasticsearch.Serverless.Id setId, Elastic.Clients.Elasticsearch.Serverless.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutSynonymRuleRequestDescriptor(setId, ruleId); + 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.Tasks.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Tasks.g.cs deleted file mode 100644 index 699ee96be09..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Tasks.g.cs +++ /dev/null @@ -1,320 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// 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.Tasks; - -public partial class TasksNamespacedClient : NamespacedClientProxy -{ - /// - /// Initializes a new instance of the class for mocking. - /// - protected TasksNamespacedClient() : base() - { - } - - 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. - /// - public virtual CancelResponse Cancel(CancelRequest request) - { - request.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task CancelAsync(CancelRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// 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. - /// - public virtual CancelResponse Cancel() - { - var descriptor = new CancelRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual CancelResponse Cancel(CancelRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual CancelResponse Cancel(Action configureRequest) - { - var descriptor = new CancelRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task CancelAsync(CancellationToken cancellationToken = default) - { - var descriptor = new CancelRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// 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. - /// - public virtual Task CancelAsync(CancelRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// 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. - /// - public virtual Task CancelAsync(Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new CancelRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// 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. - /// - public virtual GetTasksResponse Get(GetTasksRequest request) - { - request.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task GetAsync(GetTasksRequest 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 information about a task. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id task_id) - { - var descriptor = new GetTasksRequestDescriptor(task_id); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual GetTasksResponse Get(GetTasksRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest) - { - var descriptor = new GetTasksRequestDescriptor(task_id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, CancellationToken cancellationToken = default) - { - var descriptor = new GetTasksRequestDescriptor(task_id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// 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. - /// - public virtual Task GetAsync(GetTasksRequestDescriptor 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 information about a task. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetTasksRequestDescriptor(task_id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, 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. - /// - public virtual ListResponse List(ListRequest request) - { - request.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task ListAsync(ListRequest 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 a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ListResponse List() - { - var descriptor = new ListRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual ListResponse List(ListRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual ListResponse List(Action configureRequest) - { - var descriptor = new ListRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(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. - /// - public virtual Task ListAsync(CancellationToken cancellationToken = default) - { - var descriptor = new ListRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, 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. - /// - public virtual Task ListAsync(ListRequestDescriptor 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 a list of tasks. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ListAsync(Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ListRequestDescriptor(); - 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.TextStructure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.TextStructure.g.cs new file mode 100644 index 00000000000..54eb075cbdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.TextStructure.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.TextStructure; + +public partial class TextStructureNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected TextStructureNamespacedClient() : base() + { + } + + internal TextStructureNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TestGrokPatternResponse TestGrokPattern(TestGrokPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(TestGrokPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TestGrokPatternRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(TestGrokPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TestGrokPatternRequestDescriptor(); + 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.Transform.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Transform.g.cs new file mode 100644 index 00000000000..943e1b3dead --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Transform.g.cs @@ -0,0 +1,644 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public partial class TransformManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected TransformManagementNamespacedClient() : base() + { + } + + internal TransformManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTransformResponse DeleteTransform(DeleteTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(DeleteTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(DeleteTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTransformResponse GetTransform(GetTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(GetTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(GetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTransformStatsResponse GetTransformStats(GetTransformStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(GetTransformStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Names transformId, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(GetTransformStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Names transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PreviewTransformResponse PreviewTransform(PreviewTransformRequest request) + { + request.BeforeRequest(); + return DoRequest, PreviewTransformRequestParameters>(request); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(PreviewTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, PreviewTransformRequestParameters>(request, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PreviewTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(PreviewTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTransformResponse PutTransform(PutTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResetTransformResponse ResetTransform(ResetTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(ResetTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(ResetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScheduleNowTransformResponse ScheduleNowTransform(ScheduleNowTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(ScheduleNowTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(ScheduleNowTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartTransformResponse StartTransform(StartTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(StartTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(StartTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopTransformResponse StopTransform(StopTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(StopTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Name transformId, CancellationToken cancellationToken = default) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(StopTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Name transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateTransformResponse UpdateTransform(UpdateTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpgradeTransformsResponse UpgradeTransforms(UpgradeTransformsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(UpgradeTransformsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(UpgradeTransformsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + 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.Xpack.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Xpack.g.cs new file mode 100644 index 00000000000..f4701fa3667 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.Xpack.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Serverless.Xpack; + +public partial class XpackNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected XpackNamespacedClient() : base() + { + } + + internal XpackNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual XpackInfoResponse Info(XpackInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(XpackInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new XpackInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(XpackInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new XpackInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual XpackUsageResponse Usage(XpackUsageRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(XpackUsageRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(CancellationToken cancellationToken = default) + { + var descriptor = new XpackUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(XpackUsageRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new XpackUsageRequestDescriptor(); + 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.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs index e313578afc7..403b1d473c5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Client/ElasticsearchClient.g.cs @@ -24,8 +24,16 @@ using Elastic.Clients.Elasticsearch.Serverless.Graph; using Elastic.Clients.Elasticsearch.Serverless.IndexManagement; using Elastic.Clients.Elasticsearch.Serverless.Ingest; +using Elastic.Clients.Elasticsearch.Serverless.LicenseManagement; +using Elastic.Clients.Elasticsearch.Serverless.MachineLearning; +using Elastic.Clients.Elasticsearch.Serverless.Nodes; +using Elastic.Clients.Elasticsearch.Serverless.Snapshot; +using Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; using Elastic.Clients.Elasticsearch.Serverless.Sql; -using Elastic.Clients.Elasticsearch.Serverless.Tasks; +using Elastic.Clients.Elasticsearch.Serverless.Synonyms; +using Elastic.Clients.Elasticsearch.Serverless.TextStructure; +using Elastic.Clients.Elasticsearch.Serverless.TransformManagement; +using Elastic.Clients.Elasticsearch.Serverless.Xpack; using System; using System.Threading; using System.Threading.Tasks; @@ -41,17 +49,41 @@ public partial class ElasticsearchClient public virtual GraphNamespacedClient Graph { get; private set; } public virtual IndicesNamespacedClient Indices { get; private set; } public virtual IngestNamespacedClient Ingest { get; private set; } + public virtual LicenseManagementNamespacedClient LicenseManagement { get; private set; } + public virtual MachineLearningNamespacedClient MachineLearning { get; private set; } + public virtual NodesNamespacedClient Nodes { get; private set; } + public virtual SnapshotNamespacedClient Snapshot { get; private set; } + public virtual SnapshotLifecycleManagementNamespacedClient SnapshotLifecycleManagement { get; private set; } public virtual SqlNamespacedClient Sql { get; private set; } - public virtual TasksNamespacedClient Tasks { get; private set; } + public virtual SynonymsNamespacedClient Synonyms { get; private set; } + public virtual TextStructureNamespacedClient TextStructure { get; private set; } + public virtual TransformManagementNamespacedClient TransformManagement { get; private set; } + public virtual XpackNamespacedClient Xpack { get; private set; } private partial void SetupNamespaces() { - AsyncSearch = new AsyncSearchNamespacedClient(this); Cluster = new ClusterNamespacedClient(this); Enrich = new EnrichNamespacedClient(this); Eql = new EqlNamespacedClient(this); Graph = new GraphNamespacedClient(this); Indices = new IndicesNamespacedClient(this); Ingest = new IngestNamespacedClient(this); Sql = new SqlNamespacedClient(this); Tasks = new TasksNamespacedClient(this); + AsyncSearch = new AsyncSearchNamespacedClient(this); + Cluster = new ClusterNamespacedClient(this); + Enrich = new EnrichNamespacedClient(this); + Eql = new EqlNamespacedClient(this); + Graph = new GraphNamespacedClient(this); + Indices = new IndicesNamespacedClient(this); + Ingest = new IngestNamespacedClient(this); + LicenseManagement = new LicenseManagementNamespacedClient(this); + MachineLearning = new MachineLearningNamespacedClient(this); + Nodes = new NodesNamespacedClient(this); + Snapshot = new SnapshotNamespacedClient(this); + SnapshotLifecycleManagement = new SnapshotLifecycleManagementNamespacedClient(this); + Sql = new SqlNamespacedClient(this); + Synonyms = new SynonymsNamespacedClient(this); + TextStructure = new TextStructureNamespacedClient(this); + TransformManagement = new TransformManagementNamespacedClient(this); + Xpack = new XpackNamespacedClient(this); } /// /// 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) { @@ -61,7 +93,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) { @@ -71,51 +103,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. - /// - 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task BulkAsync(BulkRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -125,7 +113,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) { @@ -137,7 +125,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) { @@ -147,7 +135,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) { @@ -159,7 +147,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) { @@ -169,7 +157,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) { @@ -179,40 +167,7 @@ public virtual Task ClearScrollAsync(ClearScrollRequest req /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClearScrollAsync(CancellationToken cancellationToken = default) { @@ -223,7 +178,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) { @@ -233,7 +188,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) { @@ -245,7 +200,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) { @@ -255,7 +210,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) { @@ -265,40 +220,7 @@ public virtual Task ClosePointInTimeAsync(ClosePointIn /// /// 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task ClosePointInTimeAsync(CancellationToken cancellationToken = default) { @@ -309,7 +231,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) { @@ -319,7 +241,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) { @@ -349,61 +271,6 @@ public virtual Task CountAsync(CountRequest request, Cancellation 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. @@ -481,43 +348,6 @@ public virtual Task CreateAsync(CreateRequest, 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. @@ -543,80 +373,76 @@ public virtual Task CreateAsync(TDocument document, E } /// - /// 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. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual DeleteResponse Delete(DeleteRequest request) { - var descriptor = new CreateRequestDescriptor(document); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Deletes documents matching the provided query. - /// Learn more about this API in the Elasticsearch documentation. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequest request) + public virtual Task DeleteAsync(DeleteRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequest(request); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes documents matching the provided query. - /// Learn more about this API in the Elasticsearch documentation. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryAsync(DeleteByQueryRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new DeleteRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes documents matching the provided query. - /// Learn more about this API in the Elasticsearch documentation. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) + public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes documents matching the provided query. - /// Learn more about this API in the Elasticsearch documentation. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRequestDescriptor(indices); + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes documents matching the provided query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) + public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequest request) { - descriptor.BeforeRequest(); - return DoRequest, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// /// 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) + public virtual Task DeleteByQueryAsync(DeleteByQueryRequest request, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, DeleteByQueryResponse, DeleteByQueryRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// @@ -687,1618 +513,777 @@ public virtual Task DeleteByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id) + public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.TaskId taskId, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(DeleteByQueryRethrottleRequestDescriptor descriptor) + public virtual Task DeleteByQueryRethrottleAsync(DeleteByQueryRethrottleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id, Action configureRequest) + public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.TaskId taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Changes the number of requests per second for a particular Delete By Query operation. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id, CancellationToken cancellationToken = default) + public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequest request) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Changes the number of requests per second for a particular Delete By Query operation. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryRethrottleAsync(DeleteByQueryRethrottleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteScriptAsync(DeleteScriptRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Changes the number of requests per second for a particular Delete By Query operation. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.TaskId task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); - configureRequest?.Invoke(descriptor); + var descriptor = new DeleteScriptRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteResponse Delete(DeleteRequest request) + public virtual Task DeleteScriptAsync(DeleteScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new DeleteScriptRequestDescriptor(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. + /// Returns information about whether a document exists in an 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) + public virtual ExistsResponse Exists(ExistsRequest request) { - var descriptor = new DeleteRequestDescriptor(index, id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) + public virtual Task ExistsAsync(ExistsRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an 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) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new ExistsRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); descriptor.BeforeRequest(); - return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + var descriptor = new ExistsRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteResponse Delete(DeleteRequestDescriptor descriptor) + public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document exists in an 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) + public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new ExistsRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, DeleteResponse, DeleteRequestParameters>(descriptor); + return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an 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) + public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequest request) { - var descriptor = new DeleteRequestDescriptor(index, id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ExistsSourceAsync(ExistsSourceRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an 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) + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new ExistsSourceRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an 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) + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(typeof(TDocument), id); + var descriptor = new ExistsSourceRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Removes a document from the index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a document source exists in an 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) + public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteRequestDescriptor(index, id); + var descriptor = new ExistsSourceRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteResponse, DeleteRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequest request) + public virtual ExplainResponse Explain(ExplainRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest, ExplainRequestParameters>(request); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(DeleteScriptRequest request, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(ExplainRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync, ExplainRequestParameters>(request, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); + var descriptor = new ExplainRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor descriptor) + public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about why a specific matches (or doesn't match) a query. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); + var descriptor = new ExplainRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor descriptor) + public virtual FieldCapsResponse FieldCaps(FieldCapsRequest request) { - descriptor.BeforeRequest(); - return DoRequest, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task FieldCapsAsync(FieldCapsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); + var descriptor = new FieldCapsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(DeleteScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); + var descriptor = new FieldCapsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(DeleteScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(FieldCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, FieldCapsResponse, FieldCapsRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes a script. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the information about the capabilities of fields among multiple indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task FieldCapsAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteScriptRequestDescriptor(id); + var descriptor = new FieldCapsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteScriptResponse, DeleteScriptRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, FieldCapsResponse, FieldCapsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsResponse Exists(ExistsRequest request) + public virtual GetResponse Get(GetRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest, GetRequestParameters>(request); } /// - /// Returns information about whether a document exists in an index. + /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequest request, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(GetRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync, GetRequestParameters>(request, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns a document. /// 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) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) + public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns a document. /// 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) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new GetRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual GetScriptResponse GetScript(GetScriptRequest request) { - var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about whether a document exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task GetScriptAsync(GetScriptRequest request, CancellationToken cancellationToken = default) { - 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); + 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. + /// Returns a script. + /// 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) + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new GetScriptRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest, ExistsResponse, ExistsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// 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) + public virtual Task GetScriptAsync(GetScriptRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + 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); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns the source of a document. /// 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) + public virtual GetSourceResponse GetSource(GetSourceRequest request) { - var descriptor = new ExistsRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest, GetSourceRequestParameters>(request); } /// - /// Returns information about whether a document exists in an index. + /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(GetSourceRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync, GetSourceRequestParameters>(request, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); + var descriptor = new GetSourceRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document exists in an index. + /// Returns the source of a document. /// 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) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(index, id); + var descriptor = new GetSourceRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequest request) + public virtual HealthReportResponse HealthReport(HealthReportRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(ExistsSourceRequest request, CancellationToken cancellationToken = default) + public virtual Task HealthReportAsync(HealthReportRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// 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) + public virtual Task HealthReportAsync(CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new HealthReportRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + public virtual Task HealthReportAsync(HealthReportRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// 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) + public virtual Task HealthReportAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new HealthReportRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual IndexResponse Index(IndexRequest request) { - var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest, IndexResponse, IndexRequestParameters>(request); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task IndexAsync(IndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(request, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates a document in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) + public virtual Task IndexAsync(IndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates a document 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) + public virtual Task IndexAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); + var descriptor = new IndexRequestDescriptor(document, index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor); + return DoRequestAsync, IndexResponse, IndexRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns basic information about the cluster. + /// 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) + public virtual InfoResponse Info(InfoRequest request) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(InfoRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Returns basic information about the cluster. + /// 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) + public virtual Task InfoAsync(CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); + var descriptor = new InfoRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(InfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns basic information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(typeof(TDocument), id); + var descriptor = new InfoRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a document source exists in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsSourceAsync(ExistsSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual MultiTermVectorsResponse Mtermvectors(MultiTermVectorsRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + 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. + /// Returns multiple termvectors in one request. + /// 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) + public virtual Task MtermvectorsAsync(MultiTermVectorsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExistsSourceRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, ExistsSourceResponse, ExistsSourceRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(ExplainRequest request) + public virtual Task MtermvectorsAsync(CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest, ExplainRequestParameters>(request); + var descriptor = new MultiTermVectorsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(ExplainRequest request, CancellationToken cancellationToken = default) + public virtual Task MtermvectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync, ExplainRequestParameters>(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual Task MtermvectorsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(ExplainRequestDescriptor descriptor) + public virtual Task MtermvectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task MtermvectorsAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new MultiTermVectorsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Serverless.Id id) + public virtual MultiGetResponse MultiGet(MultiGetRequest request) { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest, MultiGetRequestParameters>(request); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest) + public virtual Task> MultiGetAsync(MultiGetRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync, MultiGetRequestParameters>(request, cancellationToken); } /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) + public virtual Task> MultiGetAsync(CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(index, id); + var descriptor = new MultiGetRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ExplainRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default) - { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(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); + return DoRequestAsync, MultiGetResponse, MultiGetRequestParameters>(descriptor, cancellationToken); } /// @@ -2312,397 +1297,146 @@ public virtual Task> MultiGetAsync(MultiG } /// - /// 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. + /// Allows to get multiple documents in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual MultiTermVectorsResponse MultiTermVectors(Action> configureRequest) + public virtual Task> MultiGetAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new MultiTermVectorsRequestDescriptor(); + var descriptor = new MultiGetRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor); + return DoRequestAsync, MultiGetResponse, MultiGetRequestParameters>(descriptor, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(CancellationToken cancellationToken = default) + public virtual MultiSearchResponse MultiSearch(MultiSearchRequest request) { - var descriptor = new MultiTermVectorsRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest, MultiSearchRequestParameters>(request); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchAsync(MultiSearchRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync, MultiSearchRequestParameters>(request, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchAsync(CancellationToken cancellationToken = default) { - var descriptor = new MultiTermVectorsRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new MultiSearchRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchAsync(MultiSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new MultiTermVectorsRequestDescriptor(); + var descriptor = new MultiSearchRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequest request) + public virtual MultiSearchTemplateResponse MultiSearchTemplate(MultiSearchTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest, MultiSearchTemplateRequestParameters>(request); } /// - /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequest request, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchTemplateAsync(MultiSearchTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(request, cancellationToken); } /// - /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + public virtual Task> MultiSearchTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new OpenPointInTimeRequestDescriptor(indices); + var descriptor = new MultiSearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) + public virtual Task> MultiSearchTemplateAsync(MultiSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Open a point in time that can be used in subsequent searches - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + public virtual Task> MultiSearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new OpenPointInTimeRequestDescriptor(indices); + var descriptor = new MultiSearchTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// /// 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) + public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequest request) { - descriptor.BeforeRequest(); - return DoRequest, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor); + 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. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action> configureRequest) + public virtual Task OpenPointInTimeAsync(OpenPointInTimeRequest request, CancellationToken cancellationToken = default) { - var descriptor = new OpenPointInTimeRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, OpenPointInTimeResponse, OpenPointInTimeRequestParameters>(descriptor); + 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, CancellationToken cancellationToken = default) { @@ -2713,7 +1447,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) { @@ -2723,7 +1457,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.Serverless.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { @@ -2733,28 +1467,6 @@ public virtual Task OpenPointInTimeAsync(Elastic.Client 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. @@ -2775,39 +1487,6 @@ public virtual Task PingAsync(PingRequest request, CancellationTok 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. @@ -2861,50 +1540,6 @@ public virtual Task PutScriptAsync(PutScriptRequest request, 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. @@ -2927,28 +1562,6 @@ public virtual Task PutScriptAsync(Elastic.Clients.Elasticsea 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. @@ -2969,61 +1582,6 @@ public virtual Task RankEvalAsync(RankEvalRequest request, Can 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. @@ -3099,50 +1657,6 @@ public virtual Task ReindexAsync(ReindexRequest request, Cancel return DoRequestAsync(request, cancellationToken); } - /// - /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
- /// Learn more about this API in the Elasticsearch documentation. - ///
- public virtual ReindexResponse Reindex(ReindexRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
- /// Learn more about this API in the Elasticsearch documentation. - ///
- public virtual ReindexResponse Reindex(Action configureRequest) - { - var descriptor = new ReindexRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
- /// Learn more about this API in the Elasticsearch documentation. - ///
- public virtual ReindexResponse Reindex(ReindexRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, ReindexResponse, ReindexRequestParameters>(descriptor); - } - - /// - /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
- /// Learn more about this API in the Elasticsearch documentation. - ///
- public virtual ReindexResponse Reindex(Action> configureRequest) - { - var descriptor = new ReindexRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ReindexResponse, ReindexRequestParameters>(descriptor); - } - /// /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
/// Learn more about this API in the Elasticsearch documentation. @@ -3211,42 +1725,9 @@ public virtual Task ReindexRethrottleAsync(ReindexRet /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Serverless.Id task_id) + public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id taskId, CancellationToken cancellationToken = default) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Reindex operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ReindexRethrottleResponse ReindexRethrottle(ReindexRethrottleRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Reindex operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest) - { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Reindex operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, CancellationToken cancellationToken = default) - { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -3265,9 +1746,9 @@ public virtual Task ReindexRethrottleAsync(ReindexRet /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -3293,61 +1774,6 @@ public virtual Task RenderSearchTemplateAsync(Rend 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. @@ -3381,28 +1807,6 @@ public virtual Task RenderSearchTemplateAsync(Acti 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. @@ -3423,39 +1827,6 @@ public virtual Task> ScrollAsync(ScrollRequ 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. @@ -3509,39 +1880,6 @@ public virtual Task> SearchAsync(SearchRequ 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. @@ -3576,372 +1914,235 @@ public virtual Task> SearchAsync(Action - /// 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual TermsEnumResponse TermsEnum(TermsEnumRequest request) + public virtual SearchMvtResponse SearchMvt(SearchMvtRequest request) { request.BeforeRequest(); - return DoRequest(request); + 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(TermsEnumRequest request, CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(SearchMvtRequest 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); + 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual TermsEnumResponse TermsEnum(Action> configureRequest) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); - configureRequest?.Invoke(descriptor); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); descriptor.BeforeRequest(); - return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor descriptor) + public virtual Task SearchMvtAsync(SearchMvtRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(index); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermsEnumResponse, TermsEnumRequestParameters>(descriptor); + 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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(SearchMvtRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SearchMvtResponse, SearchMvtRequestParameters>(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. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Elastic.Clients.Elasticsearch.Serverless.Field field, int zoom, int x, int y, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SearchMvtResponse, SearchMvtRequestParameters>(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. + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + public virtual SearchTemplateResponse SearchTemplate(SearchTemplateRequest request) { - var descriptor = new TermsEnumRequestDescriptor(index); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest, SearchTemplateRequestParameters>(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. + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(CancellationToken cancellationToken = default) + public virtual Task> SearchTemplateAsync(SearchTemplateRequest request, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); - descriptor.BeforeRequest(); - return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync, SearchTemplateRequestParameters>(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. + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(typeof(TDocument)); - configureRequest?.Invoke(descriptor); + var descriptor = new SearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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. + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> SearchTemplateAsync(SearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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. + /// Allows to use the Mustache language to pre-render a search definition. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermsEnumRequestDescriptor(index); + var descriptor = new SearchTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, TermsEnumResponse, TermsEnumRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, SearchTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsResponse TermVectors(TermVectorsRequest request) + public virtual TermsEnumResponse TermsEnum(TermsEnumRequest request) { request.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(request); + return DoRequest(request); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) + public virtual Task TermsEnumAsync(TermsEnumRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsResponse TermVectors(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index) + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new TermsEnumRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsResponse TermVectors(TermVectorsRequestDescriptor descriptor) + public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsResponse TermVectors(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest) + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new TermsEnumRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 TermVectorsResponse TermVectors(TDocument document) + public virtual Task TermsEnumAsync(TermsEnumRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + 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. + /// 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 TermVectorsResponse TermVectors(TDocument document, Action> configureRequest) + public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); + var descriptor = new TermsEnumRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + 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 Task TermVectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) + public virtual TermVectorsResponse Termvectors(TermVectorsRequest request) { - var descriptor = new TermVectorsRequestDescriptor(document, index); - descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + 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(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + 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 Task TermVectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document, index); - configureRequest?.Invoke(descriptor); + var descriptor = new TermVectorsRequestDescriptor(index); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } @@ -3950,9 +2151,8 @@ public virtual Task TermVectorsAsync(TDocument d /// 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) + public virtual Task TermvectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); descriptor.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); } @@ -3961,91 +2161,78 @@ public virtual Task TermVectorsAsync(TDocument d /// 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) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); + var descriptor = new TermVectorsRequestDescriptor(index); 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. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequest request) + public virtual UpdateResponse Update(UpdateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest, UpdateResponse, UpdateRequestParameters>(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. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task UpdateByQueryAsync(UpdateByQueryRequest request, CancellationToken cancellationToken = default) + public virtual Task> UpdateAsync(UpdateRequest 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); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(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. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescriptor descriptor) + public virtual Task> UpdateAsync(UpdateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(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. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Serverless.Indices indices, Action configureRequest) + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.Serverless.IndexName index, Elastic.Clients.Elasticsearch.Serverless.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRequestDescriptor(indices); + var descriptor = new UpdateRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) + public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequest request) { - descriptor.BeforeRequest(); - return DoRequest, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor); + 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.
+ /// Updates documents that match the specified query. If no query is specified,
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) + public virtual Task UpdateByQueryAsync(UpdateByQueryRequest request, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, UpdateByQueryResponse, UpdateByQueryRequestParameters>(descriptor); + 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.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4056,7 +2243,7 @@ public virtual Task UpdateByQueryAsync(Elastic.Clients.El } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4066,7 +2253,7 @@ public virtual Task UpdateByQueryAsync(UpdateByQueryReque } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4078,7 +2265,7 @@ public virtual Task UpdateByQueryAsync(Elastic.Clients.El } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4088,7 +2275,7 @@ public virtual Task UpdateByQueryAsync(UpdateB } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4123,42 +2310,9 @@ public virtual Task UpdateByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Serverless.Id task_id) - { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Update By Query operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(UpdateByQueryRethrottleRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Update By Query operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest) - { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Changes the number of requests per second for a particular Update By Query operation. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, CancellationToken cancellationToken = default) + public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id taskId, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -4177,99 +2331,11 @@ public virtual Task UpdateByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Serverless.Id taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(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/Aggregations/AdjacencyMatrixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs index ee8746f028f..c83936708f1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs @@ -27,111 +27,19 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class AdjacencyMatrixAggregationConverter : JsonConverter +public sealed partial class AdjacencyMatrixAggregation { - 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.
///
+ [JsonInclude, JsonPropertyName("filters")] public IDictionary? Filters { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.AdjacencyMatrix(adjacencyMatrixAggregation); } public sealed partial class AdjacencyMatrixAggregationDescriptor : SerializableDescriptor> @@ -142,42 +50,16 @@ 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> 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; - } + private string? NameValue { get; set; } /// /// Filters used to create buckets.
At least one filter is required.
///
- public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + public AdjacencyMatrixAggregationDescriptor Filters(Func>, FluentDescriptorDictionary>> selector) { - FiltersValue = selector?.Invoke(new FluentDictionary()); + FiltersValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -187,10 +69,14 @@ public AdjacencyMatrixAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + 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) { @@ -198,27 +84,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -233,42 +108,16 @@ 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 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; - } + private string? NameValue { get; set; } /// /// Filters used to create buckets.
At least one filter is required.
///
- public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDescriptorDictionary> selector) { - FiltersValue = selector?.Invoke(new FluentDictionary()); + FiltersValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -278,10 +127,14 @@ public AdjacencyMatrixAggregationDescriptor Meta(Func 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 +internal sealed partial class AdjacencyMatrixBucketConverter : JsonConverter { - public override AdjacencyMatrixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new AdjacencyMatrixBucket(subAggs) { DocCount = docCount, Key = key }; + return new AdjacencyMatrixBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, AdjacencyMatrixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, AdjacencyMatrixBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'AdjacencyMatrixBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(AdjacencyMatrixBucketConverter))] +public sealed partial class AdjacencyMatrixBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ 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 index d16050bfb6c..dcfeab4c6eb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AggregateDictionary.g.cs @@ -24,12 +24,17 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Linq; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +public partial interface IAggregate +{ +} + [JsonConverter(typeof(AggregateDictionaryConverter))] public partial class AggregateDictionary : IsAReadOnlyDictionary { @@ -37,63 +42,595 @@ public AggregateDictionary(IReadOnlyDictionary backingDictio { } - 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; + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregate? GetAdjacencyMatrix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregate? GetAutoDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregate? GetAverage(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketMetricValueAggregate? GetBucketMetricValue(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregate? GetCumulativeCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregate? GetDateRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregate? GetDerivative(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.DoubleTermsAggregate? GetDoubleTerms(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.FilterAggregate? GetFilter(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregate? GetFilters(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsAggregate? GetFrequentItemSets(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.GeoDistanceAggregate? GetGeoDistance(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregate? GetGeohashGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregate? GetGeohexGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregate? GetGeoLine(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregate? GetGeotileGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregate? GetGlobal(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrPercentileRanksAggregate? GetHdrPercentileRanks(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrPercentilesAggregate? GetHdrPercentiles(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregate? GetHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregate? GetInference(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregate? GetIpPrefix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregate? GetIpRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.LongRareTermsAggregate? GetLongRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.LongTermsAggregate? GetLongTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregate? GetMatrixStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregate? GetMax(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.MissingAggregate? GetMissing(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregate? GetMultiTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregate? GetNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregate? GetParent(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregate? GetPercentilesBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregate? GetRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregate? GetRate(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregate? GetReverseNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregate? GetSampler(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregate? GetScriptedMetric(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantLongTermsAggregate? GetSignificantLongTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantStringTermsAggregate? GetSignificantStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SimpleValueAggregate? GetSimpleValue(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.StringRareTermsAggregate? GetStringRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregate? GetStringStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringTermsAggregate? GetStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregate? GetSum(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentileRanksAggregate? GetTDigestPercentileRanks(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestPercentilesAggregate? GetTDigestPercentiles(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregate? GetTopHits(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.UnmappedRareTermsAggregate? GetUnmappedRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.UnmappedSamplerAggregate? GetUnmappedSampler(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.UnmappedSignificantTermsAggregate? GetUnmappedSignificantTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.UnmappedTermsAggregate? GetUnmappedTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregate? GetValueCount(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregate? GetVariableWidthHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregate? GetWeightedAverage(string key) => TryGet(key); + private T? TryGet(string key) where T : class, IAggregate => BackingDictionary.TryGetValue(key, out var value) ? value as T : null; +} + +internal sealed partial class AggregateDictionaryConverter : JsonConverter +{ + public override AggregateDictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var dictionary = new Dictionary(); + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString(); + reader.Read(); + ReadItem(ref reader, options, dictionary, name); + } + + return new AggregateDictionary(dictionary); + } + + public override void Write(Utf8JsonWriter writer, AggregateDictionary value, JsonSerializerOptions options) + { + throw new NotImplementedException("'AggregateDictionary' is a readonly type, used only on responses and does not support being written to JSON."); + } + + public static void ReadItem(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary dictionary, string name) + { + var nameParts = name.Split('#'); + if (nameParts.Length != 2) + throw new JsonException($"Unable to parse typed-key '{name}'."); + var type = nameParts[0]; + switch (type) + { + case "adjacency_matrix": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "auto_date_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "avg": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "box_plot": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "bucket_metric_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "cardinality": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "children": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "composite": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "simple_long_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "date_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "date_range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "derivative": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "dterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "extended_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "extended_stats_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "filter": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "filters": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "frequent_item_sets": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_bounds": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_centroid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_distance": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geohash_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geohex_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_line": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geotile_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "global": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "hdr_percentile_ranks": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "hdr_percentiles": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "inference": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "ip_prefix": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "ip_range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "lrareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "lterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "matrix_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "max": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "median_absolute_deviation": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "min": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "missing": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "multi_terms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "nested": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "parent": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "percentiles_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "rate": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "reverse_nested": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sampler": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "scripted_metric": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "siglterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sigsterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "simple_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "stats_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "srareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "string_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sum": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "tdigest_percentile_ranks": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "tdigest_percentiles": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "top_hits": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "top_metrics": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "t_test": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umrareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "unmapped_sampler": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umsigterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "value_count": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "variable_width_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "weighted_avg": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + default: + throw new NotSupportedException($"The tagged variant '{type}' is currently not supported."); + } + } } \ 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 index f61607999c7..6838dd9750b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Aggregation.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -30,1192 +31,1359 @@ 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 Aggregation(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 Aggregation AdjacencyMatrix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => new Aggregation("adjacency_matrix", adjacencyMatrixAggregation); + public static Aggregation AutoDateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => new Aggregation("auto_date_histogram", autoDateHistogramAggregation); + public static Aggregation Avg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregation averageAggregation) => new Aggregation("avg", averageAggregation); + public static Aggregation AvgBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageBucketAggregation averageBucketAggregation) => new Aggregation("avg_bucket", averageBucketAggregation); + public static Aggregation Boxplot(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregation boxplotAggregation) => new Aggregation("boxplot", boxplotAggregation); + public static Aggregation BucketScript(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketScriptAggregation bucketScriptAggregation) => new Aggregation("bucket_script", bucketScriptAggregation); + public static Aggregation BucketSelector(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => new Aggregation("bucket_selector", bucketSelectorAggregation); + public static Aggregation BucketSort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSortAggregation bucketSortAggregation) => new Aggregation("bucket_sort", bucketSortAggregation); + public static Aggregation Cardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregation cardinalityAggregation) => new Aggregation("cardinality", cardinalityAggregation); + public static Aggregation Children(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregation childrenAggregation) => new Aggregation("children", childrenAggregation); + public static Aggregation Composite(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregation compositeAggregation) => new Aggregation("composite", compositeAggregation); + public static Aggregation CumulativeCardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => new Aggregation("cumulative_cardinality", cumulativeCardinalityAggregation); + public static Aggregation CumulativeSum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => new Aggregation("cumulative_sum", cumulativeSumAggregation); + public static Aggregation DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => new Aggregation("date_histogram", dateHistogramAggregation); + public static Aggregation DateRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregation dateRangeAggregation) => new Aggregation("date_range", dateRangeAggregation); + public static Aggregation Derivative(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregation derivativeAggregation) => new Aggregation("derivative", derivativeAggregation); + public static Aggregation DiversifiedSampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => new Aggregation("diversified_sampler", diversifiedSamplerAggregation); + public static Aggregation ExtendedStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => new Aggregation("extended_stats", extendedStatsAggregation); + public static Aggregation ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => new Aggregation("extended_stats_bucket", extendedStatsBucketAggregation); + public static Aggregation Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query queryContainer) => new Aggregation("filter", queryContainer); + public static Aggregation Filters(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregation filtersAggregation) => new Aggregation("filters", filtersAggregation); + public static Aggregation FrequentItemSets(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => new Aggregation("frequent_item_sets", frequentItemSetsAggregation); + public static Aggregation GeoBounds(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => new Aggregation("geo_bounds", geoBoundsAggregation); + public static Aggregation GeoCentroid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => new Aggregation("geo_centroid", geoCentroidAggregation); + public static Aggregation GeoDistance(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => new Aggregation("geo_distance", geoDistanceAggregation); + public static Aggregation GeohashGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregation geohashGridAggregation) => new Aggregation("geohash_grid", geohashGridAggregation); + public static Aggregation GeohexGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregation geohexGridAggregation) => new Aggregation("geohex_grid", geohexGridAggregation); + public static Aggregation GeoLine(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => new Aggregation("geo_line", geoLineAggregation); + public static Aggregation GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => new Aggregation("geotile_grid", geotileGridAggregation); + public static Aggregation Global(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregation globalAggregation) => new Aggregation("global", globalAggregation); + public static Aggregation Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => new Aggregation("histogram", histogramAggregation); + public static Aggregation Inference(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregation inferenceAggregation) => new Aggregation("inference", inferenceAggregation); + public static Aggregation IpPrefix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregation ipPrefixAggregation) => new Aggregation("ip_prefix", ipPrefixAggregation); + public static Aggregation IpRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregation ipRangeAggregation) => new Aggregation("ip_range", ipRangeAggregation); + public static Aggregation Line(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => new Aggregation("line", geoLineAggregation); + public static Aggregation MatrixStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => new Aggregation("matrix_stats", matrixStatsAggregation); + public static Aggregation Max(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregation maxAggregation) => new Aggregation("max", maxAggregation); + public static Aggregation MaxBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxBucketAggregation maxBucketAggregation) => new Aggregation("max_bucket", maxBucketAggregation); + public static Aggregation MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => new Aggregation("median_absolute_deviation", medianAbsoluteDeviationAggregation); + public static Aggregation Min(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregation minAggregation) => new Aggregation("min", minAggregation); + public static Aggregation MinBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinBucketAggregation minBucketAggregation) => new Aggregation("min_bucket", minBucketAggregation); + public static Aggregation Missing(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregation missingAggregation) => new Aggregation("missing", missingAggregation); + public static Aggregation MovingFn(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => new Aggregation("moving_fn", movingFunctionAggregation); + public static Aggregation MovingPercentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => new Aggregation("moving_percentiles", movingPercentilesAggregation); + public static Aggregation MultiTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregation multiTermsAggregation) => new Aggregation("multi_terms", multiTermsAggregation); + public static Aggregation Nested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregation nestedAggregation) => new Aggregation("nested", nestedAggregation); + public static Aggregation Normalize(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeAggregation normalizeAggregation) => new Aggregation("normalize", normalizeAggregation); + public static Aggregation Parent(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregation parentAggregation) => new Aggregation("parent", parentAggregation); + public static Aggregation PercentileRanks(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => new Aggregation("percentile_ranks", percentileRanksAggregation); + public static Aggregation Percentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesAggregation percentilesAggregation) => new Aggregation("percentiles", percentilesAggregation); + public static Aggregation PercentilesBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => new Aggregation("percentiles_bucket", percentilesBucketAggregation); + public static Aggregation Range(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregation rangeAggregation) => new Aggregation("range", rangeAggregation); + public static Aggregation RareTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RareTermsAggregation rareTermsAggregation) => new Aggregation("rare_terms", rareTermsAggregation); + public static Aggregation Rate(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregation rateAggregation) => new Aggregation("rate", rateAggregation); + public static Aggregation ReverseNested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => new Aggregation("reverse_nested", reverseNestedAggregation); + public static Aggregation Sampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregation samplerAggregation) => new Aggregation("sampler", samplerAggregation); + public static Aggregation ScriptedMetric(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => new Aggregation("scripted_metric", scriptedMetricAggregation); + public static Aggregation SerialDiff(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => new Aggregation("serial_diff", serialDifferencingAggregation); + public static Aggregation SignificantTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTermsAggregation significantTermsAggregation) => new Aggregation("significant_terms", significantTermsAggregation); + public static Aggregation SignificantText(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTextAggregation significantTextAggregation) => new Aggregation("significant_text", significantTextAggregation); + public static Aggregation Stats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregation statsAggregation) => new Aggregation("stats", statsAggregation); + public static Aggregation StatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregation statsBucketAggregation) => new Aggregation("stats_bucket", statsBucketAggregation); + public static Aggregation StringStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregation stringStatsAggregation) => new Aggregation("string_stats", stringStatsAggregation); + public static Aggregation Sum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregation sumAggregation) => new Aggregation("sum", sumAggregation); + public static Aggregation SumBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumBucketAggregation sumBucketAggregation) => new Aggregation("sum_bucket", sumBucketAggregation); + public static Aggregation Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation termsAggregation) => new Aggregation("terms", termsAggregation); + public static Aggregation TopHits(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregation topHitsAggregation) => new Aggregation("top_hits", topHitsAggregation); + public static Aggregation TopMetrics(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregation topMetricsAggregation) => new Aggregation("top_metrics", topMetricsAggregation); + public static Aggregation TTest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregation tTestAggregation) => new Aggregation("t_test", tTestAggregation); + public static Aggregation ValueCount(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregation valueCountAggregation) => new Aggregation("value_count", valueCountAggregation); + public static Aggregation VariableWidthHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => new Aggregation("variable_width_histogram", variableWidthHistogramAggregation); + public static Aggregation WeightedAvg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => new Aggregation("weighted_avg", weightedAverageAggregation); + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal ISearchAggregation Variant { get; } + return false; + } } 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 == "geohash_grid") - { - return AggregationSerializationHelper.ReadContainer("geohash_grid", ref reader, options); - } - - if (propertyName == "geohex_grid") - { - return AggregationSerializationHelper.ReadContainer("geohex_grid", ref reader, options); - } - - if (propertyName == "geo_line") - { - return AggregationSerializationHelper.ReadContainer("geo_line", 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") + if (reader.TokenType != JsonTokenType.StartObject) { - return AggregationSerializationHelper.ReadContainer("significant_terms", ref reader, options); + throw new JsonException("Expected start token."); } - if (propertyName == "stats") + object? variantValue = default; + string? variantNameValue = default; + IDictionary? aggregationsValue = default; + IDictionary? metaValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - return AggregationSerializationHelper.ReadContainer("stats", ref reader, options); + 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 == "aggregations") + { + aggregationsValue = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (propertyName == "meta") + { + metaValue = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (propertyName == "adjacency_matrix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "auto_date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "avg") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "avg_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "boxplot") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_selector") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_sort") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cardinality") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "children") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "composite") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cumulative_cardinality") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cumulative_sum") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "date_range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "derivative") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "diversified_sampler") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "extended_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "extended_stats_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "filter") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "filters") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "frequent_item_sets") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_bounds") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_centroid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_distance") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geohash_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geohex_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_line") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geotile_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "global") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "inference") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ip_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ip_range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "line") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "matrix_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "max") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "max_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "median_absolute_deviation") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "min") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "min_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "missing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "moving_fn") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "moving_percentiles") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "multi_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "normalize") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "parent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentile_ranks") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentiles") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentiles_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "rare_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "rate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "reverse_nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sampler") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "scripted_metric") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "serial_diff") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "significant_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "significant_text") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stats_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "string_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sum") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sum_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "top_hits") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "top_metrics") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "t_test") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "value_count") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "variable_width_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "weighted_avg") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Aggregation' from the response."); } - if (propertyName == "stats_bucket") - { - return AggregationSerializationHelper.ReadContainer("stats_bucket", ref reader, options); - } + reader.Read(); + var result = new Aggregation(variantNameValue, variantValue); + result.Aggregations = aggregationsValue; + result.Meta = metaValue; + return result; + } - if (propertyName == "string_stats") + public override void Write(Utf8JsonWriter writer, Aggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) { - return AggregationSerializationHelper.ReadContainer("string_stats", ref reader, options); + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); } - if (propertyName == "sum") + if (value.Meta is not null) { - return AggregationSerializationHelper.ReadContainer("sum", ref reader, options); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); } - if (propertyName == "terms") + if (value.VariantName is not null && value.Variant is not null) { - return AggregationSerializationHelper.ReadContainer("terms", ref reader, options); + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "adjacency_matrix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregation)value.Variant, options); + break; + case "auto_date_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregation)value.Variant, options); + break; + case "avg": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregation)value.Variant, options); + break; + case "avg_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageBucketAggregation)value.Variant, options); + break; + case "boxplot": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregation)value.Variant, options); + break; + case "bucket_script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketScriptAggregation)value.Variant, options); + break; + case "bucket_selector": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSelectorAggregation)value.Variant, options); + break; + case "bucket_sort": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSortAggregation)value.Variant, options); + break; + case "cardinality": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregation)value.Variant, options); + break; + case "children": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregation)value.Variant, options); + break; + case "composite": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregation)value.Variant, options); + break; + case "cumulative_cardinality": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregation)value.Variant, options); + break; + case "cumulative_sum": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeSumAggregation)value.Variant, options); + break; + case "date_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation)value.Variant, options); + break; + case "date_range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregation)value.Variant, options); + break; + case "derivative": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregation)value.Variant, options); + break; + case "diversified_sampler": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.DiversifiedSamplerAggregation)value.Variant, options); + break; + case "extended_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregation)value.Variant, options); + break; + case "extended_stats_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregation)value.Variant, options); + break; + case "filter": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query)value.Variant, options); + break; + case "filters": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregation)value.Variant, options); + break; + case "frequent_item_sets": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsAggregation)value.Variant, options); + break; + case "geo_bounds": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregation)value.Variant, options); + break; + case "geo_centroid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregation)value.Variant, options); + break; + case "geo_distance": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregation)value.Variant, options); + break; + case "geohash_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregation)value.Variant, options); + break; + case "geohex_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregation)value.Variant, options); + break; + case "geo_line": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation)value.Variant, options); + break; + case "geotile_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation)value.Variant, options); + break; + case "global": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregation)value.Variant, options); + break; + case "histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation)value.Variant, options); + break; + case "inference": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregation)value.Variant, options); + break; + case "ip_prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregation)value.Variant, options); + break; + case "ip_range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregation)value.Variant, options); + break; + case "line": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation)value.Variant, options); + break; + case "matrix_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregation)value.Variant, options); + break; + case "max": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregation)value.Variant, options); + break; + case "max_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxBucketAggregation)value.Variant, options); + break; + case "median_absolute_deviation": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregation)value.Variant, options); + break; + case "min": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregation)value.Variant, options); + break; + case "min_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinBucketAggregation)value.Variant, options); + break; + case "missing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregation)value.Variant, options); + break; + case "moving_fn": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingFunctionAggregation)value.Variant, options); + break; + case "moving_percentiles": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingPercentilesAggregation)value.Variant, options); + break; + case "multi_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregation)value.Variant, options); + break; + case "nested": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregation)value.Variant, options); + break; + case "normalize": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeAggregation)value.Variant, options); + break; + case "parent": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregation)value.Variant, options); + break; + case "percentile_ranks": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentileRanksAggregation)value.Variant, options); + break; + case "percentiles": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesAggregation)value.Variant, options); + break; + case "percentiles_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregation)value.Variant, options); + break; + case "range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregation)value.Variant, options); + break; + case "rare_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.RareTermsAggregation)value.Variant, options); + break; + case "rate": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregation)value.Variant, options); + break; + case "reverse_nested": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregation)value.Variant, options); + break; + case "sampler": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregation)value.Variant, options); + break; + case "scripted_metric": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregation)value.Variant, options); + break; + case "serial_diff": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SerialDifferencingAggregation)value.Variant, options); + break; + case "significant_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTermsAggregation)value.Variant, options); + break; + case "significant_text": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTextAggregation)value.Variant, options); + break; + case "stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregation)value.Variant, options); + break; + case "stats_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregation)value.Variant, options); + break; + case "string_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregation)value.Variant, options); + break; + case "sum": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregation)value.Variant, options); + break; + case "sum_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumBucketAggregation)value.Variant, options); + break; + case "terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation)value.Variant, options); + break; + case "top_hits": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregation)value.Variant, options); + break; + case "top_metrics": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregation)value.Variant, options); + break; + case "t_test": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregation)value.Variant, options); + break; + case "value_count": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregation)value.Variant, options); + break; + case "variable_width_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregation)value.Variant, options); + break; + case "weighted_avg": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregation)value.Variant, options); + break; + } } - if (propertyName == "top_hits") - { - return AggregationSerializationHelper.ReadContainer("top_hits", ref reader, options); - } + writer.WriteEndObject(); + } +} - if (propertyName == "top_metrics") - { - return AggregationSerializationHelper.ReadContainer("top_metrics", ref reader, options); - } +public sealed partial class AggregationDescriptor : SerializableDescriptor> +{ + internal AggregationDescriptor(Action> configure) => configure.Invoke(this); - if (propertyName == "t_test") - { - return AggregationSerializationHelper.ReadContainer("t_test", ref reader, options); - } + public AggregationDescriptor() : base() + { + } - if (propertyName == "value_count") + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private AggregationDescriptor 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 AggregationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ public AggregationDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + public AggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregationDescriptor AdjacencyMatrix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Set(adjacencyMatrixAggregation, "adjacency_matrix"); + public AggregationDescriptor AdjacencyMatrix(Action> configure) => Set(configure, "adjacency_matrix"); + public AggregationDescriptor AutoDateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => Set(autoDateHistogramAggregation, "auto_date_histogram"); + public AggregationDescriptor AutoDateHistogram(Action> configure) => Set(configure, "auto_date_histogram"); + public AggregationDescriptor Avg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregation averageAggregation) => Set(averageAggregation, "avg"); + public AggregationDescriptor Avg(Action> configure) => Set(configure, "avg"); + public AggregationDescriptor AvgBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageBucketAggregation averageBucketAggregation) => Set(averageBucketAggregation, "avg_bucket"); + public AggregationDescriptor AvgBucket(Action configure) => Set(configure, "avg_bucket"); + public AggregationDescriptor Boxplot(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregation boxplotAggregation) => Set(boxplotAggregation, "boxplot"); + public AggregationDescriptor Boxplot(Action> configure) => Set(configure, "boxplot"); + public AggregationDescriptor BucketScript(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketScriptAggregation bucketScriptAggregation) => Set(bucketScriptAggregation, "bucket_script"); + public AggregationDescriptor BucketScript(Action configure) => Set(configure, "bucket_script"); + public AggregationDescriptor BucketSelector(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => Set(bucketSelectorAggregation, "bucket_selector"); + public AggregationDescriptor BucketSelector(Action configure) => Set(configure, "bucket_selector"); + public AggregationDescriptor BucketSort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSortAggregation bucketSortAggregation) => Set(bucketSortAggregation, "bucket_sort"); + public AggregationDescriptor BucketSort(Action> configure) => Set(configure, "bucket_sort"); + public AggregationDescriptor Cardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregation cardinalityAggregation) => Set(cardinalityAggregation, "cardinality"); + public AggregationDescriptor Cardinality(Action> configure) => Set(configure, "cardinality"); + public AggregationDescriptor Children(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregation childrenAggregation) => Set(childrenAggregation, "children"); + public AggregationDescriptor Children(Action configure) => Set(configure, "children"); + public AggregationDescriptor Composite(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregation compositeAggregation) => Set(compositeAggregation, "composite"); + public AggregationDescriptor Composite(Action> configure) => Set(configure, "composite"); + public AggregationDescriptor CumulativeCardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Set(cumulativeCardinalityAggregation, "cumulative_cardinality"); + public AggregationDescriptor CumulativeCardinality(Action configure) => Set(configure, "cumulative_cardinality"); + public AggregationDescriptor CumulativeSum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => Set(cumulativeSumAggregation, "cumulative_sum"); + public AggregationDescriptor CumulativeSum(Action configure) => Set(configure, "cumulative_sum"); + public AggregationDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public AggregationDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public AggregationDescriptor DateRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregation dateRangeAggregation) => Set(dateRangeAggregation, "date_range"); + public AggregationDescriptor DateRange(Action> configure) => Set(configure, "date_range"); + public AggregationDescriptor Derivative(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregation derivativeAggregation) => Set(derivativeAggregation, "derivative"); + public AggregationDescriptor Derivative(Action configure) => Set(configure, "derivative"); + public AggregationDescriptor DiversifiedSampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Set(diversifiedSamplerAggregation, "diversified_sampler"); + public AggregationDescriptor DiversifiedSampler(Action> configure) => Set(configure, "diversified_sampler"); + public AggregationDescriptor ExtendedStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => Set(extendedStatsAggregation, "extended_stats"); + public AggregationDescriptor ExtendedStats(Action> configure) => Set(configure, "extended_stats"); + public AggregationDescriptor ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Set(extendedStatsBucketAggregation, "extended_stats_bucket"); + public AggregationDescriptor ExtendedStatsBucket(Action configure) => Set(configure, "extended_stats_bucket"); + public AggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query queryContainer) => Set(queryContainer, "filter"); + public AggregationDescriptor Filter(Action> configure) => Set(configure, "filter"); + public AggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregation filtersAggregation) => Set(filtersAggregation, "filters"); + public AggregationDescriptor Filters(Action> configure) => Set(configure, "filters"); + public AggregationDescriptor FrequentItemSets(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => Set(frequentItemSetsAggregation, "frequent_item_sets"); + public AggregationDescriptor FrequentItemSets(Action> configure) => Set(configure, "frequent_item_sets"); + public AggregationDescriptor GeoBounds(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => Set(geoBoundsAggregation, "geo_bounds"); + public AggregationDescriptor GeoBounds(Action> configure) => Set(configure, "geo_bounds"); + public AggregationDescriptor GeoCentroid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => Set(geoCentroidAggregation, "geo_centroid"); + public AggregationDescriptor GeoCentroid(Action> configure) => Set(configure, "geo_centroid"); + public AggregationDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => Set(geoDistanceAggregation, "geo_distance"); + public AggregationDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public AggregationDescriptor GeohashGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregation geohashGridAggregation) => Set(geohashGridAggregation, "geohash_grid"); + public AggregationDescriptor GeohashGrid(Action> configure) => Set(configure, "geohash_grid"); + public AggregationDescriptor GeohexGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregation geohexGridAggregation) => Set(geohexGridAggregation, "geohex_grid"); + public AggregationDescriptor GeohexGrid(Action> configure) => Set(configure, "geohex_grid"); + public AggregationDescriptor GeoLine(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "geo_line"); + public AggregationDescriptor GeoLine(Action> configure) => Set(configure, "geo_line"); + public AggregationDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public AggregationDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public AggregationDescriptor Global(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregation globalAggregation) => Set(globalAggregation, "global"); + public AggregationDescriptor Global(Action configure) => Set(configure, "global"); + public AggregationDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public AggregationDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public AggregationDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregation inferenceAggregation) => Set(inferenceAggregation, "inference"); + public AggregationDescriptor Inference(Action> configure) => Set(configure, "inference"); + public AggregationDescriptor IpPrefix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregation ipPrefixAggregation) => Set(ipPrefixAggregation, "ip_prefix"); + public AggregationDescriptor IpPrefix(Action> configure) => Set(configure, "ip_prefix"); + public AggregationDescriptor IpRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregation ipRangeAggregation) => Set(ipRangeAggregation, "ip_range"); + public AggregationDescriptor IpRange(Action> configure) => Set(configure, "ip_range"); + public AggregationDescriptor Line(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "line"); + public AggregationDescriptor Line(Action> configure) => Set(configure, "line"); + public AggregationDescriptor MatrixStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => Set(matrixStatsAggregation, "matrix_stats"); + public AggregationDescriptor MatrixStats(Action> configure) => Set(configure, "matrix_stats"); + public AggregationDescriptor Max(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregation maxAggregation) => Set(maxAggregation, "max"); + public AggregationDescriptor Max(Action> configure) => Set(configure, "max"); + public AggregationDescriptor MaxBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxBucketAggregation maxBucketAggregation) => Set(maxBucketAggregation, "max_bucket"); + public AggregationDescriptor MaxBucket(Action configure) => Set(configure, "max_bucket"); + public AggregationDescriptor MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Set(medianAbsoluteDeviationAggregation, "median_absolute_deviation"); + public AggregationDescriptor MedianAbsoluteDeviation(Action> configure) => Set(configure, "median_absolute_deviation"); + public AggregationDescriptor Min(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregation minAggregation) => Set(minAggregation, "min"); + public AggregationDescriptor Min(Action> configure) => Set(configure, "min"); + public AggregationDescriptor MinBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinBucketAggregation minBucketAggregation) => Set(minBucketAggregation, "min_bucket"); + public AggregationDescriptor MinBucket(Action configure) => Set(configure, "min_bucket"); + public AggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregation missingAggregation) => Set(missingAggregation, "missing"); + public AggregationDescriptor Missing(Action> configure) => Set(configure, "missing"); + public AggregationDescriptor MovingFn(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => Set(movingFunctionAggregation, "moving_fn"); + public AggregationDescriptor MovingFn(Action configure) => Set(configure, "moving_fn"); + public AggregationDescriptor MovingPercentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => Set(movingPercentilesAggregation, "moving_percentiles"); + public AggregationDescriptor MovingPercentiles(Action configure) => Set(configure, "moving_percentiles"); + public AggregationDescriptor MultiTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregation multiTermsAggregation) => Set(multiTermsAggregation, "multi_terms"); + public AggregationDescriptor MultiTerms(Action> configure) => Set(configure, "multi_terms"); + public AggregationDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregation nestedAggregation) => Set(nestedAggregation, "nested"); + public AggregationDescriptor Nested(Action> configure) => Set(configure, "nested"); + public AggregationDescriptor Normalize(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeAggregation normalizeAggregation) => Set(normalizeAggregation, "normalize"); + public AggregationDescriptor Normalize(Action configure) => Set(configure, "normalize"); + public AggregationDescriptor Parent(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregation parentAggregation) => Set(parentAggregation, "parent"); + public AggregationDescriptor Parent(Action configure) => Set(configure, "parent"); + public AggregationDescriptor PercentileRanks(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => Set(percentileRanksAggregation, "percentile_ranks"); + public AggregationDescriptor PercentileRanks(Action> configure) => Set(configure, "percentile_ranks"); + public AggregationDescriptor Percentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesAggregation percentilesAggregation) => Set(percentilesAggregation, "percentiles"); + public AggregationDescriptor Percentiles(Action> configure) => Set(configure, "percentiles"); + public AggregationDescriptor PercentilesBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => Set(percentilesBucketAggregation, "percentiles_bucket"); + public AggregationDescriptor PercentilesBucket(Action configure) => Set(configure, "percentiles_bucket"); + public AggregationDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregation rangeAggregation) => Set(rangeAggregation, "range"); + public AggregationDescriptor Range(Action> configure) => Set(configure, "range"); + public AggregationDescriptor RareTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RareTermsAggregation rareTermsAggregation) => Set(rareTermsAggregation, "rare_terms"); + public AggregationDescriptor RareTerms(Action> configure) => Set(configure, "rare_terms"); + public AggregationDescriptor Rate(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregation rateAggregation) => Set(rateAggregation, "rate"); + public AggregationDescriptor Rate(Action> configure) => Set(configure, "rate"); + public AggregationDescriptor ReverseNested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => Set(reverseNestedAggregation, "reverse_nested"); + public AggregationDescriptor ReverseNested(Action> configure) => Set(configure, "reverse_nested"); + public AggregationDescriptor Sampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregation samplerAggregation) => Set(samplerAggregation, "sampler"); + public AggregationDescriptor Sampler(Action configure) => Set(configure, "sampler"); + public AggregationDescriptor ScriptedMetric(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => Set(scriptedMetricAggregation, "scripted_metric"); + public AggregationDescriptor ScriptedMetric(Action> configure) => Set(configure, "scripted_metric"); + public AggregationDescriptor SerialDiff(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => Set(serialDifferencingAggregation, "serial_diff"); + public AggregationDescriptor SerialDiff(Action configure) => Set(configure, "serial_diff"); + public AggregationDescriptor SignificantTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTermsAggregation significantTermsAggregation) => Set(significantTermsAggregation, "significant_terms"); + public AggregationDescriptor SignificantTerms(Action> configure) => Set(configure, "significant_terms"); + public AggregationDescriptor SignificantText(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTextAggregation significantTextAggregation) => Set(significantTextAggregation, "significant_text"); + public AggregationDescriptor SignificantText(Action> configure) => Set(configure, "significant_text"); + public AggregationDescriptor Stats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregation statsAggregation) => Set(statsAggregation, "stats"); + public AggregationDescriptor Stats(Action> configure) => Set(configure, "stats"); + public AggregationDescriptor StatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregation statsBucketAggregation) => Set(statsBucketAggregation, "stats_bucket"); + public AggregationDescriptor StatsBucket(Action configure) => Set(configure, "stats_bucket"); + public AggregationDescriptor StringStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregation stringStatsAggregation) => Set(stringStatsAggregation, "string_stats"); + public AggregationDescriptor StringStats(Action> configure) => Set(configure, "string_stats"); + public AggregationDescriptor Sum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregation sumAggregation) => Set(sumAggregation, "sum"); + public AggregationDescriptor Sum(Action> configure) => Set(configure, "sum"); + public AggregationDescriptor SumBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumBucketAggregation sumBucketAggregation) => Set(sumBucketAggregation, "sum_bucket"); + public AggregationDescriptor SumBucket(Action configure) => Set(configure, "sum_bucket"); + public AggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public AggregationDescriptor Terms(Action> configure) => Set(configure, "terms"); + public AggregationDescriptor TopHits(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregation topHitsAggregation) => Set(topHitsAggregation, "top_hits"); + public AggregationDescriptor TopHits(Action> configure) => Set(configure, "top_hits"); + public AggregationDescriptor TopMetrics(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregation topMetricsAggregation) => Set(topMetricsAggregation, "top_metrics"); + public AggregationDescriptor TopMetrics(Action> configure) => Set(configure, "top_metrics"); + public AggregationDescriptor TTest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregation tTestAggregation) => Set(tTestAggregation, "t_test"); + public AggregationDescriptor TTest(Action> configure) => Set(configure, "t_test"); + public AggregationDescriptor ValueCount(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregation valueCountAggregation) => Set(valueCountAggregation, "value_count"); + public AggregationDescriptor ValueCount(Action> configure) => Set(configure, "value_count"); + public AggregationDescriptor VariableWidthHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Set(variableWidthHistogramAggregation, "variable_width_histogram"); + public AggregationDescriptor VariableWidthHistogram(Action> configure) => Set(configure, "variable_width_histogram"); + public AggregationDescriptor WeightedAvg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => Set(weightedAverageAggregation, "weighted_avg"); + public AggregationDescriptor WeightedAvg(Action> configure) => Set(configure, "weighted_avg"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) { - return AggregationSerializationHelper.ReadContainer("value_count", ref reader, options); + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); } - if (propertyName == "variable_width_histogram") + if (MetaValue is not null) { - return AggregationSerializationHelper.ReadContainer("variable_width_histogram", ref reader, options); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } - if (propertyName == "weighted_avg") + if (!string.IsNullOrEmpty(ContainedVariantName)) { - return AggregationSerializationHelper.ReadContainer("weighted_avg", ref reader, options); + 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); } - 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"); - } + writer.WriteEndObject(); } } -public sealed partial class AggregationDescriptor : SerializableDescriptor> +public sealed partial class AggregationDescriptor : SerializableDescriptor { - internal AggregationDescriptor(Action> configure) => configure.Invoke(this); + 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)); - } + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private AggregationDescriptor 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 AggregationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ public AggregationDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + public AggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregationDescriptor AdjacencyMatrix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Set(adjacencyMatrixAggregation, "adjacency_matrix"); + public AggregationDescriptor AdjacencyMatrix(Action configure) => Set(configure, "adjacency_matrix"); + public AggregationDescriptor AutoDateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => Set(autoDateHistogramAggregation, "auto_date_histogram"); + public AggregationDescriptor AutoDateHistogram(Action configure) => Set(configure, "auto_date_histogram"); + public AggregationDescriptor Avg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageAggregation averageAggregation) => Set(averageAggregation, "avg"); + public AggregationDescriptor Avg(Action configure) => Set(configure, "avg"); + public AggregationDescriptor AvgBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AverageBucketAggregation averageBucketAggregation) => Set(averageBucketAggregation, "avg_bucket"); + public AggregationDescriptor AvgBucket(Action configure) => Set(configure, "avg_bucket"); + public AggregationDescriptor Boxplot(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BoxplotAggregation boxplotAggregation) => Set(boxplotAggregation, "boxplot"); + public AggregationDescriptor Boxplot(Action configure) => Set(configure, "boxplot"); + public AggregationDescriptor BucketScript(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketScriptAggregation bucketScriptAggregation) => Set(bucketScriptAggregation, "bucket_script"); + public AggregationDescriptor BucketScript(Action configure) => Set(configure, "bucket_script"); + public AggregationDescriptor BucketSelector(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => Set(bucketSelectorAggregation, "bucket_selector"); + public AggregationDescriptor BucketSelector(Action configure) => Set(configure, "bucket_selector"); + public AggregationDescriptor BucketSort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketSortAggregation bucketSortAggregation) => Set(bucketSortAggregation, "bucket_sort"); + public AggregationDescriptor BucketSort(Action configure) => Set(configure, "bucket_sort"); + public AggregationDescriptor Cardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityAggregation cardinalityAggregation) => Set(cardinalityAggregation, "cardinality"); + public AggregationDescriptor Cardinality(Action configure) => Set(configure, "cardinality"); + public AggregationDescriptor Children(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChildrenAggregation childrenAggregation) => Set(childrenAggregation, "children"); + public AggregationDescriptor Children(Action configure) => Set(configure, "children"); + public AggregationDescriptor Composite(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeAggregation compositeAggregation) => Set(compositeAggregation, "composite"); + public AggregationDescriptor Composite(Action configure) => Set(configure, "composite"); + public AggregationDescriptor CumulativeCardinality(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Set(cumulativeCardinalityAggregation, "cumulative_cardinality"); + public AggregationDescriptor CumulativeCardinality(Action configure) => Set(configure, "cumulative_cardinality"); + public AggregationDescriptor CumulativeSum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => Set(cumulativeSumAggregation, "cumulative_sum"); + public AggregationDescriptor CumulativeSum(Action configure) => Set(configure, "cumulative_sum"); + public AggregationDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public AggregationDescriptor DateHistogram(Action configure) => Set(configure, "date_histogram"); + public AggregationDescriptor DateRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeAggregation dateRangeAggregation) => Set(dateRangeAggregation, "date_range"); + public AggregationDescriptor DateRange(Action configure) => Set(configure, "date_range"); + public AggregationDescriptor Derivative(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DerivativeAggregation derivativeAggregation) => Set(derivativeAggregation, "derivative"); + public AggregationDescriptor Derivative(Action configure) => Set(configure, "derivative"); + public AggregationDescriptor DiversifiedSampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Set(diversifiedSamplerAggregation, "diversified_sampler"); + public AggregationDescriptor DiversifiedSampler(Action configure) => Set(configure, "diversified_sampler"); + public AggregationDescriptor ExtendedStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => Set(extendedStatsAggregation, "extended_stats"); + public AggregationDescriptor ExtendedStats(Action configure) => Set(configure, "extended_stats"); + public AggregationDescriptor ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Set(extendedStatsBucketAggregation, "extended_stats_bucket"); + public AggregationDescriptor ExtendedStatsBucket(Action configure) => Set(configure, "extended_stats_bucket"); + public AggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query queryContainer) => Set(queryContainer, "filter"); + public AggregationDescriptor Filter(Action configure) => Set(configure, "filter"); + public AggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FiltersAggregation filtersAggregation) => Set(filtersAggregation, "filters"); + public AggregationDescriptor Filters(Action configure) => Set(configure, "filters"); + public AggregationDescriptor FrequentItemSets(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => Set(frequentItemSetsAggregation, "frequent_item_sets"); + public AggregationDescriptor FrequentItemSets(Action configure) => Set(configure, "frequent_item_sets"); + public AggregationDescriptor GeoBounds(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => Set(geoBoundsAggregation, "geo_bounds"); + public AggregationDescriptor GeoBounds(Action configure) => Set(configure, "geo_bounds"); + public AggregationDescriptor GeoCentroid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => Set(geoCentroidAggregation, "geo_centroid"); + public AggregationDescriptor GeoCentroid(Action configure) => Set(configure, "geo_centroid"); + public AggregationDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => Set(geoDistanceAggregation, "geo_distance"); + public AggregationDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); + public AggregationDescriptor GeohashGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohashGridAggregation geohashGridAggregation) => Set(geohashGridAggregation, "geohash_grid"); + public AggregationDescriptor GeohashGrid(Action configure) => Set(configure, "geohash_grid"); + public AggregationDescriptor GeohexGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeohexGridAggregation geohexGridAggregation) => Set(geohexGridAggregation, "geohex_grid"); + public AggregationDescriptor GeohexGrid(Action configure) => Set(configure, "geohex_grid"); + public AggregationDescriptor GeoLine(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "geo_line"); + public AggregationDescriptor GeoLine(Action configure) => Set(configure, "geo_line"); + public AggregationDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public AggregationDescriptor GeotileGrid(Action configure) => Set(configure, "geotile_grid"); + public AggregationDescriptor Global(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GlobalAggregation globalAggregation) => Set(globalAggregation, "global"); + public AggregationDescriptor Global(Action configure) => Set(configure, "global"); + public AggregationDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public AggregationDescriptor Histogram(Action configure) => Set(configure, "histogram"); + public AggregationDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceAggregation inferenceAggregation) => Set(inferenceAggregation, "inference"); + public AggregationDescriptor Inference(Action configure) => Set(configure, "inference"); + public AggregationDescriptor IpPrefix(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpPrefixAggregation ipPrefixAggregation) => Set(ipPrefixAggregation, "ip_prefix"); + public AggregationDescriptor IpPrefix(Action configure) => Set(configure, "ip_prefix"); + public AggregationDescriptor IpRange(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregation ipRangeAggregation) => Set(ipRangeAggregation, "ip_range"); + public AggregationDescriptor IpRange(Action configure) => Set(configure, "ip_range"); + public AggregationDescriptor Line(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "line"); + public AggregationDescriptor Line(Action configure) => Set(configure, "line"); + public AggregationDescriptor MatrixStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => Set(matrixStatsAggregation, "matrix_stats"); + public AggregationDescriptor MatrixStats(Action configure) => Set(configure, "matrix_stats"); + public AggregationDescriptor Max(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxAggregation maxAggregation) => Set(maxAggregation, "max"); + public AggregationDescriptor Max(Action configure) => Set(configure, "max"); + public AggregationDescriptor MaxBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MaxBucketAggregation maxBucketAggregation) => Set(maxBucketAggregation, "max_bucket"); + public AggregationDescriptor MaxBucket(Action configure) => Set(configure, "max_bucket"); + public AggregationDescriptor MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Set(medianAbsoluteDeviationAggregation, "median_absolute_deviation"); + public AggregationDescriptor MedianAbsoluteDeviation(Action configure) => Set(configure, "median_absolute_deviation"); + public AggregationDescriptor Min(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinAggregation minAggregation) => Set(minAggregation, "min"); + public AggregationDescriptor Min(Action configure) => Set(configure, "min"); + public AggregationDescriptor MinBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MinBucketAggregation minBucketAggregation) => Set(minBucketAggregation, "min_bucket"); + public AggregationDescriptor MinBucket(Action configure) => Set(configure, "min_bucket"); + public AggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingAggregation missingAggregation) => Set(missingAggregation, "missing"); + public AggregationDescriptor Missing(Action configure) => Set(configure, "missing"); + public AggregationDescriptor MovingFn(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => Set(movingFunctionAggregation, "moving_fn"); + public AggregationDescriptor MovingFn(Action configure) => Set(configure, "moving_fn"); + public AggregationDescriptor MovingPercentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => Set(movingPercentilesAggregation, "moving_percentiles"); + public AggregationDescriptor MovingPercentiles(Action configure) => Set(configure, "moving_percentiles"); + public AggregationDescriptor MultiTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermsAggregation multiTermsAggregation) => Set(multiTermsAggregation, "multi_terms"); + public AggregationDescriptor MultiTerms(Action configure) => Set(configure, "multi_terms"); + public AggregationDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NestedAggregation nestedAggregation) => Set(nestedAggregation, "nested"); + public AggregationDescriptor Nested(Action configure) => Set(configure, "nested"); + public AggregationDescriptor Normalize(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeAggregation normalizeAggregation) => Set(normalizeAggregation, "normalize"); + public AggregationDescriptor Normalize(Action configure) => Set(configure, "normalize"); + public AggregationDescriptor Parent(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ParentAggregation parentAggregation) => Set(parentAggregation, "parent"); + public AggregationDescriptor Parent(Action configure) => Set(configure, "parent"); + public AggregationDescriptor PercentileRanks(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => Set(percentileRanksAggregation, "percentile_ranks"); + public AggregationDescriptor PercentileRanks(Action configure) => Set(configure, "percentile_ranks"); + public AggregationDescriptor Percentiles(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesAggregation percentilesAggregation) => Set(percentilesAggregation, "percentiles"); + public AggregationDescriptor Percentiles(Action configure) => Set(configure, "percentiles"); + public AggregationDescriptor PercentilesBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => Set(percentilesBucketAggregation, "percentiles_bucket"); + public AggregationDescriptor PercentilesBucket(Action configure) => Set(configure, "percentiles_bucket"); + public AggregationDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RangeAggregation rangeAggregation) => Set(rangeAggregation, "range"); + public AggregationDescriptor Range(Action configure) => Set(configure, "range"); + public AggregationDescriptor RareTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RareTermsAggregation rareTermsAggregation) => Set(rareTermsAggregation, "rare_terms"); + public AggregationDescriptor RareTerms(Action configure) => Set(configure, "rare_terms"); + public AggregationDescriptor Rate(Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateAggregation rateAggregation) => Set(rateAggregation, "rate"); + public AggregationDescriptor Rate(Action configure) => Set(configure, "rate"); + public AggregationDescriptor ReverseNested(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => Set(reverseNestedAggregation, "reverse_nested"); + public AggregationDescriptor ReverseNested(Action configure) => Set(configure, "reverse_nested"); + public AggregationDescriptor Sampler(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregation samplerAggregation) => Set(samplerAggregation, "sampler"); + public AggregationDescriptor Sampler(Action configure) => Set(configure, "sampler"); + public AggregationDescriptor ScriptedMetric(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => Set(scriptedMetricAggregation, "scripted_metric"); + public AggregationDescriptor ScriptedMetric(Action configure) => Set(configure, "scripted_metric"); + public AggregationDescriptor SerialDiff(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => Set(serialDifferencingAggregation, "serial_diff"); + public AggregationDescriptor SerialDiff(Action configure) => Set(configure, "serial_diff"); + public AggregationDescriptor SignificantTerms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTermsAggregation significantTermsAggregation) => Set(significantTermsAggregation, "significant_terms"); + public AggregationDescriptor SignificantTerms(Action configure) => Set(configure, "significant_terms"); + public AggregationDescriptor SignificantText(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SignificantTextAggregation significantTextAggregation) => Set(significantTextAggregation, "significant_text"); + public AggregationDescriptor SignificantText(Action configure) => Set(configure, "significant_text"); + public AggregationDescriptor Stats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsAggregation statsAggregation) => Set(statsAggregation, "stats"); + public AggregationDescriptor Stats(Action configure) => Set(configure, "stats"); + public AggregationDescriptor StatsBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StatsBucketAggregation statsBucketAggregation) => Set(statsBucketAggregation, "stats_bucket"); + public AggregationDescriptor StatsBucket(Action configure) => Set(configure, "stats_bucket"); + public AggregationDescriptor StringStats(Elastic.Clients.Elasticsearch.Serverless.Aggregations.StringStatsAggregation stringStatsAggregation) => Set(stringStatsAggregation, "string_stats"); + public AggregationDescriptor StringStats(Action configure) => Set(configure, "string_stats"); + public AggregationDescriptor Sum(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumAggregation sumAggregation) => Set(sumAggregation, "sum"); + public AggregationDescriptor Sum(Action configure) => Set(configure, "sum"); + public AggregationDescriptor SumBucket(Elastic.Clients.Elasticsearch.Serverless.Aggregations.SumBucketAggregation sumBucketAggregation) => Set(sumBucketAggregation, "sum_bucket"); + public AggregationDescriptor SumBucket(Action configure) => Set(configure, "sum_bucket"); + public AggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public AggregationDescriptor Terms(Action configure) => Set(configure, "terms"); + public AggregationDescriptor TopHits(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopHitsAggregation topHitsAggregation) => Set(topHitsAggregation, "top_hits"); + public AggregationDescriptor TopHits(Action configure) => Set(configure, "top_hits"); + public AggregationDescriptor TopMetrics(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsAggregation topMetricsAggregation) => Set(topMetricsAggregation, "top_metrics"); + public AggregationDescriptor TopMetrics(Action configure) => Set(configure, "top_metrics"); + public AggregationDescriptor TTest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestAggregation tTestAggregation) => Set(tTestAggregation, "t_test"); + public AggregationDescriptor TTest(Action configure) => Set(configure, "t_test"); + public AggregationDescriptor ValueCount(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueCountAggregation valueCountAggregation) => Set(valueCountAggregation, "value_count"); + public AggregationDescriptor ValueCount(Action configure) => Set(configure, "value_count"); + public AggregationDescriptor VariableWidthHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Set(variableWidthHistogramAggregation, "variable_width_histogram"); + public AggregationDescriptor VariableWidthHistogram(Action configure) => Set(configure, "variable_width_histogram"); + public AggregationDescriptor WeightedAvg(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => Set(weightedAverageAggregation, "weighted_avg"); + public AggregationDescriptor WeightedAvg(Action configure) => Set(configure, "weighted_avg"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } - public AggregationDescriptor GeohexGrid(string name, Action> configure) - { - return SetContainer(name, Aggregation.CreateWithAction("geohex_grid", configure)); - } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } - public AggregationDescriptor GeotileGrid(string name, Action> configure) - { - return SetContainer(name, Aggregation.CreateWithAction("geotile_grid", configure)); - } + 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); + } - 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)); + writer.WriteEndObject(); } } \ 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 index be0d5d866c2..bcad834754b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs @@ -27,287 +27,59 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class AutoDateHistogramAggregationConverter : JsonConverter +public sealed partial class AutoDateHistogramAggregation { - 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. /// + [JsonInclude, JsonPropertyName("buckets")] public int? Buckets { get; set; } /// /// The field on which to run the aggregation. /// + [JsonInclude, JsonPropertyName("field")] 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.
///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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`.
///
+ [JsonInclude, JsonPropertyName("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.
///
+ [JsonInclude, JsonPropertyName("missing")] public DateTimeOffset? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Time zone specified as a ISO 8601 UTC offset. /// + [JsonInclude, JsonPropertyName("offset")] public string? Offset { get; set; } + [JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Time zone ID. /// + [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(AutoDateHistogramAggregation autoDateHistogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.AutoDateHistogram(autoDateHistogramAggregation); } public sealed partial class AutoDateHistogramAggregationDescriptor : SerializableDescriptor> @@ -318,44 +90,18 @@ 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? NameValue { 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. /// @@ -383,6 +129,15 @@ public AutoDateHistogramAggregationDescriptor Field(Expressio 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.
///
@@ -416,6 +171,12 @@ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? return Self; } + public AutoDateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Time zone specified as a ISO 8601 UTC offset. /// @@ -448,8 +209,6 @@ public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZo protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("auto_date_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -469,6 +228,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinimumIntervalValue is not null) { writer.WritePropertyName("minimum_interval"); @@ -481,6 +246,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (!string.IsNullOrEmpty(OffsetValue)) { writer.WritePropertyName("offset"); @@ -499,33 +270,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -540,44 +288,18 @@ 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? NameValue { 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. /// @@ -647,6 +369,12 @@ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) return Self; } + public AutoDateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Time zone specified as a ISO 8601 UTC offset. /// @@ -679,8 +407,6 @@ public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("auto_date_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -700,6 +426,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinimumIntervalValue is not null) { writer.WritePropertyName("minimum_interval"); @@ -712,6 +444,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (!string.IsNullOrEmpty(OffsetValue)) { writer.WritePropertyName("offset"); @@ -730,33 +468,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); 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 index 8690cc18f39..cf27f832307 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class AverageAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index dc91541cdde..84f00150db1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class AverageAggregationConverter : JsonConverter +public sealed partial class AverageAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(AverageAggregation averageAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Avg(averageAggregation); } public sealed partial class AverageAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public AverageAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public AverageAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + public AverageAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public AverageAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AverageAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("avg"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public AverageAggregationDescriptor Format(string? format) return Self; } - public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public AverageAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AverageAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverl protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("avg"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/AverageBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs new file mode 100644 index 00000000000..a326711c5cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/AverageBucketAggregation.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.Aggregations; + +public sealed partial class AverageBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(AverageBucketAggregation averageBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.AvgBucket(averageBucketAggregation); +} + +public sealed partial class AverageBucketAggregationDescriptor : SerializableDescriptor +{ + internal AverageBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public AverageBucketAggregationDescriptor() : 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 string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public AverageBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public AverageBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public AverageBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public AverageBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AverageBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ 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 index 589c1f74739..bdb9fecc732 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BoxplotAggregation.g.cs @@ -27,150 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class BoxplotAggregationConverter : JsonConverter +public sealed partial class BoxplotAggregation { - 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. /// + [JsonInclude, JsonPropertyName("compression")] public double? Compression { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(BoxplotAggregation boxplotAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Boxplot(boxplotAggregation); } public sealed partial class BoxplotAggregationDescriptor : SerializableDescriptor> @@ -183,8 +62,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -196,25 +74,37 @@ public BoxplotAggregationDescriptor Compression(double? compression) return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public BoxplotAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public BoxplotAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public BoxplotAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public BoxplotAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -228,8 +118,6 @@ public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("boxplot"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -255,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,8 +157,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -289,31 +169,37 @@ public BoxplotAggregationDescriptor Compression(double? compression) return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public BoxplotAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -327,8 +213,6 @@ public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverl protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("boxplot"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -354,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/BucketMetricValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs new file mode 100644 index 00000000000..7e3aeb72401 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketMetricValueAggregate.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 BucketMetricValueAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("keys")] + public IReadOnlyCollection Keys { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
+ [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/BucketScriptAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs new file mode 100644 index 00000000000..9b5a4c03aa6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketScriptAggregation.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.Aggregations; + +public sealed partial class BucketScriptAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script to run for this aggregation. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(BucketScriptAggregation bucketScriptAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.BucketScript(bucketScriptAggregation); +} + +public sealed partial class BucketScriptAggregationDescriptor : SerializableDescriptor +{ + internal BucketScriptAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketScriptAggregationDescriptor() : 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 string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketScriptAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public BucketScriptAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public BucketScriptAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketScriptAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketScriptAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script to run for this aggregation. + /// + public BucketScriptAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/BucketSelectorAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs new file mode 100644 index 00000000000..789ca7b81ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSelectorAggregation.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.Aggregations; + +public sealed partial class BucketSelectorAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script to run for this aggregation. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(BucketSelectorAggregation bucketSelectorAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.BucketSelector(bucketSelectorAggregation); +} + +public sealed partial class BucketSelectorAggregationDescriptor : SerializableDescriptor +{ + internal BucketSelectorAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketSelectorAggregationDescriptor() : 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 string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketSelectorAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public BucketSelectorAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public BucketSelectorAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketSelectorAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketSelectorAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script to run for this aggregation. + /// + public BucketSelectorAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/BucketSortAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs index 5153c2e5a04..a21755cbcef 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketSortAggregation.g.cs @@ -27,161 +27,38 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class BucketSortAggregationConverter : JsonConverter +public sealed partial class BucketSortAggregation { - 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. /// + [JsonInclude, JsonPropertyName("from")] public int? From { get; set; } /// /// The policy to apply when gaps are found in the data. /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
+ [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The list of fields to sort on. /// + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] public ICollection? Sort { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(BucketSortAggregation bucketSortAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.BucketSort(bucketSortAggregation); } public sealed partial class BucketSortAggregationDescriptor : SerializableDescriptor> @@ -195,11 +72,12 @@ public BucketSortAggregationDescriptor() : base() private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } /// /// Buckets in positions prior to `from` will be truncated. @@ -225,6 +103,12 @@ public BucketSortAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
@@ -246,7 +130,7 @@ public BucketSortAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public BucketSortAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -255,7 +139,7 @@ public BucketSortAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public BucketSortAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -264,7 +148,7 @@ public BucketSortAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public BucketSortAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -275,8 +159,6 @@ public BucketSortAggregationDescriptor Sort(params Action(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -313,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -325,13 +219,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -347,11 +234,12 @@ public BucketSortAggregationDescriptor() : base() private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } /// /// Buckets in positions prior to `from` will be truncated. @@ -377,6 +265,12 @@ public BucketSortAggregationDescriptor Meta(Func /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
@@ -398,7 +292,7 @@ public BucketSortAggregationDescriptor Sort(ICollection configure) + public BucketSortAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -416,7 +310,7 @@ public BucketSortAggregationDescriptor Sort(Action config return Self; } - public BucketSortAggregationDescriptor Sort(params Action[] configure) + public BucketSortAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -427,8 +321,6 @@ public BucketSortAggregationDescriptor Sort(params Action protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("bucket_sort"); writer.WriteStartObject(); if (FromValue.HasValue) { @@ -442,6 +334,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, GapPolicyValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (SizeValue.HasValue) { writer.WritePropertyName("size"); @@ -456,7 +360,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -465,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -477,13 +381,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, 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/Buckets.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs index de77d4de89f..1600e36ac53 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Buckets.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +/// +/// Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for
the different buckets, the result is a dictionary.
+///
public sealed partial class Buckets : Union, IReadOnlyCollection> { - public Buckets(IReadOnlyDictionary dictionary) : base(dictionary) + public Buckets(IReadOnlyDictionary Keyed) : base(Keyed) { } - public Buckets(IReadOnlyCollection collection) : base(collection) + public Buckets(IReadOnlyCollection Array) : base(Array) { } } \ 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 index bb634fe719b..63efac1f522 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/BucketsPath.g.cs @@ -115,9 +115,8 @@ internal sealed class BucketsPathConverter : MultiItemUnionConverter { { BucketsPath.Kind.Single, typeof(string) }, { BucketsPath.Kind.Array, typeof(string[]) }, { BucketsPath.Kind.Dictionary, typeof(Dictionary) } }; + _types = new Dictionary { { BucketsPath.Kind.Single, typeof(string) }, { BucketsPath.Kind.Array, typeof(IReadOnlyCollection) }, { BucketsPath.Kind.Dictionary, typeof(IReadOnlyDictionary) } }; _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 { }; + _uniquePropertyToType = new Dictionary { { "", typeof(string) }, { "", typeof(IReadOnlyCollection) }, { "", typeof(IReadOnlyDictionary) } }; } } \ 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 index c272b9eab27..8bda81a29a0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CardinalityAggregation.g.cs @@ -27,192 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class CardinalityAggregationConverter : JsonConverter +public sealed partial class CardinalityAggregation { - 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. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CardinalityExecutionMode? ExecutionHint { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } /// /// A unique count below which counts are expected to be close to accurate.
This allows to trade memory for accuracy.
///
+ [JsonInclude, JsonPropertyName("precision_threshold")] public int? PrecisionThreshold { get; set; } + [JsonInclude, JsonPropertyName("rehash")] public bool? Rehash { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(CardinalityAggregation cardinalityAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Cardinality(cardinalityAggregation); } public sealed partial class CardinalityAggregationDescriptor : SerializableDescriptor> @@ -225,8 +70,7 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } @@ -240,25 +84,37 @@ public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public CardinalityAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public CardinalityAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public CardinalityAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public CardinalityAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -287,8 +143,6 @@ public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasti protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("cardinality"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -326,13 +180,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -347,8 +194,7 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } @@ -362,31 +208,37 @@ public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsea return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public CardinalityAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -415,8 +267,6 @@ public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Ser protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("cardinality"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -454,13 +304,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/ChildrenAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs index 32817a6d323..7a853ee27a7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class ChildrenAggregateConverter : JsonConverter { - public override ChildrenAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ChildrenAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ChildrenAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ChildrenAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ChildrenAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ChildrenAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ChildrenAggregateConverter))] +public sealed partial class ChildrenAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 7a3fe65e883..b7ce1c25751 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ChildrenAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ChildrenAggregationConverter : JsonConverter +public sealed partial class ChildrenAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The child type that should be selected. /// + [JsonInclude, JsonPropertyName("type")] 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ChildrenAggregation childrenAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Children(childrenAggregation); } public sealed partial class ChildrenAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ 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? NameValue { 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) + public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ChildrenAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public ChildrenAggregationDescriptor Type(string? type) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(TypeValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); 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 index e9f715ab428..29704ff5e9b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregate.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; public sealed partial class CompositeAggregate : IAggregate { [JsonInclude, JsonPropertyName("after_key")] - public IReadOnlyDictionary? AfterKey { get; init; } + public IReadOnlyDictionary? AfterKey { get; init; } [JsonInclude, JsonPropertyName("buckets")] public IReadOnlyCollection Buckets { get; init; } [JsonInclude, JsonPropertyName("meta")] 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 index ea52bd26d29..13533c14ce0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeAggregation.g.cs @@ -27,156 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class CompositeAggregationConverter : JsonConverter +public sealed partial class CompositeAggregation { - 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. /// + [JsonInclude, JsonPropertyName("after")] public IDictionary? After { get; set; } - public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of composite buckets that should be returned. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The value sources used to build composite buckets.
Keys are returned in the order of the `sources` definition.
///
+ [JsonInclude, JsonPropertyName("sources")] public ICollection>? Sources { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(CompositeAggregation compositeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Composite(compositeAggregation); } public sealed partial class CompositeAggregationDescriptor : SerializableDescriptor> @@ -188,10 +63,8 @@ public CompositeAggregationDescriptor() : base() } private IDictionary? AfterValue { get; set; } - 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? NameValue { get; set; } private int? SizeValue { get; set; } private ICollection>? SourcesValue { get; set; } @@ -204,33 +77,15 @@ public CompositeAggregationDescriptor After(Func 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) + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + public CompositeAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -254,8 +109,6 @@ public CompositeAggregationDescriptor Sources(ICollection(AggregationsDescriptorAction), options); + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); } - else if (AggregationsValue is not null) + + if (SourcesValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("sources"); + JsonSerializer.Serialize(writer, SourcesValue, options); } writer.WriteEndObject(); @@ -311,10 +153,8 @@ public CompositeAggregationDescriptor() : base() } private IDictionary? AfterValue { get; set; } - 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? NameValue { get; set; } private int? SizeValue { get; set; } private ICollection>? SourcesValue { get; set; } @@ -327,33 +167,15 @@ public CompositeAggregationDescriptor After(Func configure) + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + public CompositeAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -377,8 +199,6 @@ public CompositeAggregationDescriptor Sources(ICollection + /// A date histogram aggregation. + ///
+ [JsonInclude, JsonPropertyName("date_histogram")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregation? DateHistogram { get; set; } + + /// + /// A geotile grid aggregation. + /// + [JsonInclude, JsonPropertyName("geotile_grid")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregation? GeotileGrid { get; set; } + + /// + /// A histogram aggregation. + /// + [JsonInclude, JsonPropertyName("histogram")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregation? Histogram { get; set; } + + /// + /// A terms aggregation. + /// + [JsonInclude, JsonPropertyName("terms")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregation? Terms { get; set; } +} + +public sealed partial class CompositeAggregationSourceDescriptor : SerializableDescriptor> +{ + internal CompositeAggregationSourceDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeAggregationSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregation? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor DateHistogramDescriptor { get; set; } + private Action> DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregation? GeotileGridValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor GeotileGridDescriptor { get; set; } + private Action> GeotileGridDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregation? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor HistogramDescriptor { get; set; } + private Action> HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregation? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + + /// + /// A date histogram aggregation. + /// + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregation? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Action> configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// A geotile grid aggregation. + /// + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregation? geotileGrid) + { + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = null; + GeotileGridValue = geotileGrid; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor descriptor) + { + GeotileGridValue = null; + GeotileGridDescriptorAction = null; + GeotileGridDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Action> configure) + { + GeotileGridValue = null; + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = configure; + return Self; + } + + /// + /// A histogram aggregation. + /// + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregation? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Action> configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// A terms aggregation. + /// + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregation? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Action> configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (GeotileGridDescriptor is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridDescriptor, options); + } + else if (GeotileGridDescriptorAction is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor(GeotileGridDescriptorAction), options); + } + else if (GeotileGridValue is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } } public sealed partial class CompositeAggregationSourceDescriptor : SerializableDescriptor @@ -39,7 +262,194 @@ public CompositeAggregationSourceDescriptor() : base() { } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregation? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor DateHistogramDescriptor { get; set; } + private Action DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregation? GeotileGridValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor GeotileGridDescriptor { get; set; } + private Action GeotileGridDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregation? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor HistogramDescriptor { get; set; } + private Action HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregation? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + + /// + /// A date histogram aggregation. + /// + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregation? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Action configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// A geotile grid aggregation. + /// + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregation? geotileGrid) + { + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = null; + GeotileGridValue = geotileGrid; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor descriptor) + { + GeotileGridValue = null; + GeotileGridDescriptorAction = null; + GeotileGridDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Action configure) + { + GeotileGridValue = null; + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = configure; + return Self; + } + + /// + /// A histogram aggregation. + /// + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregation? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Action configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// A terms aggregation. + /// + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregation? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Action configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeDateHistogramAggregationDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (GeotileGridDescriptor is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridDescriptor, options); + } + else if (GeotileGridDescriptorAction is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeGeoTileGridAggregationDescriptor(GeotileGridDescriptorAction), options); + } + else if (GeotileGridValue is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeHistogramAggregationDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.CompositeTermsAggregationDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); } } \ 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 index 7933028dd64..a2c9e542bc2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeBucket.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -[JsonConverter(typeof(CompositeBucketConverter))] -public sealed partial class CompositeBucket : AggregateDictionary +internal sealed partial class CompositeBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; - IReadOnlyDictionary key = default; - while (reader.Read()) + IReadOnlyDictionary key = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize>(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new CompositeBucket(subAggs) { DocCount = docCount, Key = key }; + return new CompositeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, CompositeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'CompositeBucket' is a readonly type, used only on responses and does not support being written to JSON."); } +} - public override void Write(Utf8JsonWriter writer, CompositeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +[JsonConverter(typeof(CompositeBucketConverter))] +public sealed partial class CompositeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs new file mode 100644 index 00000000000..5ada6165df9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.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; + +public sealed partial class CompositeDateHistogramAggregation +{ + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + [JsonInclude, JsonPropertyName("calendar_interval")] + public string? CalendarInterval { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + [JsonInclude, JsonPropertyName("fixed_interval")] + public string? FixedInterval { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("offset")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Offset { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeDateHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeDateHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeDateHistogramAggregationDescriptor() : base() + { + } + + private string? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor CalendarInterval(string? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor FixedInterval(string? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Serverless.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CalendarIntervalValue)) + { + writer.WritePropertyName("calendar_interval"); + writer.WriteStringValue(CalendarIntervalValue); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FixedIntervalValue)) + { + writer.WritePropertyName("fixed_interval"); + writer.WriteStringValue(FixedIntervalValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + 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 (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeDateHistogramAggregationDescriptor : SerializableDescriptor +{ + internal CompositeDateHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeDateHistogramAggregationDescriptor() : base() + { + } + + private string? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private string? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor CalendarInterval(string? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor FixedInterval(string? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Serverless.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CalendarIntervalValue)) + { + writer.WritePropertyName("calendar_interval"); + writer.WriteStringValue(CalendarIntervalValue); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FixedIntervalValue)) + { + writer.WritePropertyName("fixed_interval"); + writer.WriteStringValue(FixedIntervalValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + 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 (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs new file mode 100644 index 00000000000..d8ca9b08145 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.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; + +public sealed partial class CompositeGeoTileGridAggregation +{ + [JsonInclude, JsonPropertyName("bounds")] + public Elastic.Clients.Elasticsearch.Serverless.GeoBounds? Bounds { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("precision")] + public int? Precision { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeGeoTileGridAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeGeoTileGridAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeGeoTileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private int? PrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + public CompositeGeoTileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeGeoTileGridAggregationDescriptor : SerializableDescriptor +{ + internal CompositeGeoTileGridAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeGeoTileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.SortOrder? OrderValue { get; set; } + private int? PrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } + + public CompositeGeoTileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.Serverless.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs new file mode 100644 index 00000000000..8a2a634ddbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs @@ -0,0 +1,307 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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 CompositeHistogramAggregation +{ + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("interval")] + public double Interval { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private double IntervalValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { 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.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeHistogramAggregationDescriptor Interval(double interval) + { + IntervalValue = interval; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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("interval"); + writer.WriteNumberValue(IntervalValue); + 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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeHistogramAggregationDescriptor : SerializableDescriptor +{ + internal CompositeHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private double IntervalValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { 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.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeHistogramAggregationDescriptor Interval(double interval) + { + IntervalValue = interval; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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("interval"); + writer.WriteNumberValue(IntervalValue); + 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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs new file mode 100644 index 00000000000..fd574e0d192 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CompositeTermsAggregation.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.Aggregations; + +public sealed partial class CompositeTermsAggregation +{ + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeTermsAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeTermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { 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.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeTermsAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeTermsAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeTermsAggregationDescriptor : SerializableDescriptor +{ + internal CompositeTermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { 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.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeTermsAggregationDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeTermsAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ 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 index 0330233888a..6b058cb9a79 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class CumulativeCardinalityAggregationConverter : JsonConverter +public sealed partial class CumulativeCardinalityAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.CumulativeCardinality(cumulativeCardinalityAggregation); } public sealed partial class CumulativeCardinalityAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public CumulativeCardinalityAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public CumulativeCardinalityAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public CumulativeCardinalityAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public CumulativeCardinalityAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public CumulativeCardinalityAggregationDescriptor Meta(Func +public sealed partial class CumulativeSumAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(CumulativeSumAggregation cumulativeSumAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.CumulativeSum(cumulativeSumAggregation); } public sealed partial class CumulativeSumAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public CumulativeSumAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public CumulativeSumAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public CumulativeSumAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public CumulativeSumAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public CumulativeSumAggregationDescriptor Meta(Func +public sealed partial class DateHistogramAggregation { - 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`.
///
+ [JsonInclude, JsonPropertyName("calendar_interval")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? CalendarInterval { get; set; } /// /// The date field whose values are use to build a histogram. /// + [JsonInclude, JsonPropertyName("field")] 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. /// + [JsonInclude, JsonPropertyName("fixed_interval")] 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.
///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public DateTimeOffset? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// + [JsonInclude, JsonPropertyName("offset")] public Elastic.Clients.Elasticsearch.Serverless.Duration? Offset { get; set; } - [JsonConverter(typeof(AggregateOrderConverter))] + /// /// The sort order of the returned buckets. /// - public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Time zone used for bucketing and rounding.
Defaults to Coordinated Universal Time (UTC).
///
+ [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(DateHistogramAggregation dateHistogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.DateHistogram(dateHistogramAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy(DateHistogramAggregation dateHistogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy.DateHistogram(dateHistogramAggregation); } public sealed partial class DateHistogramAggregationDescriptor : SerializableDescriptor> @@ -364,9 +104,6 @@ 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; } @@ -374,36 +111,13 @@ public DateHistogramAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } - private ICollection>? OrderValue { 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`.
///
@@ -431,6 +145,15 @@ public DateHistogramAggregationDescriptor Field(Expression + /// 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. /// @@ -473,6 +196,12 @@ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? mis return Self; } + public DateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// @@ -485,7 +214,7 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elas /// /// The sort order of the returned buckets. /// - public DateHistogramAggregationDescriptor Order(ICollection>? order) + public DateHistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -514,8 +243,6 @@ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_histogram"); writer.WriteStartObject(); if (CalendarIntervalValue is not null) { @@ -541,6 +268,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -553,6 +286,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue is not null) { writer.WritePropertyName("offset"); @@ -562,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ParamsValue is not null) @@ -577,33 +316,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -618,9 +334,6 @@ 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; } @@ -628,36 +341,13 @@ public DateHistogramAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? OffsetValue { get; set; } - private ICollection>? OrderValue { 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`.
///
@@ -736,6 +426,12 @@ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) return Self; } + public DateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// @@ -748,7 +444,7 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.S /// /// The sort order of the returned buckets. /// - public DateHistogramAggregationDescriptor Order(ICollection>? order) + public DateHistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -777,8 +473,6 @@ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_histogram"); writer.WriteStartObject(); if (CalendarIntervalValue is not null) { @@ -804,6 +498,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -816,6 +516,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue is not null) { writer.WritePropertyName("offset"); @@ -825,7 +531,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ParamsValue is not null) @@ -840,33 +546,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); 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 index 6ad64f9b284..31459715c86 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateHistogramBucket.g.cs @@ -27,68 +27,67 @@ 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 +internal sealed partial class DateHistogramBucketConverter : JsonConverter { - public override DateHistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new DateHistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + return new DateHistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, DateHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, DateHistogramBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'DateHistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DateHistogramBucketConverter))] +public sealed partial class DateHistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { 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 index a370fa2b9d5..99e5b69c5a9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DateRangeAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class DateRangeAggregationConverter : JsonConverter +public sealed partial class DateRangeAggregation { - 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. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } /// /// The date format used to format `from` and `to` in the response. /// + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Array of date ranges. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } /// /// Time zone used to convert dates from another time zone to UTC. /// + [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(DateRangeAggregation dateRangeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.DateRange(dateRangeAggregation); } public sealed partial class DateRangeAggregationDescriptor : SerializableDescriptor> @@ -234,47 +74,30 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private ICollection? RangesValue { get; set; } - private DateRangeExpressionDescriptor RangesDescriptor { get; set; } - private Action RangesDescriptorAction { get; set; } - private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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) + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are use to build ranges. /// - public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + public DateRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -283,7 +106,7 @@ public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticse /// /// The date field whose values are use to build ranges. /// - public DateRangeAggregationDescriptor Field(Expression> field) + public DateRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -307,12 +130,18 @@ public DateRangeAggregationDescriptor Meta(Func /// 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) + public DateRangeAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public DateRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of date ranges. /// @@ -325,7 +154,7 @@ public DateRangeAggregationDescriptor Ranges(ICollection Ranges(DateRangeExpressionDescriptor descriptor) + public DateRangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeExpressionDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -334,7 +163,7 @@ public DateRangeAggregationDescriptor Ranges(DateRangeExpressionDescr return Self; } - public DateRangeAggregationDescriptor Ranges(Action configure) + public DateRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -343,7 +172,7 @@ public DateRangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public DateRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -363,8 +192,6 @@ public DateRangeAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -378,12 +205,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -395,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeExpressionDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -404,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeExpressionDescriptor(action), options); } writer.WriteEndArray(); @@ -415,33 +254,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RangesValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -456,43 +272,17 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private ICollection? RangesValue { get; set; } - private DateRangeExpressionDescriptor RangesDescriptor { get; set; } - private Action RangesDescriptorAction { get; set; } - private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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. /// @@ -538,12 +328,18 @@ public DateRangeAggregationDescriptor Meta(Func /// /// 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) + public DateRangeAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public DateRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of date ranges. /// @@ -556,7 +352,7 @@ public DateRangeAggregationDescriptor Ranges(ICollection configure) + public DateRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -574,7 +370,7 @@ public DateRangeAggregationDescriptor Ranges(Action[] configure) + public DateRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -594,8 +390,6 @@ public DateRangeAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -609,12 +403,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -626,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeExpressionDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -635,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateRangeExpressionDescriptor(action), options); } writer.WriteEndArray(); @@ -646,33 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RangesValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); 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 index ef311f8d77b..310daddfabc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregate.g.cs @@ -35,6 +35,10 @@ public sealed partial class DerivativeAggregate : IAggregate public double? NormalizedValue { get; init; } [JsonInclude, JsonPropertyName("normalized_value_as_string")] public string? NormalizedValueAsString { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index edaeb7085b0..d829aa976bf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/DerivativeAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class DerivativeAggregationConverter : JsonConverter +public sealed partial class DerivativeAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(DerivativeAggregation derivativeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Derivative(derivativeAggregation); } public sealed partial class DerivativeAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public DerivativeAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public DerivativeAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public DerivativeAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public DerivativeAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public DerivativeAggregationDescriptor Meta(Func +public sealed partial class DiversifiedSamplerAggregation { - 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. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.SamplerAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field used to provide values used for de-duplication. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } /// /// Limits how many documents are permitted per choice of de-duplicating value. /// + [JsonInclude, JsonPropertyName("max_docs_per_value")] public int? MaxDocsPerValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Limits how many top-scoring documents are collected in the sample processed on each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.DiversifiedSampler(diversifiedSamplerAggregation); } public sealed partial class DiversifiedSamplerAggregationDescriptor : SerializableDescriptor> @@ -230,40 +70,14 @@ 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 string? NameValue { 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. /// @@ -291,6 +105,15 @@ public DiversifiedSamplerAggregationDescriptor Field(Expressi 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. /// @@ -306,6 +129,12 @@ public DiversifiedSamplerAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + public DiversifiedSamplerAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) { ScriptValue = script; @@ -323,8 +152,6 @@ public DiversifiedSamplerAggregationDescriptor ShardSize(int? shardSi protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("diversified_sampler"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -344,39 +171,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (ScriptValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); } - else if (AggregationsValue is not null) + + if (ShardSizeValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); } writer.WriteEndObject(); @@ -391,40 +207,14 @@ 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 string? NameValue { 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. /// @@ -476,6 +266,12 @@ public DiversifiedSamplerAggregationDescriptor Meta(Func 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 +internal sealed partial class DoubleTermsBucketConverter : JsonConverter { - public override DoubleTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; double key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new DoubleTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + return new DoubleTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, DoubleTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, DoubleTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'DoubleTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DoubleTermsBucketConverter))] +public sealed partial class DoubleTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public double Key { get; init; } + public string? KeyAsString { 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 index 90e23788802..7f0f113eee6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs @@ -27,170 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ExtendedStatsAggregationConverter : JsonConverter +public sealed partial class ExtendedStatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// The number of standard deviations above/below the mean to display. /// + [JsonInclude, JsonPropertyName("sigma")] public double? Sigma { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ExtendedStatsAggregation extendedStatsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.ExtendedStats(extendedStatsAggregation); } public sealed partial class ExtendedStatsAggregationDescriptor : SerializableDescriptor> @@ -203,36 +64,47 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public ExtendedStatsAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public ExtendedStatsAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ExtendedStatsAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ExtendedStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -255,8 +127,6 @@ public ExtendedStatsAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -288,13 +158,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(SigmaValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -309,23 +172,31 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -338,13 +209,10 @@ public ExtendedStatsAggregationDescriptor Format(string? format) return Self; } - public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ExtendedStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -367,8 +235,6 @@ public ExtendedStatsAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -400,13 +266,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/ExtendedStatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs index 56402b7fe96..498c47e9d48 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs @@ -27,150 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ExtendedStatsBucketAggregationConverter : JsonConverter +public sealed partial class ExtendedStatsBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of standard deviations above/below the mean to display. /// + [JsonInclude, JsonPropertyName("sigma")] public double? Sigma { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.ExtendedStatsBucket(extendedStatsBucketAggregation); } public sealed partial class ExtendedStatsBucketAggregationDescriptor : SerializableDescriptor @@ -185,20 +72,30 @@ public ExtendedStatsBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private double? SigmaValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public ExtendedStatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public ExtendedStatsBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public ExtendedStatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -211,6 +108,12 @@ public ExtendedStatsBucketAggregationDescriptor Meta(Func /// The number of standard deviations above/below the mean to display. ///
@@ -222,8 +125,6 @@ public ExtendedStatsBucketAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats_bucket"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -243,19 +144,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (SigmaValue.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(SigmaValue.Value); + } + 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 index 24b25e6c41f..5cd007ef9b1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FieldDateMath.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -public sealed partial class FieldDateMath : Union +/// +/// A date range limit, represented either as a DateMath expression or a number expressed
according to the target field's precision.
+///
+public sealed partial class FieldDateMath : Union { - public FieldDateMath(Elastic.Clients.Elasticsearch.Serverless.DateMath expr) : base(expr) + public FieldDateMath(string Expr) : base(Expr) { } - public FieldDateMath(double value) : base(value) + 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 index f91b22a5c94..7ae0d8c6dee 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FilterAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class FilterAggregateConverter : JsonConverter { - public override FilterAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new FilterAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new FilterAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, FilterAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, FilterAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FilterAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FilterAggregateConverter))] +public sealed partial class FilterAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + 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 index 9c22d351190..4b26bf7fd10 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersAggregation.g.cs @@ -27,157 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class FiltersAggregationConverter : JsonConverter +public sealed partial class FiltersAggregation { - 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. /// + [JsonInclude, JsonPropertyName("filters")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.Buckets? Filters { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. /// + [JsonInclude, JsonPropertyName("other_bucket")] public bool? OtherBucket { get; set; } /// /// The key with which the other bucket is returned. /// + [JsonInclude, JsonPropertyName("other_bucket_key")] public string? OtherBucketKey { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(FiltersAggregation filtersAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Filters(filtersAggregation); } public sealed partial class FiltersAggregationDescriptor : SerializableDescriptor> @@ -188,38 +62,12 @@ 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 string? NameValue { 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. /// @@ -235,6 +83,12 @@ public FiltersAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + 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. /// @@ -255,8 +109,6 @@ public FiltersAggregationDescriptor OtherBucketKey(string? otherBucke protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("filters"); writer.WriteStartObject(); if (FiltersValue is not null) { @@ -264,39 +116,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (OtherBucketValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); } writer.WriteEndObject(); @@ -311,38 +152,12 @@ 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 string? NameValue { 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. /// @@ -358,6 +173,12 @@ public FiltersAggregationDescriptor Meta(Func, return Self; } + public FiltersAggregationDescriptor Name(string? name) + { + NameValue = name; + 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. /// @@ -378,8 +199,6 @@ public FiltersAggregationDescriptor OtherBucketKey(string? otherBucketKey) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("filters"); writer.WriteStartObject(); if (FiltersValue is not null) { @@ -387,39 +206,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (OtherBucketValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); } writer.WriteEndObject(); 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 index 4753160433c..645e0298522 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FiltersBucket.g.cs @@ -27,50 +27,51 @@ 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 +internal sealed partial class FiltersBucketConverter : JsonConverter { - public override FiltersBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new FiltersBucket(subAggs) { DocCount = docCount }; + return new FiltersBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount }; } - public override void Write(Utf8JsonWriter writer, FiltersBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, FiltersBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FiltersBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FiltersBucketConverter))] +public sealed partial class FiltersBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs new file mode 100644 index 00000000000..10327902268 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregate.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 FrequentItemSetsAggregate : 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/FrequentItemSetsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs new file mode 100644 index 00000000000..80108f64615 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs @@ -0,0 +1,431 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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 FrequentItemSetsAggregation +{ + /// + /// Fields to analyze. + /// + [JsonInclude, JsonPropertyName("fields")] + public ICollection Fields { get; set; } + + /// + /// Query that filters documents from analysis. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } + + /// + /// The minimum size of one item set. + /// + [JsonInclude, JsonPropertyName("minimum_set_size")] + public int? MinimumSetSize { get; set; } + + /// + /// The minimum support of one item set. + /// + [JsonInclude, JsonPropertyName("minimum_support")] + public double? MinimumSupport { get; set; } + + /// + /// The number of top item sets to return. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(FrequentItemSetsAggregation frequentItemSetsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.FrequentItemSets(frequentItemSetsAggregation); +} + +public sealed partial class FrequentItemSetsAggregationDescriptor : SerializableDescriptor> +{ + internal FrequentItemSetsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public FrequentItemSetsAggregationDescriptor() : base() + { + } + + private ICollection FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private int? MinimumSetSizeValue { get; set; } + private double? MinimumSupportValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Fields to analyze. + /// + public FrequentItemSetsAggregationDescriptor Fields(ICollection fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Query that filters documents from analysis. + /// + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The minimum size of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSetSize(int? minimumSetSize) + { + MinimumSetSizeValue = minimumSetSize; + return Self; + } + + /// + /// The minimum support of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSupport(double? minimumSupport) + { + MinimumSupportValue = minimumSupport; + return Self; + } + + /// + /// The number of top item sets to return. + /// + public FrequentItemSetsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MinimumSetSizeValue.HasValue) + { + writer.WritePropertyName("minimum_set_size"); + writer.WriteNumberValue(MinimumSetSizeValue.Value); + } + + if (MinimumSupportValue.HasValue) + { + writer.WritePropertyName("minimum_support"); + writer.WriteNumberValue(MinimumSupportValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FrequentItemSetsAggregationDescriptor : SerializableDescriptor +{ + internal FrequentItemSetsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public FrequentItemSetsAggregationDescriptor() : base() + { + } + + private ICollection FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MinimumSetSizeValue { get; set; } + private double? MinimumSupportValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Fields to analyze. + /// + public FrequentItemSetsAggregationDescriptor Fields(ICollection fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Query that filters documents from analysis. + /// + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The minimum size of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSetSize(int? minimumSetSize) + { + MinimumSetSizeValue = minimumSetSize; + return Self; + } + + /// + /// The minimum support of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSupport(double? minimumSupport) + { + MinimumSupportValue = minimumSupport; + return Self; + } + + /// + /// The number of top item sets to return. + /// + public FrequentItemSetsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.FrequentItemSetsFieldDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MinimumSetSizeValue.HasValue) + { + writer.WritePropertyName("minimum_set_size"); + writer.WriteNumberValue(MinimumSetSizeValue.Value); + } + + if (MinimumSupportValue.HasValue) + { + writer.WritePropertyName("minimum_support"); + writer.WriteNumberValue(MinimumSupportValue.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/Aggregations/FrequentItemSetsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs new file mode 100644 index 00000000000..b21da546e56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsBucket.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.Aggregations; + +internal sealed partial class FrequentItemSetsBucketConverter : JsonConverter +{ + public override FrequentItemSetsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + IReadOnlyDictionary> key = default; + double support = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize>>(ref reader, options); + continue; + } + + if (property == "support") + { + support = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new FrequentItemSetsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, Support = support }; + } + + public override void Write(Utf8JsonWriter writer, FrequentItemSetsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FrequentItemSetsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FrequentItemSetsBucketConverter))] +public sealed partial class FrequentItemSetsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary> Key { get; init; } + public double Support { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs new file mode 100644 index 00000000000..bbed41f9202 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/FrequentItemSetsField.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.Aggregations; + +public sealed partial class FrequentItemSetsField +{ + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ [JsonInclude, JsonPropertyName("exclude")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } +} + +public sealed partial class FrequentItemSetsFieldDescriptor : SerializableDescriptor> +{ + internal FrequentItemSetsFieldDescriptor(Action> configure) => configure.Invoke(this); + + public FrequentItemSetsFieldDescriptor() : base() + { + } + + 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; } + + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + 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 (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FrequentItemSetsFieldDescriptor : SerializableDescriptor +{ + internal FrequentItemSetsFieldDescriptor(Action configure) => configure.Invoke(this); + + public FrequentItemSetsFieldDescriptor() : base() + { + } + + 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; } + + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + 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 (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + writer.WriteEndObject(); + } +} \ 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 index 56f59181997..914f8756c29 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs @@ -27,151 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeoBoundsAggregationConverter : JsonConverter +public sealed partial class GeoBoundsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Specifies whether the bounding box should be allowed to overlap the international date line. /// + [JsonInclude, JsonPropertyName("wrap_longitude")] public bool? WrapLongitude { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeoBoundsAggregation geoBoundsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeoBounds(geoBoundsAggregation); } public sealed partial class GeoBoundsAggregationDescriptor : SerializableDescriptor> @@ -183,30 +61,41 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private bool? WrapLongitudeValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public GeoBoundsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public GeoBoundsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public GeoBoundsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoBoundsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -229,8 +118,6 @@ public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitu protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_bounds"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -256,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(WrapLongitudeValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,36 +156,41 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private bool? WrapLongitudeValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoBoundsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -328,8 +213,6 @@ public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitude = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_bounds"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/GeoCentroidAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs index 079955eba25..9070e16816e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs @@ -27,166 +27,28 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeoCentroidAggregationConverter : JsonConverter +public sealed partial class GeoCentroidAggregation { - 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() - { - } - + [JsonInclude, JsonPropertyName("count")] public long? Count { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("location")] 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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeoCentroidAggregation geoCentroidAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeoCentroid(geoCentroidAggregation); } public sealed partial class GeoCentroidAggregationDescriptor : SerializableDescriptor> @@ -200,8 +62,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } public GeoCentroidAggregationDescriptor Count(long? count) @@ -210,31 +71,43 @@ public GeoCentroidAggregationDescriptor Count(long? count) return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? location) + /// + /// The field on which to run the aggregation. + /// + public GeoCentroidAggregationDescriptor Field(Expression> field) { - LocationValue = location; + FieldValue = field; return Self; } - public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) + public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation? location) { - MetaValue = selector?.Invoke(new FluentDictionary()); + LocationValue = location; return Self; } - public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoCentroidAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -248,8 +121,6 @@ public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasti protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_centroid"); writer.WriteStartObject(); if (CountValue.HasValue) { @@ -281,13 +152,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -303,8 +167,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } public GeoCentroidAggregationDescriptor Count(long? count) @@ -313,18 +176,27 @@ public GeoCentroidAggregationDescriptor Count(long? count) return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -337,13 +209,10 @@ public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.S return Self; } - public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoCentroidAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -357,8 +226,6 @@ public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Ser protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_centroid"); writer.WriteStartObject(); if (CountValue.HasValue) { @@ -390,13 +257,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/GeoDistanceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs index a3c388cef1a..f2ddd161e66 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeoDistanceAggregationConverter : JsonConverter +public sealed partial class GeoDistanceAggregation { - 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. /// + [JsonInclude, JsonPropertyName("distance_type")] public Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceType { get; set; } /// /// A field of type `geo_point` used to evaluate the distance. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The origin used to evaluate the distance. /// + [JsonInclude, JsonPropertyName("origin")] public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? Origin { get; set; } /// /// An array of ranges used to bucket documents. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } /// /// The distance unit. /// + [JsonInclude, JsonPropertyName("unit")] public Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? Unit { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeoDistanceAggregation geoDistanceAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeoDistance(geoDistanceAggregation); } public sealed partial class GeoDistanceAggregationDescriptor : SerializableDescriptor> @@ -234,43 +74,17 @@ 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 string? NameValue { 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.Aggregations.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. /// @@ -298,12 +112,27 @@ public GeoDistanceAggregationDescriptor Field(Expression + /// 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; } + public GeoDistanceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The origin used to evaluate the distance. /// @@ -325,7 +154,7 @@ public GeoDistanceAggregationDescriptor Ranges(ICollection Ranges(AggregationRangeDescriptor descriptor) + public GeoDistanceAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -334,7 +163,7 @@ public GeoDistanceAggregationDescriptor Ranges(AggregationRangeDescri return Self; } - public GeoDistanceAggregationDescriptor Ranges(Action configure) + public GeoDistanceAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -343,7 +172,7 @@ public GeoDistanceAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -363,8 +192,6 @@ public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elastics protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_distance"); writer.WriteStartObject(); if (DistanceTypeValue is not null) { @@ -378,6 +205,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OriginValue is not null) { writer.WritePropertyName("origin"); @@ -395,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -404,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -421,29 +260,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -456,43 +272,17 @@ 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 string? NameValue { 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.Aggregations.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. /// @@ -535,6 +325,12 @@ public GeoDistanceAggregationDescriptor Meta(Func /// The origin used to evaluate the distance. ///
@@ -556,7 +352,7 @@ public GeoDistanceAggregationDescriptor Ranges(ICollection configure) + public GeoDistanceAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -574,7 +370,7 @@ public GeoDistanceAggregationDescriptor Ranges(Action[] configure) + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -594,8 +390,6 @@ public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serve protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_distance"); writer.WriteStartObject(); if (DistanceTypeValue is not null) { @@ -609,6 +403,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OriginValue is not null) { writer.WritePropertyName("origin"); @@ -626,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -635,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -652,29 +458,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/GeoLineAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs index 0f932532f55..02ef9aead37 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineAggregation.g.cs @@ -27,167 +27,36 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeoLineAggregationConverter : JsonConverter +public sealed partial class GeoLineAggregation { - 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. /// + [JsonInclude, JsonPropertyName("include_sort")] public bool? IncludeSort { get; set; } - public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } /// /// The name of the geo_point field. /// + [JsonInclude, JsonPropertyName("point")] 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.
///
+ [JsonInclude, JsonPropertyName("size")] 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.
///
+ [JsonInclude, JsonPropertyName("sort")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort Sort { get; set; } /// /// The order in which the line is sorted (ascending or descending). /// + [JsonInclude, JsonPropertyName("sort_order")] public Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrder { get; set; } } @@ -200,14 +69,13 @@ public GeoLineAggregationDescriptor() : base() } private bool? IncludeSortValue { get; set; } - private IDictionary? MetaValue { get; set; } 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.GeoLinePointDescriptor PointDescriptor { get; set; } + private Action> PointDescriptorAction { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort SortValue { get; set; } - private GeoLineSortDescriptor SortDescriptor { get; set; } - private Action> SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrderValue { get; set; } /// @@ -219,12 +87,6 @@ public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = t return Self; } - public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The name of the geo_point field. /// @@ -236,7 +98,7 @@ public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsear return Self; } - public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePointDescriptor descriptor) { PointValue = null; PointDescriptorAction = null; @@ -244,7 +106,7 @@ public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor Point(Action> configure) + public GeoLineAggregationDescriptor Point(Action> configure) { PointValue = null; PointDescriptor = null; @@ -272,7 +134,7 @@ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearc return Self; } - public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -280,7 +142,7 @@ public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor Sort(Action> configure) + public GeoLineAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -299,8 +161,6 @@ public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elastic protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_line"); writer.WriteStartObject(); if (IncludeSortValue.HasValue) { @@ -316,7 +176,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PointDescriptorAction is not null) { writer.WritePropertyName("point"); - JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePointDescriptor(PointDescriptorAction), options); } else { @@ -338,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor(SortDescriptorAction), options); } else { @@ -352,13 +212,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SortOrderValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -372,14 +225,13 @@ public GeoLineAggregationDescriptor() : base() } private bool? IncludeSortValue { get; set; } - private IDictionary? MetaValue { get; set; } 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.GeoLinePointDescriptor PointDescriptor { get; set; } + private Action PointDescriptorAction { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSort SortValue { get; set; } - private GeoLineSortDescriptor SortDescriptor { get; set; } - private Action SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortOrder? SortOrderValue { get; set; } /// @@ -391,12 +243,6 @@ public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = true) return Self; } - public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The name of the geo_point field. /// @@ -408,7 +254,7 @@ public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Serverle return Self; } - public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePointDescriptor descriptor) { PointValue = null; PointDescriptorAction = null; @@ -416,7 +262,7 @@ public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) return Self; } - public GeoLineAggregationDescriptor Point(Action configure) + public GeoLineAggregationDescriptor Point(Action configure) { PointValue = null; PointDescriptor = null; @@ -444,7 +290,7 @@ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverles return Self; } - public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -452,7 +298,7 @@ public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) return Self; } - public GeoLineAggregationDescriptor Sort(Action configure) + public GeoLineAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -471,8 +317,6 @@ public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elasticsearch.Serv protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_line"); writer.WriteStartObject(); if (IncludeSortValue.HasValue) { @@ -488,7 +332,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PointDescriptorAction is not null) { writer.WritePropertyName("point"); - JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLinePointDescriptor(PointDescriptorAction), options); } else { @@ -510,7 +354,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeoLineSortDescriptor(SortDescriptorAction), options); } else { @@ -524,13 +368,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 3934e992e02..6690961eeb7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLinePoint.g.cs @@ -64,6 +64,15 @@ public GeoLinePointDescriptor Field(Expression + /// 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(); 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 index 1190a91075f..2bbe56ed8ea 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeoLineSort.g.cs @@ -64,6 +64,15 @@ public GeoLineSortDescriptor Field(Expression + /// 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(); 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 index 3cc2436cf66..84e57d7bb01 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeohashGridAggregationConverter : JsonConverter +public sealed partial class GeohashGridAggregation { - 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. /// + [JsonInclude, JsonPropertyName("bounds")] 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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The string length of the geohashes used to define cells/buckets in the results. /// + [JsonInclude, JsonPropertyName("precision")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The maximum number of geohash buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeohashGridAggregation geohashGridAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeohashGrid(geohashGridAggregation); } public sealed partial class GeohashGridAggregationDescriptor : SerializableDescriptor> @@ -234,40 +74,14 @@ 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 string? NameValue { 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. /// @@ -295,12 +109,27 @@ public GeohashGridAggregationDescriptor Field(Expression + /// 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; } + public GeohashGridAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The string length of the geohashes used to define cells/buckets in the results. /// @@ -330,8 +159,6 @@ public GeohashGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohash_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -345,6 +172,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue is not null) { writer.WritePropertyName("precision"); @@ -363,29 +202,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -398,40 +214,14 @@ 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 string? NameValue { 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. /// @@ -474,6 +264,12 @@ public GeohashGridAggregationDescriptor Meta(Func /// The string length of the geohashes used to define cells/buckets in the results. ///
@@ -503,8 +299,6 @@ public GeohashGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohash_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -518,6 +312,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue is not null) { writer.WritePropertyName("precision"); @@ -536,29 +342,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 797eee29495..2da0bf001a5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohashGridBucket.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class GeohashGridBucketConverter : JsonConverter { - public override GeohashGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeohashGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeohashGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeohashGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeohashGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeohashGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeohashGridBucketConverter))] +public sealed partial class GeohashGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { 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 index 662b767ee78..073ce69370c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs @@ -27,195 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeohexGridAggregationConverter : JsonConverter +public sealed partial class GeohexGridAggregation { - 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. /// + [JsonInclude, JsonPropertyName("bounds")] 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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
///
+ [JsonInclude, JsonPropertyName("precision")] public int? Precision { get; set; } /// /// Number of buckets returned from each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// Maximum number of buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeohexGridAggregation geohexGridAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeohexGrid(geohexGridAggregation); } public sealed partial class GeohexGridAggregationDescriptor : SerializableDescriptor> @@ -226,40 +74,14 @@ 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 string? NameValue { 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. /// @@ -287,12 +109,27 @@ public GeohexGridAggregationDescriptor Field(Expression + /// 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; } + public GeohexGridAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
///
@@ -322,8 +159,6 @@ public GeohexGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohex_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -333,6 +168,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -351,29 +198,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -386,40 +210,14 @@ 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 string? NameValue { 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. /// @@ -462,6 +260,12 @@ public GeohexGridAggregationDescriptor Meta(Func /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
///
@@ -491,8 +295,6 @@ public GeohexGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohex_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -502,6 +304,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -520,29 +334,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index a5ff4eb2854..b209a3d44ec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeohexGridBucket.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class GeohexGridBucketConverter : JsonConverter { - public override GeohexGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeohexGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeohexGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeohexGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeohexGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeohexGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeohexGridBucketConverter))] +public sealed partial class GeohexGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { 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 index 583166e2594..60a415e6516 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs @@ -27,203 +27,44 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GeotileGridAggregationConverter : JsonConverter +public sealed partial class GeotileGridAggregation { - 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. /// + [JsonInclude, JsonPropertyName("bounds")] 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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
///
+ [JsonInclude, JsonPropertyName("precision")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The maximum number of buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GeotileGridAggregation geotileGridAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.GeotileGrid(geotileGridAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy(GeotileGridAggregation geotileGridAggregation) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy.GeotileGrid(geotileGridAggregation); } public sealed partial class GeotileGridAggregationDescriptor : SerializableDescriptor> @@ -234,40 +75,14 @@ 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 string? NameValue { 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. /// @@ -295,12 +110,27 @@ public GeotileGridAggregationDescriptor Field(Expression + /// 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; } + public GeotileGridAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -330,8 +160,6 @@ public GeotileGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geotile_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -345,10 +173,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } - if (PrecisionValue is not null) + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, PrecisionValue, options); + writer.WriteNumberValue(PrecisionValue.Value); } if (ShardSizeValue.HasValue) @@ -363,29 +203,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -398,40 +215,14 @@ 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 string? NameValue { 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. /// @@ -474,6 +265,12 @@ public GeotileGridAggregationDescriptor Meta(Func /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
///
@@ -503,8 +300,6 @@ public GeotileGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geotile_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -518,10 +313,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } - if (PrecisionValue is not null) + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, PrecisionValue, options); + writer.WriteNumberValue(PrecisionValue.Value); } if (ShardSizeValue.HasValue) @@ -536,29 +343,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index b29efb1ff86..6dd85f2d912 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GeotileGridBucket.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class GeotileGridBucketConverter : JsonConverter { - public override GeotileGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeotileGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeotileGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeotileGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeotileGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeotileGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeotileGridBucketConverter))] +public sealed partial class GeotileGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ 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 index a6521bec1d3..143b11cad28 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class GlobalAggregateConverter : JsonConverter { - public override GlobalAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GlobalAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new GlobalAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, GlobalAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GlobalAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GlobalAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GlobalAggregateConverter))] +public sealed partial class GlobalAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 44b1e1acfc3..c35cb8ac4a3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/GlobalAggregation.g.cs @@ -27,164 +27,14 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class GlobalAggregationConverter : JsonConverter +public sealed partial class GlobalAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] 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); - } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } - writer.WriteEndObject(); - } + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(GlobalAggregation globalAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Global(globalAggregation); } public sealed partial class GlobalAggregationDescriptor : SerializableDescriptor @@ -195,67 +45,34 @@ 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; } + private string? NameValue { 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) + public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) + public GlobalAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs new file mode 100644 index 00000000000..6cc5bdc26df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.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 HdrPercentileRanksAggregate : 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/HdrPercentilesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs new file mode 100644 index 00000000000..5da78134c81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HdrPercentilesAggregate.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 HdrPercentilesAggregate : 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/HistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs index c9d4f118b8b..113d4cbc833 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramAggregation.g.cs @@ -27,264 +27,55 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class HistogramAggregationConverter : JsonConverter +public sealed partial class HistogramAggregation { - 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. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// The interval for the buckets.
Must be a positive decimal.
///
+ [JsonInclude, JsonPropertyName("interval")] public double? Interval { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public double? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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.
///
+ [JsonInclude, JsonPropertyName("offset")] 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; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(HistogramAggregation histogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Histogram(histogramAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy(HistogramAggregation histogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy.Histogram(histogramAggregation); } public sealed partial class HistogramAggregationDescriptor : SerializableDescriptor> @@ -295,47 +86,30 @@ 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 string? NameValue { get; set; } private double? OffsetValue { get; set; } - private ICollection>? OrderValue { 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) + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The name of the field to aggregate on. /// - public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + public HistogramAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -344,7 +118,7 @@ public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticse /// /// The name of the field to aggregate on. /// - public HistogramAggregationDescriptor Field(Expression> field) + public HistogramAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -389,6 +163,12 @@ public HistogramAggregationDescriptor Missing(double? missing) return Self; } + public HistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -401,7 +181,7 @@ public HistogramAggregationDescriptor Offset(double? offset) /// /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
///
- public HistogramAggregationDescriptor Order(ICollection>? order) + public HistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -415,8 +195,6 @@ public HistogramAggregationDescriptor Script(Elastic.Clients.Elastics protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("histogram"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -436,6 +214,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(IntervalValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -448,6 +232,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue.HasValue) { writer.WritePropertyName("offset"); @@ -457,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ScriptValue is not null) @@ -466,29 +256,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -501,43 +268,17 @@ 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 string? NameValue { get; set; } private double? OffsetValue { get; set; } - private ICollection>? OrderValue { 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. /// @@ -604,6 +345,12 @@ public HistogramAggregationDescriptor Missing(double? missing) return Self; } + public HistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -616,7 +363,7 @@ public HistogramAggregationDescriptor Offset(double? offset) /// /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
///
- public HistogramAggregationDescriptor Order(ICollection>? order) + public HistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -630,8 +377,6 @@ public HistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serve protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("histogram"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -651,6 +396,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(IntervalValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -663,6 +414,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue.HasValue) { writer.WritePropertyName("offset"); @@ -672,7 +429,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ScriptValue is not null) @@ -681,29 +438,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 6fb92c7cbbc..4add224991a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/HistogramBucket.g.cs @@ -27,68 +27,67 @@ 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 +internal sealed partial class HistogramBucketConverter : JsonConverter { - public override HistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new HistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + return new HistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, HistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, HistogramBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'HistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(HistogramBucketConverter))] +public sealed partial class HistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double Key { get; init; } + public string? KeyAsString { get; init; } } \ 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 index e658594de19..7ac285b7fb5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregate.g.cs @@ -27,18 +27,78 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +internal sealed partial class InferenceAggregateConverter : JsonConverter +{ + public override InferenceAggregate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection? featureImportance = default; + IReadOnlyDictionary? meta = default; + IReadOnlyCollection? topClasses = default; + Elastic.Clients.Elasticsearch.Serverless.FieldValue? value = default; + string? warning = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "feature_importance") + { + featureImportance = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "top_classes") + { + topClasses = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "value") + { + value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "warning") + { + warning = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new InferenceAggregate { Data = additionalProperties, FeatureImportance = featureImportance, Meta = meta, TopClasses = topClasses, Value = value, Warning = warning }; + } + + public override void Write(Utf8JsonWriter writer, InferenceAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'InferenceAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(InferenceAggregateConverter))] public sealed partial class InferenceAggregate : IAggregate { - [JsonInclude, JsonPropertyName("data")] + /// + /// Additional 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 index b35207933f3..5707910c05b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceAggregation.g.cs @@ -27,165 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class InferenceAggregationConverter : JsonConverter +public sealed partial class InferenceAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } /// /// Contains the inference type and its options. /// + [JsonInclude, JsonPropertyName("inference_config")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig? InferenceConfig { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// The ID or alias for the trained model. /// + [JsonInclude, JsonPropertyName("model_id")] public Elastic.Clients.Elasticsearch.Serverless.Name ModelId { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(InferenceAggregation inferenceAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Inference(inferenceAggregation); } public sealed partial class InferenceAggregationDescriptor : SerializableDescriptor> @@ -200,23 +78,33 @@ public InferenceAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } 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.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name ModelIdValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public InferenceAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -234,7 +122,7 @@ public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients return Self; } - public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -242,7 +130,7 @@ public InferenceAggregationDescriptor InferenceConfig(InferenceConfig return Self; } - public InferenceAggregationDescriptor InferenceConfig(Action> configure) + public InferenceAggregationDescriptor InferenceConfig(Action> configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -265,10 +153,14 @@ public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elastic return Self; } + public InferenceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("inference"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -296,7 +188,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -304,15 +196,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, InferenceConfigValue, 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.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + writer.WriteEndObject(); } } @@ -329,23 +226,33 @@ public InferenceAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } 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.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name ModelIdValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public InferenceAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -363,7 +270,7 @@ public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsea return Self; } - public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -371,7 +278,7 @@ public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor return Self; } - public InferenceAggregationDescriptor InferenceConfig(Action configure) + public InferenceAggregationDescriptor InferenceConfig(Action configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -394,10 +301,14 @@ public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elasticsearch.Serv return Self; } + public InferenceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("inference"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -425,7 +336,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -433,15 +344,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, InferenceConfigValue, 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.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + writer.WriteEndObject(); } } \ 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 index 53dbb960a8e..58afe7f77b5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/InferenceConfig.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -45,8 +46,20 @@ internal InferenceConfig(string variantName, object 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); + public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfig("classification", classificationInferenceOptions); + public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfig("regression", regressionInferenceOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class InferenceConfigConverter : JsonConverter @@ -58,44 +71,57 @@ public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "classification") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new InferenceConfig(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "regression") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new InferenceConfig(propertyName, variant); + if (propertyName == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfig' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new InferenceConfig(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + 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); + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions)value.Variant, options); break; case "regression": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ml.RegressionInferenceOptions)value.Variant, options); + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions)value.Variant, options); break; } } @@ -135,29 +161,27 @@ private InferenceConfigDescriptor Set(object variant, string variantN 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 Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -193,30 +217,27 @@ private InferenceConfigDescriptor Set(object variant, string variantName) 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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/IpPrefixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs index c8b543d4590..883db983043 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs @@ -27,210 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class IpPrefixAggregationConverter : JsonConverter +public sealed partial class IpPrefixAggregation { - 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. /// + [JsonInclude, JsonPropertyName("append_prefix_length")] public bool? AppendPrefixLength { get; set; } /// /// The IP address field to aggregation on. The field mapping type must be `ip`. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Defines whether the prefix applies to IPv6 addresses. /// + [JsonInclude, JsonPropertyName("is_ipv6")] 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Minimum number of documents in a bucket for it to be included in the response. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].
For IPv6 addresses the accepted range is [0, 128].
///
+ [JsonInclude, JsonPropertyName("prefix_length")] public int PrefixLength { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(IpPrefixAggregation ipPrefixAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.IpPrefix(ipPrefixAggregation); } public sealed partial class IpPrefixAggregationDescriptor : SerializableDescriptor> @@ -241,41 +74,14 @@ 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 string? NameValue { 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. /// @@ -304,20 +110,20 @@ public IpPrefixAggregationDescriptor Field(Expression - /// Defines whether the prefix applies to IPv6 addresses. + /// The IP address field to aggregation on. The field mapping type must be `ip`. /// - public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) + public IpPrefixAggregationDescriptor Field(Expression> field) { - IsIpv6Value = isIpv6; + FieldValue = field; return Self; } /// - /// Defines whether buckets are returned as a hash rather than an array in the response. + /// Defines whether the prefix applies to IPv6 addresses. /// - public IpPrefixAggregationDescriptor Keyed(bool? keyed = true) + public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) { - KeyedValue = keyed; + IsIpv6Value = isIpv6; return Self; } @@ -336,6 +142,12 @@ public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public IpPrefixAggregationDescriptor Name(string? name) + { + NameValue = name; + 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].
///
@@ -347,8 +159,6 @@ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("ip_prefix"); writer.WriteStartObject(); if (AppendPrefixLengthValue.HasValue) { @@ -364,10 +174,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IsIpv6Value.Value); } - if (KeyedValue.HasValue) + if (MetaValue is not null) { - writer.WritePropertyName("keyed"); - writer.WriteBooleanValue(KeyedValue.Value); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } if (MinDocCountValue.HasValue) @@ -376,31 +186,14 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - 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.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); writer.WriteEndObject(); } } @@ -413,41 +206,14 @@ 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 string? NameValue { 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. /// @@ -493,15 +259,6 @@ public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) 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()); @@ -517,6 +274,12 @@ public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public IpPrefixAggregationDescriptor Name(string? name) + { + NameValue = name; + 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].
///
@@ -528,8 +291,6 @@ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("ip_prefix"); writer.WriteStartObject(); if (AppendPrefixLengthValue.HasValue) { @@ -545,10 +306,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IsIpv6Value.Value); } - if (KeyedValue.HasValue) + if (MetaValue is not null) { - writer.WritePropertyName("keyed"); - writer.WriteBooleanValue(KeyedValue.Value); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } if (MinDocCountValue.HasValue) @@ -557,31 +318,14 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - 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.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); 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 index bd624a23465..3a1a038cffd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpPrefixBucket.g.cs @@ -27,86 +27,83 @@ 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 +internal sealed partial class IpPrefixBucketConverter : JsonConverter { - public override IpPrefixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; bool isIpv6 = default; string key = default; string? netmask = default; int prefixLength = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("is_ipv6", StringComparison.Ordinal)) - { - isIpv6 = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "is_ipv6") + { + isIpv6 = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("netmask", StringComparison.Ordinal)) - { - netmask = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "netmask") + { + netmask = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("prefix_length", StringComparison.Ordinal)) - { - prefixLength = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "prefix_length") + { + prefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new IpPrefixBucket(subAggs) { DocCount = docCount, IsIpv6 = isIpv6, Key = key, Netmask = netmask, PrefixLength = prefixLength }; + return new IpPrefixBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, IsIpv6 = isIpv6, Key = key, Netmask = netmask, PrefixLength = prefixLength }; } - public override void Write(Utf8JsonWriter writer, IpPrefixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, IpPrefixBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'IpPrefixBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(IpPrefixBucketConverter))] +public sealed partial class IpPrefixBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public bool IsIpv6 { get; init; } + public string Key { get; init; } + public string? Netmask { get; init; } + public int PrefixLength { 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 index 6ad91948613..e3b9bcf0012 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/IpRangeAggregation.g.cs @@ -27,134 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class IpRangeAggregationConverter : JsonConverter +public sealed partial class IpRangeAggregation { - 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. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Array of IP ranges. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(IpRangeAggregation ipRangeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.IpRange(ipRangeAggregation); } public sealed partial class IpRangeAggregationDescriptor : SerializableDescriptor> @@ -165,44 +56,27 @@ 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 string? NameValue { 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; - } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } - public IpRangeAggregationDescriptor Aggregations(Action> configure) + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are used to build ranges. /// - public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + public IpRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -211,7 +85,7 @@ public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsear /// /// The date field whose values are used to build ranges. /// - public IpRangeAggregationDescriptor Field(Expression> field) + public IpRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -223,6 +97,12 @@ public IpRangeAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of IP ranges. /// @@ -235,7 +115,7 @@ public IpRangeAggregationDescriptor Ranges(ICollection Ranges(IpRangeAggregationRangeDescriptor descriptor) + public IpRangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -244,7 +124,7 @@ public IpRangeAggregationDescriptor Ranges(IpRangeAggregationRangeDes return Self; } - public IpRangeAggregationDescriptor Ranges(Action configure) + public IpRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -253,7 +133,7 @@ public IpRangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public IpRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -264,8 +144,6 @@ public IpRangeAggregationDescriptor Ranges(params Action(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); - } - writer.WriteEndObject(); } } @@ -339,39 +206,13 @@ 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 string? NameValue { 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; - } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } /// /// The date field whose values are used to build ranges. @@ -406,6 +247,12 @@ public IpRangeAggregationDescriptor Meta(Func, return Self; } + public IpRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of IP ranges. /// @@ -418,7 +265,7 @@ public IpRangeAggregationDescriptor Ranges(ICollection configure) + public IpRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -436,7 +283,7 @@ public IpRangeAggregationDescriptor Ranges(Action[] configure) + public IpRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -447,8 +294,6 @@ public IpRangeAggregationDescriptor Ranges(params Action 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 +internal sealed partial class IpRangeBucketConverter : JsonConverter { - public override IpRangeBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string? from = default; string? key = default; string? to = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("from", StringComparison.Ordinal)) - { - from = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "from") + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("to", StringComparison.Ordinal)) - { - to = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "to") + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new IpRangeBucket(subAggs) { DocCount = docCount, From = from, Key = key, To = to }; + return new IpRangeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, From = from, Key = key, To = to }; } - public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'IpRangeBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(IpRangeBucketConverter))] +public sealed partial class IpRangeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string? From { get; init; } + public string? Key { get; init; } + public string? To { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs new file mode 100644 index 00000000000..352a90c2f93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsAggregate.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 some kind of whole number like a integer, long, or a date. +/// +public sealed partial class LongRareTermsAggregate : 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/LongRareTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs new file mode 100644 index 00000000000..71dc5b33b38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongRareTermsBucket.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.Aggregations; + +internal sealed partial class LongRareTermsBucketConverter : JsonConverter +{ + public override LongRareTermsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + long key = default; + string? keyAsString = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new LongRareTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, LongRareTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'LongRareTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(LongRareTermsBucketConverter))] +public sealed partial class LongRareTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { 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 index f7bb55b157c..550820efffb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/LongTermsBucket.g.cs @@ -27,77 +27,75 @@ 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 +internal sealed partial class LongTermsBucketConverter : JsonConverter { - public override LongTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; long key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new LongTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + return new LongTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, LongTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, LongTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'LongTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(LongTermsBucketConverter))] +public sealed partial class LongTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public long Key { get; init; } + public string? KeyAsString { 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 index 2089cd66886..0b62e92f7da 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs @@ -27,131 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MatrixStatsAggregationConverter : JsonConverter +public sealed partial class MatrixStatsAggregation { - 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() - { - } - + /// + /// An array of fields for computing the statistics. + /// + [JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] public IDictionary? Missing { get; set; } /// /// Array value the aggregation will use for array or multi-valued fields. /// + [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MatrixStatsAggregation matrixStatsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MatrixStats(matrixStatsAggregation); } public sealed partial class MatrixStatsAggregationDescriptor : SerializableDescriptor> @@ -166,7 +66,11 @@ public MatrixStatsAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private IDictionary? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private string? NameValue { get; set; } + /// + /// An array of fields for computing the statistics. + /// public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) { FieldsValue = fields; @@ -179,6 +83,9 @@ public MatrixStatsAggregationDescriptor Meta(Func + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) { MissingValue = selector?.Invoke(new FluentDictionary()); @@ -194,10 +101,14 @@ public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elastics return Self; } + public MatrixStatsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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) { @@ -205,6 +116,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldsValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); @@ -217,11 +134,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ModeValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -240,7 +156,11 @@ public MatrixStatsAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private IDictionary? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } + private string? NameValue { get; set; } + /// + /// An array of fields for computing the statistics. + /// public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Fields? fields) { FieldsValue = fields; @@ -253,6 +173,9 @@ public MatrixStatsAggregationDescriptor Meta(Func + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ /// public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) { MissingValue = selector?.Invoke(new FluentDictionary()); @@ -268,10 +191,14 @@ public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Serve return Self; } + public MatrixStatsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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) { @@ -279,6 +206,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldsValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); @@ -291,11 +224,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ModeValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); 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 index 63d0e59acb3..a9a25dc9d9d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MaxAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index 41cf629e31b..992a2b72f85 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MaxAggregationConverter : JsonConverter +public sealed partial class MaxAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MaxAggregation maxAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Max(maxAggregation); } public sealed partial class MaxAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MaxAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MaxAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MaxAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MaxAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MaxAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("max"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public MaxAggregationDescriptor Format(string? format) return Self; } - public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MaxAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MaxAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("max"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/MaxBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs new file mode 100644 index 00000000000..6258dfe4b2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MaxBucketAggregation.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.Aggregations; + +public sealed partial class MaxBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MaxBucketAggregation maxBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MaxBucket(maxBucketAggregation); +} + +public sealed partial class MaxBucketAggregationDescriptor : SerializableDescriptor +{ + internal MaxBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MaxBucketAggregationDescriptor() : 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 string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MaxBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MaxBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MaxBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MaxBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MaxBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 index 62913538632..ab854c3f6c7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MedianAbsoluteDeviationAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index 10bf469bb1f..97306594dc6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs @@ -27,169 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MedianAbsoluteDeviationAggregationConverter : JsonConverter +public sealed partial class MedianAbsoluteDeviationAggregation { - 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. /// + [JsonInclude, JsonPropertyName("compression")] public double? Compression { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MedianAbsoluteDeviation(medianAbsoluteDeviationAggregation); } public sealed partial class MedianAbsoluteDeviationAggregationDescriptor : SerializableDescriptor> @@ -203,8 +65,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -216,31 +77,43 @@ public MedianAbsoluteDeviationAggregationDescriptor Compression(doubl return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MedianAbsoluteDeviationAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -254,8 +127,6 @@ public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Cl protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("median_absolute_deviation"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -287,13 +158,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -309,8 +173,7 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -322,18 +185,27 @@ public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compress return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -346,13 +218,10 @@ public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MedianAbsoluteDeviationAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -366,8 +235,6 @@ public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Clients.Elast protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("median_absolute_deviation"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -399,13 +266,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index cef27724f4a..1d7912c68cb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MinAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index 772a3809867..097d028bc3b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MinAggregationConverter : JsonConverter +public sealed partial class MinAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MinAggregation minAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Min(minAggregation); } public sealed partial class MinAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MinAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MinAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MinAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MinAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MinAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("min"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public MinAggregationDescriptor Format(string? format) return Self; } - public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MinAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MinAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("min"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/MinBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinBucketAggregation.g.cs new file mode 100644 index 00000000000..43699f17289 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MinBucketAggregation.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.Aggregations; + +public sealed partial class MinBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MinBucketAggregation minBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MinBucket(minBucketAggregation); +} + +public sealed partial class MinBucketAggregationDescriptor : SerializableDescriptor +{ + internal MinBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MinBucketAggregationDescriptor() : 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 string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MinBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MinBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MinBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MinBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MinBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 index fd455ebcd4c..21a57756ed0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class MissingAggregateConverter : JsonConverter { - public override MissingAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new MissingAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new MissingAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, MissingAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, MissingAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'MissingAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(MissingAggregateConverter))] +public sealed partial class MissingAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 878656ec79a..c962e96f558 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MissingAggregation.g.cs @@ -27,130 +27,21 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MissingAggregationConverter : JsonConverter +public sealed partial class MissingAggregation { - 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. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MissingAggregation missingAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Missing(missingAggregation); } public sealed partial class MissingAggregationDescriptor : SerializableDescriptor> @@ -161,41 +52,24 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { 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) + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The name of the field. /// - public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + public MissingAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -204,7 +78,7 @@ public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsear /// /// The name of the field. /// - public MissingAggregationDescriptor Field(Expression> field) + public MissingAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -216,16 +90,20 @@ public MissingAggregationDescriptor Meta(Func Missing(FieldValue? missing) + public MissingAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public MissingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("missing"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -233,33 +111,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (MissingValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -274,36 +141,10 @@ 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; - } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } /// /// The name of the field. @@ -338,16 +179,20 @@ public MissingAggregationDescriptor Meta(Func, return Self; } - public MissingAggregationDescriptor Missing(FieldValue? missing) + public MissingAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public MissingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("missing"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,33 +200,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (MissingValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs new file mode 100644 index 00000000000..426e2c120aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs @@ -0,0 +1,211 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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 MovingFunctionAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script that should be executed on each window of data. + /// + [JsonInclude, JsonPropertyName("script")] + public string? Script { get; set; } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ [JsonInclude, JsonPropertyName("shift")] + public int? Shift { get; set; } + + /// + /// The size of window to "slide" across the histogram. + /// + [JsonInclude, JsonPropertyName("window")] + public int? Window { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MovingFunctionAggregation movingFunctionAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MovingFn(movingFunctionAggregation); +} + +public sealed partial class MovingFunctionAggregationDescriptor : SerializableDescriptor +{ + internal MovingFunctionAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MovingFunctionAggregationDescriptor() : 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 string? NameValue { get; set; } + private string? ScriptValue { get; set; } + private int? ShiftValue { get; set; } + private int? WindowValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MovingFunctionAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MovingFunctionAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MovingFunctionAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MovingFunctionAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MovingFunctionAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script that should be executed on each window of data. + /// + public MovingFunctionAggregationDescriptor Script(string? script) + { + ScriptValue = script; + return Self; + } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ public MovingFunctionAggregationDescriptor Shift(int? shift) + { + ShiftValue = shift; + return Self; + } + + /// + /// The size of window to "slide" across the histogram. + /// + public MovingFunctionAggregationDescriptor Window(int? window) + { + WindowValue = window; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (!string.IsNullOrEmpty(ScriptValue)) + { + writer.WritePropertyName("script"); + writer.WriteStringValue(ScriptValue); + } + + if (ShiftValue.HasValue) + { + writer.WritePropertyName("shift"); + writer.WriteNumberValue(ShiftValue.Value); + } + + if (WindowValue.HasValue) + { + writer.WritePropertyName("window"); + writer.WriteNumberValue(WindowValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs new file mode 100644 index 00000000000..f1bd13e1e2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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 MovingPercentilesAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ [JsonInclude, JsonPropertyName("shift")] + public int? Shift { get; set; } + + /// + /// The size of window to "slide" across the histogram. + /// + [JsonInclude, JsonPropertyName("window")] + public int? Window { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MovingPercentilesAggregation movingPercentilesAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MovingPercentiles(movingPercentilesAggregation); +} + +public sealed partial class MovingPercentilesAggregationDescriptor : SerializableDescriptor +{ + internal MovingPercentilesAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MovingPercentilesAggregationDescriptor() : 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 string? NameValue { get; set; } + private int? ShiftValue { get; set; } + private int? WindowValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MovingPercentilesAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MovingPercentilesAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MovingPercentilesAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MovingPercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MovingPercentilesAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ public MovingPercentilesAggregationDescriptor Shift(int? shift) + { + ShiftValue = shift; + return Self; + } + + /// + /// The size of window to "slide" across the histogram. + /// + public MovingPercentilesAggregationDescriptor Window(int? window) + { + WindowValue = window; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (ShiftValue.HasValue) + { + writer.WritePropertyName("shift"); + writer.WriteNumberValue(ShiftValue.Value); + } + + if (WindowValue.HasValue) + { + writer.WritePropertyName("window"); + writer.WriteNumberValue(WindowValue.Value); + } + + 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 index 0e4a1d906aa..d67300ec644 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermLookup.g.cs @@ -39,7 +39,7 @@ public sealed partial class MultiTermLookup /// 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } } public sealed partial class MultiTermLookupDescriptor : SerializableDescriptor> @@ -51,7 +51,7 @@ public MultiTermLookupDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } /// /// A fields from which to retrieve terms. @@ -71,10 +71,19 @@ public MultiTermLookupDescriptor Field(Expression + /// 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) + public MultiTermLookupDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -104,7 +113,7 @@ public MultiTermLookupDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } /// /// A fields from which to retrieve terms. @@ -136,7 +145,7 @@ public MultiTermLookupDescriptor Field(Expression /// 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) + public MultiTermLookupDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; 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 index 5b90b0b1290..a42a13fed17 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs @@ -27,264 +27,62 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class MultiTermsAggregationConverter : JsonConverter +public sealed partial class MultiTermsAggregation { - 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. /// + [JsonInclude, JsonPropertyName("collect_mode")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// The minimum number of documents in a bucket for it to be returned. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } - override public string? Name { get; internal set; } - [JsonConverter(typeof(AggregateOrderConverter))] + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } /// /// The minimum number of documents in a bucket on each shard for it to be returned. /// + [JsonInclude, JsonPropertyName("shard_min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// Calculates the doc count error on per term basis. /// + [JsonInclude, JsonPropertyName("show_term_doc_count_error")] public bool? ShowTermDocCountError { get; set; } /// /// The number of term buckets should be returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The field from which to generate sets of terms. /// + [JsonInclude, JsonPropertyName("terms")] public ICollection Terms { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(MultiTermsAggregation multiTermsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.MultiTerms(multiTermsAggregation); } public sealed partial class MultiTermsAggregationDescriptor : SerializableDescriptor> @@ -295,45 +93,19 @@ 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 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 string? NameValue { 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; } private ICollection TermsValue { get; set; } - private MultiTermLookupDescriptor TermsDescriptor { get; set; } - private Action> TermsDescriptorAction { get; set; } - private Action>[] TermsDescriptorActions { 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; - } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + private Action>[] TermsDescriptorActions { get; set; } /// /// Specifies the strategy for data collection. @@ -359,10 +131,16 @@ public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public MultiTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public MultiTermsAggregationDescriptor Order(ICollection>? order) + public MultiTermsAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -416,7 +194,7 @@ public MultiTermsAggregationDescriptor Terms(ICollection Terms(MultiTermLookupDescriptor descriptor) + public MultiTermsAggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor descriptor) { TermsValue = null; TermsDescriptorAction = null; @@ -425,7 +203,7 @@ public MultiTermsAggregationDescriptor Terms(MultiTermLookupDescripto return Self; } - public MultiTermsAggregationDescriptor Terms(Action> configure) + public MultiTermsAggregationDescriptor Terms(Action> configure) { TermsValue = null; TermsDescriptor = null; @@ -434,7 +212,7 @@ public MultiTermsAggregationDescriptor Terms(Action Terms(params Action>[] configure) + public MultiTermsAggregationDescriptor Terms(params Action>[] configure) { TermsValue = null; TermsDescriptor = null; @@ -445,8 +223,6 @@ public MultiTermsAggregationDescriptor Terms(params Action>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ShardMinDocCountValue.HasValue) @@ -501,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("terms"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor(TermsDescriptorAction), options); writer.WriteEndArray(); } else if (TermsDescriptorActions is not null) @@ -510,7 +298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in TermsDescriptorActions) { - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor(action), options); } writer.WriteEndArray(); @@ -521,29 +309,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TermsValue, 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(); } } @@ -556,45 +321,19 @@ 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 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 string? NameValue { 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; } private ICollection TermsValue { get; set; } - private MultiTermLookupDescriptor TermsDescriptor { get; set; } - private Action TermsDescriptorAction { get; set; } - private Action[] TermsDescriptorActions { 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; - } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + private Action[] TermsDescriptorActions { get; set; } /// /// Specifies the strategy for data collection. @@ -620,10 +359,16 @@ public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public MultiTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public MultiTermsAggregationDescriptor Order(ICollection>? order) + public MultiTermsAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -677,7 +422,7 @@ public MultiTermsAggregationDescriptor Terms(ICollection configure) + public MultiTermsAggregationDescriptor Terms(Action configure) { TermsValue = null; TermsDescriptor = null; @@ -695,7 +440,7 @@ public MultiTermsAggregationDescriptor Terms(Action c return Self; } - public MultiTermsAggregationDescriptor Terms(params Action[] configure) + public MultiTermsAggregationDescriptor Terms(params Action[] configure) { TermsValue = null; TermsDescriptor = null; @@ -706,8 +451,6 @@ public MultiTermsAggregationDescriptor Terms(params Action>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ShardMinDocCountValue.HasValue) @@ -762,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("terms"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor(TermsDescriptorAction), options); writer.WriteEndArray(); } else if (TermsDescriptorActions is not null) @@ -771,7 +526,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in TermsDescriptorActions) { - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MultiTermLookupDescriptor(action), options); } writer.WriteEndArray(); @@ -782,29 +537,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TermsValue, 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/MultiTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs index 54f117427ad..6652c3ad895 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/MultiTermsBucket.g.cs @@ -27,77 +27,75 @@ 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 +internal sealed partial class MultiTermsBucketConverter : JsonConverter { - public override MultiTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountErrorUpperBound = default; IReadOnlyCollection key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + 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 (property == "doc_count_error_upper_bound") + { + docCountErrorUpperBound = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize>(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new MultiTermsBucket(subAggs) { DocCount = docCount, DocCountErrorUpperBound = docCountErrorUpperBound, Key = key, KeyAsString = keyAsString }; + return new MultiTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountErrorUpperBound = docCountErrorUpperBound, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, MultiTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, MultiTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'MultiTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(MultiTermsBucketConverter))] +public sealed partial class MultiTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountErrorUpperBound { get; init; } + public IReadOnlyCollection Key { get; init; } + public string? KeyAsString { get; init; } } \ 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 index 85293f2c831..9aef93a0d7d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class NestedAggregateConverter : JsonConverter { - public override NestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new NestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new NestedAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, NestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, NestedAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NestedAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NestedAggregateConverter))] +public sealed partial class NestedAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 34568118aa8..b05c6fda2ce 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/NestedAggregation.g.cs @@ -27,111 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class NestedAggregationConverter : JsonConverter +public sealed partial class NestedAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The path to the field of type `nested`. /// + [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(NestedAggregation nestedAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Nested(nestedAggregation); } public sealed partial class NestedAggregationDescriptor : SerializableDescriptor> @@ -142,46 +51,35 @@ 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 string? NameValue { 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) + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public NestedAggregationDescriptor Aggregations(Action> configure) + public NestedAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + NameValue = name; return Self; } - public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) { - MetaValue = selector?.Invoke(new FluentDictionary()); + PathValue = path; return Self; } /// /// The path to the field of type `nested`. /// - public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Serverless.Field? path) + public NestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -190,7 +88,7 @@ public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch /// /// The path to the field of type `nested`. /// - public NestedAggregationDescriptor Path(Expression> path) + public NestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -199,35 +97,22 @@ public NestedAggregationDescriptor Path(Expression(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (PathValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); } writer.WriteEndObject(); @@ -242,39 +127,19 @@ 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 string? NameValue { 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) + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + public NestedAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -308,35 +173,22 @@ public NestedAggregationDescriptor Path(Expression + /// Path to the buckets that contain one set of values to correlate. + ///
+ [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + /// + /// The specific method to apply. + /// + [JsonInclude, JsonPropertyName("method")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeMethod? Method { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(NormalizeAggregation normalizeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Normalize(normalizeAggregation); +} + +public sealed partial class NormalizeAggregationDescriptor : SerializableDescriptor +{ + internal NormalizeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public NormalizeAggregationDescriptor() : 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeMethod? MethodValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public NormalizeAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public NormalizeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public NormalizeAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public NormalizeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The specific method to apply. + /// + public NormalizeAggregationDescriptor Method(Elastic.Clients.Elasticsearch.Serverless.Aggregations.NormalizeMethod? method) + { + MethodValue = method; + return Self; + } + + public NormalizeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 index a65e02b96d5..146a25b6366 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class ParentAggregateConverter : JsonConverter { - public override ParentAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ParentAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ParentAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ParentAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ParentAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ParentAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ParentAggregateConverter))] +public sealed partial class ParentAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 2e1f7a447ca..1043b93f1b6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ParentAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ParentAggregationConverter : JsonConverter +public sealed partial class ParentAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The child type that should be selected. /// + [JsonInclude, JsonPropertyName("type")] 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ParentAggregation parentAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Parent(parentAggregation); } public sealed partial class ParentAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ 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? NameValue { 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) + public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ParentAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public ParentAggregationDescriptor Type(string? type) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(TypeValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); 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 index 068983056fd..0e51bc998df 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs @@ -41,5 +41,7 @@ public PercentageScoreHeuristicDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ 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 index 88a702fe9ec..a69d8aeda42 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs @@ -27,216 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class PercentileRanksAggregationConverter : JsonConverter +public sealed partial class PercentileRanksAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. /// + [JsonInclude, JsonPropertyName("hdr")] 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 value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Sets parameters for the default TDigest algorithm used to calculate percentile ranks. /// + [JsonInclude, JsonPropertyName("tdigest")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigest { get; set; } /// /// An array of values for which to calculate the percentile ranks. /// + [JsonInclude, JsonPropertyName("values")] public ICollection? Values { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(PercentileRanksAggregation percentileRanksAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.PercentileRanks(percentileRanksAggregation); } public sealed partial class PercentileRanksAggregationDescriptor : SerializableDescriptor> @@ -250,28 +77,42 @@ 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.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } private ICollection? ValuesValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public PercentileRanksAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PercentileRanksAggregationDescriptor Format(string? format) { FormatValue = format; @@ -289,7 +130,7 @@ public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elast return Self; } - public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -297,7 +138,7 @@ public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor d return Self; } - public PercentileRanksAggregationDescriptor Hdr(Action configure) + public PercentileRanksAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -305,13 +146,10 @@ public PercentileRanksAggregationDescriptor Hdr(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentileRanksAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -334,7 +172,7 @@ public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.E return Self; } - public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -342,7 +180,7 @@ public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor return Self; } - public PercentileRanksAggregationDescriptor TDigest(Action configure) + public PercentileRanksAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -361,8 +199,6 @@ public PercentileRanksAggregationDescriptor Values(ICollection HdrDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } private ICollection? ValuesValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -493,7 +330,7 @@ public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Se return Self; } - public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -501,7 +338,7 @@ public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) return Self; } - public PercentileRanksAggregationDescriptor Hdr(Action configure) + public PercentileRanksAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -509,13 +346,10 @@ public PercentileRanksAggregationDescriptor Hdr(Action conf return Self; } - public PercentileRanksAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentileRanksAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -538,7 +372,7 @@ public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearc return Self; } - public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -546,7 +380,7 @@ public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor return Self; } - public PercentileRanksAggregationDescriptor TDigest(Action configure) + public PercentileRanksAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -565,8 +399,6 @@ public PercentileRanksAggregationDescriptor Values(ICollection? values) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentile_ranks"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -588,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HdrDescriptorAction is not null) { writer.WritePropertyName("hdr"); - JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor(HdrDescriptorAction), options); } else if (HdrValue is not null) { @@ -616,7 +448,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TDigestDescriptorAction is not null) { writer.WritePropertyName("tdigest"); - JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor(TDigestDescriptorAction), options); } else if (TDigestValue is not null) { @@ -630,13 +462,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index bbba65e6980..e38861b6f11 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/Percentiles.g.cs @@ -30,13 +30,13 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -public sealed partial class Percentiles : Union, IReadOnlyCollection> +public sealed partial class Percentiles : Union, IReadOnlyCollection> { - public Percentiles(IReadOnlyDictionary dictionary) : base(dictionary) + public Percentiles(IReadOnlyDictionary Keyed) : base(Keyed) { } - public Percentiles(IReadOnlyCollection collection) : base(collection) + public Percentiles(IReadOnlyCollection Array) : base(Array) { } } \ 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 index 813927cecbe..4dc92dacc75 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesAggregation.g.cs @@ -27,216 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class PercentilesAggregationConverter : JsonConverter +public sealed partial class PercentilesAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. /// + [JsonInclude, JsonPropertyName("hdr")] 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 value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } /// /// The percentiles to calculate. /// + [JsonInclude, JsonPropertyName("percents")] public ICollection? Percents { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Sets parameters for the default TDigest algorithm used to calculate percentiles. /// + [JsonInclude, JsonPropertyName("tdigest")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigest? TDigest { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(PercentilesAggregation percentilesAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Percentiles(percentilesAggregation); } public sealed partial class PercentilesAggregationDescriptor : SerializableDescriptor> @@ -250,28 +77,42 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public PercentilesAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PercentilesAggregationDescriptor Format(string? format) { FormatValue = format; @@ -289,7 +130,7 @@ public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticse return Self; } - public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -297,7 +138,7 @@ public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descr return Self; } - public PercentilesAggregationDescriptor Hdr(Action configure) + public PercentilesAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -305,13 +146,10 @@ public PercentilesAggregationDescriptor Hdr(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentilesAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentilesAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -343,7 +181,7 @@ public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elast return Self; } - public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -351,7 +189,7 @@ public PercentilesAggregationDescriptor TDigest(TDigestDescriptor des return Self; } - public PercentilesAggregationDescriptor TDigest(Action configure) + public PercentilesAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -361,8 +199,6 @@ public PercentilesAggregationDescriptor TDigest(Action HdrDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -493,7 +330,7 @@ public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Server return Self; } - public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -501,7 +338,7 @@ public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) return Self; } - public PercentilesAggregationDescriptor Hdr(Action configure) + public PercentilesAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -509,13 +346,10 @@ public PercentilesAggregationDescriptor Hdr(Action configur return Self; } - public PercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentilesAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentilesAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -547,7 +381,7 @@ public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Se return Self; } - public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -555,7 +389,7 @@ public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) return Self; } - public PercentilesAggregationDescriptor TDigest(Action configure) + public PercentilesAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -565,8 +399,6 @@ public PercentilesAggregationDescriptor TDigest(Action config protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentiles"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -588,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HdrDescriptorAction is not null) { writer.WritePropertyName("hdr"); - JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.HdrMethodDescriptor(HdrDescriptorAction), options); } else if (HdrValue is not null) { @@ -622,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TDigestDescriptorAction is not null) { writer.WritePropertyName("tdigest"); - JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TDigestDescriptor(TDigestDescriptorAction), options); } else if (TDigestValue is not null) { @@ -630,13 +462,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/PercentilesBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs index 2a4d8ab1667..55dd4b86aeb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs @@ -27,150 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class PercentilesBucketAggregationConverter : JsonConverter +public sealed partial class PercentilesBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The list of percentiles to calculate. /// + [JsonInclude, JsonPropertyName("percents")] public ICollection? Percents { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(PercentilesBucketAggregation percentilesBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.PercentilesBucket(percentilesBucketAggregation); } public sealed partial class PercentilesBucketAggregationDescriptor : SerializableDescriptor @@ -185,20 +72,30 @@ public PercentilesBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private ICollection? PercentsValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public PercentilesBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public PercentilesBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public PercentilesBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -211,6 +108,12 @@ public PercentilesBucketAggregationDescriptor Meta(Func /// The list of percentiles to calculate. ///
@@ -222,8 +125,6 @@ public PercentilesBucketAggregationDescriptor Percents(ICollection? perc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentiles_bucket"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -243,19 +144,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PercentsValue is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, PercentsValue, options); + } + writer.WriteEndObject(); } } \ 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 index 673162d0a8c..23094bcfc16 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeAggregation.g.cs @@ -27,195 +27,35 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class RangeAggregationConverter : JsonConverter +public sealed partial class RangeAggregation { - 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. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public int? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// An array of ranges used to bucket documents. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(RangeAggregation rangeAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Range(rangeAggregation); } public sealed partial class RangeAggregationDescriptor : SerializableDescriptor> @@ -226,47 +66,30 @@ 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 string? NameValue { 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.Aggregations.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) + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are use to build ranges. /// - public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + public RangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -275,7 +98,7 @@ public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch /// /// The date field whose values are use to build ranges. /// - public RangeAggregationDescriptor Field(Expression> field) + public RangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -302,6 +125,12 @@ public RangeAggregationDescriptor Missing(int? missing) return Self; } + public RangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// An array of ranges used to bucket documents. /// @@ -314,7 +143,7 @@ public RangeAggregationDescriptor Ranges(ICollection Ranges(AggregationRangeDescriptor descriptor) + public RangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -323,7 +152,7 @@ public RangeAggregationDescriptor Ranges(AggregationRangeDescriptor d return Self; } - public RangeAggregationDescriptor Ranges(Action configure) + public RangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -332,7 +161,7 @@ public RangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public RangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -349,8 +178,6 @@ public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -364,12 +191,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue.HasValue) { writer.WritePropertyName("missing"); writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -381,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -390,7 +229,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -407,29 +246,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -442,43 +258,17 @@ 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 string? NameValue { 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.Aggregations.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. /// @@ -527,6 +317,12 @@ public RangeAggregationDescriptor Missing(int? missing) return Self; } + public RangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// An array of ranges used to bucket documents. /// @@ -539,7 +335,7 @@ public RangeAggregationDescriptor Ranges(ICollection configure) + public RangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -557,7 +353,7 @@ public RangeAggregationDescriptor Ranges(Action conf return Self; } - public RangeAggregationDescriptor Ranges(params Action[] configure) + public RangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -574,8 +370,6 @@ public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverles protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -589,12 +383,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue.HasValue) { writer.WritePropertyName("missing"); writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -606,7 +412,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -615,7 +421,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -632,29 +438,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index b987f36dc06..04d805ebe29 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RangeBucket.g.cs @@ -27,99 +27,95 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -[JsonConverter(typeof(RangeBucketConverter))] -public sealed partial class RangeBucket : AggregateDictionary +internal sealed partial class RangeBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double? from = default; string? fromAsString = default; string? key = default; double? to = default; string? toAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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("#")) + if (reader.TokenType == JsonTokenType.PropertyName) { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from_as_string") + { + fromAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to_as_string") + { + toAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); } - - throw new JsonException("Unknown property read from JSON."); } - return new RangeBucket(subAggs) { DocCount = docCount, From = from, FromAsString = fromAsString, Key = key, To = to, ToAsString = toAsString }; + return new RangeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), 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(); + public override void Write(Utf8JsonWriter writer, RangeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'RangeBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(RangeBucketConverter))] +public sealed partial class RangeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double? From { get; init; } + public string? FromAsString { get; init; } + + /// + /// The bucket key. Present if the aggregation is _not_ keyed + /// + public string? Key { get; init; } + public double? To { get; init; } + public string? ToAsString { get; init; } } \ 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 index 4d17762441f..5735abfd3cb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RareTermsAggregation.g.cs @@ -27,245 +27,51 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class RareTermsAggregationConverter : JsonConverter +public sealed partial class RareTermsAggregation { - 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. /// + [JsonInclude, JsonPropertyName("exclude")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } /// /// The field from which to return rare terms. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } /// /// Terms that should be included in the aggregation. /// + [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } /// /// The maximum number of documents a term should appear in. /// + [JsonInclude, JsonPropertyName("max_doc_count")] public long? MaxDocCount { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
+ [JsonInclude, JsonPropertyName("precision")] public double? Precision { get; set; } + [JsonInclude, JsonPropertyName("value_type")] public string? ValueType { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(RareTermsAggregation rareTermsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.RareTerms(rareTermsAggregation); } public sealed partial class RareTermsAggregationDescriptor : SerializableDescriptor> @@ -276,42 +82,16 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { 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. /// @@ -339,6 +119,15 @@ public RareTermsAggregationDescriptor Field(Expression + /// 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. /// @@ -366,12 +155,18 @@ public RareTermsAggregationDescriptor Meta(Func /// 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) + public RareTermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public RareTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
@@ -389,8 +184,6 @@ public RareTermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rare_terms"); writer.WriteStartObject(); if (ExcludeValue is not null) { @@ -416,12 +209,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MaxDocCountValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -434,29 +239,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -469,42 +251,16 @@ 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } + private string? NameValue { 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. /// @@ -568,12 +324,18 @@ public RareTermsAggregationDescriptor Meta(Func /// /// 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) + public RareTermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; } + public RareTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
@@ -591,8 +353,6 @@ public RareTermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rare_terms"); writer.WriteStartObject(); if (ExcludeValue is not null) { @@ -618,12 +378,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MaxDocCountValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -636,29 +408,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/RateAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs index 3f8b8082e45..4b5297eb2f6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/RateAggregation.g.cs @@ -27,193 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class RateAggregationConverter : JsonConverter +public sealed partial class RateAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } /// /// How the rate is calculated. /// + [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.RateMode? Mode { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("script")] 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.
///
+ [JsonInclude, JsonPropertyName("unit")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.CalendarInterval? Unit { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(RateAggregation rateAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Rate(rateAggregation); } public sealed partial class RateAggregationDescriptor : SerializableDescriptor> @@ -226,37 +70,48 @@ 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.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; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public RateAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public RateAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) + public RateAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public RateAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RateAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -288,8 +143,6 @@ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.S protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rate"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -327,13 +180,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UnitValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -348,24 +194,32 @@ 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.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; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -378,13 +232,10 @@ public RateAggregationDescriptor Format(string? format) return Self; } - public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public RateAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RateAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -416,8 +267,6 @@ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.A protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rate"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -455,13 +304,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index ecfc8cdd211..0bc30043dba 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs @@ -27,59 +27,59 @@ 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 +internal sealed partial class ReverseNestedAggregateConverter : JsonConverter { - public override ReverseNestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ReverseNestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ReverseNestedAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ReverseNestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ReverseNestedAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ReverseNestedAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ReverseNestedAggregateConverter))] +public sealed partial class ReverseNestedAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index 3379ae55ced..bec8b6bd201 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs @@ -27,111 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ReverseNestedAggregationConverter : JsonConverter +public sealed partial class ReverseNestedAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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.
///
+ [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ReverseNestedAggregation reverseNestedAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.ReverseNested(reverseNestedAggregation); } public sealed partial class ReverseNestedAggregationDescriptor : SerializableDescriptor> @@ -142,46 +51,35 @@ 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 string? NameValue { 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) + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ReverseNestedAggregationDescriptor Aggregations(Action> configure) + public ReverseNestedAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + NameValue = name; return Self; } - public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// 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) { - MetaValue = selector?.Invoke(new FluentDictionary()); + 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(Elastic.Clients.Elasticsearch.Serverless.Field? path) + public ReverseNestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -190,7 +88,7 @@ public ReverseNestedAggregationDescriptor Path(Elastic.Clients.Elasti /// /// 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) + public ReverseNestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -199,35 +97,22 @@ public ReverseNestedAggregationDescriptor Path(Expression(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (PathValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); } writer.WriteEndObject(); @@ -242,39 +127,19 @@ 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 string? NameValue { 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) + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ReverseNestedAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -308,35 +173,22 @@ public ReverseNestedAggregationDescriptor Path(Expression 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 +internal sealed partial class SamplerAggregateConverter : JsonConverter { - public override SamplerAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new SamplerAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new SamplerAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, SamplerAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, SamplerAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SamplerAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SamplerAggregateConverter))] +public sealed partial class SamplerAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ 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 index de2e22c80fa..b7bdb5fe135 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SamplerAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class SamplerAggregationConverter : JsonConverter +public sealed partial class SamplerAggregation { - 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Limits how many top-scoring documents are collected in the sample processed on each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SamplerAggregation samplerAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Sampler(samplerAggregation); } public sealed partial class SamplerAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ 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 string? NameValue { 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) + public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public SamplerAggregationDescriptor Aggregations(Action configure) + public SamplerAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } - - public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public SamplerAggregationDescriptor ShardSize(int? shardSize) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsValue is not null) + + if (ShardSizeValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); } writer.WriteEndObject(); 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 index a749aff76cb..c3f87224370 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs @@ -27,242 +27,53 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ScriptedMetricAggregationConverter : JsonConverter +public sealed partial class ScriptedMetricAggregation { - 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.
///
+ [JsonInclude, JsonPropertyName("combine_script")] public Elastic.Clients.Elasticsearch.Serverless.Script? CombineScript { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] 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.
///
+ [JsonInclude, JsonPropertyName("init_script")] 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.
///
+ [JsonInclude, JsonPropertyName("map_script")] 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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } /// /// A global object with script parameters for `init`, `map` and `combine` scripts.
It is shared between the scripts.
///
+ [JsonInclude, JsonPropertyName("params")] 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.
///
+ [JsonInclude, JsonPropertyName("reduce_script")] public Elastic.Clients.Elasticsearch.Serverless.Script? ReduceScript { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ScriptedMetricAggregation scriptedMetricAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.ScriptedMetric(scriptedMetricAggregation); } public sealed partial class ScriptedMetricAggregationDescriptor : SerializableDescriptor> @@ -277,8 +88,7 @@ public ScriptedMetricAggregationDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -292,18 +102,33 @@ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clie return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + 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.
///
@@ -322,13 +147,10 @@ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients. return Self; } - public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ScriptedMetricAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -360,8 +182,6 @@ public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Ela protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("scripted_metric"); writer.WriteStartObject(); if (CombineScriptValue is not null) { @@ -411,13 +231,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -434,8 +247,7 @@ public ScriptedMetricAggregationDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -449,18 +261,27 @@ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clients.Elastic return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -485,13 +306,10 @@ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients.Elasticsear return Self; } - public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ScriptedMetricAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -523,8 +341,6 @@ public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("scripted_metric"); writer.WriteStartObject(); if (CombineScriptValue is not null) { @@ -574,13 +390,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/SerialDifferencingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs new file mode 100644 index 00000000000..8e4679391cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SerialDifferencingAggregation.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.Aggregations; + +public sealed partial class SerialDifferencingAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + + /// + /// The historical bucket to subtract from the current value.
Must be a positive, non-zero integer.
+ ///
+ [JsonInclude, JsonPropertyName("lag")] + public int? Lag { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SerialDifferencingAggregation serialDifferencingAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.SerialDiff(serialDifferencingAggregation); +} + +public sealed partial class SerialDifferencingAggregationDescriptor : SerializableDescriptor +{ + internal SerialDifferencingAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SerialDifferencingAggregationDescriptor() : 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 int? LagValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public SerialDifferencingAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public SerialDifferencingAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public SerialDifferencingAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + /// + /// The historical bucket to subtract from the current value.
Must be a positive, non-zero integer.
+ ///
+ public SerialDifferencingAggregationDescriptor Lag(int? lag) + { + LagValue = lag; + return Self; + } + + public SerialDifferencingAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SerialDifferencingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (LagValue.HasValue) + { + writer.WritePropertyName("lag"); + writer.WriteNumberValue(LagValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs new file mode 100644 index 00000000000..682a7e49a9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsAggregate.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 SignificantLongTermsAggregate : 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/SignificantLongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs new file mode 100644 index 00000000000..8dc978ac649 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantLongTermsBucket.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.Aggregations; + +internal sealed partial class SignificantLongTermsBucketConverter : JsonConverter +{ + public override SignificantLongTermsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long bgCount = default; + long docCount = default; + long key = default; + string? keyAsString = default; + double score = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "bg_count") + { + bgCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "score") + { + score = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new SignificantLongTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), BgCount = bgCount, DocCount = docCount, Key = key, KeyAsString = keyAsString, Score = score }; + } + + public override void Write(Utf8JsonWriter writer, SignificantLongTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SignificantLongTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SignificantLongTermsBucketConverter))] +public sealed partial class SignificantLongTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long BgCount { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { get; init; } + public double Score { 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 index 7aad22a98e3..063f37d37d3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs @@ -27,77 +27,75 @@ 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 +internal sealed partial class SignificantStringTermsBucketConverter : JsonConverter { - public override SignificantStringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long bgCount = default; long docCount = default; string key = default; double score = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - bgCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "bg_count") + { + bgCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count", StringComparison.Ordinal)) - { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("score", StringComparison.Ordinal)) - { - score = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "score") + { + score = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new SignificantStringTermsBucket(subAggs) { BgCount = bgCount, DocCount = docCount, Key = key, Score = score }; + return new SignificantStringTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), BgCount = bgCount, DocCount = docCount, Key = key, Score = score }; } - public override void Write(Utf8JsonWriter writer, SignificantStringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, SignificantStringTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SignificantStringTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SignificantStringTermsBucketConverter))] +public sealed partial class SignificantStringTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long BgCount { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } + public double Score { get; init; } } \ 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 index f638dd79efb..819b490dd5e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs @@ -27,433 +27,103 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class SignificantTermsAggregationConverter : JsonConverter +public sealed partial class SignificantTermsAggregation { - 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. /// + [JsonInclude, JsonPropertyName("background_filter")] 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. /// + [JsonInclude, JsonPropertyName("chi_square")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquare { get; set; } /// /// Terms to exclude. /// + [JsonInclude, JsonPropertyName("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. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field from which to return significant terms. /// + [JsonInclude, JsonPropertyName("field")] 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. /// + [JsonInclude, JsonPropertyName("gnd")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? Gnd { get; set; } /// /// Terms to include. /// + [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } /// /// Use JLH score as the significance score. /// + [JsonInclude, JsonPropertyName("jlh")] public Elastic.Clients.Elasticsearch.Serverless.EmptyObject? Jlh { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Only return terms that are found in more than `min_doc_count` hits. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } /// /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. /// + [JsonInclude, JsonPropertyName("mutual_information")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? MutualInformation { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. /// + [JsonInclude, JsonPropertyName("percentage")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? Percentage { get; set; } /// /// Customized score, implemented via a script. /// + [JsonInclude, JsonPropertyName("script_heuristic")] 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`.
///
+ [JsonInclude, JsonPropertyName("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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The number of buckets returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SignificantTermsAggregation significantTermsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.SignificantTerms(significantTermsAggregation); } public sealed partial class SignificantTermsAggregationDescriptor : SerializableDescriptor> @@ -464,64 +134,38 @@ 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.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.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.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 Elastic.Clients.Elasticsearch.Serverless.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.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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. /// @@ -533,7 +177,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { BackgroundFilterValue = null; BackgroundFilterDescriptorAction = null; @@ -541,7 +185,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDs return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(Action> configure) + public SignificantTermsAggregationDescriptor BackgroundFilter(Action> configure) { BackgroundFilterValue = null; BackgroundFilterDescriptor = null; @@ -560,7 +204,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Client return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor descriptor) { ChiSquareValue = null; ChiSquareDescriptorAction = null; @@ -568,7 +212,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuri return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) { ChiSquareValue = null; ChiSquareDescriptor = null; @@ -612,6 +256,15 @@ public SignificantTermsAggregationDescriptor Field(Expression 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. /// @@ -623,7 +276,7 @@ public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elas return Self; } - public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) { GndValue = null; GndDescriptorAction = null; @@ -631,7 +284,7 @@ public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDist return Self; } - public SignificantTermsAggregationDescriptor Gnd(Action configure) + public SignificantTermsAggregationDescriptor Gnd(Action configure) { GndValue = null; GndDescriptor = null; @@ -659,7 +312,7 @@ public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elas return Self; } - public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor descriptor) { JlhValue = null; JlhDescriptorAction = null; @@ -667,7 +320,7 @@ public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescripto return Self; } - public SignificantTermsAggregationDescriptor Jlh(Action configure) + public SignificantTermsAggregationDescriptor Jlh(Action configure) { JlhValue = null; JlhDescriptor = null; @@ -701,7 +354,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Elasti return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor descriptor) { MutualInformationValue = null; MutualInformationDescriptorAction = null; @@ -709,7 +362,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Mutual return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) { MutualInformationValue = null; MutualInformationDescriptor = null; @@ -717,6 +370,12 @@ public SignificantTermsAggregationDescriptor MutualInformation(Action return Self; } + public SignificantTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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. /// @@ -728,7 +387,7 @@ public SignificantTermsAggregationDescriptor Percentage(Elastic.Clien return Self; } - public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor descriptor) { PercentageValue = null; PercentageDescriptorAction = null; @@ -736,7 +395,7 @@ public SignificantTermsAggregationDescriptor Percentage(PercentageSco return Self; } - public SignificantTermsAggregationDescriptor Percentage(Action configure) + public SignificantTermsAggregationDescriptor Percentage(Action configure) { PercentageValue = null; PercentageDescriptor = null; @@ -755,7 +414,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic. return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor descriptor) { ScriptHeuristicValue = null; ScriptHeuristicDescriptorAction = null; @@ -763,7 +422,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Scripted return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) { ScriptHeuristicValue = null; ScriptHeuristicDescriptor = null; @@ -800,8 +459,6 @@ public SignificantTermsAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("significant_terms"); writer.WriteStartObject(); if (BackgroundFilterDescriptor is not null) { @@ -811,7 +468,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BackgroundFilterDescriptorAction is not null) { writer.WritePropertyName("background_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); } else if (BackgroundFilterValue is not null) { @@ -827,7 +484,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ChiSquareDescriptorAction is not null) { writer.WritePropertyName("chi_square"); - JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); } else if (ChiSquareValue is not null) { @@ -861,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GndDescriptorAction is not null) { writer.WritePropertyName("gnd"); - JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); } else if (GndValue is not null) { @@ -883,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (JlhDescriptorAction is not null) { writer.WritePropertyName("jlh"); - JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor(JlhDescriptorAction), options); } else if (JlhValue is not null) { @@ -891,6 +548,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, JlhValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -905,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MutualInformationDescriptorAction is not null) { writer.WritePropertyName("mutual_information"); - JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); } else if (MutualInformationValue is not null) { @@ -913,6 +576,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MutualInformationValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PercentageDescriptor is not null) { writer.WritePropertyName("percentage"); @@ -921,7 +590,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PercentageDescriptorAction is not null) { writer.WritePropertyName("percentage"); - JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); } else if (PercentageValue is not null) { @@ -937,7 +606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptHeuristicDescriptorAction is not null) { writer.WritePropertyName("script_heuristic"); - JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); } else if (ScriptHeuristicValue is not null) { @@ -963,29 +632,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -998,64 +644,38 @@ 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.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.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.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 Elastic.Clients.Elasticsearch.Serverless.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.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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. /// @@ -1067,7 +687,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.El return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { BackgroundFilterValue = null; BackgroundFilterDescriptorAction = null; @@ -1075,7 +695,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDesc return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(Action configure) + public SignificantTermsAggregationDescriptor BackgroundFilter(Action configure) { BackgroundFilterValue = null; BackgroundFilterDescriptor = null; @@ -1094,7 +714,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticse return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor descriptor) { ChiSquareValue = null; ChiSquareDescriptorAction = null; @@ -1102,7 +722,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescrip return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) { ChiSquareValue = null; ChiSquareDescriptor = null; @@ -1166,7 +786,7 @@ public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.S return Self; } - public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) { GndValue = null; GndDescriptorAction = null; @@ -1174,7 +794,7 @@ public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeurist return Self; } - public SignificantTermsAggregationDescriptor Gnd(Action configure) + public SignificantTermsAggregationDescriptor Gnd(Action configure) { GndValue = null; GndDescriptor = null; @@ -1202,7 +822,7 @@ public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.S return Self; } - public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor descriptor) { JlhValue = null; JlhDescriptorAction = null; @@ -1210,7 +830,7 @@ public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descripto return Self; } - public SignificantTermsAggregationDescriptor Jlh(Action configure) + public SignificantTermsAggregationDescriptor Jlh(Action configure) { JlhValue = null; JlhDescriptor = null; @@ -1244,7 +864,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.E return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor descriptor) { MutualInformationValue = null; MutualInformationDescriptorAction = null; @@ -1252,7 +872,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(MutualInformation return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) { MutualInformationValue = null; MutualInformationDescriptor = null; @@ -1260,6 +880,12 @@ public SignificantTermsAggregationDescriptor MutualInformation(Action /// 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. /// @@ -1271,7 +897,7 @@ public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elastics return Self; } - public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor descriptor) { PercentageValue = null; PercentageDescriptorAction = null; @@ -1279,7 +905,7 @@ public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristic return Self; } - public SignificantTermsAggregationDescriptor Percentage(Action configure) + public SignificantTermsAggregationDescriptor Percentage(Action configure) { PercentageValue = null; PercentageDescriptor = null; @@ -1298,7 +924,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Ela return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor descriptor) { ScriptHeuristicValue = null; ScriptHeuristicDescriptorAction = null; @@ -1306,7 +932,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDe return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) { ScriptHeuristicValue = null; ScriptHeuristicDescriptor = null; @@ -1343,8 +969,6 @@ public SignificantTermsAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("significant_terms"); writer.WriteStartObject(); if (BackgroundFilterDescriptor is not null) { @@ -1354,7 +978,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BackgroundFilterDescriptorAction is not null) { writer.WritePropertyName("background_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); } else if (BackgroundFilterValue is not null) { @@ -1370,7 +994,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ChiSquareDescriptorAction is not null) { writer.WritePropertyName("chi_square"); - JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); } else if (ChiSquareValue is not null) { @@ -1404,7 +1028,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GndDescriptorAction is not null) { writer.WritePropertyName("gnd"); - JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); } else if (GndValue is not null) { @@ -1426,7 +1050,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (JlhDescriptorAction is not null) { writer.WritePropertyName("jlh"); - JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor(JlhDescriptorAction), options); } else if (JlhValue is not null) { @@ -1434,6 +1058,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, JlhValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -1448,7 +1078,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MutualInformationDescriptorAction is not null) { writer.WritePropertyName("mutual_information"); - JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); } else if (MutualInformationValue is not null) { @@ -1456,6 +1086,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MutualInformationValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PercentageDescriptor is not null) { writer.WritePropertyName("percentage"); @@ -1464,7 +1100,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PercentageDescriptorAction is not null) { writer.WritePropertyName("percentage"); - JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); } else if (PercentageValue is not null) { @@ -1480,7 +1116,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptHeuristicDescriptorAction is not null) { writer.WritePropertyName("script_heuristic"); - JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); } else if (ScriptHeuristicValue is not null) { @@ -1506,29 +1142,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/SignificantTextAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs new file mode 100644 index 00000000000..01662e97bf2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs @@ -0,0 +1,1223 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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 SignificantTextAggregation +{ + /// + /// A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index. + /// + [JsonInclude, JsonPropertyName("background_filter")] + 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. + /// + [JsonInclude, JsonPropertyName("chi_square")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquare { get; set; } + + /// + /// Values to exclude. + /// + [JsonInclude, JsonPropertyName("exclude")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + [JsonInclude, JsonPropertyName("execution_hint")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } + + /// + /// The field from which to return significant text. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + [JsonInclude, JsonPropertyName("filter_duplicate_text")] + public bool? FilterDuplicateText { get; set; } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + [JsonInclude, JsonPropertyName("gnd")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? Gnd { get; set; } + + /// + /// Values to include. + /// + [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } + + /// + /// Use JLH score as the significance score. + /// + [JsonInclude, JsonPropertyName("jlh")] + public Elastic.Clients.Elasticsearch.Serverless.EmptyObject? Jlh { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + /// + /// Only return values that are found in more than `min_doc_count` hits. + /// + [JsonInclude, JsonPropertyName("min_doc_count")] + public long? MinDocCount { get; set; } + + /// + /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. + /// + [JsonInclude, JsonPropertyName("mutual_information")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? MutualInformation { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. + /// + [JsonInclude, JsonPropertyName("percentage")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? Percentage { get; set; } + + /// + /// Customized score, implemented via a script. + /// + [JsonInclude, JsonPropertyName("script_heuristic")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristic { get; set; } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ [JsonInclude, JsonPropertyName("shard_min_doc_count")] + 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.
+ ///
+ [JsonInclude, JsonPropertyName("shard_size")] + public int? ShardSize { get; set; } + + /// + /// The number of buckets returned out of the overall terms list. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + [JsonInclude, JsonPropertyName("source_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFields { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SignificantTextAggregation significantTextAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.SignificantText(significantTextAggregation); +} + +public sealed partial class SignificantTextAggregationDescriptor : SerializableDescriptor> +{ + internal SignificantTextAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public SignificantTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? BackgroundFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action> BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 bool? FilterDuplicateTextValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFieldsValue { 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 SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Values to exclude. + /// + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + public SignificantTextAggregationDescriptor FilterDuplicateText(bool? filterDuplicateText = true) + { + FilterDuplicateTextValue = filterDuplicateText; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Values to include. + /// + public SignificantTextAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor Name(string? name) + { + NameValue = name; + 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 SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + public SignificantTextAggregationDescriptor SourceFields(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceFields) + { + SourceFieldsValue = sourceFields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 (FilterDuplicateTextValue.HasValue) + { + writer.WritePropertyName("filter_duplicate_text"); + writer.WriteBooleanValue(FilterDuplicateTextValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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); + } + + if (SourceFieldsValue is not null) + { + writer.WritePropertyName("source_fields"); + JsonSerializer.Serialize(writer, SourceFieldsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SignificantTextAggregationDescriptor : SerializableDescriptor +{ + internal SignificantTextAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SignificantTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? BackgroundFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 bool? FilterDuplicateTextValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFieldsValue { 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 SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Values to exclude. + /// + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + public SignificantTextAggregationDescriptor FilterDuplicateText(bool? filterDuplicateText = true) + { + FilterDuplicateTextValue = filterDuplicateText; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Values to include. + /// + public SignificantTextAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor Name(string? name) + { + NameValue = name; + 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 SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Serverless.Aggregations.PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Serverless.Aggregations.ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + public SignificantTextAggregationDescriptor SourceFields(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceFields) + { + SourceFieldsValue = sourceFields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 (FilterDuplicateTextValue.HasValue) + { + writer.WritePropertyName("filter_duplicate_text"); + writer.WriteBooleanValue(FilterDuplicateTextValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.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); + } + + if (SourceFieldsValue is not null) + { + writer.WritePropertyName("source_fields"); + JsonSerializer.Serialize(writer, SourceFieldsValue, 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 index 3746c1be2cf..767adb9f317 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class SimpleValueAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index c8dbb72039a..abfe4490480 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class StatsAggregationConverter : JsonConverter +public sealed partial class StatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(StatsAggregation statsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Stats(statsAggregation); } public sealed partial class StatsAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public StatsAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public StatsAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + public StatsAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public StatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public StatsAggregationDescriptor Format(string? format) return Self; } - public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public StatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverles protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/StatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs index 9c69494b754..b46fa067e4e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class StatsBucketAggregationConverter : JsonConverter +public sealed partial class StatsBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(StatsBucketAggregation statsBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.StatsBucket(statsBucketAggregation); } public sealed partial class StatsBucketAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public StatsBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public StatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public StatsBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public StatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public StatsBucketAggregationDescriptor Meta(Func 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 +internal sealed partial class StringRareTermsBucketConverter : JsonConverter { - public override StringRareTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new StringRareTermsBucket(subAggs) { DocCount = docCount, Key = key }; + return new StringRareTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, StringRareTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, StringRareTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'StringRareTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StringRareTermsBucketConverter))] +public sealed partial class StringRareTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { 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 index d17fcd718b8..80756f17dd4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringStatsAggregation.g.cs @@ -27,151 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class StringStatsAggregationConverter : JsonConverter +public sealed partial class StringStatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Shows the probability distribution for all characters. /// + [JsonInclude, JsonPropertyName("show_distribution")] public bool? ShowDistribution { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(StringStatsAggregation stringStatsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.StringStats(stringStatsAggregation); } public sealed partial class StringStatsAggregationDescriptor : SerializableDescriptor> @@ -183,30 +61,41 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public StringStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public StringStatsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public StringStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StringStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -229,8 +118,6 @@ public StringStatsAggregationDescriptor ShowDistribution(bool? showDi protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("string_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -256,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(ShowDistributionValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,36 +156,41 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StringStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -328,8 +213,6 @@ public StringStatsAggregationDescriptor ShowDistribution(bool? showDistribution protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("string_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/StringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs index 52cbe1f7714..bd400cd56d3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/StringTermsBucket.g.cs @@ -27,68 +27,67 @@ 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 +internal sealed partial class StringTermsBucketConverter : JsonConverter { - public override StringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; Elastic.Clients.Elasticsearch.Serverless.FieldValue key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new StringTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key }; + return new StringTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key }; } - public override void Write(Utf8JsonWriter writer, StringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, StringTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'StringTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StringTermsBucketConverter))] +public sealed partial class StringTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.FieldValue Key { get; init; } } \ 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 index abc8dc2f9ac..ae3ff25da92 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class SumAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index 2a181e1b7ae..c9bd6c78de1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class SumAggregationConverter : JsonConverter +public sealed partial class SumAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SumAggregation sumAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Sum(sumAggregation); } public sealed partial class SumAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public SumAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public SumAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) + public SumAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public SumAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public SumAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("sum"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public SumAggregationDescriptor Format(string? format) return Self; } - public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public SumAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public SumAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverless. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("sum"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/SumBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumBucketAggregation.g.cs new file mode 100644 index 00000000000..73ff221853e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/SumBucketAggregation.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.Aggregations; + +public sealed partial class SumBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(SumBucketAggregation sumBucketAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.SumBucket(sumBucketAggregation); +} + +public sealed partial class SumBucketAggregationDescriptor : SerializableDescriptor +{ + internal SumBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SumBucketAggregationDescriptor() : 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 string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public SumBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Serverless.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public SumBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public SumBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public SumBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SumBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ 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 index 1feb96b6aec..a7879d62ef4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TTestAggregation.g.cs @@ -27,138 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class TTestAggregationConverter : JsonConverter +public sealed partial class TTestAggregation { - 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. /// + [JsonInclude, JsonPropertyName("a")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? a { get; set; } /// /// Test population B. /// + [JsonInclude, JsonPropertyName("b")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulation? b { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The type of test. /// + [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? Type { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(TTestAggregation tTestAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.TTest(tTestAggregation); } public sealed partial class TTestAggregationDescriptor : SerializableDescriptor> @@ -170,12 +63,13 @@ 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.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor bDescriptor { get; set; } + private Action> bDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? TypeValue { get; set; } /// @@ -189,7 +83,7 @@ public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Ser return Self; } - public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor descriptor) { aValue = null; aDescriptorAction = null; @@ -197,7 +91,7 @@ public TTestAggregationDescriptor a(TestPopulationDescriptor a(Action> configure) + public TTestAggregationDescriptor a(Action> configure) { aValue = null; aDescriptor = null; @@ -216,7 +110,7 @@ public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Ser return Self; } - public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor descriptor) { bValue = null; bDescriptorAction = null; @@ -224,7 +118,7 @@ public TTestAggregationDescriptor b(TestPopulationDescriptor b(Action> configure) + public TTestAggregationDescriptor b(Action> configure) { bValue = null; bDescriptor = null; @@ -238,6 +132,12 @@ public TTestAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The type of test. /// @@ -249,8 +149,6 @@ public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("t_test"); writer.WriteStartObject(); if (aDescriptor is not null) { @@ -260,7 +158,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (aDescriptorAction is not null) { writer.WritePropertyName("a"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor(aDescriptorAction), options); } else if (aValue is not null) { @@ -276,7 +174,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (bDescriptorAction is not null) { writer.WritePropertyName("b"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor(bDescriptorAction), options); } else if (bValue is not null) { @@ -284,19 +182,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + writer.WriteEndObject(); } } @@ -310,12 +213,13 @@ 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.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 Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor bDescriptor { get; set; } + private Action bDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TTestType? TypeValue { get; set; } /// @@ -329,7 +233,7 @@ public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Serverless.Agg return Self; } - public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor descriptor) { aValue = null; aDescriptorAction = null; @@ -337,7 +241,7 @@ public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) return Self; } - public TTestAggregationDescriptor a(Action configure) + public TTestAggregationDescriptor a(Action configure) { aValue = null; aDescriptor = null; @@ -356,7 +260,7 @@ public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Serverless.Agg return Self; } - public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor descriptor) { bValue = null; bDescriptorAction = null; @@ -364,7 +268,7 @@ public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) return Self; } - public TTestAggregationDescriptor b(Action configure) + public TTestAggregationDescriptor b(Action configure) { bValue = null; bDescriptor = null; @@ -378,6 +282,12 @@ public TTestAggregationDescriptor Meta(Func, Fl return Self; } + public TTestAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The type of test. /// @@ -389,8 +299,6 @@ public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch.Serverless. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("t_test"); writer.WriteStartObject(); if (aDescriptor is not null) { @@ -400,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (aDescriptorAction is not null) { writer.WritePropertyName("a"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor(aDescriptorAction), options); } else if (aValue is not null) { @@ -416,7 +324,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (bDescriptorAction is not null) { writer.WritePropertyName("b"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TestPopulationDescriptor(bDescriptorAction), options); } else if (bValue is not null) { @@ -424,19 +332,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs index 2092928970c..dbe88928bd1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -27,440 +27,95 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class TermsAggregationConverter : JsonConverter +public sealed partial class TermsAggregation { - 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. /// + [JsonInclude, JsonPropertyName("collect_mode")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } /// /// Values to exclude.
Accepts regular expressions and partitions.
///
+ [JsonInclude, JsonPropertyName("exclude")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsExclude? Exclude { get; set; } /// /// Determines whether the aggregation will use field values directly or global ordinals. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field from which to return terms. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Values to include.
Accepts regular expressions and partitions.
///
+ [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.TermsInclude? Include { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Only return values that are found in more than `min_doc_count` hits. /// + [JsonInclude, JsonPropertyName("min_doc_count")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrder { get; set; } - override public string? Name { get; internal set; } - [JsonConverter(typeof(AggregateOrderConverter))] + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
+ [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(KeyValuePair))] public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("script")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] 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. /// + [JsonInclude, JsonPropertyName("show_term_doc_count_error")] public bool? ShowTermDocCountError { get; set; } /// /// The number of buckets returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// Coerced unmapped fields into the specified type. /// + [JsonInclude, JsonPropertyName("value_type")] public string? ValueType { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(TermsAggregation termsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.Terms(termsAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy(TermsAggregation termsAggregation) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.PivotGroupBy.Terms(termsAggregation); } public sealed partial class TermsAggregationDescriptor : SerializableDescriptor> @@ -471,9 +126,6 @@ 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; } @@ -482,9 +134,10 @@ public TermsAggregationDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private string? NameValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } @@ -492,30 +145,6 @@ public TermsAggregationDescriptor() : base() 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. /// @@ -561,6 +190,15 @@ public TermsAggregationDescriptor Field(Expression + /// The field from which to return terms. + ///
+ public TermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermsAggregationDescriptor Format(string? format) { FormatValue = format; @@ -594,7 +232,7 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) /// /// 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) + public TermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -612,6 +250,12 @@ public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasti return Self; } + public TermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
@@ -665,8 +309,6 @@ public TermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("terms"); writer.WriteStartObject(); if (CollectModeValue is not null) { @@ -704,6 +346,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, IncludeValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -728,6 +376,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingOrderValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OrderValue is not null) { writer.WritePropertyName("order"); @@ -764,29 +418,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -799,9 +430,6 @@ 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; } @@ -810,9 +438,10 @@ public TermsAggregationDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private string? NameValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } @@ -820,30 +449,6 @@ public TermsAggregationDescriptor() : base() 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. /// @@ -931,7 +536,7 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) /// /// 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) + public TermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -949,6 +554,12 @@ public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Ser return Self; } + public TermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
@@ -1002,8 +613,6 @@ public TermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("terms"); writer.WriteStartObject(); if (CollectModeValue is not null) { @@ -1041,6 +650,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, IncludeValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -1065,6 +680,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingOrderValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OrderValue is not null) { writer.WritePropertyName("order"); @@ -1101,29 +722,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/TestPopulation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs index 1cc918902fa..6e65d3c4d9f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TestPopulation.g.cs @@ -54,8 +54,8 @@ public TestPopulationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -76,6 +76,15 @@ public TestPopulationDescriptor Field(Expression + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// A filter used to define a set of records to run unpaired t-test on. /// @@ -87,7 +96,7 @@ public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -95,7 +104,7 @@ public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public TestPopulationDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -122,7 +131,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -150,8 +159,8 @@ public TestPopulationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } /// @@ -192,7 +201,7 @@ public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -200,7 +209,7 @@ public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public TestPopulationDescriptor Filter(Action configure) + public TestPopulationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -227,7 +236,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { 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 index 730204e84fb..37e0bdd076f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -27,403 +27,96 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class TopHitsAggregationConverter : JsonConverter +public sealed partial class TopHitsAggregation { - 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. /// + [JsonInclude, JsonPropertyName("docvalue_fields")] public Elastic.Clients.Elasticsearch.Serverless.Fields? DocvalueFields { get; set; } /// /// If `true`, returns detailed information about score computation as part of a hit. /// + [JsonInclude, JsonPropertyName("explain")] public bool? Explain { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } /// /// Starting document offset. /// + [JsonInclude, JsonPropertyName("from")] public int? From { get; set; } /// /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. /// + [JsonInclude, JsonPropertyName("highlight")] 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; } + + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// Returns the result of one or more script evaluations for each hit. /// + [JsonInclude, JsonPropertyName("script_fields")] public IDictionary? ScriptFields { 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; } /// /// The maximum number of top matching hits to return per bucket. /// + [JsonInclude, JsonPropertyName("size")] 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.
///
+ [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] public ICollection? Sort { get; set; } + /// + /// Selects the fields of the source that are returned. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + /// /// Returns values for the specified stored fields (fields that use the `store` mapping option). /// + [JsonInclude, JsonPropertyName("stored_fields")] 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. /// + [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; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(TopHitsAggregation topHitsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.TopHits(topHitsAggregation); } public sealed partial class TopHitsAggregationDescriptor : SerializableDescriptor> @@ -439,18 +132,17 @@ public TopHitsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } private int? FromValue { 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 IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.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? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } @@ -474,18 +166,33 @@ public TopHitsAggregationDescriptor Explain(bool? explain = true) return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public TopHitsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Starting document offset. /// @@ -506,7 +213,7 @@ public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elastic return Self; } - public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -514,7 +221,7 @@ public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDe return Self; } - public TopHitsAggregationDescriptor Highlight(Action> configure) + public TopHitsAggregationDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -522,13 +229,10 @@ public TopHitsAggregationDescriptor Highlight(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public TopHitsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopHitsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -543,9 +247,9 @@ public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsea /// /// Returns the result of one or more script evaluations for each hit. /// - public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -579,7 +283,7 @@ public TopHitsAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public TopHitsAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -588,7 +292,7 @@ public TopHitsAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public TopHitsAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -597,7 +301,7 @@ public TopHitsAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public TopHitsAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -644,8 +348,6 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_hits"); writer.WriteStartObject(); if (DocvalueFieldsValue is not null) { @@ -679,7 +381,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -725,7 +427,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -734,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -770,13 +472,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(VersionValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -794,18 +489,17 @@ public TopHitsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } private int? FromValue { 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 IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.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? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } @@ -829,18 +523,27 @@ public TopHitsAggregationDescriptor Explain(bool? explain = true) return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -867,7 +570,7 @@ public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Serv return Self; } - public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -875,7 +578,7 @@ public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor de return Self; } - public TopHitsAggregationDescriptor Highlight(Action configure) + public TopHitsAggregationDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -883,13 +586,10 @@ public TopHitsAggregationDescriptor Highlight(Action, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public TopHitsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopHitsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -904,9 +604,9 @@ public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serverl /// /// Returns the result of one or more script evaluations for each hit. /// - public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -940,7 +640,7 @@ public TopHitsAggregationDescriptor Sort(ICollection configure) + public TopHitsAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -958,7 +658,7 @@ public TopHitsAggregationDescriptor Sort(Action configure return Self; } - public TopHitsAggregationDescriptor Sort(params Action[] configure) + public TopHitsAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -1005,8 +705,6 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_hits"); writer.WriteStartObject(); if (DocvalueFieldsValue is not null) { @@ -1040,7 +738,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1086,7 +784,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -1095,7 +793,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -1131,13 +829,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 2b7e43bd16c..d52e6a7d158 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetrics.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; public sealed partial class TopMetrics { [JsonInclude, JsonPropertyName("metrics")] - public IReadOnlyDictionary? Metrics { get; init; } + public IReadOnlyDictionary Metrics { get; init; } [JsonInclude, JsonPropertyName("sort")] - public IReadOnlyCollection? Sort { get; init; } + public IReadOnlyCollection Sort { 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 index 76f5b5f204c..0c3c07976e2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs @@ -27,197 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class TopMetricsAggregationConverter : JsonConverter +public sealed partial class TopMetricsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } - public IDictionary? Meta { get; set; } /// /// The fields of the top document to return. /// + [JsonInclude, JsonPropertyName("metrics")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValue))] public ICollection? Metrics { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } /// /// The number of top documents from which to return metrics. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The sort order of the documents. /// + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] public ICollection? Sort { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(TopMetricsAggregation topMetricsAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.TopMetrics(topMetricsAggregation); } public sealed partial class TopMetricsAggregationDescriptor : SerializableDescriptor> @@ -229,34 +75,42 @@ public TopMetricsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } private ICollection? MetricsValue { get; set; } - private TopMetricsValueDescriptor MetricsDescriptor { get; set; } - private Action> MetricsDescriptorAction { get; set; } - private Action>[] MetricsDescriptorActions { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action> MetricsDescriptorAction { get; set; } + private Action>[] MetricsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public TopMetricsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } @@ -272,7 +126,7 @@ public TopMetricsAggregationDescriptor Metrics(ICollection Metrics(TopMetricsValueDescriptor descriptor) + public TopMetricsAggregationDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor descriptor) { MetricsValue = null; MetricsDescriptorAction = null; @@ -281,7 +135,7 @@ public TopMetricsAggregationDescriptor Metrics(TopMetricsValueDescrip return Self; } - public TopMetricsAggregationDescriptor Metrics(Action> configure) + public TopMetricsAggregationDescriptor Metrics(Action> configure) { MetricsValue = null; MetricsDescriptor = null; @@ -290,7 +144,7 @@ public TopMetricsAggregationDescriptor Metrics(Action Metrics(params Action>[] configure) + public TopMetricsAggregationDescriptor Metrics(params Action>[] configure) { MetricsValue = null; MetricsDescriptor = null; @@ -299,7 +153,10 @@ public TopMetricsAggregationDescriptor Metrics(params Action Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopMetricsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -332,7 +189,7 @@ public TopMetricsAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public TopMetricsAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -341,7 +198,7 @@ public TopMetricsAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public TopMetricsAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -350,7 +207,7 @@ public TopMetricsAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public TopMetricsAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -361,8 +218,6 @@ public TopMetricsAggregationDescriptor Sort(params Action(MetricsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor(MetricsDescriptorAction), options); } else if (MetricsDescriptorActions is not null) { @@ -387,7 +242,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MetricsDescriptorActions) { - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor(action), options); } if (MetricsDescriptorActions.Length > 1) @@ -425,7 +280,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -434,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -446,13 +301,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -466,43 +314,45 @@ public TopMetricsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } private ICollection? MetricsValue { get; set; } - private TopMetricsValueDescriptor MetricsDescriptor { get; set; } - private Action MetricsDescriptorAction { get; set; } - private Action[] MetricsDescriptorActions { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Action[] MetricsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The fields of the top document to return. /// @@ -515,7 +365,7 @@ public TopMetricsAggregationDescriptor Metrics(ICollection configure) + public TopMetricsAggregationDescriptor Metrics(Action configure) { MetricsValue = null; MetricsDescriptor = null; @@ -533,7 +383,7 @@ public TopMetricsAggregationDescriptor Metrics(Action return Self; } - public TopMetricsAggregationDescriptor Metrics(params Action[] configure) + public TopMetricsAggregationDescriptor Metrics(params Action[] configure) { MetricsValue = null; MetricsDescriptor = null; @@ -542,7 +392,10 @@ public TopMetricsAggregationDescriptor Metrics(params Action + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopMetricsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -575,7 +428,7 @@ public TopMetricsAggregationDescriptor Sort(ICollection configure) + public TopMetricsAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -593,7 +446,7 @@ public TopMetricsAggregationDescriptor Sort(Action config return Self; } - public TopMetricsAggregationDescriptor Sort(params Action[] configure) + public TopMetricsAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -604,8 +457,6 @@ public TopMetricsAggregationDescriptor Sort(params Action protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_metrics"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -621,7 +472,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricsDescriptorAction is not null) { writer.WritePropertyName("metrics"); - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(MetricsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor(MetricsDescriptorAction), options); } else if (MetricsDescriptorActions is not null) { @@ -630,7 +481,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MetricsDescriptorActions) { - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.TopMetricsValueDescriptor(action), options); } if (MetricsDescriptorActions.Length > 1) @@ -668,7 +519,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -677,7 +528,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -689,13 +540,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, 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/TopMetricsValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs index ac51aa52cd1..8ce4bbd4206 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TopMetricsValue.g.cs @@ -64,6 +64,15 @@ public TopMetricsValueDescriptor Field(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs new file mode 100644 index 00000000000..d597a6059e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.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 `rare_terms` aggregation when the field is unmapped. `buckets` is always empty. +/// +public sealed partial class UnmappedRareTermsAggregate : 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/UnmappedSamplerAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs new file mode 100644 index 00000000000..861fdab5a7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSamplerAggregate.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; + +internal sealed partial class UnmappedSamplerAggregateConverter : JsonConverter +{ + public override UnmappedSamplerAggregate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + IReadOnlyDictionary? meta = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new UnmappedSamplerAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, UnmappedSamplerAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'UnmappedSamplerAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(UnmappedSamplerAggregateConverter))] +public sealed partial class UnmappedSamplerAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs new file mode 100644 index 00000000000..33eb4a09dbf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.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 the `significant_terms` aggregation on an unmapped field. `buckets` is always empty. +/// +public sealed partial class UnmappedSignificantTermsAggregate : 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/UnmappedTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs new file mode 100644 index 00000000000..0353dce9731 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/UnmappedTermsAggregate.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 unmapped. `buckets` is always empty. +/// +public sealed partial class UnmappedTermsAggregate : 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/ValueCountAggregate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs index 6347e58ef31..02d2017ebfe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class ValueCountAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index eecc78b13dc..e487f32cb4a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/ValueCountAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class ValueCountAggregationConverter : JsonConverter +public sealed partial class ValueCountAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(ValueCountAggregation valueCountAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.ValueCount(valueCountAggregation); } public sealed partial class ValueCountAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public ValueCountAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public ValueCountAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ValueCountAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public ValueCountAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ValueCountAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public ValueCountAggregationDescriptor Script(Elastic.Clients.Elastic protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("value_count"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ 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.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public ValueCountAggregationDescriptor Format(string? format) return Self; } - public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ValueCountAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ValueCountAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public ValueCountAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Serv protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("value_count"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/VariableWidthHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs index 1be140549a1..a2e2aacb73f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs @@ -27,161 +27,33 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class VariableWidthHistogramAggregationConverter : JsonConverter +public sealed partial class VariableWidthHistogramAggregation { - 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. /// + [JsonInclude, JsonPropertyName("buckets")] public int? Buckets { get; set; } /// /// The name of the field. /// + [JsonInclude, JsonPropertyName("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)`.
///
+ [JsonInclude, JsonPropertyName("initial_buffer")] 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`.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.VariableWidthHistogram(variableWidthHistogramAggregation); } public sealed partial class VariableWidthHistogramAggregationDescriptor : SerializableDescriptor> @@ -195,7 +67,6 @@ 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; } /// @@ -226,17 +97,20 @@ public VariableWidthHistogramAggregationDescriptor Field(Expr } /// - /// 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)`.
+ /// The name of the field. ///
- public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuffer) + public VariableWidthHistogramAggregationDescriptor Field(Expression> field) { - InitialBufferValue = initialBuffer; + FieldValue = field; return Self; } - public VariableWidthHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// 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) { - MetaValue = selector?.Invoke(new FluentDictionary()); + InitialBufferValue = initialBuffer; return Self; } @@ -251,8 +125,6 @@ public VariableWidthHistogramAggregationDescriptor ShardSize(int? sha protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("variable_width_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -278,13 +150,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(ShardSizeValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -300,7 +165,6 @@ 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; } /// @@ -348,12 +212,6 @@ public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuf 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`.
///
@@ -365,8 +223,6 @@ public VariableWidthHistogramAggregationDescriptor ShardSize(int? shardSize) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("variable_width_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -392,13 +248,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 85ad253a4b7..5050994fafd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs @@ -27,36 +27,12 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -[JsonConverter(typeof(VariableWidthHistogramBucketConverter))] -public sealed partial class VariableWidthHistogramBucket : AggregateDictionary +internal sealed partial class VariableWidthHistogramBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double key = default; string? keyAsString = default; @@ -64,67 +40,86 @@ internal sealed class VariableWidthHistogramBucketConverter : JsonConverter additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - max = JsonSerializer.Deserialize(ref reader, options); - continue; + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max") + { + max = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_as_string") + { + maxAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "min") + { + min = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "min_as_string") + { + minAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); } - - 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 }; + return new VariableWidthHistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary(additionalProperties), 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("'VariableWidthHistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); } +} - public override void Write(Utf8JsonWriter writer, VariableWidthHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +[JsonConverter(typeof(VariableWidthHistogramBucketConverter))] +public sealed partial class VariableWidthHistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double Key { get; init; } + public string? KeyAsString { get; init; } + public double Max { get; init; } + public string? MaxAsString { get; init; } + public double Min { get; init; } + public string? MinAsString { get; init; } } \ 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 index b4bee60b073..4bd66cfeebf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class WeightedAverageAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] 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 index 82bada902f5..b128787becd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs @@ -27,157 +27,33 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -internal sealed class WeightedAverageAggregationConverter : JsonConverter +public sealed partial class WeightedAverageAggregation { - 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. /// + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Configuration for the field that provides the values. /// + [JsonInclude, JsonPropertyName("value")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? Value { get; set; } + [JsonInclude, JsonPropertyName("value_type")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueType { get; set; } /// /// Configuration for the field or script that provides the weights. /// + [JsonInclude, JsonPropertyName("weight")] public Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? Weight { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation(WeightedAverageAggregation weightedAverageAggregation) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.Aggregation.WeightedAvg(weightedAverageAggregation); } public sealed partial class WeightedAverageAggregationDescriptor : SerializableDescriptor> @@ -190,13 +66,14 @@ public WeightedAverageAggregationDescriptor() : base() private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } 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.WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action> ValueDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? WeightValue { get; set; } - private WeightedAverageValueDescriptor WeightDescriptor { get; set; } - private Action> WeightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action> WeightDescriptorAction { get; set; } /// /// A numeric response formatter. @@ -213,6 +90,12 @@ public WeightedAverageAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Configuration for the field that provides the values. /// @@ -224,7 +107,7 @@ public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Ela return Self; } - public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor descriptor) { ValueValue = null; ValueDescriptorAction = null; @@ -232,7 +115,7 @@ public WeightedAverageAggregationDescriptor Value(WeightedAverageValu return Self; } - public WeightedAverageAggregationDescriptor Value(Action> configure) + public WeightedAverageAggregationDescriptor Value(Action> configure) { ValueValue = null; ValueDescriptor = null; @@ -257,7 +140,7 @@ public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.El return Self; } - public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor descriptor) { WeightValue = null; WeightDescriptorAction = null; @@ -265,7 +148,7 @@ public WeightedAverageAggregationDescriptor Weight(WeightedAverageVal return Self; } - public WeightedAverageAggregationDescriptor Weight(Action> configure) + public WeightedAverageAggregationDescriptor Weight(Action> configure) { WeightValue = null; WeightDescriptor = null; @@ -275,8 +158,6 @@ public WeightedAverageAggregationDescriptor Weight(Action(ValueDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor(ValueDescriptorAction), options); } else if (ValueValue is not null) { @@ -314,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (WeightDescriptorAction is not null) { writer.WritePropertyName("weight"); - JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(WeightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor(WeightDescriptorAction), options); } else if (WeightValue is not null) { @@ -322,13 +215,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, WeightValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -343,13 +229,14 @@ public WeightedAverageAggregationDescriptor() : base() private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } 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.WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action ValueDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.ValueType? ValueTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValue? WeightValue { get; set; } - private WeightedAverageValueDescriptor WeightDescriptor { get; set; } - private Action WeightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action WeightDescriptorAction { get; set; } /// /// A numeric response formatter. @@ -366,6 +253,12 @@ public WeightedAverageAggregationDescriptor Meta(Func /// Configuration for the field that provides the values. /// @@ -377,7 +270,7 @@ public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch. return Self; } - public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor descriptor) { ValueValue = null; ValueDescriptorAction = null; @@ -385,7 +278,7 @@ public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor return Self; } - public WeightedAverageAggregationDescriptor Value(Action configure) + public WeightedAverageAggregationDescriptor Value(Action configure) { ValueValue = null; ValueDescriptor = null; @@ -410,7 +303,7 @@ public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch return Self; } - public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Serverless.Aggregations.WeightedAverageValueDescriptor descriptor) { WeightValue = null; WeightDescriptorAction = null; @@ -418,7 +311,7 @@ public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescripto return Self; } - public WeightedAverageAggregationDescriptor Weight(Action configure) + public WeightedAverageAggregationDescriptor Weight(Action configure) { WeightValue = null; WeightDescriptor = null; @@ -428,8 +321,6 @@ public WeightedAverageAggregationDescriptor Weight(Action Field(Expression + /// 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. /// 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 index 79663582dae..22c425de4b8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Analyzers.g.cs @@ -66,47 +66,47 @@ public AnalyzersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Whitespace(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); public AnalyzersDescriptor Whitespace(string analyzerName, WhitespaceAnalyzer whitespaceAnalyzer) => AssignVariant(analyzerName, whitespaceAnalyzer); } @@ -124,39 +124,36 @@ public override IAnalyzer Read(ref Utf8JsonReader reader, Type typeToConvert, Js switch (type) { + case "custom": + return JsonSerializer.Deserialize(ref reader, options); case "dutch": - return JsonSerializer.Deserialize(ref reader, options); - case "snowball": - return JsonSerializer.Deserialize(ref reader, options); - case "kuromoji": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji": + return JsonSerializer.Deserialize(ref reader, options); + case "language": + return JsonSerializer.Deserialize(ref reader, options); + case "nori": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "simple": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); default: - ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IAnalyzer)); - return null; + return JsonSerializer.Deserialize(ref reader, options); } } @@ -170,47 +167,47 @@ public override void Write(Utf8JsonWriter writer, IAnalyzer value, JsonSerialize switch (value.Type) { - case "dutch": - JsonSerializer.Serialize(writer, value, typeof(DutchAnalyzer), options); + case "custom": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.CustomAnalyzer), options); return; - case "snowball": - JsonSerializer.Serialize(writer, value, typeof(SnowballAnalyzer), options); + case "dutch": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.DutchAnalyzer), options); return; - case "kuromoji": - JsonSerializer.Serialize(writer, value, typeof(KuromojiAnalyzer), options); + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.FingerprintAnalyzer), options); return; case "icu_analyzer": - JsonSerializer.Serialize(writer, value, typeof(IcuAnalyzer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuAnalyzer), options); return; - case "whitespace": - JsonSerializer.Serialize(writer, value, typeof(WhitespaceAnalyzer), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeywordAnalyzer), options); return; - case "stop": - JsonSerializer.Serialize(writer, value, typeof(StopAnalyzer), options); + case "kuromoji": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiAnalyzer), options); return; - case "standard": - JsonSerializer.Serialize(writer, value, typeof(StandardAnalyzer), options); + case "language": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LanguageAnalyzer), options); return; - case "simple": - JsonSerializer.Serialize(writer, value, typeof(SimpleAnalyzer), options); + case "nori": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriAnalyzer), options); return; case "pattern": - JsonSerializer.Serialize(writer, value, typeof(PatternAnalyzer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PatternAnalyzer), options); return; - case "nori": - JsonSerializer.Serialize(writer, value, typeof(NoriAnalyzer), options); + case "simple": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.SimpleAnalyzer), options); return; - case "language": - JsonSerializer.Serialize(writer, value, typeof(LanguageAnalyzer), options); + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballAnalyzer), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordAnalyzer), options); + case "standard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StandardAnalyzer), options); return; - case "fingerprint": - JsonSerializer.Serialize(writer, value, typeof(FingerprintAnalyzer), options); + case "stop": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StopAnalyzer), options); return; - case "custom": - JsonSerializer.Serialize(writer, value, typeof(CustomAnalyzer), options); + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.WhitespaceAnalyzer), options); return; default: var type = value.GetType(); @@ -223,5 +220,5 @@ public override void Write(Utf8JsonWriter writer, IAnalyzer value, JsonSerialize [JsonConverter(typeof(AnalyzerInterfaceConverter))] public partial interface IAnalyzer { - public string Type { get; } + 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 index fb8884e529e..4360889efcb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs @@ -30,7 +30,6 @@ 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")] @@ -66,18 +65,18 @@ public AsciiFoldingTokenFilterDescriptor Version(string? version) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("asciifolding"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index b078b6bf809..2e369133ca6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharFilters.g.cs @@ -66,20 +66,20 @@ public CharFiltersDescriptor() : base(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) => 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) => 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) => 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) => 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) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor PatternReplace(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); public CharFiltersDescriptor PatternReplace(string charFilterName, PatternReplaceCharFilter patternReplaceCharFilter) => AssignVariant(charFilterName, patternReplaceCharFilter); } @@ -97,16 +97,16 @@ public override ICharFilter Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { - case "kuromoji_iteration_mark": - return JsonSerializer.Deserialize(ref reader, options); + case "html_strip": + return JsonSerializer.Deserialize(ref reader, options); case "icu_normalizer": - return JsonSerializer.Deserialize(ref reader, options); - case "pattern_replace": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_iteration_mark": + return JsonSerializer.Deserialize(ref reader, options); case "mapping": - return JsonSerializer.Deserialize(ref reader, options); - case "html_strip": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ICharFilter)); return null; @@ -123,20 +123,20 @@ public override void Write(Utf8JsonWriter writer, ICharFilter value, JsonSeriali switch (value.Type) { - case "kuromoji_iteration_mark": - JsonSerializer.Serialize(writer, value, typeof(KuromojiIterationMarkCharFilter), options); + case "html_strip": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.HtmlStripCharFilter), options); return; case "icu_normalizer": - JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationCharFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationCharFilter), options); return; - case "pattern_replace": - JsonSerializer.Serialize(writer, value, typeof(PatternReplaceCharFilter), options); + case "kuromoji_iteration_mark": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiIterationMarkCharFilter), options); return; case "mapping": - JsonSerializer.Serialize(writer, value, typeof(MappingCharFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.MappingCharFilter), options); return; - case "html_strip": - JsonSerializer.Serialize(writer, value, typeof(HtmlStripCharFilter), options); + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PatternReplaceCharFilter), options); return; default: var type = value.GetType(); @@ -149,5 +149,5 @@ public override void Write(Utf8JsonWriter writer, ICharFilter value, JsonSeriali [JsonConverter(typeof(CharFilterInterfaceConverter))] public partial interface ICharFilter { - public string Type { get; } + 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 index 1dd08a62b78..25a623fa3cb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CharGroupTokenizer.g.cs @@ -84,10 +84,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenizeOnCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("char_group"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 6c8cdb87852..042bb74c9e4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("common_grams"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 808c10a3af1..3b9562f678f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ConditionTokenFilter.g.cs @@ -80,10 +80,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("condition"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 044bebe82a2..053b6eff686 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("delimited_payload"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 8e45fe49cdb..7fc6b44b4ae 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs @@ -151,10 +151,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("dictionary_decompounder"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } if (WordListValue is not null) 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 index 81412696f38..dcddfd23d84 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/DutchAnalyzer.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; public sealed partial class DutchAnalyzer : IAnalyzer { [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] 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 index dc9d46ce503..4fcc17e8802 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs @@ -34,7 +34,6 @@ public sealed partial class EdgeNGramTokenFilter : ITokenFilter [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; } @@ -105,10 +104,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinGramValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (SideValue is not null) @@ -119,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("edge_ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f3bf6ea156d..6992131e171 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -106,10 +106,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("edge_ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c878534044a..1eff891e4f4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ElisionTokenFilter.g.cs @@ -32,7 +32,6 @@ 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; } @@ -90,10 +89,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ArticlesValue, options); } - if (ArticlesCaseValue is not null) + if (ArticlesCaseValue.HasValue) { writer.WritePropertyName("articles_case"); - JsonSerializer.Serialize(writer, ArticlesCaseValue, options); + writer.WriteBooleanValue(ArticlesCaseValue.Value); } if (!string.IsNullOrEmpty(ArticlesPathValue)) @@ -104,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("elision"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a9ca8571029..bb792973a82 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs @@ -36,7 +36,7 @@ public sealed partial class FingerprintAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -122,10 +122,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("fingerprint"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 427d920c90c..561f46132d4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("fingerprint"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index b037b4255a1..a63e47285e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("html_strip"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 43c74160147..ce185492e8c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HunspellTokenFilter.g.cs @@ -114,10 +114,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("hunspell"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index ed593ba8f3a..d1cc538b5a3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs @@ -151,10 +151,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("hyphenation_decompounder"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } if (WordListValue is not null) 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 index a8a54562a6c..332e718992e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs @@ -238,10 +238,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(VariantValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 3be32f6fe7b..27a6a58e860 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs @@ -68,10 +68,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("icu_folding"); writer.WritePropertyName("unicode_set_filter"); writer.WriteStringValue(UnicodeSetFilterValue); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index dcdeaf36636..9ede316676f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("icu_normalizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c6fd50f6827..c2fb98d7225 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("icu_normalizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 0b6d5937e7c..2d8c8fa600c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTokenizer.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(RuleFilesValue); writer.WritePropertyName("type"); writer.WriteStringValue("icu_tokenizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index bdc56a68927..7129fd84a9e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs @@ -84,10 +84,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(IdValue); writer.WritePropertyName("type"); writer.WriteStringValue("icu_transform"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index ae463d7b395..2376fc024de 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KStemTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("kstem"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 61099cbe749..b46fb678f59 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TypesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 6f2dde30cf1..e7d52565bd8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("keep"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 4f619537980..f282054e4e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 8e355eccab2..9fc8bf1b52e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("keyword_marker"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 5b0837673e1..25621e123f4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KeywordTokenizer.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BufferSizeValue); writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 1f912d539bb..5ac4881c869 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs @@ -80,10 +80,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(NormalizeKanjiValue); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_iteration_mark"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c3411dd43ca..d80b03e1473 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, StoptagsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_part_of_speech"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f1619a02ed9..a4ca5c9623a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs @@ -68,10 +68,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("kuromoji_readingform"); writer.WritePropertyName("use_romaji"); writer.WriteBooleanValue(UseRomajiValue); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index bd568ac6e9d..21b6ac2b863 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinimumLengthValue); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_stemmer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 1a3afce7c87..457d5130d68 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/KuromojiTokenizer.g.cs @@ -159,10 +159,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 6f9013ce1b5..0728851d857 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LanguageAnalyzer.g.cs @@ -34,7 +34,7 @@ public sealed partial class LanguageAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("stem_exclusion")] public ICollection StemExclusion { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -111,10 +111,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("language"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c0d8e50503b..65ffaf5e8b0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LengthTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("length"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index e55ef0131b8..691c49bcf0a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LetterTokenizer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("letter"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index ed7ad152be1..7d343f99696 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -81,18 +80,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(ConsumeAllTokensValue.Value); } - if (MaxTokenCountValue is not null) + if (MaxTokenCountValue.HasValue) { writer.WritePropertyName("max_token_count"); - JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + writer.WriteNumberValue(MaxTokenCountValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("limit"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 656d2ac8147..3dc48eb8e5d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("lowercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index fa07591c7f1..641bce2dcbe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/LowercaseTokenizer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("lowercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 5bee705fc2d..7073013bdda 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MappingCharFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("mapping"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c1365727e8b..7eeccd15ac6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -77,18 +76,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("filters"); JsonSerializer.Serialize(writer, FiltersValue, options); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("multiplexer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 1cb779a4c5a..d1448a4b4b4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenFilter.g.cs @@ -34,7 +34,6 @@ public sealed partial class NGramTokenFilter : ITokenFilter [JsonInclude, JsonPropertyName("min_gram")] public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("preserve_original")] - [JsonConverter(typeof(StringifiedBoolConverter))] public bool? PreserveOriginal { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -96,18 +95,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinGramValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 2b6c04e6a37..b56cc0414bb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -106,10 +106,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f10bb061663..20aef3c7ab8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriAnalyzer.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(UserDictionaryValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a7cffd76e15..553db15c24f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("nori_part_of_speech"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f34a0d7c96f..b45fdb45130 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/NoriTokenizer.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a49a0403275..ec1ee4b7fa0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Normalizers.g.cs @@ -66,11 +66,11 @@ public NormalizersDescriptor() : base(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) => 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) => AssignVariant(normalizerName, null); + public NormalizersDescriptor Lowercase(string normalizerName, Action configure) => AssignVariant(normalizerName, configure); public NormalizersDescriptor Lowercase(string normalizerName, LowercaseNormalizer lowercaseNormalizer) => AssignVariant(normalizerName, lowercaseNormalizer); } @@ -89,9 +89,9 @@ public override INormalizer Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { case "custom": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); case "lowercase": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(INormalizer)); return null; @@ -109,10 +109,10 @@ public override void Write(Utf8JsonWriter writer, INormalizer value, JsonSeriali switch (value.Type) { case "custom": - JsonSerializer.Serialize(writer, value, typeof(CustomNormalizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.CustomNormalizer), options); return; case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseNormalizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LowercaseNormalizer), options); return; default: var type = value.GetType(); @@ -122,8 +122,11 @@ public override void Write(Utf8JsonWriter writer, INormalizer value, JsonSeriali } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(NormalizerInterfaceConverter))] public partial interface INormalizer { - public string Type { get; } + 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 index 71ac21458b1..cd21cf2e9b6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs @@ -30,17 +30,14 @@ 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")] @@ -104,10 +101,10 @@ public PathHierarchyTokenizerDescriptor Version(string? version) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (BufferSizeValue is not null) + if (BufferSizeValue.HasValue) { writer.WritePropertyName("buffer_size"); - JsonSerializer.Serialize(writer, BufferSizeValue, options); + writer.WriteNumberValue(BufferSizeValue.Value); } if (!string.IsNullOrEmpty(DelimiterValue)) @@ -122,24 +119,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(ReplacementValue); } - if (ReverseValue is not null) + if (ReverseValue.HasValue) { writer.WritePropertyName("reverse"); - JsonSerializer.Serialize(writer, ReverseValue, options); + writer.WriteBooleanValue(ReverseValue.Value); } - if (SkipValue is not null) + if (SkipValue.HasValue) { writer.WritePropertyName("skip"); - JsonSerializer.Serialize(writer, SkipValue, options); + writer.WriteNumberValue(SkipValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("path_hierarchy"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 84603a1c4df..93bf278a294 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternAnalyzer.g.cs @@ -36,7 +36,7 @@ public sealed partial class PatternAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("pattern")] public string Pattern { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -115,10 +115,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f1a9b65cb21..11b89a48d0f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -77,18 +76,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("patterns"); JsonSerializer.Serialize(writer, PatternsValue, options); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("pattern_capture"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index ae692a66ae6..dc98f7d7eea 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs @@ -99,10 +99,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern_replace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 12b89661cce..1265acbcfae 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs @@ -114,10 +114,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern_replace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 67da6385f2f..d893220c095 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PatternTokenizer.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index e6257eb45fa..31a8a198a1e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs @@ -132,10 +132,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuleTypeValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("phonetic"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index e6ae822fc8b..8ba04f094a8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("porter_stem"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a01a430bd1c..5586caf0e07 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/PredicateTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("predicate_token_filter"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 91d1152064b..d9b5a4654d4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("remove_duplicates"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 75b076aed51..1664a9991dd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ReverseTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("reverse"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 14cc8b83fb5..5a01cbb2009 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/ShingleTokenFilter.g.cs @@ -32,9 +32,9 @@ 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; } + public object? MaxShingleSize { get; set; } [JsonInclude, JsonPropertyName("min_shingle_size")] - public Union? MinShingleSize { get; set; } + public object? MinShingleSize { get; set; } [JsonInclude, JsonPropertyName("output_unigrams")] public bool? OutputUnigrams { get; set; } [JsonInclude, JsonPropertyName("output_unigrams_if_no_shingles")] @@ -58,8 +58,8 @@ public ShingleTokenFilterDescriptor() : base() } private string? FillerTokenValue { get; set; } - private Union? MaxShingleSizeValue { get; set; } - private Union? MinShingleSizeValue { get; set; } + private object? MaxShingleSizeValue { get; set; } + private object? MinShingleSizeValue { get; set; } private bool? OutputUnigramsValue { get; set; } private bool? OutputUnigramsIfNoShinglesValue { get; set; } private string? TokenSeparatorValue { get; set; } @@ -71,13 +71,13 @@ public ShingleTokenFilterDescriptor FillerToken(string? fillerToken) return Self; } - public ShingleTokenFilterDescriptor MaxShingleSize(Union? maxShingleSize) + public ShingleTokenFilterDescriptor MaxShingleSize(object? maxShingleSize) { MaxShingleSizeValue = maxShingleSize; return Self; } - public ShingleTokenFilterDescriptor MinShingleSize(Union? minShingleSize) + public ShingleTokenFilterDescriptor MinShingleSize(object? minShingleSize) { MinShingleSizeValue = minShingleSize; return Self; @@ -148,10 +148,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("shingle"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 1517f67f4d3..9a175339f6c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SimpleAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("simple"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 270ca087833..98cb613c3b6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballAnalyzer.g.cs @@ -32,7 +32,7 @@ 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))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -85,10 +85,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("snowball"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index c9b5b9471f3..148ebf8ab93 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SnowballTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, LanguageValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("snowball"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index ed175210241..e064b2c5e0a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardAnalyzer.g.cs @@ -32,7 +32,7 @@ public sealed partial class StandardAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("max_token_length")] public int? MaxTokenLength { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] 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 index e13a3926e48..9b1ce518ed7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StandardTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("standard"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 762e21b146a..9a84a06184d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stemmer_override"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 2554b67865a..3803785787e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StemmerTokenFilter.g.cs @@ -67,10 +67,10 @@ public override void Write(Utf8JsonWriter writer, StemmerTokenFilter value, Json writer.WritePropertyName("type"); writer.WriteStringValue("stemmer"); - if (value.Version is not null) + if (!string.IsNullOrEmpty(value.Version)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, value.Version, options); + writer.WriteStringValue(value.Version); } writer.WriteEndObject(); @@ -82,7 +82,6 @@ public sealed partial class StemmerTokenFilter : ITokenFilter { public string? Language { get; set; } - [JsonInclude, JsonPropertyName("type")] public string Type => "stemmer"; public string? Version { get; set; } @@ -122,10 +121,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stemmer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 433ac057d9b..29e73833d84 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopAnalyzer.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Analysis; public sealed partial class StopAnalyzer : IAnalyzer { [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -89,10 +89,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stop"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 0071fe4984e..59989df0afc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/StopTokenFilter.g.cs @@ -34,7 +34,7 @@ public sealed partial class StopTokenFilter : ITokenFilter [JsonInclude, JsonPropertyName("remove_trailing")] public bool? RemoveTrailing { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -119,10 +119,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stop"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a64c34f211a..d20b35ed099 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs @@ -163,10 +163,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(UpdateableValue.Value); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f6803ba5afe..9043fcfa5df 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/SynonymTokenFilter.g.cs @@ -163,10 +163,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(UpdateableValue.Value); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 6804f9f7dd6..5d05ae0174c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TokenFilters.g.cs @@ -66,146 +66,146 @@ public TokenFiltersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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 IcuTransform(string tokenFilterName) => AssignVariant(tokenFilterName, null); - public TokenFiltersDescriptor IcuTransform(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, WordDelimiterTokenFilter wordDelimiterTokenFilter) => AssignVariant(tokenFilterName, wordDelimiterTokenFilter); } @@ -223,100 +223,100 @@ public override ITokenFilter Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { + case "asciifolding": + return JsonSerializer.Deserialize(ref reader, options); + case "common_grams": + return JsonSerializer.Deserialize(ref reader, options); + case "condition": + return JsonSerializer.Deserialize(ref reader, options); + case "delimited_payload": + return JsonSerializer.Deserialize(ref reader, options); 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); + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "elision": + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + return JsonSerializer.Deserialize(ref reader, options); + case "hunspell": + return JsonSerializer.Deserialize(ref reader, options); + case "hyphenation_decompounder": + return JsonSerializer.Deserialize(ref reader, options); case "icu_collation": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "icu_folding": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_normalizer": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_transform": + return JsonSerializer.Deserialize(ref reader, options); + case "keep_types": + return JsonSerializer.Deserialize(ref reader, options); + case "keep": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword_marker": + return JsonSerializer.Deserialize(ref reader, options); + case "kstem": + return JsonSerializer.Deserialize(ref reader, options); case "kuromoji_part_of_speech": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); case "kuromoji_readingform": - return JsonSerializer.Deserialize(ref reader, options); + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "limit": + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "multiplexer": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_part_of_speech": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_capture": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); + case "phonetic": + return JsonSerializer.Deserialize(ref reader, options); + case "porter_stem": + return JsonSerializer.Deserialize(ref reader, options); + case "predicate_token_filter": + return JsonSerializer.Deserialize(ref reader, options); + case "remove_duplicates": + return JsonSerializer.Deserialize(ref reader, options); + case "reverse": + return JsonSerializer.Deserialize(ref reader, options); + case "shingle": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer_override": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym": + return JsonSerializer.Deserialize(ref reader, options); + case "trim": + return JsonSerializer.Deserialize(ref reader, options); + case "truncate": + return JsonSerializer.Deserialize(ref reader, options); + case "unique": + return JsonSerializer.Deserialize(ref reader, options); + case "uppercase": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenFilter)); return null; @@ -333,146 +333,146 @@ public override void Write(Utf8JsonWriter writer, ITokenFilter value, JsonSerial switch (value.Type) { - case "dictionary_decompounder": - JsonSerializer.Serialize(writer, value, typeof(DictionaryDecompounderTokenFilter), options); + case "asciifolding": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.AsciiFoldingTokenFilter), options); return; - case "phonetic": - JsonSerializer.Serialize(writer, value, typeof(PhoneticTokenFilter), options); + case "common_grams": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.CommonGramsTokenFilter), options); return; - case "icu_transform": - JsonSerializer.Serialize(writer, value, typeof(IcuTransformTokenFilter), options); + case "condition": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.ConditionTokenFilter), options); return; - case "icu_normalizer": - JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationTokenFilter), options); + case "delimited_payload": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.DelimitedPayloadTokenFilter), options); return; - case "icu_folding": - JsonSerializer.Serialize(writer, value, typeof(IcuFoldingTokenFilter), options); + case "dictionary_decompounder": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.DictionaryDecompounderTokenFilter), options); return; - case "icu_collation": - JsonSerializer.Serialize(writer, value, typeof(IcuCollationTokenFilter), options); + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.EdgeNGramTokenFilter), options); return; - case "kuromoji_part_of_speech": - JsonSerializer.Serialize(writer, value, typeof(KuromojiPartOfSpeechTokenFilter), options); + case "elision": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.ElisionTokenFilter), options); return; - case "kuromoji_readingform": - JsonSerializer.Serialize(writer, value, typeof(KuromojiReadingFormTokenFilter), options); + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.FingerprintTokenFilter), options); return; - case "kuromoji_stemmer": - JsonSerializer.Serialize(writer, value, typeof(KuromojiStemmerTokenFilter), options); + case "hunspell": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.HunspellTokenFilter), options); return; - case "word_delimiter": - JsonSerializer.Serialize(writer, value, typeof(WordDelimiterTokenFilter), options); + case "hyphenation_decompounder": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.HyphenationDecompounderTokenFilter), options); return; - case "word_delimiter_graph": - JsonSerializer.Serialize(writer, value, typeof(WordDelimiterGraphTokenFilter), options); + case "icu_collation": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuCollationTokenFilter), options); return; - case "uppercase": - JsonSerializer.Serialize(writer, value, typeof(UppercaseTokenFilter), options); + case "icu_folding": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuFoldingTokenFilter), options); return; - case "unique": - JsonSerializer.Serialize(writer, value, typeof(UniqueTokenFilter), options); + case "icu_normalizer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuNormalizationTokenFilter), options); return; - case "truncate": - JsonSerializer.Serialize(writer, value, typeof(TruncateTokenFilter), options); + case "icu_transform": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuTransformTokenFilter), options); return; - case "trim": - JsonSerializer.Serialize(writer, value, typeof(TrimTokenFilter), options); + case "keep_types": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeepTypesTokenFilter), options); return; - case "synonym": - JsonSerializer.Serialize(writer, value, typeof(SynonymTokenFilter), options); + case "keep": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeepWordsTokenFilter), options); return; - case "synonym_graph": - JsonSerializer.Serialize(writer, value, typeof(SynonymGraphTokenFilter), options); + case "keyword_marker": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeywordMarkerTokenFilter), options); return; - case "stop": - JsonSerializer.Serialize(writer, value, typeof(StopTokenFilter), options); + case "kstem": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KStemTokenFilter), options); return; - case "stemmer": - JsonSerializer.Serialize(writer, value, typeof(StemmerTokenFilter), options); + case "kuromoji_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiPartOfSpeechTokenFilter), options); return; - case "stemmer_override": - JsonSerializer.Serialize(writer, value, typeof(StemmerOverrideTokenFilter), options); + case "kuromoji_readingform": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiReadingFormTokenFilter), options); return; - case "snowball": - JsonSerializer.Serialize(writer, value, typeof(SnowballTokenFilter), options); + case "kuromoji_stemmer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiStemmerTokenFilter), options); return; - case "shingle": - JsonSerializer.Serialize(writer, value, typeof(ShingleTokenFilter), options); + case "length": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LengthTokenFilter), options); return; - case "reverse": - JsonSerializer.Serialize(writer, value, typeof(ReverseTokenFilter), options); + case "limit": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LimitTokenCountTokenFilter), options); return; - case "remove_duplicates": - JsonSerializer.Serialize(writer, value, typeof(RemoveDuplicatesTokenFilter), options); + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LowercaseTokenFilter), options); return; - case "predicate_token_filter": - JsonSerializer.Serialize(writer, value, typeof(PredicateTokenFilter), options); + case "multiplexer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.MultiplexerTokenFilter), options); return; - case "porter_stem": - JsonSerializer.Serialize(writer, value, typeof(PorterStemTokenFilter), options); + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.NGramTokenFilter), options); return; - case "pattern_replace": - JsonSerializer.Serialize(writer, value, typeof(PatternReplaceTokenFilter), options); + case "nori_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriPartOfSpeechTokenFilter), options); return; case "pattern_capture": - JsonSerializer.Serialize(writer, value, typeof(PatternCaptureTokenFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PatternCaptureTokenFilter), options); return; - case "nori_part_of_speech": - JsonSerializer.Serialize(writer, value, typeof(NoriPartOfSpeechTokenFilter), options); + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PatternReplaceTokenFilter), options); return; - case "ngram": - JsonSerializer.Serialize(writer, value, typeof(NGramTokenFilter), options); + case "phonetic": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PhoneticTokenFilter), options); return; - case "multiplexer": - JsonSerializer.Serialize(writer, value, typeof(MultiplexerTokenFilter), options); + case "porter_stem": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PorterStemTokenFilter), options); return; - case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenFilter), options); + case "predicate_token_filter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PredicateTokenFilter), options); return; - case "limit": - JsonSerializer.Serialize(writer, value, typeof(LimitTokenCountTokenFilter), options); + case "remove_duplicates": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.RemoveDuplicatesTokenFilter), options); return; - case "length": - JsonSerializer.Serialize(writer, value, typeof(LengthTokenFilter), options); + case "reverse": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.ReverseTokenFilter), options); return; - case "kstem": - JsonSerializer.Serialize(writer, value, typeof(KStemTokenFilter), options); + case "shingle": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.ShingleTokenFilter), options); return; - case "keyword_marker": - JsonSerializer.Serialize(writer, value, typeof(KeywordMarkerTokenFilter), options); + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.SnowballTokenFilter), options); return; - case "keep": - JsonSerializer.Serialize(writer, value, typeof(KeepWordsTokenFilter), options); + case "stemmer_override": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StemmerOverrideTokenFilter), options); return; - case "keep_types": - JsonSerializer.Serialize(writer, value, typeof(KeepTypesTokenFilter), options); + case "stemmer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StemmerTokenFilter), options); return; - case "hyphenation_decompounder": - JsonSerializer.Serialize(writer, value, typeof(HyphenationDecompounderTokenFilter), options); + case "stop": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StopTokenFilter), options); return; - case "hunspell": - JsonSerializer.Serialize(writer, value, typeof(HunspellTokenFilter), options); + case "synonym_graph": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymGraphTokenFilter), options); return; - case "fingerprint": - JsonSerializer.Serialize(writer, value, typeof(FingerprintTokenFilter), options); + case "synonym": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.SynonymTokenFilter), options); return; - case "elision": - JsonSerializer.Serialize(writer, value, typeof(ElisionTokenFilter), options); + case "trim": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.TrimTokenFilter), options); return; - case "edge_ngram": - JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenFilter), options); + case "truncate": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.TruncateTokenFilter), options); return; - case "delimited_payload": - JsonSerializer.Serialize(writer, value, typeof(DelimitedPayloadTokenFilter), options); + case "unique": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.UniqueTokenFilter), options); return; - case "condition": - JsonSerializer.Serialize(writer, value, typeof(ConditionTokenFilter), options); + case "uppercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.UppercaseTokenFilter), options); return; - case "common_grams": - JsonSerializer.Serialize(writer, value, typeof(CommonGramsTokenFilter), options); + case "word_delimiter_graph": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.WordDelimiterGraphTokenFilter), options); return; - case "asciifolding": - JsonSerializer.Serialize(writer, value, typeof(AsciiFoldingTokenFilter), options); + case "word_delimiter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.WordDelimiterTokenFilter), options); return; default: var type = value.GetType(); @@ -485,5 +485,5 @@ public override void Write(Utf8JsonWriter writer, ITokenFilter value, JsonSerial [JsonConverter(typeof(TokenFilterInterfaceConverter))] public partial interface ITokenFilter { - public string Type { get; } + 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 index d6a38ff223c..e43e3e982d9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/Tokenizers.g.cs @@ -66,47 +66,47 @@ public TokenizersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Whitespace(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); public TokenizersDescriptor Whitespace(string tokenizerName, WhitespaceTokenizer whitespaceTokenizer) => AssignVariant(tokenizerName, whitespaceTokenizer); } @@ -124,34 +124,34 @@ public override ITokenizer Read(ref Utf8JsonReader reader, Type typeToConvert, J switch (type) { + case "char_group": + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); case "icu_tokenizer": - return JsonSerializer.Deserialize(ref reader, options); - case "pattern": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "path_hierarchy": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "uax_url_email": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenizer)); return null; @@ -168,47 +168,47 @@ public override void Write(Utf8JsonWriter writer, ITokenizer value, JsonSerializ switch (value.Type) { + case "char_group": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.CharGroupTokenizer), options); + return; + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.EdgeNGramTokenizer), options); + return; case "icu_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(IcuTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.IcuTokenizer), options); return; - case "pattern": - JsonSerializer.Serialize(writer, value, typeof(PatternTokenizer), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KeywordTokenizer), options); return; case "kuromoji_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(KuromojiTokenizer), options); - return; - case "whitespace": - JsonSerializer.Serialize(writer, value, typeof(WhitespaceTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.KuromojiTokenizer), options); return; - case "uax_url_email": - JsonSerializer.Serialize(writer, value, typeof(UaxEmailUrlTokenizer), options); + case "letter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LetterTokenizer), options); return; - case "standard": - JsonSerializer.Serialize(writer, value, typeof(StandardTokenizer), options); + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.LowercaseTokenizer), options); return; - case "path_hierarchy": - JsonSerializer.Serialize(writer, value, typeof(PathHierarchyTokenizer), options); + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.NGramTokenizer), options); return; case "nori_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(NoriTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.NoriTokenizer), options); return; - case "ngram": - JsonSerializer.Serialize(writer, value, typeof(NGramTokenizer), options); - return; - case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenizer), options); + case "path_hierarchy": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PathHierarchyTokenizer), options); return; - case "letter": - JsonSerializer.Serialize(writer, value, typeof(LetterTokenizer), options); + case "pattern": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.PatternTokenizer), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordTokenizer), options); + case "standard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.StandardTokenizer), options); return; - case "edge_ngram": - JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenizer), options); + case "uax_url_email": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.UaxEmailUrlTokenizer), options); return; - case "char_group": - JsonSerializer.Serialize(writer, value, typeof(CharGroupTokenizer), options); + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Analysis.WhitespaceTokenizer), options); return; default: var type = value.GetType(); @@ -221,5 +221,5 @@ public override void Write(Utf8JsonWriter writer, ITokenizer value, JsonSerializ [JsonConverter(typeof(TokenizerInterfaceConverter))] public partial interface ITokenizer { - public string Type { get; } + 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 index c6eec0e1351..6dcf0e81cdd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TrimTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("trim"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a68630b539b..1c6d1627df0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/TruncateTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("truncate"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index f26c825b5b8..7873031f600 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("uax_url_email"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 34754620f00..02cf7b00215 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UniqueTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("unique"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 100d2d678d3..f319231f7e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("uppercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index efa0d59818e..b92925e537e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("whitespace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index a6b21c991e6..874180ee5ee 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("whitespace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 6a5b37a7ad1..36ace00f071 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs @@ -44,7 +44,6 @@ public sealed partial class WordDelimiterGraphTokenFilter : ITokenFilter [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; } @@ -234,10 +233,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreKeywordsValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (ProtectedWordsValue is not null) @@ -284,10 +283,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TypeTablePathValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 598aa62e8fb..ca6c53f0c88 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs @@ -40,7 +40,6 @@ public sealed partial class WordDelimiterTokenFilter : ITokenFilter [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; } @@ -204,10 +203,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(GenerateWordPartsValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (ProtectedWordsValue is not null) @@ -254,10 +253,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TypeTablePathValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); 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 index 8e93f2e939a..efb9407f9c6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AsyncSearch/AsyncSearch.g.cs @@ -29,22 +29,13 @@ 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("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } [JsonInclude, JsonPropertyName("fields")] public IReadOnlyDictionary? Fields { get; init; } [JsonInclude, JsonPropertyName("hits")] @@ -61,6 +52,14 @@ public sealed partial class AsyncSearch 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; } + + /// + /// 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; } [JsonInclude, JsonPropertyName("suggest")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestDictionary? Suggest { get; init; } [JsonInclude, JsonPropertyName("terminated_early")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs index d03ebd289a2..c30440322e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ByteSize.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class ByteSize : Union { - public ByteSize(long byteSize) : base(byteSize) + public ByteSize(long Bytesize) : base(Bytesize) { } - public ByteSize(string 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/CharFilterTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs index 3c274c10373..b7a21f5cd19 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/CharFilterTypes.g.cs @@ -59,6 +59,12 @@ public sealed partial class CharFilterTypes [JsonInclude, JsonPropertyName("built_in_tokenizers")] public IReadOnlyCollection BuiltInTokenizers { get; init; } + /// + /// Contains statistics about character filter types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("char_filter_types")] + public IReadOnlyCollection CharFilterTypes2 { get; init; } + /// /// Contains statistics about token filter types used in selected nodes. /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplate.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplate.g.cs index af7295d54f4..3ce87963c22 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/AggregateOrderConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplate.g.cs @@ -17,19 +17,20 @@ #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; +namespace Elastic.Clients.Elasticsearch.Serverless.Cluster; -internal sealed class AggregateOrderConverter : SingleOrManyCollectionConverter> +public sealed partial class ComponentTemplate { + [JsonInclude, JsonPropertyName("component_template")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ComponentTemplateNode ComponentTemplateNode { 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/Cluster/ComponentTemplateNode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateNode.g.cs new file mode 100644 index 00000000000..2155bf8958f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateNode.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 ComponentTemplateNode +{ + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Serverless.Cluster.ComponentTemplateSummary Template { 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/Cluster/ComponentTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs new file mode 100644 index 00000000000..fb48da5840f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Cluster/ComponentTemplateSummary.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.Cluster; + +public sealed partial class ComponentTemplateSummary +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyDictionary? Aliases { get; init; } + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? Mappings { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("settings")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings))] + 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/ClusterDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs index 8d515996627..e8bc2b3b0d2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ClusterDetails.g.cs @@ -29,12 +29,12 @@ 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("_shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } [JsonInclude, JsonPropertyName("status")] public Elastic.Clients.Elasticsearch.Serverless.ClusterSearchStatus Status { get; init; } [JsonInclude, JsonPropertyName("timed_out")] 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 index d5047c92e37..8b35513e825 100644 --- 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 @@ -19,7 +19,6 @@ 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; @@ -28,8 +27,18 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk; -public abstract partial class ResponseItem +public partial class ResponseItem { + /// + /// Contains additional information about the failed operation.
The parameter is only returned for failed operations.
+ ///
+ [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; } + /// /// The document ID associated with the operation. /// @@ -48,6 +57,12 @@ public abstract partial class ResponseItem [JsonInclude, JsonPropertyName("_primary_term")] public long? PrimaryTerm { get; init; } + /// + /// Result of the operation.
Successful values are `created`, `deleted`, and `updated`.
+ ///
+ [JsonInclude, JsonPropertyName("result")] + public string? Result { get; init; } + /// /// The sequence number assigned to the document for the operation.
Sequence numbers are used to ensure an older version of a document doesn’t overwrite a newer version.
///
@@ -60,31 +75,15 @@ public abstract partial class ResponseItem [JsonInclude, JsonPropertyName("_shards")] public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } - /// - /// The document version associated with the operation.
The document version is incremented each time the document is updated.
- ///
- [JsonInclude, JsonPropertyName("_version")] - public long? Version { get; init; } - - /// - /// Contains additional information about the failed operation.
The parameter is only returned for failed operations.
- ///
- [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; } - - /// - /// Result of the operation.
Successful values are `created`, `deleted`, and `updated`.
- ///
- [JsonInclude, JsonPropertyName("result")] - public string? Result { get; init; } - /// /// HTTP status code returned for the operation. /// [JsonInclude, JsonPropertyName("status")] public int Status { get; init; } + + /// + /// The document version associated with the operation.
The document version is incremented each time the document is updated.
+ ///
+ [JsonInclude, JsonPropertyName("_version")] + public long? Version { 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 index 0dc1f09bc91..368f9343620 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Context.g.cs @@ -30,13 +30,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +/// +/// Text or location that we want similar documents for or a lookup to a document's field for the text. +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Context : Union { - public Context(string category) : base(category) + public Context(string Category) : base(Category) { } - public Context(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) : base(location) + 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/FieldCaps/FieldCapability.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs index 1931ffb8988..5dcf33e96b3 100644 --- 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 @@ -39,7 +39,8 @@ public sealed partial class FieldCapability /// 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; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? 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. @@ -53,47 +54,25 @@ public sealed partial class FieldCapability [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; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? NonAggregatableIndices { 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; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? 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 index 27a0026c782..f79aacff7bc 100644 --- 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 @@ -29,6 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Get; public sealed partial class GetResult { + [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")] @@ -40,12 +44,7 @@ public sealed partial class GetResult [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/HealthReport/Diagnosis.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Diagnosis.g.cs new file mode 100644 index 00000000000..b6c27c1cb46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Diagnosis.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.HealthReport; + +public sealed partial class Diagnosis +{ + [JsonInclude, JsonPropertyName("action")] + public string Action { get; init; } + [JsonInclude, JsonPropertyName("affected_resources")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.DiagnosisAffectedResources AffectedResources { get; init; } + [JsonInclude, JsonPropertyName("cause")] + public string Cause { get; init; } + [JsonInclude, JsonPropertyName("help_url")] + public string HelpUrl { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs new file mode 100644 index 00000000000..89bfd2d4e2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.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.Core.HealthReport; + +public sealed partial class DiagnosisAffectedResources +{ + [JsonInclude, JsonPropertyName("feature_states")] + public IReadOnlyCollection? FeatureStates { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Indices { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyCollection? Nodes { get; init; } + [JsonInclude, JsonPropertyName("slm_policies")] + public IReadOnlyCollection? SlmPolicies { get; init; } + [JsonInclude, JsonPropertyName("snapshot_repositories")] + public IReadOnlyCollection? SnapshotRepositories { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs new file mode 100644 index 00000000000..0520c573f94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicator.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.Core.HealthReport; + +/// +/// DISK +/// +public sealed partial class DiskIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.DiskIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs new file mode 100644 index 00000000000..3b4a5769fad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.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.HealthReport; + +public sealed partial class DiskIndicatorDetails +{ + [JsonInclude, JsonPropertyName("indices_with_readonly_block")] + public long IndicesWithReadonlyBlock { get; init; } + [JsonInclude, JsonPropertyName("nodes_over_flood_stage_watermark")] + public long NodesOverFloodStageWatermark { get; init; } + [JsonInclude, JsonPropertyName("nodes_over_high_watermark")] + public long NodesOverHighWatermark { get; init; } + [JsonInclude, JsonPropertyName("nodes_with_enough_disk_space")] + public long NodesWithEnoughDiskSpace { get; init; } + [JsonInclude, JsonPropertyName("nodes_with_unknown_disk_status")] + public long NodesWithUnknownDiskStatus { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs new file mode 100644 index 00000000000..1466907fb7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicator.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.Core.HealthReport; + +/// +/// ILM +/// +public sealed partial class IlmIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IlmIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs new file mode 100644 index 00000000000..8194630ce94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.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.HealthReport; + +public sealed partial class IlmIndicatorDetails +{ + [JsonInclude, JsonPropertyName("ilm_status")] + public Elastic.Clients.Elasticsearch.Serverless.LifecycleOperationMode IlmStatus { get; init; } + [JsonInclude, JsonPropertyName("policies")] + public long Policies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Impact.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Impact.g.cs new file mode 100644 index 00000000000..c14d45c54d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Impact.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.HealthReport; + +public sealed partial class Impact +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("impact_areas")] + public IReadOnlyCollection ImpactAreas { get; init; } + [JsonInclude, JsonPropertyName("severity")] + public int Severity { 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/Core/HealthReport/IndicatorNode.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs index 01b9f967dac..691ee52665d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ExpandWildcardsConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs @@ -17,19 +17,20 @@ #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; +namespace Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport; -internal sealed class ExpandWildcardsConverter : SingleOrManyCollectionConverter +public sealed partial class IndicatorNode { + [JsonInclude, JsonPropertyName("name")] + public string? Name { 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/Core/HealthReport/Indicators.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Indicators.g.cs new file mode 100644 index 00000000000..aaf3e6556b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/Indicators.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.Core.HealthReport; + +public sealed partial class Indicators +{ + [JsonInclude, JsonPropertyName("disk")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.DiskIndicator? Disk { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IlmIndicator? Ilm { get; init; } + [JsonInclude, JsonPropertyName("master_is_stable")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.MasterIsStableIndicator? MasterIsStable { get; init; } + [JsonInclude, JsonPropertyName("repository_integrity")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.RepositoryIntegrityIndicator? RepositoryIntegrity { get; init; } + [JsonInclude, JsonPropertyName("shards_availability")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsAvailabilityIndicator? ShardsAvailability { get; init; } + [JsonInclude, JsonPropertyName("shards_capacity")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsCapacityIndicator? ShardsCapacity { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.SlmIndicator? Slm { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs new file mode 100644 index 00000000000..9303ebe980d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.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.Core.HealthReport; + +/// +/// MASTER_IS_STABLE +/// +public sealed partial class MasterIsStableIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.MasterIsStableIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs new file mode 100644 index 00000000000..c8b80880e4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.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.HealthReport; + +public sealed partial class MasterIsStableIndicatorClusterFormationNode +{ + [JsonInclude, JsonPropertyName("cluster_formation_message")] + public string ClusterFormationMessage { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { 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/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs new file mode 100644 index 00000000000..7865cdf466d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.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.HealthReport; + +public sealed partial class MasterIsStableIndicatorDetails +{ + [JsonInclude, JsonPropertyName("cluster_formation")] + public IReadOnlyCollection? ClusterFormation { get; init; } + [JsonInclude, JsonPropertyName("current_master")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorNode CurrentMaster { get; init; } + [JsonInclude, JsonPropertyName("exception_fetching_history")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory? ExceptionFetchingHistory { get; init; } + [JsonInclude, JsonPropertyName("recent_masters")] + public IReadOnlyCollection RecentMasters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs new file mode 100644 index 00000000000..6c88148b004 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.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.HealthReport; + +public sealed partial class MasterIsStableIndicatorExceptionFetchingHistory +{ + [JsonInclude, JsonPropertyName("message")] + public string Message { get; init; } + [JsonInclude, JsonPropertyName("stack_trace")] + public string StackTrace { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs new file mode 100644 index 00000000000..9bbd5dbad20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.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.Core.HealthReport; + +/// +/// REPOSITORY_INTEGRITY +/// +public sealed partial class RepositoryIntegrityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.RepositoryIntegrityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs new file mode 100644 index 00000000000..561d895cefe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.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.HealthReport; + +public sealed partial class RepositoryIntegrityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("corrupted")] + public IReadOnlyCollection? Corrupted { get; init; } + [JsonInclude, JsonPropertyName("corrupted_repositories")] + public long? CorruptedRepositories { get; init; } + [JsonInclude, JsonPropertyName("total_repositories")] + public long? TotalRepositories { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs new file mode 100644 index 00000000000..0140d11d29d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.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.Core.HealthReport; + +/// +/// SHARDS_AVAILABILITY +/// +public sealed partial class ShardsAvailabilityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsAvailabilityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs new file mode 100644 index 00000000000..d231091c7fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.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.Core.HealthReport; + +public sealed partial class ShardsAvailabilityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("creating_primaries")] + public long CreatingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("initializing_primaries")] + public long InitializingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("initializing_replicas")] + public long InitializingReplicas { get; init; } + [JsonInclude, JsonPropertyName("restarting_primaries")] + public long RestartingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("restarting_replicas")] + public long RestartingReplicas { get; init; } + [JsonInclude, JsonPropertyName("started_primaries")] + public long StartedPrimaries { get; init; } + [JsonInclude, JsonPropertyName("started_replicas")] + public long StartedReplicas { get; init; } + [JsonInclude, JsonPropertyName("unassigned_primaries")] + public long UnassignedPrimaries { get; init; } + [JsonInclude, JsonPropertyName("unassigned_replicas")] + public long UnassignedReplicas { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs new file mode 100644 index 00000000000..0a79ce68d8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.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.Core.HealthReport; + +/// +/// SHARDS_CAPACITY +/// +public sealed partial class ShardsCapacityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsCapacityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs new file mode 100644 index 00000000000..79d7f3f48a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.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.HealthReport; + +public sealed partial class ShardsCapacityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("data")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsCapacityIndicatorTierDetail Data { get; init; } + [JsonInclude, JsonPropertyName("frozen")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.ShardsCapacityIndicatorTierDetail Frozen { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs new file mode 100644 index 00000000000..4ae5675421f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.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.HealthReport; + +public sealed partial class ShardsCapacityIndicatorTierDetail +{ + [JsonInclude, JsonPropertyName("current_used_shards")] + public int? CurrentUsedShards { get; init; } + [JsonInclude, JsonPropertyName("max_shards_in_cluster")] + public int MaxShardsInCluster { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs new file mode 100644 index 00000000000..9f389c5423c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicator.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.Core.HealthReport; + +/// +/// SLM +/// +public sealed partial class SlmIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.SlmIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs new file mode 100644 index 00000000000..c5c3abd8688 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.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.HealthReport; + +public sealed partial class SlmIndicatorDetails +{ + [JsonInclude, JsonPropertyName("policies")] + public long Policies { get; init; } + [JsonInclude, JsonPropertyName("slm_status")] + public Elastic.Clients.Elasticsearch.Serverless.LifecycleOperationMode SlmStatus { get; init; } + [JsonInclude, JsonPropertyName("unhealthy_policies")] + public Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport.SlmIndicatorUnhealthyPolicies UnhealthyPolicies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs new file mode 100644 index 00000000000..a8b55e73909 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.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.HealthReport; + +public sealed partial class SlmIndicatorUnhealthyPolicies +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("invocations_since_last_success")] + public IReadOnlyDictionary? InvocationsSinceLastSuccess { 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 index 33b2f3f6ce9..af5c6088203 100644 --- 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 @@ -29,10 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.MGet; public sealed partial class MultiGetError { + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Error { get; init; } [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 index 17cc8ead9e7..5984b34f90f 100644 --- 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 @@ -41,18 +41,18 @@ public sealed partial class MultiGetOperation [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; } + /// + /// If `false`, excludes all _source fields. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + /// /// The stored fields you want to retrieve. /// @@ -64,6 +64,124 @@ public sealed partial class MultiGetOperation 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.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? SourceValue { 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; + } + + /// + /// 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; + } + + /// + /// If `false`, excludes all _source fields. + /// + public MultiGetOperationDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source) + { + SourceValue = source; + 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 (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} + public sealed partial class MultiGetOperationDescriptor : SerializableDescriptor { internal MultiGetOperationDescriptor(Action configure) => configure.Invoke(this); @@ -166,10 +284,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, StoredFieldsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) 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 index 3c941cd5300..5b48b7b456f 100644 --- 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 @@ -29,14 +29,10 @@ 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("_clusters")] + public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; } [JsonInclude, JsonPropertyName("fields")] public IReadOnlyDictionary? Fields { get; init; } [JsonInclude, JsonPropertyName("hits")] @@ -49,6 +45,10 @@ public sealed partial class MultiSearchItem 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("status")] public int? Status { get; init; } [JsonInclude, JsonPropertyName("suggest")] 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 index eb9aa6cfbe2..1e36face2d7 100644 --- 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 @@ -33,7 +33,37 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve { if (reader.TokenType != JsonTokenType.StartObject) throw new JsonException("Unexpected JSON detected."); - var variant = new MultisearchBody(); + IReadOnlyDictionary? aggregations = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse = default; + IReadOnlyCollection? docvalueFields = default; + bool? explain = default; + IReadOnlyDictionary? ext = default; + IReadOnlyCollection? fields = default; + int? from = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? highlight = default; + IReadOnlyCollection>? indicesBoost = default; + IReadOnlyCollection? knn = default; + double? minScore = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? pit = default; + Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? postFilter = default; + bool? profile = default; + Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query = default; + IReadOnlyCollection? rescore = default; + IReadOnlyDictionary? runtimeMappings = default; + IReadOnlyDictionary? scriptFields = default; + IReadOnlyCollection? searchAfter = default; + bool? seqNoPrimaryTerm = default; + int? size = default; + IReadOnlyCollection? sort = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? source = default; + IReadOnlyCollection? stats = default; + Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? suggest = default; + long? terminateAfter = default; + string? timeout = default; + bool? trackScores = default; + Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? trackTotalHits = default; + bool? version = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType == JsonTokenType.PropertyName) @@ -41,2465 +71,321 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "collapse") { - variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + collapse = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "docvalue_fields") { - variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + docvalueFields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "explain") { - variant.Explain = JsonSerializer.Deserialize(ref reader, options); + explain = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "ext") { - variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + ext = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "fields") { - variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + fields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "from") { - variant.From = JsonSerializer.Deserialize(ref reader, options); + from = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "highlight") { - variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + highlight = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "indices_boost") { - variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + indicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); continue; } if (property == "knn") { - variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + knn = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "min_score") { - variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + minScore = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "pit") { - variant.Pit = JsonSerializer.Deserialize(ref reader, options); + pit = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "post_filter") { - variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + postFilter = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "profile") { - variant.Profile = JsonSerializer.Deserialize(ref reader, options); + profile = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "query") { - variant.Query = JsonSerializer.Deserialize(ref reader, options); + query = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "rescore") { - variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + rescore = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "runtime_mappings") { - variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + runtimeMappings = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "script_fields") { - variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + scriptFields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "search_after") { - variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + searchAfter = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "seq_no_primary_term") { - variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + seqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "size") { - variant.Size = JsonSerializer.Deserialize(ref reader, options); + size = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "sort") { - variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + sort = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "_source") { - variant.Source = JsonSerializer.Deserialize(ref reader, options); + source = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "stats") { - variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + stats = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "stored_fields") { - variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + storedFields = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "suggest") { - variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + suggest = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "terminate_after") { - variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + terminateAfter = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "timeout") { - variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + timeout = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "track_scores") { - variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + trackScores = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "track_total_hits") { - variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + trackTotalHits = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "version") { - variant.Version = JsonSerializer.Deserialize(ref reader, options); + version = JsonSerializer.Deserialize(ref reader, options); continue; } } } - return variant; + return new MultisearchBody { Aggregations = aggregations, Collapse = collapse, DocvalueFields = docvalueFields, Explain = explain, Ext = ext, Fields = fields, From = from, Highlight = highlight, IndicesBoost = indicesBoost, Knn = knn, MinScore = minScore, Pit = pit, PostFilter = postFilter, Profile = profile, Query = query, Rescore = rescore, RuntimeMappings = runtimeMappings, ScriptFields = scriptFields, SearchAfter = searchAfter, SeqNoPrimaryTerm = seqNoPrimaryTerm, Size = size, Sort = sort, Source = source, Stats = stats, StoredFields = storedFields, Suggest = suggest, TerminateAfter = terminateAfter, Timeout = timeout, TrackScores = trackScores, TrackTotalHits = trackTotalHits, Version = version }; } public override void Write(Utf8JsonWriter writer, MultisearchBody 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.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.Source is not null) - { - writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, value.Source, 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(); + throw new NotImplementedException("'MultisearchBody' is a readonly type, used only on responses and does not support being written to JSON."); } } [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; } + public IReadOnlyDictionary? Aggregations { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; init; } /// /// 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; } + public IReadOnlyCollection? DocvalueFields { get; init; } /// /// If true, returns detailed information about score computation as part of a hit. /// - public bool? Explain { get; set; } + public bool? Explain { get; init; } /// /// Configuration of search extensions defined by Elasticsearch plugins. /// - public IDictionary? Ext { get; set; } + public IReadOnlyDictionary? Ext { get; init; } /// /// 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; } + public IReadOnlyCollection? Fields { get; init; } /// /// 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; } + public int? From { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; init; } /// /// Boosts the _score of documents from specified indices. /// - public ICollection>? IndicesBoost { get; set; } + public IReadOnlyCollection>? IndicesBoost { get; init; } /// /// Defines the approximate kNN search to run. /// - public ICollection? Knn { get; set; } + public IReadOnlyCollection? Knn { get; init; } /// /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
///
- public double? MinScore { get; set; } + public double? MinScore { get; init; } /// /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; init; } + public bool? Profile { get; init; } /// /// Defines the search definition using the Query DSL. /// - public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } - public ICollection? Rescore { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; init; } + public IReadOnlyCollection? Rescore { get; init; } /// /// 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; } + public IReadOnlyDictionary? RuntimeMappings { get; init; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public IDictionary? ScriptFields { get; set; } - public ICollection? SearchAfter { get; set; } + public IReadOnlyDictionary? ScriptFields { get; init; } + public IReadOnlyCollection? SearchAfter { get; init; } /// /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
///
- public bool? SeqNoPrimaryTerm { get; set; } + public bool? SeqNoPrimaryTerm { get; init; } /// /// 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; } + public int? Size { get; init; } + public IReadOnlyCollection? Sort { get; init; } + + /// + /// 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; init; } /// /// 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; } + public IReadOnlyCollection? Stats { get; init; } /// /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; init; } /// /// 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; } + public long? TerminateAfter { get; init; } /// /// 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; } + public string? Timeout { get; init; } /// /// If true, calculate and return document scores, even if the scores are not used for sorting. /// - public bool? TrackScores { get; set; } + public bool? TrackScores { get; init; } /// /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; init; } /// /// 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 bool? ExplainValue { get; set; } - private IDictionary? ExtValue { get; set; } - private ICollection? FieldsValue { get; set; } - private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } - private Action> FieldsDescriptorAction { get; set; } - private Action>[] FieldsDescriptorActions { get; set; } - private int? FromValue { 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>? IndicesBoostValue { get; set; } - private ICollection? KnnValue { get; set; } - private KnnQueryDescriptor KnnDescriptor { get; set; } - private Action> KnnDescriptorAction { get; set; } - private Action>[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action> PostFilterDescriptorAction { get; set; } - private bool? ProfileValue { 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 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? 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 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - 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; - } - - /// - /// Boosts the _score of documents from specified indices. - /// - public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) - { - IndicesBoostValue = indicesBoost; - 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; - } - - /// - /// 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 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; - } - - public MultisearchBodyDescriptor Profile(bool? profile = true) - { - ProfileValue = profile; - 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; - } - - /// - /// 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; - } - - 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; - } - - /// - /// 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 (ExplainValue.HasValue) - { - writer.WritePropertyName("explain"); - writer.WriteBooleanValue(ExplainValue.Value); - } - - if (ExtValue is not null) - { - writer.WritePropertyName("ext"); - JsonSerializer.Serialize(writer, ExtValue, 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 (FromValue.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(FromValue.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 Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); - } - else if (HighlightValue is not null) - { - writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, HighlightValue, options); - } - - if (IndicesBoostValue is not null) - { - writer.WritePropertyName("indices_boost"); - JsonSerializer.Serialize(writer, IndicesBoostValue, 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 (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 (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 (ProfileValue.HasValue) - { - writer.WritePropertyName("profile"); - writer.WriteBooleanValue(ProfileValue.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 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 (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 (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 (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 bool? ExplainValue { get; set; } - private IDictionary? ExtValue { get; set; } - private ICollection? FieldsValue { get; set; } - private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } - private Action FieldsDescriptorAction { get; set; } - private Action[] FieldsDescriptorActions { get; set; } - private int? FromValue { 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>? IndicesBoostValue { get; set; } - private ICollection? KnnValue { get; set; } - private KnnQueryDescriptor KnnDescriptor { get; set; } - private Action KnnDescriptorAction { get; set; } - private Action[] KnnDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action PostFilterDescriptorAction { get; set; } - private bool? ProfileValue { 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 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? 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 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - 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; - } - - /// - /// Boosts the _score of documents from specified indices. - /// - public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) - { - IndicesBoostValue = indicesBoost; - 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; - } - - /// - /// 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 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; - } - - public MultisearchBodyDescriptor Profile(bool? profile = true) - { - ProfileValue = profile; - 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; - } - - /// - /// 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; - } - - 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; - } - - /// - /// 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 (ExplainValue.HasValue) - { - writer.WritePropertyName("explain"); - writer.WriteBooleanValue(ExplainValue.Value); - } - - if (ExtValue is not null) - { - writer.WritePropertyName("ext"); - JsonSerializer.Serialize(writer, ExtValue, 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 (FromValue.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(FromValue.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 Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); - } - else if (HighlightValue is not null) - { - writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, HighlightValue, options); - } - - if (IndicesBoostValue is not null) - { - writer.WritePropertyName("indices_boost"); - JsonSerializer.Serialize(writer, IndicesBoostValue, 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 (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 (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 (ProfileValue.HasValue) - { - writer.WritePropertyName("profile"); - writer.WriteBooleanValue(ProfileValue.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 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 (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 (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 (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 bool? Version { get; init; } } \ 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 index 01366f5b7d3..24aae6ace5c 100644 --- 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 @@ -33,188 +33,26 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.MSearch; public sealed partial class MultisearchHeader { [JsonInclude, JsonPropertyName("allow_no_indices")] - public bool? AllowNoIndices { get; set; } + public bool? AllowNoIndices { get; init; } [JsonInclude, JsonPropertyName("allow_partial_search_results")] - public bool? AllowPartialSearchResults { get; set; } + public bool? AllowPartialSearchResults { get; init; } [JsonInclude, JsonPropertyName("ccs_minimize_roundtrips")] - public bool? CcsMinimizeRoundtrips { get; set; } + public bool? CcsMinimizeRoundtrips { get; init; } [JsonInclude, JsonPropertyName("expand_wildcards")] - [JsonConverter(typeof(ExpandWildcardsConverter))] - public ICollection? ExpandWildcards { get; set; } + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.ExpandWildcard))] + public IReadOnlyCollection? ExpandWildcards { get; init; } [JsonInclude, JsonPropertyName("ignore_throttled")] - public bool? IgnoreThrottled { get; set; } + public bool? IgnoreThrottled { get; init; } [JsonInclude, JsonPropertyName("ignore_unavailable")] - public bool? IgnoreUnavailable { get; set; } + public bool? IgnoreUnavailable { get; init; } [JsonInclude, JsonPropertyName("index")] - public Elastic.Clients.Elasticsearch.Serverless.Indices? Index { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; init; } [JsonInclude, JsonPropertyName("preference")] - public string? Preference { get; set; } + public string? Preference { get; init; } [JsonInclude, JsonPropertyName("request_cache")] - public bool? RequestCache { get; set; } + public bool? RequestCache { get; init; } [JsonInclude, JsonPropertyName("routing")] - public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; init; } [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(); - } + public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get; init; } } \ 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 index 568a3c12230..6e2201615a8 100644 --- 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 @@ -33,125 +33,29 @@ public sealed partial class TemplateConfig /// If `true`, returns detailed information about score calculation as part of each hit. ///
[JsonInclude, JsonPropertyName("explain")] - public bool? Explain { get; set; } + public bool? Explain { get; init; } /// /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; init; } /// /// Key-value pairs used to replace Mustache variables in the template.
The key is the variable name.
The value is the variable value.
///
[JsonInclude, JsonPropertyName("params")] - public IDictionary? Params { get; set; } + public IReadOnlyDictionary? Params { get; init; } /// /// If `true`, the query execution is profiled. /// [JsonInclude, JsonPropertyName("profile")] - public bool? Profile { get; set; } + public bool? Profile { get; init; } /// /// 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; } - - /// - /// If `true`, returns detailed information about score calculation as part of each hit. - /// - 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; - } - - /// - /// Key-value pairs used to replace Mustache variables in the template.
The key is the variable name.
The value is the variable value.
- ///
- public TemplateConfigDescriptor Params(Func, FluentDictionary> selector) - { - ParamsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - /// - /// If `true`, the query execution is profiled. - /// - 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(); - } + public string? Source { get; init; } } \ 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 index 5b89224ec23..f10a8526f9d 100644 --- 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 @@ -29,42 +29,42 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Mtermvectors; public sealed partial class MultiTermVectorsOperation { - /// - /// The ID of the document. - /// - [JsonInclude, JsonPropertyName("_id")] - public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } - - /// - /// The index of the document. - /// - [JsonInclude, JsonPropertyName("_index")] - public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } - /// /// An artificial document (a document not present in the index) for which you want to retrieve term vectors. /// [JsonInclude, JsonPropertyName("doc")] public object? Doc { get; set; } - /// - /// If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. - /// - [JsonInclude, JsonPropertyName("field_statistics")] - public bool? FieldStatistics { get; set; } - /// /// Comma-separated list or wildcard expressions of fields to include in the statistics.
Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
///
[JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Serverless.Fields? Fields { get; set; } + /// + /// If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. + /// + [JsonInclude, JsonPropertyName("field_statistics")] + public bool? FieldStatistics { get; set; } + /// /// Filter terms based on their tf-idf scores. /// [JsonInclude, JsonPropertyName("filter")] public Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.Filter? Filter { get; set; } + /// + /// The ID of the document. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// The index of the document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + /// /// If `true`, the response includes term offsets. /// @@ -120,8 +120,8 @@ public MultiTermVectorsOperationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private bool? FieldStatisticsValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } private bool? OffsetsValue { get; set; } @@ -170,7 +170,7 @@ public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Ela return Self; } - public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -178,7 +178,7 @@ public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.Fi return Self; } - public MultiTermVectorsOperationDescriptor Filter(Action configure) + public MultiTermVectorsOperationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -296,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -342,10 +342,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(TermStatisticsValue.Value); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -370,8 +370,8 @@ public MultiTermVectorsOperationDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private bool? FieldStatisticsValue { 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 Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id IdValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } private bool? OffsetsValue { get; set; } @@ -420,7 +420,7 @@ public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -428,7 +428,7 @@ public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescrip return Self; } - public MultiTermVectorsOperationDescriptor Filter(Action configure) + public MultiTermVectorsOperationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -546,7 +546,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -592,10 +592,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(TermStatisticsValue.Value); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) 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 index e98ebb6dfb8..e9470c32e8f 100644 --- 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 @@ -29,19 +29,19 @@ 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("_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/Types/Core/MultiGetResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs index 76fb1e8d07d..9ff09f18602 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiGetResponseItem.g.cs @@ -32,11 +32,11 @@ 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.Get.GetResult Result) : base(Result) { } - public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Serverless.Core.MGet.MultiGetError failure) : base(failure) + 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 index 4dd7d222374..cc143a4d923 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/MultiSearchResponseItem.g.cs @@ -32,11 +32,11 @@ 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.Core.MSearch.MultiSearchItem Result) : base(Result) { } - public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Serverless.ErrorResponseBase failure) : base(failure) + 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/RankEvalMetric.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs index b934afee6f1..72bb4258aa3 100644 --- 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 @@ -50,20 +50,20 @@ 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.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.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.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.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; } + private Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecallDescriptor RecallDescriptor { get; set; } + private Action RecallDescriptorAction { get; set; } public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? dcg) { @@ -73,7 +73,7 @@ public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Serverless.Cor return Self; } - public RankEvalMetricDescriptor Dcg(RankEvalMetricDiscountedCumulativeGainDescriptor descriptor) + public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGainDescriptor descriptor) { DcgValue = null; DcgDescriptorAction = null; @@ -81,7 +81,7 @@ public RankEvalMetricDescriptor Dcg(RankEvalMetricDiscountedCumulativeGainDescri return Self; } - public RankEvalMetricDescriptor Dcg(Action configure) + public RankEvalMetricDescriptor Dcg(Action configure) { DcgValue = null; DcgDescriptor = null; @@ -97,7 +97,7 @@ public RankEvalMetricDescriptor ExpectedReciprocalRank(Elastic.Clients.Elasticse return Self; } - public RankEvalMetricDescriptor ExpectedReciprocalRank(RankEvalMetricExpectedReciprocalRankDescriptor descriptor) + public RankEvalMetricDescriptor ExpectedReciprocalRank(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricExpectedReciprocalRankDescriptor descriptor) { ExpectedReciprocalRankValue = null; ExpectedReciprocalRankDescriptorAction = null; @@ -105,7 +105,7 @@ public RankEvalMetricDescriptor ExpectedReciprocalRank(RankEvalMetricExpectedRec return Self; } - public RankEvalMetricDescriptor ExpectedReciprocalRank(Action configure) + public RankEvalMetricDescriptor ExpectedReciprocalRank(Action configure) { ExpectedReciprocalRankValue = null; ExpectedReciprocalRankDescriptor = null; @@ -121,7 +121,7 @@ public RankEvalMetricDescriptor MeanReciprocalRank(Elastic.Clients.Elasticsearch return Self; } - public RankEvalMetricDescriptor MeanReciprocalRank(RankEvalMetricMeanReciprocalRankDescriptor descriptor) + public RankEvalMetricDescriptor MeanReciprocalRank(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricMeanReciprocalRankDescriptor descriptor) { MeanReciprocalRankValue = null; MeanReciprocalRankDescriptorAction = null; @@ -129,7 +129,7 @@ public RankEvalMetricDescriptor MeanReciprocalRank(RankEvalMetricMeanReciprocalR return Self; } - public RankEvalMetricDescriptor MeanReciprocalRank(Action configure) + public RankEvalMetricDescriptor MeanReciprocalRank(Action configure) { MeanReciprocalRankValue = null; MeanReciprocalRankDescriptor = null; @@ -145,7 +145,7 @@ public RankEvalMetricDescriptor Precision(Elastic.Clients.Elasticsearch.Serverle return Self; } - public RankEvalMetricDescriptor Precision(RankEvalMetricPrecisionDescriptor descriptor) + public RankEvalMetricDescriptor Precision(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricPrecisionDescriptor descriptor) { PrecisionValue = null; PrecisionDescriptorAction = null; @@ -153,7 +153,7 @@ public RankEvalMetricDescriptor Precision(RankEvalMetricPrecisionDescriptor desc return Self; } - public RankEvalMetricDescriptor Precision(Action configure) + public RankEvalMetricDescriptor Precision(Action configure) { PrecisionValue = null; PrecisionDescriptor = null; @@ -169,7 +169,7 @@ public RankEvalMetricDescriptor Recall(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public RankEvalMetricDescriptor Recall(RankEvalMetricRecallDescriptor descriptor) + public RankEvalMetricDescriptor Recall(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecallDescriptor descriptor) { RecallValue = null; RecallDescriptorAction = null; @@ -177,7 +177,7 @@ public RankEvalMetricDescriptor Recall(RankEvalMetricRecallDescriptor descriptor return Self; } - public RankEvalMetricDescriptor Recall(Action configure) + public RankEvalMetricDescriptor Recall(Action configure) { RecallValue = null; RecallDescriptor = null; @@ -196,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DcgDescriptorAction is not null) { writer.WritePropertyName("dcg"); - JsonSerializer.Serialize(writer, new RankEvalMetricDiscountedCumulativeGainDescriptor(DcgDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricDiscountedCumulativeGainDescriptor(DcgDescriptorAction), options); } else if (DcgValue is not null) { @@ -212,7 +212,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExpectedReciprocalRankDescriptorAction is not null) { writer.WritePropertyName("expected_reciprocal_rank"); - JsonSerializer.Serialize(writer, new RankEvalMetricExpectedReciprocalRankDescriptor(ExpectedReciprocalRankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricExpectedReciprocalRankDescriptor(ExpectedReciprocalRankDescriptorAction), options); } else if (ExpectedReciprocalRankValue is not null) { @@ -228,7 +228,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MeanReciprocalRankDescriptorAction is not null) { writer.WritePropertyName("mean_reciprocal_rank"); - JsonSerializer.Serialize(writer, new RankEvalMetricMeanReciprocalRankDescriptor(MeanReciprocalRankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricMeanReciprocalRankDescriptor(MeanReciprocalRankDescriptorAction), options); } else if (MeanReciprocalRankValue is not null) { @@ -244,7 +244,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PrecisionDescriptorAction is not null) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, new RankEvalMetricPrecisionDescriptor(PrecisionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricPrecisionDescriptor(PrecisionDescriptorAction), options); } else if (PrecisionValue is not null) { @@ -260,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RecallDescriptorAction is not null) { writer.WritePropertyName("recall"); - JsonSerializer.Serialize(writer, new RankEvalMetricRecallDescriptor(RecallDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalMetricRecallDescriptor(RecallDescriptorAction), options); } else if (RecallValue is not null) { 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 index 19417c80dd3..1de603aeaab 100644 --- 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 @@ -29,9 +29,13 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; /// /// Discounted cumulative gain (DCG) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricDiscountedCumulativeGain { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } @@ -44,6 +48,7 @@ public sealed partial class RankEvalMetricDiscountedCumulativeGain /// /// Discounted cumulative gain (DCG) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricDiscountedCumulativeGainDescriptor : SerializableDescriptor { @@ -56,6 +61,9 @@ public RankEvalMetricDiscountedCumulativeGainDescriptor() : base() private int? kValue { get; set; } private bool? NormalizeValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricDiscountedCumulativeGainDescriptor k(int? k) { kValue = k; 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 index ecfe0fa728d..dbd86732ea4 100644 --- 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 @@ -29,9 +29,13 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; /// /// Expected Reciprocal Rank (ERR) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricExpectedReciprocalRank { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } @@ -44,6 +48,7 @@ public sealed partial class RankEvalMetricExpectedReciprocalRank /// /// Expected Reciprocal Rank (ERR) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricExpectedReciprocalRankDescriptor : SerializableDescriptor { @@ -56,6 +61,9 @@ public RankEvalMetricExpectedReciprocalRankDescriptor() : base() private int? kValue { get; set; } private int MaximumRelevanceValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricExpectedReciprocalRankDescriptor k(int? k) { kValue = k; 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 index f6074297ee2..5b814eb096c 100644 --- 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 @@ -29,17 +29,26 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; /// /// Mean Reciprocal Rank +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricMeanReciprocalRank { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Mean Reciprocal Rank +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricMeanReciprocalRankDescriptor : SerializableDescriptor { @@ -52,12 +61,18 @@ public RankEvalMetricMeanReciprocalRankDescriptor() : base() private int? kValue { get; set; } private int? RelevantRatingThresholdValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricMeanReciprocalRankDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricMeanReciprocalRankDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; 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 index e06858843f4..d15ba067860 100644 --- 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 @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; /// /// Precision at K (P@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricPrecision { @@ -37,14 +38,23 @@ public sealed partial class RankEvalMetricPrecision ///
[JsonInclude, JsonPropertyName("ignore_unlabeled")] public bool? IgnoreUnlabeled { get; set; } + + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Precision at K (P@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricPrecisionDescriptor : SerializableDescriptor { @@ -67,12 +77,18 @@ public RankEvalMetricPrecisionDescriptor IgnoreUnlabeled(bool? ignoreUnlabeled = return Self; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricPrecisionDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricPrecisionDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; 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 index e5e9140cec8..6f7f44c7279 100644 --- 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 @@ -29,17 +29,26 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.RankEval; /// /// Recall at K (R@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricRecall { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Recall at K (R@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricRecallDescriptor : SerializableDescriptor { @@ -52,12 +61,18 @@ public RankEvalMetricRecallDescriptor() : base() private int? kValue { get; set; } private int? RelevantRatingThresholdValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricRecallDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricRecallDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; 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 index 59229ceddb3..d3a94bc1579 100644 --- 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 @@ -44,8 +44,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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) @@ -56,7 +56,7 @@ public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Se return Self; } - public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -64,7 +64,7 @@ public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public RankEvalQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -89,7 +89,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -116,8 +116,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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) @@ -128,7 +128,7 @@ public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Qu return Self; } - public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -136,7 +136,7 @@ public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public RankEvalQueryDescriptor Query(Action configure) + public RankEvalQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { 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 index bacc446ae95..b9677341432 100644 --- 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 @@ -71,12 +71,12 @@ public RankEvalRequestItemDescriptor() : base() 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.Core.RankEval.DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } 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.Core.RankEval.RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action> RequestDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id? TemplateIdValue { get; set; } /// @@ -109,7 +109,7 @@ public RankEvalRequestItemDescriptor Ratings(ICollection Ratings(DocumentRatingDescriptor descriptor) + public RankEvalRequestItemDescriptor Ratings(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.DocumentRatingDescriptor descriptor) { RatingsValue = null; RatingsDescriptorAction = null; @@ -118,7 +118,7 @@ public RankEvalRequestItemDescriptor Ratings(DocumentRatingDescriptor return Self; } - public RankEvalRequestItemDescriptor Ratings(Action configure) + public RankEvalRequestItemDescriptor Ratings(Action configure) { RatingsValue = null; RatingsDescriptor = null; @@ -127,7 +127,7 @@ public RankEvalRequestItemDescriptor Ratings(Action Ratings(params Action[] configure) + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) { RatingsValue = null; RatingsDescriptor = null; @@ -147,7 +147,7 @@ public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elastics return Self; } - public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQueryDescriptor descriptor) { RequestValue = null; RequestDescriptorAction = null; @@ -155,7 +155,7 @@ public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor< return Self; } - public RankEvalRequestItemDescriptor Request(Action> configure) + public RankEvalRequestItemDescriptor Request(Action> configure) { RequestValue = null; RequestDescriptor = null; @@ -194,7 +194,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ratings"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.DocumentRatingDescriptor(RatingsDescriptorAction), options); writer.WriteEndArray(); } else if (RatingsDescriptorActions is not null) @@ -203,7 +203,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RatingsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.DocumentRatingDescriptor(action), options); } writer.WriteEndArray(); @@ -222,7 +222,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RequestDescriptorAction is not null) { writer.WritePropertyName("request"); - JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQueryDescriptor(RequestDescriptorAction), options); } else if (RequestValue is not null) { @@ -251,12 +251,12 @@ public RankEvalRequestItemDescriptor() : base() 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.Core.RankEval.DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } 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.Core.RankEval.RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action RequestDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id? TemplateIdValue { get; set; } /// @@ -289,7 +289,7 @@ public RankEvalRequestItemDescriptor Ratings(ICollection configure) + public RankEvalRequestItemDescriptor Ratings(Action configure) { RatingsValue = null; RatingsDescriptor = null; @@ -307,7 +307,7 @@ public RankEvalRequestItemDescriptor Ratings(Action co return Self; } - public RankEvalRequestItemDescriptor Ratings(params Action[] configure) + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) { RatingsValue = null; RatingsDescriptor = null; @@ -327,7 +327,7 @@ public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Serve return Self; } - public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQueryDescriptor descriptor) { RequestValue = null; RequestDescriptorAction = null; @@ -335,7 +335,7 @@ public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) return Self; } - public RankEvalRequestItemDescriptor Request(Action configure) + public RankEvalRequestItemDescriptor Request(Action configure) { RequestValue = null; RequestDescriptor = null; @@ -374,7 +374,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ratings"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.DocumentRatingDescriptor(RatingsDescriptorAction), options); writer.WriteEndArray(); } else if (RatingsDescriptorActions is not null) @@ -383,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RatingsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.DocumentRatingDescriptor(action), options); } writer.WriteEndArray(); @@ -402,7 +402,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RequestDescriptorAction is not null) { writer.WritePropertyName("request"); - JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.RankEval.RankEvalQueryDescriptor(RequestDescriptorAction), options); } else if (RequestValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/RemoteSource.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/RemoteSource.g.cs index 94db6f6823f..9f3ba8303cd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/RemoteSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/RemoteSource.g.cs @@ -151,11 +151,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("host"); - JsonSerializer.Serialize(writer, HostValue, options); - if (PasswordValue is not null) + writer.WriteStringValue(HostValue); + if (!string.IsNullOrEmpty(PasswordValue)) { writer.WritePropertyName("password"); - JsonSerializer.Serialize(writer, PasswordValue, options); + writer.WriteStringValue(PasswordValue); } if (SocketTimeoutValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/Source.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/Source.g.cs index a3a7316cb5c..d54256f2444 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Reindex/Source.g.cs @@ -29,17 +29,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Reindex; public sealed partial class Source { - /// - /// If `true` reindexes all source fields.
Set to a list to reindex select fields.
- ///
- [JsonInclude, JsonPropertyName("_source")] - public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFields { get; set; } - /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
[JsonInclude, JsonPropertyName("index")] - public Elastic.Clients.Elasticsearch.Serverless.Indices Index { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Indices Indices { get; set; } /// /// Specifies the documents to reindex using the Query DSL. @@ -69,6 +63,12 @@ public sealed partial class Source [JsonInclude, JsonPropertyName("sort")] [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))] public ICollection? Sort { get; set; } + + /// + /// If `true` reindexes all source fields.
Set to a list to reindex select fields.
+ ///
+ [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFields { get; set; } } public sealed partial class SourceDescriptor : SerializableDescriptor> @@ -79,30 +79,30 @@ public SourceDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Indices IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSource? RemoteValue { get; set; } - private RemoteSourceDescriptor RemoteDescriptor { get; set; } - private Action RemoteDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor RemoteDescriptor { get; set; } + private Action RemoteDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private int? SizeValue { 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.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFieldsValue { get; set; } /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
- public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.Indices index) + public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) { - IndexValue = index; + IndicesValue = indices; return Self; } @@ -117,7 +117,7 @@ public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverles return Self; } - public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -125,7 +125,7 @@ public SourceDescriptor Query(QueryDsl.QueryDescriptor des return Self; } - public SourceDescriptor Query(Action> configure) + public SourceDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -144,7 +144,7 @@ public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Serverle return Self; } - public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) + public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor descriptor) { RemoteValue = null; RemoteDescriptorAction = null; @@ -152,7 +152,7 @@ public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) return Self; } - public SourceDescriptor Remote(Action configure) + public SourceDescriptor Remote(Action configure) { RemoteValue = null; RemoteDescriptor = null; @@ -160,9 +160,9 @@ public SourceDescriptor Remote(Action configu return Self; } - public SourceDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public SourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -186,7 +186,7 @@ public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.Serverles return Self; } - public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) + public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -194,7 +194,7 @@ public SourceDescriptor Slice(SlicedScrollDescriptor descr return Self; } - public SourceDescriptor Slice(Action> configure) + public SourceDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -211,7 +211,7 @@ public SourceDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SourceDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -220,7 +220,7 @@ public SourceDescriptor Sort(SortOptionsDescriptor descrip return Self; } - public SourceDescriptor Sort(Action> configure) + public SourceDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -229,7 +229,7 @@ public SourceDescriptor Sort(Action> return Self; } - public SourceDescriptor Sort(params Action>[] configure) + public SourceDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -251,7 +251,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexValue, options); + JsonSerializer.Serialize(writer, IndicesValue, options); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -260,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -276,7 +276,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RemoteDescriptorAction is not null) { writer.WritePropertyName("remote"); - JsonSerializer.Serialize(writer, new RemoteSourceDescriptor(RemoteDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor(RemoteDescriptorAction), options); } else if (RemoteValue is not null) { @@ -304,7 +304,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -320,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -329,7 +329,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -359,30 +359,30 @@ public SourceDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Indices IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } 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.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSource? RemoteValue { get; set; } - private RemoteSourceDescriptor RemoteDescriptor { get; set; } - private Action RemoteDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor RemoteDescriptor { get; set; } + private Action RemoteDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private int? SizeValue { 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.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? SourceFieldsValue { get; set; } /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
- public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.Indices index) + public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) { - IndexValue = index; + IndicesValue = indices; return Self; } @@ -397,7 +397,7 @@ public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl. return Self; } - public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -405,7 +405,7 @@ public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public SourceDescriptor Query(Action configure) + public SourceDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -424,7 +424,7 @@ public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Serverless.Core.Rei return Self; } - public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) + public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor descriptor) { RemoteValue = null; RemoteDescriptorAction = null; @@ -432,7 +432,7 @@ public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) return Self; } - public SourceDescriptor Remote(Action configure) + public SourceDescriptor Remote(Action configure) { RemoteValue = null; RemoteDescriptor = null; @@ -440,9 +440,9 @@ public SourceDescriptor Remote(Action configure) return Self; } - public SourceDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public SourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -466,7 +466,7 @@ public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScr return Self; } - public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) + public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -474,7 +474,7 @@ public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public SourceDescriptor Slice(Action configure) + public SourceDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -491,7 +491,7 @@ public SourceDescriptor Sort(ICollection configure) + public SourceDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -509,7 +509,7 @@ public SourceDescriptor Sort(Action configure) return Self; } - public SourceDescriptor Sort(params Action[] configure) + public SourceDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -531,7 +531,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexValue, options); + JsonSerializer.Serialize(writer, IndicesValue, options); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -540,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -556,7 +556,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RemoteDescriptorAction is not null) { writer.WritePropertyName("remote"); - JsonSerializer.Serialize(writer, new RemoteSourceDescriptor(RemoteDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.RemoteSourceDescriptor(RemoteDescriptorAction), options); } else if (RemoteValue is not null) { @@ -584,7 +584,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -600,7 +600,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -609,7 +609,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs index c753a624ed1..cd14b9a0ec6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs @@ -36,7 +36,7 @@ public sealed partial class ReindexTask [JsonInclude, JsonPropertyName("description")] public string Description { get; init; } [JsonInclude, JsonPropertyName("headers")] - public IReadOnlyDictionary> Headers { get; init; } + public IReadOnlyDictionary>> Headers { get; init; } [JsonInclude, JsonPropertyName("id")] public long Id { get; init; } [JsonInclude, JsonPropertyName("node")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggest.g.cs new file mode 100644 index 00000000000..2f3b7b91e4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggest.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.Core.Search; + +public sealed partial class CompletionSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [GenericConverter(typeof(SingleOrManyCollectionConverter<>), unwrap: true)] + public IReadOnlyCollection> Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs new file mode 100644 index 00000000000..69edb9550d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/CompletionSuggestOption.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.Core.Search; + +public sealed partial class CompletionSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("contexts")] + public IReadOnlyDictionary>? Contexts { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string? Index { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double? Score { get; init; } + [JsonInclude, JsonPropertyName("_score")] + public double? Score0 { get; init; } + [JsonInclude, JsonPropertyName("_source")] + public TDocument? Source { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ 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 index fdb82a75f93..2a46ade476a 100644 --- 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 @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; public sealed partial class CompletionSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } @@ -36,7 +39,11 @@ public sealed partial class CompletionSuggester /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. ///
[JsonInclude, JsonPropertyName("contexts")] - public IDictionary>? Contexts { get; set; } + public IDictionary>>? Contexts { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } @@ -51,6 +58,10 @@ public sealed partial class CompletionSuggester ///
[JsonInclude, JsonPropertyName("regex")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptions? Regex { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -60,7 +71,7 @@ public sealed partial class CompletionSuggester [JsonInclude, JsonPropertyName("skip_duplicates")] public bool? SkipDuplicates { get; set; } - public static implicit operator FieldSuggester(CompletionSuggester completionSuggester) => Core.Search.FieldSuggester.Completion(completionSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester(CompletionSuggester completionSuggester) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester.Completion(completionSuggester); } public sealed partial class CompletionSuggesterDescriptor : SerializableDescriptor> @@ -72,17 +83,20 @@ public CompletionSuggesterDescriptor() : base() } private string? AnalyzerValue { get; set; } - private IDictionary>? ContextsValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } private int? SizeValue { get; set; } private bool? SkipDuplicatesValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public CompletionSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -92,24 +106,39 @@ public CompletionSuggesterDescriptor Analyzer(string? analyzer) /// /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. /// - public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + public CompletionSuggesterDescriptor Contexts(Func>>, FluentDictionary>>> selector) { - ContextsValue = selector?.Invoke(new FluentDictionary>()); + ContextsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public CompletionSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Enables fuzziness, meaning you can have a typo in your search and still get results back. /// @@ -121,7 +150,7 @@ public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsea return Self; } - public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzzinessDescriptor descriptor) { FuzzyValue = null; FuzzyDescriptorAction = null; @@ -129,7 +158,7 @@ public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor return Self; } - public CompletionSuggesterDescriptor Fuzzy(Action configure) + public CompletionSuggesterDescriptor Fuzzy(Action configure) { FuzzyValue = null; FuzzyDescriptor = null; @@ -148,7 +177,7 @@ public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsea return Self; } - public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor descriptor) { RegexValue = null; RegexDescriptorAction = null; @@ -156,7 +185,7 @@ public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor des return Self; } - public CompletionSuggesterDescriptor Regex(Action configure) + public CompletionSuggesterDescriptor Regex(Action configure) { RegexValue = null; RegexDescriptor = null; @@ -164,6 +193,9 @@ public CompletionSuggesterDescriptor Regex(Action + /// The maximum corrections to be returned per suggest text token. + ///
public CompletionSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -204,7 +236,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FuzzyDescriptorAction is not null) { writer.WritePropertyName("fuzzy"); - JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); } else if (FuzzyValue is not null) { @@ -220,7 +252,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RegexDescriptorAction is not null) { writer.WritePropertyName("regex"); - JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor(RegexDescriptorAction), options); } else if (RegexValue is not null) { @@ -253,17 +285,20 @@ public CompletionSuggesterDescriptor() : base() } private string? AnalyzerValue { get; set; } - private IDictionary>? ContextsValue { 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.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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } private int? SizeValue { get; set; } private bool? SkipDuplicatesValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public CompletionSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -273,24 +308,33 @@ public CompletionSuggesterDescriptor Analyzer(string? analyzer) /// /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. /// - public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + public CompletionSuggesterDescriptor Contexts(Func>>, FluentDictionary>>> selector) { - ContextsValue = selector?.Invoke(new FluentDictionary>()); + ContextsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -308,7 +352,7 @@ public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverl return Self; } - public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzzinessDescriptor descriptor) { FuzzyValue = null; FuzzyDescriptorAction = null; @@ -316,7 +360,7 @@ public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor return Self; } - public CompletionSuggesterDescriptor Fuzzy(Action configure) + public CompletionSuggesterDescriptor Fuzzy(Action configure) { FuzzyValue = null; FuzzyDescriptor = null; @@ -335,7 +379,7 @@ public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Serverl return Self; } - public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor descriptor) { RegexValue = null; RegexDescriptorAction = null; @@ -343,7 +387,7 @@ public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) return Self; } - public CompletionSuggesterDescriptor Regex(Action configure) + public CompletionSuggesterDescriptor Regex(Action configure) { RegexValue = null; RegexDescriptor = null; @@ -351,6 +395,9 @@ public CompletionSuggesterDescriptor Regex(Action config return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public CompletionSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -391,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FuzzyDescriptorAction is not null) { writer.WritePropertyName("fuzzy"); - JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); } else if (FuzzyValue is not null) { @@ -407,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RegexDescriptorAction is not null) { writer.WritePropertyName("regex"); - JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RegexOptionsDescriptor(RegexDescriptorAction), options); } else if (RegexValue is not null) { 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 index e0159f0e998..d850c22198d 100644 --- 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 @@ -134,6 +134,15 @@ public DirectGeneratorDescriptor Field(Expression + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// + public DirectGeneratorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The maximum edit distance candidate suggestions can have in order to be considered as a suggestion.
Can only be `1` or `2`.
///
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 index 642267f0206..fdf23e9556c 100644 --- 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 @@ -61,13 +61,13 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Action>[] InnerHitsDescriptorActions { get; set; } private int? MaxConcurrentGroupSearchesValue { get; set; } public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) @@ -78,7 +78,7 @@ public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -86,7 +86,7 @@ public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor Collapse(Action> configure) + public FieldCollapseDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -112,6 +112,15 @@ public FieldCollapseDescriptor Field(Expression + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The number of inner hits and their sort order /// @@ -124,7 +133,7 @@ public FieldCollapseDescriptor InnerHits(ICollection InnerHits(InnerHitsDescriptor descriptor) + public FieldCollapseDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -133,7 +142,7 @@ public FieldCollapseDescriptor InnerHits(InnerHitsDescriptor InnerHits(Action> configure) + public FieldCollapseDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -142,7 +151,7 @@ public FieldCollapseDescriptor InnerHits(Action InnerHits(params Action>[] configure) + public FieldCollapseDescriptor InnerHits(params Action>[] configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -171,7 +180,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -189,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsDescriptorActions is not null) { @@ -198,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in InnerHitsDescriptorActions) { - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(action), options); } if (InnerHitsDescriptorActions.Length > 1) @@ -229,13 +238,13 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Action[] InnerHitsDescriptorActions { get; set; } private int? MaxConcurrentGroupSearchesValue { get; set; } public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? collapse) @@ -246,7 +255,7 @@ public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless return Self; } - public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -254,7 +263,7 @@ public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) return Self; } - public FieldCollapseDescriptor Collapse(Action configure) + public FieldCollapseDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -301,7 +310,7 @@ public FieldCollapseDescriptor InnerHits(ICollection configure) + public FieldCollapseDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -319,7 +328,7 @@ public FieldCollapseDescriptor InnerHits(Action configure) return Self; } - public FieldCollapseDescriptor InnerHits(params Action[] configure) + public FieldCollapseDescriptor InnerHits(params Action[] configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -348,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -366,7 +375,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsDescriptorActions is not null) { @@ -375,7 +384,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in InnerHitsDescriptorActions) { - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(action), options); } if (InnerHitsDescriptorActions.Length > 1) 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 index 1bb5f89b586..20ac876317f 100644 --- 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 @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -66,6 +67,18 @@ internal FieldSuggester(string variantName, object variant) /// [JsonInclude, JsonPropertyName("text")] public string? Text { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class FieldSuggesterConverter : JsonConverter @@ -167,7 +180,7 @@ public override void Write(Utf8JsonWriter writer, FieldSuggester value, JsonSeri writer.WriteStringValue(value.Text); } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -250,12 +263,12 @@ public FieldSuggesterDescriptor Text(string? 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"); + public FieldSuggesterDescriptor Completion(Elastic.Clients.Elasticsearch.Serverless.Core.Search.CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action> configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action> configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action> configure) => Set(configure, "term"); protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { @@ -357,15 +370,12 @@ public FieldSuggesterDescriptor Text(string? 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"); + public FieldSuggesterDescriptor Completion(Elastic.Clients.Elasticsearch.Serverless.Core.Search.CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action configure) => Set(configure, "term"); protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { 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 index 9c05a902154..f65bfbeda16 100644 --- 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 @@ -29,48 +29,109 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; public sealed partial class Highlight { + /// + /// A string that contains each boundary character. + /// [JsonInclude, JsonPropertyName("boundary_chars")] public string? BoundaryChars { get; set; } + + /// + /// How far to scan for boundary characters. + /// [JsonInclude, JsonPropertyName("boundary_max_scan")] public int? BoundaryMaxScan { get; set; } + + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
[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; } + + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
[JsonInclude, JsonPropertyName("fragmenter")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } + + /// + /// The size of the highlighted fragment in characters. + /// + [JsonInclude, JsonPropertyName("fragment_size")] + public int? FragmentSize { get; set; } [JsonInclude, JsonPropertyName("highlight_filter")] public bool? HighlightFilter { get; set; } + + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
[JsonInclude, JsonPropertyName("highlight_query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? HighlightQuery { get; set; } + + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
[JsonInclude, JsonPropertyName("max_analyzed_offset")] public int? MaxAnalyzedOffset { get; set; } [JsonInclude, JsonPropertyName("max_fragment_length")] public int? MaxFragmentLength { get; set; } + + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// [JsonInclude, JsonPropertyName("no_match_size")] public int? NoMatchSize { get; set; } + + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
[JsonInclude, JsonPropertyName("number_of_fragments")] public int? NumberOfFragments { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
[JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? Order { get; set; } + + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("phrase_limit")] public int? PhraseLimit { get; set; } + + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("post_tags")] public ICollection? PostTags { get; set; } + + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("pre_tags")] public ICollection? PreTags { get; set; } + + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
[JsonInclude, JsonPropertyName("require_field_match")] public bool? RequireFieldMatch { get; set; } + + /// + /// Set to `styled` to use the built-in tag schema. + /// [JsonInclude, JsonPropertyName("tags_schema")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -90,14 +151,13 @@ public HighlightDescriptor() : base() 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 IDictionary> FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } 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.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } private int? NoMatchSizeValue { get; set; } @@ -111,24 +171,36 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + /// + /// A string that contains each boundary character. + /// public HighlightDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; @@ -141,24 +213,24 @@ public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Serv return Self; } - public HighlightDescriptor Fields(Func, FluentDictionary> selector) - { - FieldsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public HighlightDescriptor ForceSource(bool? forceSource = true) + public HighlightDescriptor Fields(Func>, FluentDescriptorDictionary>> selector) { - ForceSourceValue = forceSource; + FieldsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -171,6 +243,9 @@ public HighlightDescriptor HighlightFilter(bool? highlightFilter = tr return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -179,7 +254,7 @@ public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsear return Self; } - public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -187,7 +262,7 @@ public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor HighlightQuery(Action> configure) + public HighlightDescriptor HighlightQuery(Action> configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -195,6 +270,9 @@ public HighlightDescriptor HighlightQuery(Action + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ /// public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -207,12 +285,18 @@ public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -225,36 +309,54 @@ public HighlightDescriptor Options(Func + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ /// public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -302,12 +404,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("fields"); JsonSerializer.Serialize(writer, FieldsValue, options); - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -334,7 +430,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { @@ -431,14 +527,13 @@ public HighlightDescriptor() : base() 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 IDictionary FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } 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.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } private int? NoMatchSizeValue { get; set; } @@ -452,24 +547,36 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } + /// + /// A string that contains each boundary character. + /// public HighlightDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; @@ -482,24 +589,24 @@ public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Serverless.Core return Self; } - public HighlightDescriptor Fields(Func, FluentDictionary> selector) - { - FieldsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public HighlightDescriptor ForceSource(bool? forceSource = true) + public HighlightDescriptor Fields(Func, FluentDescriptorDictionary> selector) { - ForceSourceValue = forceSource; + FieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -512,6 +619,9 @@ public HighlightDescriptor HighlightFilter(bool? highlightFilter = true) return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -520,7 +630,7 @@ public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverle return Self; } - public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -528,7 +638,7 @@ public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) return Self; } - public HighlightDescriptor HighlightQuery(Action configure) + public HighlightDescriptor HighlightQuery(Action configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -536,6 +646,9 @@ public HighlightDescriptor HighlightQuery(Action confi return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -548,12 +661,18 @@ public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -566,36 +685,54 @@ public HighlightDescriptor Options(Func, Fluent return Self; } + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -643,12 +780,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("fields"); JsonSerializer.Serialize(writer, FieldsValue, options); - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -675,7 +806,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { 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 index 6a035b506d2..d8bd57e35cb 100644 --- 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 @@ -30,49 +30,111 @@ 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; } + public Elastic.Clients.Elasticsearch.Serverless.Analysis.IAnalyzer? Analyzer { get; set; } + + /// + /// A string that contains each boundary character. + /// [JsonInclude, JsonPropertyName("boundary_chars")] public string? BoundaryChars { get; set; } + + /// + /// How far to scan for boundary characters. + /// [JsonInclude, JsonPropertyName("boundary_max_scan")] public int? BoundaryMaxScan { get; set; } + + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner_locale")] public string? BoundaryScannerLocale { get; set; } - [JsonInclude, JsonPropertyName("force_source")] - public bool? ForceSource { get; set; } + + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
+ [JsonInclude, JsonPropertyName("fragmenter")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } [JsonInclude, JsonPropertyName("fragment_offset")] public int? FragmentOffset { get; set; } + + /// + /// The size of the highlighted fragment in characters. + /// [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; } + + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
[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; } + + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
[JsonInclude, JsonPropertyName("max_analyzed_offset")] public int? MaxAnalyzedOffset { get; set; } [JsonInclude, JsonPropertyName("max_fragment_length")] public int? MaxFragmentLength { get; set; } + + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// [JsonInclude, JsonPropertyName("no_match_size")] public int? NoMatchSize { get; set; } + + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
[JsonInclude, JsonPropertyName("number_of_fragments")] public int? NumberOfFragments { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
[JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? Order { get; set; } + + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("phrase_limit")] public int? PhraseLimit { get; set; } + + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("post_tags")] public ICollection? PostTags { get; set; } + + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("pre_tags")] public ICollection? PreTags { get; set; } + + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
[JsonInclude, JsonPropertyName("require_field_match")] public bool? RequireFieldMatch { get; set; } + + /// + /// Set to `styled` to use the built-in tag schema. + /// [JsonInclude, JsonPropertyName("tags_schema")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -87,19 +149,18 @@ public HighlightFieldDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IAnalyzer? 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentOffsetValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } 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.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFieldsValue { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } @@ -114,42 +175,51 @@ public HighlightFieldDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } - public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? analyzer) + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.IAnalyzer? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// A string that contains each boundary character. + /// public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; return Self; } - public HighlightFieldDescriptor ForceSource(bool? forceSource = true) - { - ForceSourceValue = forceSource; - return Self; - } - + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; @@ -162,6 +232,9 @@ public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightFieldDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -174,6 +247,9 @@ public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -182,7 +258,7 @@ public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasti return Self; } - public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -190,7 +266,7 @@ public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescript return Self; } - public HighlightFieldDescriptor HighlightQuery(Action> configure) + public HighlightFieldDescriptor HighlightQuery(Action> configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -204,6 +280,9 @@ public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elastic return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -216,12 +295,18 @@ public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLen return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -234,36 +319,54 @@ public HighlightFieldDescriptor Options(Func + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ /// public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -309,12 +412,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(BoundaryScannerLocaleValue); } - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -347,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { @@ -445,19 +542,18 @@ public HighlightFieldDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.IAnalyzer? 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentOffsetValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } 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.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? MatchedFieldsValue { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } @@ -472,42 +568,51 @@ public HighlightFieldDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterType? TypeValue { get; set; } - public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.Analyzers? analyzer) + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Serverless.Analysis.IAnalyzer? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// A string that contains each boundary character. + /// public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Serverless.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; return Self; } - public HighlightFieldDescriptor ForceSource(bool? forceSource = true) - { - ForceSourceValue = forceSource; - return Self; - } - + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; @@ -520,6 +625,9 @@ public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightFieldDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -532,6 +640,9 @@ public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter = true) return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -540,7 +651,7 @@ public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Ser return Self; } - public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -548,7 +659,7 @@ public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descript return Self; } - public HighlightFieldDescriptor HighlightQuery(Action configure) + public HighlightFieldDescriptor HighlightQuery(Action configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -562,6 +673,9 @@ public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elasticsearch.Serv return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -574,12 +688,18 @@ public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -592,36 +712,54 @@ public HighlightFieldDescriptor Options(Func, F return Self; } + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -667,12 +805,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(BoundaryScannerLocaleValue); } - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -705,7 +837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { 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 index ece4b89ce34..272dc3723a1 100644 --- 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 @@ -31,12 +31,22 @@ public sealed partial class Hit { [JsonInclude, JsonPropertyName("_explanation")] public Elastic.Clients.Elasticsearch.Serverless.Core.Explain.Explanation? Explanation { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("highlight")] + public IReadOnlyDictionary>? Highlight { get; init; } [JsonInclude, JsonPropertyName("_id")] public string Id { get; init; } [JsonInclude, JsonPropertyName("_ignored")] public IReadOnlyCollection? Ignored { get; init; } + [JsonInclude, JsonPropertyName("ignored_field_values")] + public IReadOnlyDictionary>? IgnoredFieldValues { get; init; } [JsonInclude, JsonPropertyName("_index")] public string Index { get; init; } + [JsonInclude, JsonPropertyName("inner_hits")] + public IReadOnlyDictionary? InnerHits { get; init; } + [JsonInclude, JsonPropertyName("matched_queries")] + public IReadOnlyCollection? MatchedQueries { get; init; } [JsonInclude, JsonPropertyName("_nested")] public Elastic.Clients.Elasticsearch.Serverless.Core.Search.NestedIdentity? Nested { get; init; } [JsonInclude, JsonPropertyName("_node")] @@ -51,21 +61,10 @@ public sealed partial class Hit public long? SeqNo { get; init; } [JsonInclude, JsonPropertyName("_shard")] public string? Shard { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public IReadOnlyCollection? Sort { 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 index 1cc0559659a..3db872977d3 100644 --- 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 @@ -38,5 +38,5 @@ public sealed partial class HitsMetadata /// 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; } + public Union? 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 index a151f13c01f..6a4340d078a 100644 --- 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 @@ -29,8 +29,6 @@ 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")] @@ -72,8 +70,10 @@ public sealed partial class InnerHits [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("_source")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; } + [JsonInclude, JsonPropertyName("stored_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; } [JsonInclude, JsonPropertyName("track_scores")] public bool? TrackScores { get; set; } [JsonInclude, JsonPropertyName("version")] @@ -89,29 +89,29 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } - private HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.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? StoredFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } private bool? VersionValue { get; set; } @@ -123,7 +123,7 @@ public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Ser return Self; } - public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -131,7 +131,7 @@ public InnerHitsDescriptor Collapse(FieldCollapseDescriptor Collapse(Action> configure) + public InnerHitsDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -148,7 +148,7 @@ public InnerHitsDescriptor DocvalueFields(ICollection DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public InnerHitsDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -157,7 +157,7 @@ public InnerHitsDescriptor DocvalueFields(QueryDsl.FieldAndFormatDesc return Self; } - public InnerHitsDescriptor DocvalueFields(Action> configure) + public InnerHitsDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -166,7 +166,7 @@ public InnerHitsDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public InnerHitsDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -204,7 +204,7 @@ public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Se return Self; } - public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -212,7 +212,7 @@ public InnerHitsDescriptor Highlight(HighlightDescriptor d return Self; } - public InnerHitsDescriptor Highlight(Action> configure) + public InnerHitsDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -235,9 +235,9 @@ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Serverl return Self; } - public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + public InnerHitsDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -268,7 +268,7 @@ public InnerHitsDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public InnerHitsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -277,7 +277,7 @@ public InnerHitsDescriptor Sort(SortOptionsDescriptor desc return Self; } - public InnerHitsDescriptor Sort(Action> configure) + public InnerHitsDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -286,7 +286,7 @@ public InnerHitsDescriptor Sort(Action Sort(params Action>[] configure) + public InnerHitsDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -301,9 +301,9 @@ public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Serve return Self; } - public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Serverless.Fields? storedField) + public InnerHitsDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) { - StoredFieldValue = storedField; + StoredFieldsValue = storedFields; return Self; } @@ -330,7 +330,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -349,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -358,7 +358,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -395,7 +395,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -441,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -450,7 +450,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -468,10 +468,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SourceValue, options); } - if (StoredFieldValue is not null) + if (StoredFieldsValue is not null) { - writer.WritePropertyName("stored_field"); - JsonSerializer.Serialize(writer, StoredFieldValue, options); + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); } if (TrackScoresValue.HasValue) @@ -499,29 +499,29 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fields? FieldsValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; } - private HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name? NameValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.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? StoredFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } private bool? VersionValue { get; set; } @@ -533,7 +533,7 @@ public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Cor return Self; } - public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -541,7 +541,7 @@ public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) return Self; } - public InnerHitsDescriptor Collapse(Action configure) + public InnerHitsDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -558,7 +558,7 @@ public InnerHitsDescriptor DocvalueFields(ICollection configure) + public InnerHitsDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -576,7 +576,7 @@ public InnerHitsDescriptor DocvalueFields(Action[] configure) + public InnerHitsDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -614,7 +614,7 @@ public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Co return Self; } - public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -622,7 +622,7 @@ public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) return Self; } - public InnerHitsDescriptor Highlight(Action configure) + public InnerHitsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -645,9 +645,9 @@ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name? n return Self; } - public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + public InnerHitsDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -678,7 +678,7 @@ public InnerHitsDescriptor Sort(ICollection configure) + public InnerHitsDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -696,7 +696,7 @@ public InnerHitsDescriptor Sort(Action configure) return Self; } - public InnerHitsDescriptor Sort(params Action[] configure) + public InnerHitsDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -711,9 +711,9 @@ public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Core. return Self; } - public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Serverless.Fields? storedField) + public InnerHitsDescriptor StoredFields(Elastic.Clients.Elasticsearch.Serverless.Fields? storedFields) { - StoredFieldValue = storedField; + StoredFieldsValue = storedFields; return Self; } @@ -740,7 +740,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -759,7 +759,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -768,7 +768,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -805,7 +805,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -851,7 +851,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -860,7 +860,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -878,10 +878,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SourceValue, options); } - if (StoredFieldValue is not null) + if (StoredFieldsValue is not null) { - writer.WritePropertyName("stored_field"); - JsonSerializer.Serialize(writer, StoredFieldValue, options); + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); } if (TrackScoresValue.HasValue) 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 index b5ef8780781..5126e3c183e 100644 --- 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 @@ -35,7 +35,7 @@ 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel(LaplaceSmoothingModel laplaceSmoothingModel) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel.Laplace(laplaceSmoothingModel); } public sealed partial class LaplaceSmoothingModelDescriptor : SerializableDescriptor 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 index d9c4d69639f..359489661a5 100644 --- 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 @@ -36,7 +36,7 @@ public sealed partial class LinearInterpolationSmoothingModel [JsonInclude, JsonPropertyName("unigram_lambda")] public double UnigramLambda { get; set; } - public static implicit operator SmoothingModel(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Core.Search.SmoothingModel.LinearInterpolation(linearInterpolationSmoothingModel); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel.LinearInterpolation(linearInterpolationSmoothingModel); } public sealed partial class LinearInterpolationSmoothingModelDescriptor : SerializableDescriptor 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 index 91caa4cf8da..14a9258be92 100644 --- 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 @@ -29,10 +29,10 @@ 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("_nested")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Search.NestedIdentity? Nested { 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/PhraseSuggest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggest.g.cs new file mode 100644 index 00000000000..766f2caf43b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggest.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.Core.Search; + +public sealed partial class PhraseSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestOption))] + public IReadOnlyCollection Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { 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 index 281753a1260..60b52542830 100644 --- 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 @@ -59,8 +59,8 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Parameters to use if the query is templated. @@ -91,7 +91,7 @@ public PhraseSuggestCollateDescriptor Query(Elastic.Clients.Elasticsearch.Server return Self; } - public PhraseSuggestCollateDescriptor Query(PhraseSuggestCollateQueryDescriptor descriptor) + public PhraseSuggestCollateDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -99,7 +99,7 @@ public PhraseSuggestCollateDescriptor Query(PhraseSuggestCollateQueryDescriptor return Self; } - public PhraseSuggestCollateDescriptor Query(Action configure) + public PhraseSuggestCollateDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -130,7 +130,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateQueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs new file mode 100644 index 00000000000..db25b4f2c07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/PhraseSuggestOption.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 PhraseSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("highlighted")] + public string? Highlighted { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double Score { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ 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 index 52c0fe591f5..448e1a0158a 100644 --- 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 @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; public sealed partial class PhraseSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } @@ -49,6 +52,10 @@ public sealed partial class PhraseSuggester ///
[JsonInclude, JsonPropertyName("direct_generator")] public ICollection? DirectGenerator { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } [JsonInclude, JsonPropertyName("force_unigrams")] @@ -89,6 +96,10 @@ public sealed partial class PhraseSuggester /// [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -106,7 +117,7 @@ public sealed partial class PhraseSuggester [JsonInclude, JsonPropertyName("token_limit")] public int? TokenLimit { get; set; } - public static implicit operator FieldSuggester(PhraseSuggester phraseSuggester) => Core.Search.FieldSuggester.Phrase(phraseSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester(PhraseSuggester phraseSuggester) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester.Phrase(phraseSuggester); } public sealed partial class PhraseSuggesterDescriptor : SerializableDescriptor> @@ -119,30 +130,33 @@ public PhraseSuggesterDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } private double? ConfidenceValue { get; set; } private ICollection? DirectGeneratorValue { get; set; } - private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } - private Action> DirectGeneratorDescriptorAction { get; set; } - private Action>[] DirectGeneratorDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action> DirectGeneratorDescriptorAction { get; set; } + private Action>[] DirectGeneratorDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } private string? TextValue { get; set; } private int? TokenLimitValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public PhraseSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -160,7 +174,7 @@ public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearc return Self; } - public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor descriptor) { CollateValue = null; CollateDescriptorAction = null; @@ -168,7 +182,7 @@ public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescript return Self; } - public PhraseSuggesterDescriptor Collate(Action configure) + public PhraseSuggesterDescriptor Collate(Action configure) { CollateValue = null; CollateDescriptor = null; @@ -197,7 +211,7 @@ public PhraseSuggesterDescriptor DirectGenerator(ICollection DirectGenerator(DirectGeneratorDescriptor descriptor) + public PhraseSuggesterDescriptor DirectGenerator(Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor descriptor) { DirectGeneratorValue = null; DirectGeneratorDescriptorAction = null; @@ -206,7 +220,7 @@ public PhraseSuggesterDescriptor DirectGenerator(DirectGeneratorDescr return Self; } - public PhraseSuggesterDescriptor DirectGenerator(Action> configure) + public PhraseSuggesterDescriptor DirectGenerator(Action> configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -215,7 +229,7 @@ public PhraseSuggesterDescriptor DirectGenerator(Action DirectGenerator(params Action>[] configure) + public PhraseSuggesterDescriptor DirectGenerator(params Action>[] configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -224,18 +238,33 @@ public PhraseSuggesterDescriptor DirectGenerator(params Action + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public PhraseSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PhraseSuggesterDescriptor ForceUnigrams(bool? forceUnigrams = true) { ForceUnigramsValue = forceUnigrams; @@ -262,7 +291,7 @@ public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsea return Self; } - public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -270,7 +299,7 @@ public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDesc return Self; } - public PhraseSuggesterDescriptor Highlight(Action configure) + public PhraseSuggesterDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -314,6 +343,9 @@ public PhraseSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public PhraseSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -331,7 +363,7 @@ public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsea return Self; } - public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor descriptor) { SmoothingValue = null; SmoothingDescriptorAction = null; @@ -339,7 +371,7 @@ public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor d return Self; } - public PhraseSuggesterDescriptor Smoothing(Action configure) + public PhraseSuggesterDescriptor Smoothing(Action configure) { SmoothingValue = null; SmoothingDescriptor = null; @@ -379,7 +411,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollateDescriptorAction is not null) { writer.WritePropertyName("collate"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); } else if (CollateValue is not null) { @@ -404,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("direct_generator"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); writer.WriteEndArray(); } else if (DirectGeneratorDescriptorActions is not null) @@ -413,7 +445,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DirectGeneratorDescriptorActions) { - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor(action), options); } writer.WriteEndArray(); @@ -446,7 +478,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -492,7 +524,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SmoothingDescriptorAction is not null) { writer.WritePropertyName("smoothing"); - JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor(SmoothingDescriptorAction), options); } else if (SmoothingValue is not null) { @@ -526,30 +558,33 @@ public PhraseSuggesterDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } private double? ConfidenceValue { get; set; } private ICollection? DirectGeneratorValue { get; set; } - private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } - private Action DirectGeneratorDescriptorAction { get; set; } - private Action[] DirectGeneratorDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action DirectGeneratorDescriptorAction { get; set; } + private Action[] DirectGeneratorDescriptorActions { 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } private string? TextValue { get; set; } private int? TokenLimitValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public PhraseSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -567,7 +602,7 @@ public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Serverles return Self; } - public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor descriptor) { CollateValue = null; CollateDescriptorAction = null; @@ -575,7 +610,7 @@ public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descript return Self; } - public PhraseSuggesterDescriptor Collate(Action configure) + public PhraseSuggesterDescriptor Collate(Action configure) { CollateValue = null; CollateDescriptor = null; @@ -604,7 +639,7 @@ public PhraseSuggesterDescriptor DirectGenerator(ICollection configure) + public PhraseSuggesterDescriptor DirectGenerator(Action configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -622,7 +657,7 @@ public PhraseSuggesterDescriptor DirectGenerator(Action[] configure) + public PhraseSuggesterDescriptor DirectGenerator(params Action[] configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -631,18 +666,27 @@ public PhraseSuggesterDescriptor DirectGenerator(params Action + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -675,7 +719,7 @@ public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverl return Self; } - public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -683,7 +727,7 @@ public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor desc return Self; } - public PhraseSuggesterDescriptor Highlight(Action configure) + public PhraseSuggesterDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -727,6 +771,9 @@ public PhraseSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public PhraseSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -744,7 +791,7 @@ public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Serverl return Self; } - public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor descriptor) { SmoothingValue = null; SmoothingDescriptorAction = null; @@ -752,7 +799,7 @@ public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) return Self; } - public PhraseSuggesterDescriptor Smoothing(Action configure) + public PhraseSuggesterDescriptor Smoothing(Action configure) { SmoothingValue = null; SmoothingDescriptor = null; @@ -792,7 +839,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollateDescriptorAction is not null) { writer.WritePropertyName("collate"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); } else if (CollateValue is not null) { @@ -817,7 +864,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("direct_generator"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); writer.WriteEndArray(); } else if (DirectGeneratorDescriptorActions is not null) @@ -826,7 +873,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DirectGeneratorDescriptorActions) { - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.DirectGeneratorDescriptor(action), options); } writer.WriteEndArray(); @@ -859,7 +906,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -905,7 +952,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SmoothingDescriptorAction is not null) { writer.WritePropertyName("smoothing"); - JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModelDescriptor(SmoothingDescriptorAction), options); } else if (SmoothingValue is not null) { 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 index b2057ad107d..273c95e28ee 100644 --- 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 @@ -33,7 +33,7 @@ public sealed partial class RegexOptions /// Optional operators for the regular expression. /// [JsonInclude, JsonPropertyName("flags")] - public Union? Flags { get; set; } + public object? Flags { get; set; } /// /// Maximum number of automaton states required for the query. @@ -50,13 +50,13 @@ public RegexOptionsDescriptor() : base() { } - private Union? FlagsValue { get; set; } + private object? FlagsValue { get; set; } private int? MaxDeterminizedStatesValue { get; set; } /// /// Optional operators for the regular expression. /// - public RegexOptionsDescriptor Flags(Union? flags) + public RegexOptionsDescriptor Flags(object? flags) { FlagsValue = flags; return Self; 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 index b127af33b82..28cd9731679 100644 --- 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 @@ -44,8 +44,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.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) @@ -56,7 +56,7 @@ public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverle return Self; } - public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -64,7 +64,7 @@ public RescoreDescriptor Query(RescoreQueryDescriptor desc return Self; } - public RescoreDescriptor Query(Action> configure) + public RescoreDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -89,7 +89,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQueryDescriptor(QueryDescriptorAction), options); } else { @@ -116,8 +116,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.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) @@ -128,7 +128,7 @@ public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Sea return Self; } - public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -136,7 +136,7 @@ public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) return Self; } - public RescoreDescriptor Query(Action configure) + public RescoreDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.RescoreQueryDescriptor(QueryDescriptorAction), options); } else { 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 index a704ebe4129..b6558250941 100644 --- 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 @@ -29,18 +29,18 @@ 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 original query versus the rescore query. + /// + [JsonInclude, JsonPropertyName("query_weight")] + public double? QueryWeight { get; set; } + /// /// Relative importance of the rescore query versus the original query. /// @@ -63,8 +63,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -80,7 +80,7 @@ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Ser return Self; } - public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -88,7 +88,7 @@ public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public RescoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -134,7 +134,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("rescore_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -173,8 +173,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.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; } @@ -190,7 +190,7 @@ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Que return Self; } - public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -198,7 +198,7 @@ public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public RescoreQueryDescriptor Query(Action configure) + public RescoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -244,7 +244,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("rescore_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { 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 index 870699a31cf..b1babb4cde6 100644 --- 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 @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -48,6 +49,18 @@ internal SmoothingModel(string variantName, object variant) 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class SmoothingModelConverter : JsonConverter @@ -59,42 +72,55 @@ public override SmoothingModel Read(ref Utf8JsonReader reader, Type typeToConver throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "laplace") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SmoothingModel(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "linear_interpolation") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new SmoothingModel(propertyName, variant); - } + if (propertyName == "laplace") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "stupid_backoff") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SmoothingModel(propertyName, variant); + if (propertyName == "linear_interpolation") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stupid_backoff") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'SmoothingModel' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new SmoothingModel(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, SmoothingModel value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -146,31 +172,29 @@ private SmoothingModelDescriptor Set(object variant, string variantNa 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"); + public SmoothingModelDescriptor Laplace(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(Elastic.Clients.Elasticsearch.Serverless.Core.Search.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -206,31 +230,29 @@ private SmoothingModelDescriptor Set(object variant, string variantName) 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"); + public SmoothingModelDescriptor Laplace(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(Elastic.Clients.Elasticsearch.Serverless.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(Elastic.Clients.Elasticsearch.Serverless.Core.Search.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index c5053941ede..6a454e55072 100644 --- 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 @@ -82,6 +82,48 @@ public sealed partial class SourceFilter 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(); + } +} + public sealed partial class SourceFilterDescriptor : SerializableDescriptor { internal SourceFilterDescriptor(Action configure) => configure.Invoke(this); 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 index 21355e2f8a0..3f8c16f720d 100644 --- 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 @@ -35,7 +35,7 @@ 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel(StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.SmoothingModel.StupidBackoff(stupidBackoffSmoothingModel); } public sealed partial class StupidBackoffSmoothingModelDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestDictionary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestDictionary.g.cs new file mode 100644 index 00000000000..fce42046b43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/SuggestDictionary.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.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; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; + +public partial interface ISuggest +{ +} + +[GenericConverter(typeof(SuggestDictionaryConverter<>), unwrap: true)] +public partial class SuggestDictionary : IsAReadOnlyDictionary> +{ + public SuggestDictionary(IReadOnlyDictionary> backingDictionary) : base(backingDictionary) + { + } + + public IReadOnlyCollection>? GetCompletion(string key) => TryGet>(key); + public IReadOnlyCollection? GetPhrase(string key) => TryGet(key); + public IReadOnlyCollection? GetTerm(string key) => TryGet(key); + private IReadOnlyCollection? TryGet(string key) where T : class, ISuggest => BackingDictionary.TryGetValue(key, out var value) ? value.Cast().ToArray() : null; +} + +internal sealed partial class SuggestDictionaryConverter : JsonConverter> +{ + public override SuggestDictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var dictionary = new Dictionary>(); + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString(); + reader.Read(); + ReadItem(ref reader, options, dictionary, name); + } + + return new SuggestDictionary(dictionary); + } + + public override void Write(Utf8JsonWriter writer, SuggestDictionary value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SuggestDictionary' is a readonly type, used only on responses and does not support being written to JSON."); + } + + public static void ReadItem(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary> dictionary, string name) + { + var nameParts = name.Split('#'); + if (nameParts.Length != 2) + throw new JsonException($"Unable to parse typed-key '{name}'."); + var type = nameParts[0]; + switch (type) + { + case "completion": + { + var item = JsonSerializer.Deserialize>>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "phrase": + { + var item = JsonSerializer.Deserialize>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "term": + { + var item = JsonSerializer.Deserialize>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + default: + throw new NotSupportedException($"The tagged variant '{type}' is currently not supported."); + } + } +} \ 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 index e9b2c95e27d..aeec92d1c52 100644 --- 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 @@ -47,8 +47,8 @@ public override Suggester Read(ref Utf8JsonReader reader, Type typeToConvert, Js } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } @@ -59,7 +59,7 @@ public override Suggester Read(ref Utf8JsonReader reader, Type typeToConvert, Js public override void Write(Utf8JsonWriter writer, Suggester value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.Suggesters != null) + if (value.Suggesters is not null) { foreach (var additionalProperty in value.Suggesters) { @@ -81,6 +81,9 @@ public override void Write(Utf8JsonWriter writer, Suggester value, JsonSerialize [JsonConverter(typeof(SuggesterConverter))] public sealed partial class Suggester { + /// + /// The named suggesters + /// public IDictionary Suggesters { get; set; } /// @@ -89,6 +92,57 @@ public sealed partial class Suggester 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; } + + /// + /// The named suggesters + /// + public SuggesterDescriptor Suggesters(Func>, FluentDescriptorDictionary>> selector) + { + SuggestersValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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 is not null) + { + foreach (var additionalProperty in SuggestersValue) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + writer.WriteEndObject(); + } +} + public sealed partial class SuggesterDescriptor : SerializableDescriptor { internal SuggesterDescriptor(Action configure) => configure.Invoke(this); @@ -97,12 +151,15 @@ public SuggesterDescriptor() : base() { } - private IDictionary SuggestersValue { get; set; } + private IDictionary SuggestersValue { get; set; } private string? TextValue { get; set; } - public SuggesterDescriptor Suggesters(Func, FluentDictionary> selector) + /// + /// The named suggesters + /// + public SuggesterDescriptor Suggesters(Func, FluentDescriptorDictionary> selector) { - SuggestersValue = selector?.Invoke(new FluentDictionary()); + SuggestersValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -124,7 +181,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TextValue); } - if (SuggestersValue != null) + if (SuggestersValue is not null) { foreach (var additionalProperty in SuggestersValue) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggest.g.cs new file mode 100644 index 00000000000..3f8e3ff522c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggest.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.Core.Search; + +public sealed partial class TermSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.TermSuggestOption))] + public IReadOnlyCollection Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggestOption.g.cs new file mode 100644 index 00000000000..13b6497ef80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/Search/TermSuggestOption.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 TermSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("freq")] + public long Freq { get; init; } + [JsonInclude, JsonPropertyName("highlighted")] + public string? Highlighted { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double Score { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ 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 index cdee35b3fbe..30972fe1437 100644 --- 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 @@ -29,8 +29,15 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; public sealed partial class TermSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } [JsonInclude, JsonPropertyName("lowercase_terms")] @@ -77,6 +84,10 @@ public sealed partial class TermSuggester ///
[JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -104,7 +115,7 @@ public sealed partial class TermSuggester [JsonInclude, JsonPropertyName("text")] public string? Text { get; set; } - public static implicit operator FieldSuggester(TermSuggester termSuggester) => Core.Search.FieldSuggester.Term(termSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester(TermSuggester termSuggester) => Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldSuggester.Term(termSuggester); } public sealed partial class TermSuggesterDescriptor : SerializableDescriptor> @@ -131,24 +142,42 @@ public TermSuggesterDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } private string? TextValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public TermSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public TermSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermSuggesterDescriptor LowercaseTerms(bool? lowercaseTerms = true) { LowercaseTermsValue = lowercaseTerms; @@ -218,6 +247,9 @@ public TermSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public TermSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -377,24 +409,36 @@ public TermSuggesterDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestModeValue { get; set; } private string? TextValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public TermSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -470,6 +514,9 @@ public TermSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public TermSuggesterDescriptor Size(int? size) { SizeValue = size; 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 index eca42399445..e9ebafa4041 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfig.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +/// +/// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. +/// public sealed partial class SourceConfig : Union { - public SourceConfig(bool fetch) : base(fetch) + public SourceConfig(bool Fetch) : base(Fetch) { } - public SourceConfig(Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceFilter filter) : base(filter) + 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 index 8268e256859..18d83848038 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/SourceConfigParam.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +/// +/// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
Used as a query parameter along with the `_source_includes` and `_source_excludes` parameters.
+///
public sealed partial class SourceConfigParam : Union { - public SourceConfigParam(bool fetch) : base(fetch) + public SourceConfigParam(bool Fetch) : base(Fetch) { } - public SourceConfigParam(Elastic.Clients.Elasticsearch.Serverless.Fields fields) : base(fields) + 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/TrackHits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs index 4cd105b3020..19f60f4ddd5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Core/TrackHits.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Core.Search; +/// +/// 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 sealed partial class TrackHits : Union { - public TrackHits(bool enabled) : base(enabled) + public TrackHits(bool Enabled) : base(Enabled) { } - public TrackHits(int count) : base(count) + public TrackHits(int Count) : base(Count) { } } \ 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 index c5e7169a508..c2677772610 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/EmptyObject.g.cs @@ -47,5 +47,7 @@ public EmptyObjectDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ 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 index 28e69e434fb..e45b8e52cb3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichPolicy.g.cs @@ -40,7 +40,7 @@ public sealed partial class EnrichPolicy [JsonInclude, JsonPropertyName("name")] public Elastic.Clients.Elasticsearch.Serverless.Name? Name { get; set; } [JsonInclude, JsonPropertyName("query")] - public string? Query { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } } public sealed partial class EnrichPolicyDescriptor : SerializableDescriptor> @@ -56,7 +56,9 @@ public EnrichPolicyDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) { @@ -88,18 +90,42 @@ public EnrichPolicyDescriptor MatchField(Expression 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) + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) { + QueryDescriptor = null; + QueryDescriptorAction = null; QueryValue = query; return Self; } + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EnrichPolicyDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -121,10 +147,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); } - if (!string.IsNullOrEmpty(QueryValue)) + if (QueryDescriptor is not null) { writer.WritePropertyName("query"); - writer.WriteStringValue(QueryValue); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); } writer.WriteEndObject(); @@ -144,7 +180,9 @@ public EnrichPolicyDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) { @@ -188,12 +226,30 @@ public EnrichPolicyDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name return Self; } - public EnrichPolicyDescriptor Query(string? query) + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) { + QueryDescriptor = null; + QueryDescriptorAction = null; QueryValue = query; return Self; } + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EnrichPolicyDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -215,10 +271,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); } - if (!string.IsNullOrEmpty(QueryValue)) + 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) { writer.WritePropertyName("query"); - writer.WriteStringValue(QueryValue); + JsonSerializer.Serialize(writer, QueryValue, options); } writer.WriteEndObject(); 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 index 2c54b1e3465..8246da96754 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enrich/EnrichSummary.g.cs @@ -30,5 +30,5 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Enrich; public sealed partial class EnrichSummary { [JsonInclude, JsonPropertyName("config")] - public KeyValuePair Config { get; init; } + public IReadOnlyDictionary Config { 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 index fda52cbf16e..8da3d59d09f 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -82,7 +82,8 @@ public override CalendarInterval Read(ref Utf8JsonReader reader, Type typeToConv return CalendarInterval.Day; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CalendarInterval value, JsonSerializerOptions options) @@ -168,7 +169,8 @@ public override CardinalityExecutionMode Read(ref Utf8JsonReader reader, Type ty return CardinalityExecutionMode.Direct; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CardinalityExecutionMode value, JsonSerializerOptions options) @@ -231,7 +233,8 @@ public override GapPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, Js return GapPolicy.InsertZeros; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GapPolicy value, JsonSerializerOptions options) @@ -291,7 +294,8 @@ public override MinimumInterval Read(ref Utf8JsonReader reader, Type typeToConve return MinimumInterval.Day; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MinimumInterval value, JsonSerializerOptions options) @@ -348,7 +352,8 @@ public override MissingOrder Read(ref Utf8JsonReader reader, Type typeToConvert, return MissingOrder.Default; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MissingOrder value, JsonSerializerOptions options) @@ -370,6 +375,94 @@ public override void Write(Utf8JsonWriter writer, MissingOrder value, JsonSerial } } +[JsonConverter(typeof(NormalizeMethodConverter))] +public enum NormalizeMethod +{ + /// + /// This method normalizes such that each value represents how far it is from the mean relative to the standard deviation. + /// + [EnumMember(Value = "z-score")] + ZScore, + /// + /// This method normalizes such that each value is exponentiated and relative to the sum of the exponents of the original values. + /// + [EnumMember(Value = "softmax")] + Softmax, + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 100, with the rest normalized linearly in-between. + /// + [EnumMember(Value = "rescale_0_100")] + Rescale0100, + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 1, with the rest normalized linearly in-between. + /// + [EnumMember(Value = "rescale_0_1")] + Rescale01, + /// + /// This method normalizes each value so that it represents a percentage of the total sum it attributes to. + /// + [EnumMember(Value = "percent_of_sum")] + PercentOfSum, + /// + /// This method normalizes such that each value is normalized by how much it differs from the average. + /// + [EnumMember(Value = "mean")] + Mean +} + +internal sealed class NormalizeMethodConverter : JsonConverter +{ + public override NormalizeMethod Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "z-score": + return NormalizeMethod.ZScore; + case "softmax": + return NormalizeMethod.Softmax; + case "rescale_0_100": + return NormalizeMethod.Rescale0100; + case "rescale_0_1": + return NormalizeMethod.Rescale01; + case "percent_of_sum": + return NormalizeMethod.PercentOfSum; + case "mean": + return NormalizeMethod.Mean; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, NormalizeMethod value, JsonSerializerOptions options) + { + switch (value) + { + case NormalizeMethod.ZScore: + writer.WriteStringValue("z-score"); + return; + case NormalizeMethod.Softmax: + writer.WriteStringValue("softmax"); + return; + case NormalizeMethod.Rescale0100: + writer.WriteStringValue("rescale_0_100"); + return; + case NormalizeMethod.Rescale01: + writer.WriteStringValue("rescale_0_1"); + return; + case NormalizeMethod.PercentOfSum: + writer.WriteStringValue("percent_of_sum"); + return; + case NormalizeMethod.Mean: + writer.WriteStringValue("mean"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(RateModeConverter))] public enum RateMode { @@ -398,7 +491,8 @@ public override RateMode Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return RateMode.Sum; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RateMode value, JsonSerializerOptions options) @@ -452,7 +546,8 @@ public override SamplerAggregationExecutionHint Read(ref Utf8JsonReader reader, return SamplerAggregationExecutionHint.BytesHash; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SamplerAggregationExecutionHint value, JsonSerializerOptions options) @@ -502,7 +597,8 @@ public override TermsAggregationCollectMode Read(ref Utf8JsonReader reader, Type return TermsAggregationCollectMode.BreadthFirst; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermsAggregationCollectMode value, JsonSerializerOptions options) @@ -551,7 +647,8 @@ public override TermsAggregationExecutionHint Read(ref Utf8JsonReader reader, Ty return TermsAggregationExecutionHint.GlobalOrdinals; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermsAggregationExecutionHint value, JsonSerializerOptions options) @@ -611,7 +708,8 @@ public override TTestType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return TTestType.Heteroscedastic; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TTestType value, JsonSerializerOptions options) @@ -687,7 +785,8 @@ public override ValueType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ValueType.Boolean; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ValueType value, JsonSerializerOptions options) 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 index 4caf9c3e0d1..3cc97f3f7a2 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -54,7 +54,8 @@ public override DelimitedPayloadEncoding Read(ref Utf8JsonReader reader, Type ty return DelimitedPayloadEncoding.Float; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DelimitedPayloadEncoding value, JsonSerializerOptions options) @@ -98,7 +99,8 @@ public override EdgeNGramSide Read(ref Utf8JsonReader reader, Type typeToConvert return EdgeNGramSide.Back; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, EdgeNGramSide value, JsonSerializerOptions options) @@ -139,7 +141,8 @@ public override IcuCollationAlternate Read(ref Utf8JsonReader reader, Type typeT return IcuCollationAlternate.NonIgnorable; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationAlternate value, JsonSerializerOptions options) @@ -180,7 +183,8 @@ public override IcuCollationCaseFirst Read(ref Utf8JsonReader reader, Type typeT return IcuCollationCaseFirst.Lower; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationCaseFirst value, JsonSerializerOptions options) @@ -221,7 +225,8 @@ public override IcuCollationDecomposition Read(ref Utf8JsonReader reader, Type t return IcuCollationDecomposition.Identical; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationDecomposition value, JsonSerializerOptions options) @@ -274,7 +279,8 @@ public override IcuCollationStrength Read(ref Utf8JsonReader reader, Type typeTo return IcuCollationStrength.Identical; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationStrength value, JsonSerializerOptions options) @@ -324,7 +330,8 @@ public override IcuNormalizationMode Read(ref Utf8JsonReader reader, Type typeTo return IcuNormalizationMode.Compose; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuNormalizationMode value, JsonSerializerOptions options) @@ -369,7 +376,8 @@ public override IcuNormalizationType Read(ref Utf8JsonReader reader, Type typeTo return IcuNormalizationType.Nfc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuNormalizationType value, JsonSerializerOptions options) @@ -413,7 +421,8 @@ public override IcuTransformDirection Read(ref Utf8JsonReader reader, Type typeT return IcuTransformDirection.Forward; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuTransformDirection value, JsonSerializerOptions options) @@ -454,7 +463,8 @@ public override KeepTypesMode Read(ref Utf8JsonReader reader, Type typeToConvert return KeepTypesMode.Exclude; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, KeepTypesMode value, JsonSerializerOptions options) @@ -499,7 +509,8 @@ public override KuromojiTokenizationMode Read(ref Utf8JsonReader reader, Type ty return KuromojiTokenizationMode.Extended; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, KuromojiTokenizationMode value, JsonSerializerOptions options) @@ -671,7 +682,8 @@ public override Language Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Language.Arabic; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Language value, JsonSerializerOptions options) @@ -812,7 +824,8 @@ public override NoriDecompoundMode Read(ref Utf8JsonReader reader, Type typeToCo return NoriDecompoundMode.Discard; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NoriDecompoundMode value, JsonSerializerOptions options) @@ -896,7 +909,8 @@ public override PhoneticEncoder Read(ref Utf8JsonReader reader, Type typeToConve return PhoneticEncoder.BeiderMorse; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticEncoder value, JsonSerializerOptions options) @@ -1007,7 +1021,8 @@ public override PhoneticLanguage Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticLanguage.Any; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticLanguage value, JsonSerializerOptions options) @@ -1082,7 +1097,8 @@ public override PhoneticNameType Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticNameType.Ashkenazi; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticNameType value, JsonSerializerOptions options) @@ -1126,7 +1142,8 @@ public override PhoneticRuleType Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticRuleType.Approx; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticRuleType value, JsonSerializerOptions options) @@ -1247,7 +1264,8 @@ public override SnowballLanguage Read(ref Utf8JsonReader reader, Type typeToConv return SnowballLanguage.Armenian; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SnowballLanguage value, JsonSerializerOptions options) @@ -1348,7 +1366,8 @@ public override SynonymFormat Read(ref Utf8JsonReader reader, Type typeToConvert return SynonymFormat.Solr; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SynonymFormat value, JsonSerializerOptions options) @@ -1405,7 +1424,8 @@ public override TokenChar Read(ref Utf8JsonReader reader, Type typeToConvert, Js return TokenChar.Custom; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TokenChar value, JsonSerializerOptions options) 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 index 4df256768bf..3f580204a26 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -58,7 +58,8 @@ public override AllocationExplainDecision Read(ref Utf8JsonReader reader, Type t return AllocationExplainDecision.Always; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, AllocationExplainDecision value, JsonSerializerOptions options) @@ -129,7 +130,8 @@ public override Decision Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Decision.AllocationDelayed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Decision value, JsonSerializerOptions options) @@ -240,7 +242,8 @@ public override UnassignedInformationReason Read(ref Utf8JsonReader reader, Type return UnassignedInformationReason.AllocationFailed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, UnassignedInformationReason value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs new file mode 100644 index 00000000000..8752f1368d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.HealthReport.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.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.HealthReport; + +[JsonConverter(typeof(ImpactAreaConverter))] +public enum ImpactArea +{ + [EnumMember(Value = "search")] + Search, + [EnumMember(Value = "ingest")] + Ingest, + [EnumMember(Value = "deployment_management")] + DeploymentManagement, + [EnumMember(Value = "backup")] + Backup +} + +internal sealed class ImpactAreaConverter : JsonConverter +{ + public override ImpactArea Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "search": + return ImpactArea.Search; + case "ingest": + return ImpactArea.Ingest; + case "deployment_management": + return ImpactArea.DeploymentManagement; + case "backup": + return ImpactArea.Backup; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ImpactArea value, JsonSerializerOptions options) + { + switch (value) + { + case ImpactArea.Search: + writer.WriteStringValue("search"); + return; + case ImpactArea.Ingest: + writer.WriteStringValue("ingest"); + return; + case ImpactArea.DeploymentManagement: + writer.WriteStringValue("deployment_management"); + return; + case ImpactArea.Backup: + writer.WriteStringValue("backup"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndicatorHealthStatusConverter))] +public enum IndicatorHealthStatus +{ + [EnumMember(Value = "yellow")] + Yellow, + [EnumMember(Value = "unknown")] + Unknown, + [EnumMember(Value = "red")] + Red, + [EnumMember(Value = "green")] + Green +} + +internal sealed class IndicatorHealthStatusConverter : JsonConverter +{ + public override IndicatorHealthStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yellow": + return IndicatorHealthStatus.Yellow; + case "unknown": + return IndicatorHealthStatus.Unknown; + case "red": + return IndicatorHealthStatus.Red; + case "green": + return IndicatorHealthStatus.Green; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, IndicatorHealthStatus value, JsonSerializerOptions options) + { + switch (value) + { + case IndicatorHealthStatus.Yellow: + writer.WriteStringValue("yellow"); + return; + case IndicatorHealthStatus.Unknown: + writer.WriteStringValue("unknown"); + return; + case IndicatorHealthStatus.Red: + writer.WriteStringValue("red"); + return; + case IndicatorHealthStatus.Green: + writer.WriteStringValue("green"); + 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 index 59543788673..230c04d7542 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -63,7 +63,8 @@ public override BoundaryScanner Read(ref Utf8JsonReader reader, Type typeToConve return BoundaryScanner.Chars; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, BoundaryScanner value, JsonSerializerOptions options) @@ -107,7 +108,8 @@ public override HighlighterEncoder Read(ref Utf8JsonReader reader, Type typeToCo return HighlighterEncoder.Default; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterEncoder value, JsonSerializerOptions options) @@ -148,7 +150,8 @@ public override HighlighterFragmenter Read(ref Utf8JsonReader reader, Type typeT return HighlighterFragmenter.Simple; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterFragmenter value, JsonSerializerOptions options) @@ -185,7 +188,8 @@ public override HighlighterOrder Read(ref Utf8JsonReader reader, Type typeToConv return HighlighterOrder.Score; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterOrder value, JsonSerializerOptions options) @@ -219,7 +223,8 @@ public override HighlighterTagsSchema Read(ref Utf8JsonReader reader, Type typeT return HighlighterTagsSchema.Styled; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterTagsSchema value, JsonSerializerOptions options) @@ -321,7 +326,8 @@ public override ScoreMode Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ScoreMode value, JsonSerializerOptions options) @@ -398,7 +404,8 @@ public override StringDistance Read(ref Utf8JsonReader reader, Type typeToConver return StringDistance.DamerauLevenshtein; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, StringDistance value, JsonSerializerOptions options) @@ -454,7 +461,8 @@ public override SuggestSort Read(ref Utf8JsonReader reader, Type typeToConvert, return SuggestSort.Frequency; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SuggestSort value, JsonSerializerOptions options) @@ -501,7 +509,8 @@ public override TotalHitsRelation Read(ref Utf8JsonReader reader, Type typeToCon return TotalHitsRelation.Eq; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TotalHitsRelation value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs new file mode 100644 index 00000000000..9570d6fe1ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Core.SearchMvt.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.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Core.SearchMvt; + +[JsonConverter(typeof(GridAggregationTypeConverter))] +public enum GridAggregationType +{ + [EnumMember(Value = "geotile")] + Geotile, + [EnumMember(Value = "geohex")] + Geohex +} + +internal sealed class GridAggregationTypeConverter : JsonConverter +{ + public override GridAggregationType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "geotile": + return GridAggregationType.Geotile; + case "geohex": + return GridAggregationType.Geohex; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, GridAggregationType value, JsonSerializerOptions options) + { + switch (value) + { + case GridAggregationType.Geotile: + writer.WriteStringValue("geotile"); + return; + case GridAggregationType.Geohex: + writer.WriteStringValue("geohex"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GridTypeConverter))] +public enum GridType +{ + [EnumMember(Value = "point")] + Point, + [EnumMember(Value = "grid")] + Grid, + [EnumMember(Value = "centroid")] + Centroid +} + +internal sealed class GridTypeConverter : JsonConverter +{ + public override GridType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "point": + return GridType.Point; + case "grid": + return GridType.Grid; + case "centroid": + return GridType.Centroid; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, GridType value, JsonSerializerOptions options) + { + switch (value) + { + case GridType.Point: + writer.WriteStringValue("point"); + return; + case GridType.Grid: + writer.WriteStringValue("grid"); + return; + case GridType.Centroid: + writer.WriteStringValue("centroid"); + 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 index 4e3aed21ac5..ae03d3ffb09 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -58,7 +58,8 @@ public override EnrichPolicyPhase Read(ref Utf8JsonReader reader, Type typeToCon return EnrichPolicyPhase.Complete; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, EnrichPolicyPhase value, JsonSerializerOptions options) @@ -109,7 +110,8 @@ public override PolicyType Read(ref Utf8JsonReader reader, Type typeToConvert, J return PolicyType.GeoMatch; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PolicyType value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Eql.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Eql.g.cs index d20740d24fc..efb1cf7cbea 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Eql.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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.Eql; @@ -56,7 +56,8 @@ public override ResultPosition Read(ref Utf8JsonReader reader, Type typeToConver return ResultPosition.Head; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ResultPosition value, JsonSerializerOptions options) 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 index 688b9982cc2..f88b37adba8 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -54,7 +54,8 @@ public override Feature Read(ref Utf8JsonReader reader, Type typeToConvert, Json return Feature.Aliases; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Feature value, JsonSerializerOptions options) @@ -102,7 +103,8 @@ public override IndexCheckOnStartup Read(ref Utf8JsonReader reader, Type typeToC return IndexCheckOnStartup.Checksum; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexCheckOnStartup value, JsonSerializerOptions options) @@ -146,7 +148,8 @@ public override IndexMetadataState Read(ref Utf8JsonReader reader, Type typeToCo return IndexMetadataState.Close; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexMetadataState value, JsonSerializerOptions options) @@ -195,7 +198,8 @@ public override IndexRoutingAllocationOptions Read(ref Utf8JsonReader reader, Ty return IndexRoutingAllocationOptions.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexRoutingAllocationOptions value, JsonSerializerOptions options) @@ -250,7 +254,8 @@ public override IndexRoutingRebalanceOptions Read(ref Utf8JsonReader reader, Typ return IndexRoutingRebalanceOptions.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexRoutingRebalanceOptions value, JsonSerializerOptions options) @@ -275,6 +280,55 @@ public override void Write(Utf8JsonWriter writer, IndexRoutingRebalanceOptions v } } +[JsonConverter(typeof(ManagedByConverter))] +public enum ManagedBy +{ + [EnumMember(Value = "Unmanaged")] + Unmanaged, + [EnumMember(Value = "Index Lifecycle Management")] + Ilm, + [EnumMember(Value = "Data stream lifecycle")] + Datastream +} + +internal sealed class ManagedByConverter : JsonConverter +{ + public override ManagedBy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "Unmanaged": + return ManagedBy.Unmanaged; + case "Index Lifecycle Management": + return ManagedBy.Ilm; + case "Data stream lifecycle": + return ManagedBy.Datastream; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ManagedBy value, JsonSerializerOptions options) + { + switch (value) + { + case ManagedBy.Unmanaged: + writer.WriteStringValue("Unmanaged"); + return; + case ManagedBy.Ilm: + writer.WriteStringValue("Index Lifecycle Management"); + return; + case ManagedBy.Datastream: + writer.WriteStringValue("Data stream lifecycle"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(NumericFielddataFormatConverter))] public enum NumericFielddataFormat { @@ -297,7 +351,8 @@ public override NumericFielddataFormat Read(ref Utf8JsonReader reader, Type type return NumericFielddataFormat.Array; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NumericFielddataFormat value, JsonSerializerOptions options) @@ -338,7 +393,8 @@ public override SegmentSortMissing Read(ref Utf8JsonReader reader, Type typeToCo return SegmentSortMissing.First; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortMissing value, JsonSerializerOptions options) @@ -381,7 +437,8 @@ public override SegmentSortMode Read(ref Utf8JsonReader reader, Type typeToConve return SegmentSortMode.Max; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortMode value, JsonSerializerOptions options) @@ -424,7 +481,8 @@ public override SegmentSortOrder Read(ref Utf8JsonReader reader, Type typeToConv return SegmentSortOrder.Asc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortOrder value, JsonSerializerOptions options) @@ -473,7 +531,8 @@ public override ShardRoutingState Read(ref Utf8JsonReader reader, Type typeToCon return ShardRoutingState.Initializing; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ShardRoutingState value, JsonSerializerOptions options) @@ -570,7 +629,8 @@ public override TranslogDurability Read(ref Utf8JsonReader reader, Type typeToCo return TranslogDurability.Async; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TranslogDurability value, JsonSerializerOptions options) 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 index 80409bf52c5..acf10695d15 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -70,7 +70,8 @@ public override ConvertType Read(ref Utf8JsonReader reader, Type typeToConvert, return ConvertType.Auto; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSerializerOptions options) @@ -132,7 +133,8 @@ public override JsonProcessorConflictStrategy Read(ref Utf8JsonReader reader, Ty return JsonProcessorConflictStrategy.Merge; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, JsonProcessorConflictStrategy value, JsonSerializerOptions options) @@ -173,7 +175,8 @@ public override ShapeType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ShapeType.GeoShape; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ShapeType value, JsonSerializerOptions options) @@ -246,7 +249,8 @@ public override UserAgentProperty Read(ref Utf8JsonReader reader, Type typeToCon return UserAgentProperty.Build; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, UserAgentProperty value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.LicenseManagement.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.LicenseManagement.g.cs new file mode 100644 index 00000000000..70a028f6e76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.LicenseManagement.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.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.LicenseManagement; + +[JsonConverter(typeof(LicenseStatusConverter))] +public enum LicenseStatus +{ + [EnumMember(Value = "valid")] + Valid, + [EnumMember(Value = "invalid")] + Invalid, + [EnumMember(Value = "expired")] + Expired, + [EnumMember(Value = "active")] + Active +} + +internal sealed class LicenseStatusConverter : JsonConverter +{ + public override LicenseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "valid": + return LicenseStatus.Valid; + case "invalid": + return LicenseStatus.Invalid; + case "expired": + return LicenseStatus.Expired; + case "active": + return LicenseStatus.Active; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LicenseStatus value, JsonSerializerOptions options) + { + switch (value) + { + case LicenseStatus.Valid: + writer.WriteStringValue("valid"); + return; + case LicenseStatus.Invalid: + writer.WriteStringValue("invalid"); + return; + case LicenseStatus.Expired: + writer.WriteStringValue("expired"); + return; + case LicenseStatus.Active: + writer.WriteStringValue("active"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(LicenseTypeConverter))] +public enum LicenseType +{ + [EnumMember(Value = "trial")] + Trial, + [EnumMember(Value = "standard")] + Standard, + [EnumMember(Value = "silver")] + Silver, + [EnumMember(Value = "platinum")] + Platinum, + [EnumMember(Value = "missing")] + Missing, + [EnumMember(Value = "gold")] + Gold, + [EnumMember(Value = "enterprise")] + Enterprise, + [EnumMember(Value = "dev")] + Dev, + [EnumMember(Value = "basic")] + Basic +} + +internal sealed class LicenseTypeConverter : JsonConverter +{ + public override LicenseType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "trial": + return LicenseType.Trial; + case "standard": + return LicenseType.Standard; + case "silver": + return LicenseType.Silver; + case "platinum": + return LicenseType.Platinum; + case "missing": + return LicenseType.Missing; + case "gold": + return LicenseType.Gold; + case "enterprise": + return LicenseType.Enterprise; + case "dev": + return LicenseType.Dev; + case "basic": + return LicenseType.Basic; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LicenseType value, JsonSerializerOptions options) + { + switch (value) + { + case LicenseType.Trial: + writer.WriteStringValue("trial"); + return; + case LicenseType.Standard: + writer.WriteStringValue("standard"); + return; + case LicenseType.Silver: + writer.WriteStringValue("silver"); + return; + case LicenseType.Platinum: + writer.WriteStringValue("platinum"); + return; + case LicenseType.Missing: + writer.WriteStringValue("missing"); + return; + case LicenseType.Gold: + writer.WriteStringValue("gold"); + return; + case LicenseType.Enterprise: + writer.WriteStringValue("enterprise"); + return; + case LicenseType.Dev: + writer.WriteStringValue("dev"); + return; + case LicenseType.Basic: + writer.WriteStringValue("basic"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.MachineLearning.g.cs new file mode 100644 index 00000000000..7eaa7b6d97b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.MachineLearning.g.cs @@ -0,0 +1,1206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the 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.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +[JsonConverter(typeof(AppliesToConverter))] +public enum AppliesTo +{ + [EnumMember(Value = "typical")] + Typical, + [EnumMember(Value = "time")] + Time, + [EnumMember(Value = "diff_from_typical")] + DiffFromTypical, + [EnumMember(Value = "actual")] + Actual +} + +internal sealed class AppliesToConverter : JsonConverter +{ + public override AppliesTo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "typical": + return AppliesTo.Typical; + case "time": + return AppliesTo.Time; + case "diff_from_typical": + return AppliesTo.DiffFromTypical; + case "actual": + return AppliesTo.Actual; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, AppliesTo value, JsonSerializerOptions options) + { + switch (value) + { + case AppliesTo.Typical: + writer.WriteStringValue("typical"); + return; + case AppliesTo.Time: + writer.WriteStringValue("time"); + return; + case AppliesTo.DiffFromTypical: + writer.WriteStringValue("diff_from_typical"); + return; + case AppliesTo.Actual: + writer.WriteStringValue("actual"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(CategorizationStatusConverter))] +public enum CategorizationStatus +{ + [EnumMember(Value = "warn")] + Warn, + [EnumMember(Value = "ok")] + Ok +} + +internal sealed class CategorizationStatusConverter : JsonConverter +{ + public override CategorizationStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "warn": + return CategorizationStatus.Warn; + case "ok": + return CategorizationStatus.Ok; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, CategorizationStatus value, JsonSerializerOptions options) + { + switch (value) + { + case CategorizationStatus.Warn: + writer.WriteStringValue("warn"); + return; + case CategorizationStatus.Ok: + writer.WriteStringValue("ok"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ChunkingModeConverter))] +public enum ChunkingMode +{ + [EnumMember(Value = "off")] + Off, + [EnumMember(Value = "manual")] + Manual, + [EnumMember(Value = "auto")] + Auto +} + +internal sealed class ChunkingModeConverter : JsonConverter +{ + public override ChunkingMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "off": + return ChunkingMode.Off; + case "manual": + return ChunkingMode.Manual; + case "auto": + return ChunkingMode.Auto; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ChunkingMode value, JsonSerializerOptions options) + { + switch (value) + { + case ChunkingMode.Off: + writer.WriteStringValue("off"); + return; + case ChunkingMode.Manual: + writer.WriteStringValue("manual"); + return; + case ChunkingMode.Auto: + writer.WriteStringValue("auto"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ConditionOperatorConverter))] +public enum ConditionOperator +{ + [EnumMember(Value = "lte")] + Lte, + [EnumMember(Value = "lt")] + Lt, + [EnumMember(Value = "gte")] + Gte, + [EnumMember(Value = "gt")] + Gt +} + +internal sealed class ConditionOperatorConverter : JsonConverter +{ + public override ConditionOperator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "lte": + return ConditionOperator.Lte; + case "lt": + return ConditionOperator.Lt; + case "gte": + return ConditionOperator.Gte; + case "gt": + return ConditionOperator.Gt; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ConditionOperator value, JsonSerializerOptions options) + { + switch (value) + { + case ConditionOperator.Lte: + writer.WriteStringValue("lte"); + return; + case ConditionOperator.Lt: + writer.WriteStringValue("lt"); + return; + case ConditionOperator.Gte: + writer.WriteStringValue("gte"); + return; + case ConditionOperator.Gt: + writer.WriteStringValue("gt"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DatafeedStateConverter))] +public enum DatafeedState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started +} + +internal sealed class DatafeedStateConverter : JsonConverter +{ + public override DatafeedState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DatafeedState.Stopping; + case "stopped": + return DatafeedState.Stopped; + case "starting": + return DatafeedState.Starting; + case "started": + return DatafeedState.Started; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DatafeedState value, JsonSerializerOptions options) + { + switch (value) + { + case DatafeedState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DatafeedState.Stopped: + writer.WriteStringValue("stopped"); + return; + case DatafeedState.Starting: + writer.WriteStringValue("starting"); + return; + case DatafeedState.Started: + writer.WriteStringValue("started"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DataframeStateConverter))] +public enum DataframeState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class DataframeStateConverter : JsonConverter +{ + public override DataframeState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DataframeState.Stopping; + case "stopped": + return DataframeState.Stopped; + case "starting": + return DataframeState.Starting; + case "started": + return DataframeState.Started; + case "failed": + return DataframeState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DataframeState value, JsonSerializerOptions options) + { + switch (value) + { + case DataframeState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DataframeState.Stopped: + writer.WriteStringValue("stopped"); + return; + case DataframeState.Starting: + writer.WriteStringValue("starting"); + return; + case DataframeState.Started: + writer.WriteStringValue("started"); + return; + case DataframeState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentAllocationStateConverter))] +public enum DeploymentAllocationState +{ + /// + /// Trained model deployment is starting but it is not yet deployed on any nodes. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The trained model is started on at least one node. + /// + [EnumMember(Value = "started")] + Started, + /// + /// Trained model deployment has started on all valid nodes. + /// + [EnumMember(Value = "fully_allocated")] + FullyAllocated +} + +internal sealed class DeploymentAllocationStateConverter : JsonConverter +{ + public override DeploymentAllocationState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "starting": + return DeploymentAllocationState.Starting; + case "started": + return DeploymentAllocationState.Started; + case "fully_allocated": + return DeploymentAllocationState.FullyAllocated; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentAllocationState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentAllocationState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentAllocationState.Started: + writer.WriteStringValue("started"); + return; + case DeploymentAllocationState.FullyAllocated: + writer.WriteStringValue("fully_allocated"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentAssignmentStateConverter))] +public enum DeploymentAssignmentState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class DeploymentAssignmentStateConverter : JsonConverter +{ + public override DeploymentAssignmentState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DeploymentAssignmentState.Stopping; + case "starting": + return DeploymentAssignmentState.Starting; + case "started": + return DeploymentAssignmentState.Started; + case "failed": + return DeploymentAssignmentState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentAssignmentState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentAssignmentState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DeploymentAssignmentState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentAssignmentState.Started: + writer.WriteStringValue("started"); + return; + case DeploymentAssignmentState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentStateConverter))] +public enum DeploymentState +{ + /// + /// The deployment is preparing to stop and deallocate the model from the relevant nodes. + /// + [EnumMember(Value = "stopping")] + Stopping, + /// + /// The deployment has recently started but is not yet usable; the model is not allocated on any nodes. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The deployment is usable; at least one node has the model allocated. + /// + [EnumMember(Value = "started")] + Started +} + +internal sealed class DeploymentStateConverter : JsonConverter +{ + public override DeploymentState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DeploymentState.Stopping; + case "starting": + return DeploymentState.Starting; + case "started": + return DeploymentState.Started; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DeploymentState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentState.Started: + writer.WriteStringValue("started"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ExcludeFrequentConverter))] +public enum ExcludeFrequent +{ + [EnumMember(Value = "over")] + Over, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "by")] + By, + [EnumMember(Value = "all")] + All +} + +internal sealed class ExcludeFrequentConverter : JsonConverter +{ + public override ExcludeFrequent Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "over": + return ExcludeFrequent.Over; + case "none": + return ExcludeFrequent.None; + case "by": + return ExcludeFrequent.By; + case "all": + return ExcludeFrequent.All; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ExcludeFrequent value, JsonSerializerOptions options) + { + switch (value) + { + case ExcludeFrequent.Over: + writer.WriteStringValue("over"); + return; + case ExcludeFrequent.None: + writer.WriteStringValue("none"); + return; + case ExcludeFrequent.By: + writer.WriteStringValue("by"); + return; + case ExcludeFrequent.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FilterTypeConverter))] +public enum FilterType +{ + [EnumMember(Value = "include")] + Include, + [EnumMember(Value = "exclude")] + Exclude +} + +internal sealed class FilterTypeConverter : JsonConverter +{ + public override FilterType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "include": + return FilterType.Include; + case "exclude": + return FilterType.Exclude; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, FilterType value, JsonSerializerOptions options) + { + switch (value) + { + case FilterType.Include: + writer.WriteStringValue("include"); + return; + case FilterType.Exclude: + writer.WriteStringValue("exclude"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IncludeConverter))] +public enum Include +{ + /// + /// Includes the total feature importance for the training data set. The
baseline and total feature importance values are returned in the metadata
field in the response body.
+ ///
+ [EnumMember(Value = "total_feature_importance")] + TotalFeatureImportance, + /// + /// Includes the information about hyperparameters used to train the model.
This information consists of the value, the absolute and relative
importance of the hyperparameter as well as an indicator of whether it was
specified by the user or tuned during hyperparameter optimization.
+ ///
+ [EnumMember(Value = "hyperparameters")] + Hyperparameters, + /// + /// Includes the baseline for feature importance values. + /// + [EnumMember(Value = "feature_importance_baseline")] + FeatureImportanceBaseline, + /// + /// Includes the model definition status. + /// + [EnumMember(Value = "definition_status")] + DefinitionStatus, + /// + /// Includes the model definition. + /// + [EnumMember(Value = "definition")] + Definition +} + +internal sealed class IncludeConverter : JsonConverter +{ + public override Include Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "total_feature_importance": + return Include.TotalFeatureImportance; + case "hyperparameters": + return Include.Hyperparameters; + case "feature_importance_baseline": + return Include.FeatureImportanceBaseline; + case "definition_status": + return Include.DefinitionStatus; + case "definition": + return Include.Definition; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, Include value, JsonSerializerOptions options) + { + switch (value) + { + case Include.TotalFeatureImportance: + writer.WriteStringValue("total_feature_importance"); + return; + case Include.Hyperparameters: + writer.WriteStringValue("hyperparameters"); + return; + case Include.FeatureImportanceBaseline: + writer.WriteStringValue("feature_importance_baseline"); + return; + case Include.DefinitionStatus: + writer.WriteStringValue("definition_status"); + return; + case Include.Definition: + writer.WriteStringValue("definition"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(JobBlockedReasonConverter))] +public enum JobBlockedReason +{ + [EnumMember(Value = "revert")] + Revert, + [EnumMember(Value = "reset")] + Reset, + [EnumMember(Value = "delete")] + Delete +} + +internal sealed class JobBlockedReasonConverter : JsonConverter +{ + public override JobBlockedReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "revert": + return JobBlockedReason.Revert; + case "reset": + return JobBlockedReason.Reset; + case "delete": + return JobBlockedReason.Delete; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, JobBlockedReason value, JsonSerializerOptions options) + { + switch (value) + { + case JobBlockedReason.Revert: + writer.WriteStringValue("revert"); + return; + case JobBlockedReason.Reset: + writer.WriteStringValue("reset"); + return; + case JobBlockedReason.Delete: + writer.WriteStringValue("delete"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(JobStateConverter))] +public enum JobState +{ + /// + /// The job open action is in progress and has not yet completed. + /// + [EnumMember(Value = "opening")] + Opening, + /// + /// The job is available to receive and process data. + /// + [EnumMember(Value = "opened")] + Opened, + /// + /// The job did not finish successfully due to an error.
This situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer.
If the job had irrevocably failed, it must be force closed and then deleted.
If the datafeed can be corrected, the job can be closed and then re-opened.
+ ///
+ [EnumMember(Value = "failed")] + Failed, + /// + /// The job close action is in progress and has not yet completed. A closing job cannot accept further data. + /// + [EnumMember(Value = "closing")] + Closing, + /// + /// The job finished successfully with its model state persisted. The job must be opened before it can accept further data. + /// + [EnumMember(Value = "closed")] + Closed +} + +internal sealed class JobStateConverter : JsonConverter +{ + public override JobState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "opening": + return JobState.Opening; + case "opened": + return JobState.Opened; + case "failed": + return JobState.Failed; + case "closing": + return JobState.Closing; + case "closed": + return JobState.Closed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, JobState value, JsonSerializerOptions options) + { + switch (value) + { + case JobState.Opening: + writer.WriteStringValue("opening"); + return; + case JobState.Opened: + writer.WriteStringValue("opened"); + return; + case JobState.Failed: + writer.WriteStringValue("failed"); + return; + case JobState.Closing: + writer.WriteStringValue("closing"); + return; + case JobState.Closed: + writer.WriteStringValue("closed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MemoryStatusConverter))] +public enum MemoryStatus +{ + [EnumMember(Value = "soft_limit")] + SoftLimit, + [EnumMember(Value = "ok")] + Ok, + [EnumMember(Value = "hard_limit")] + HardLimit +} + +internal sealed class MemoryStatusConverter : JsonConverter +{ + public override MemoryStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "soft_limit": + return MemoryStatus.SoftLimit; + case "ok": + return MemoryStatus.Ok; + case "hard_limit": + return MemoryStatus.HardLimit; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, MemoryStatus value, JsonSerializerOptions options) + { + switch (value) + { + case MemoryStatus.SoftLimit: + writer.WriteStringValue("soft_limit"); + return; + case MemoryStatus.Ok: + writer.WriteStringValue("ok"); + return; + case MemoryStatus.HardLimit: + writer.WriteStringValue("hard_limit"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RoutingStateConverter))] +public enum RoutingState +{ + /// + /// The trained model is being deallocated from this node. + /// + [EnumMember(Value = "stopping")] + Stopping, + /// + /// The trained model is fully deallocated from this node. + /// + [EnumMember(Value = "stopped")] + Stopped, + /// + /// The trained model is attempting to allocate on this node; inference requests are not yet accepted. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The trained model is allocated and ready to accept inference requests. + /// + [EnumMember(Value = "started")] + Started, + /// + /// The allocation attempt failed. + /// + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class RoutingStateConverter : JsonConverter +{ + public override RoutingState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return RoutingState.Stopping; + case "stopped": + return RoutingState.Stopped; + case "starting": + return RoutingState.Starting; + case "started": + return RoutingState.Started; + case "failed": + return RoutingState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, RoutingState value, JsonSerializerOptions options) + { + switch (value) + { + case RoutingState.Stopping: + writer.WriteStringValue("stopping"); + return; + case RoutingState.Stopped: + writer.WriteStringValue("stopped"); + return; + case RoutingState.Starting: + writer.WriteStringValue("starting"); + return; + case RoutingState.Started: + writer.WriteStringValue("started"); + return; + case RoutingState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RuleActionConverter))] +public enum RuleAction +{ + /// + /// The result will not be created. Unless you also specify `skip_model_update`, the model will be updated as usual with the corresponding series value. + /// + [EnumMember(Value = "skip_result")] + SkipResult, + /// + /// The value for that series will not be used to update the model. Unless you also specify `skip_result`, the results will be created as usual. This action is suitable when certain values are expected to be consistently anomalous and they affect the model in a way that negatively impacts the rest of the results. + /// + [EnumMember(Value = "skip_model_update")] + SkipModelUpdate +} + +internal sealed class RuleActionConverter : JsonConverter +{ + public override RuleAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "skip_result": + return RuleAction.SkipResult; + case "skip_model_update": + return RuleAction.SkipModelUpdate; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, RuleAction value, JsonSerializerOptions options) + { + switch (value) + { + case RuleAction.SkipResult: + writer.WriteStringValue("skip_result"); + return; + case RuleAction.SkipModelUpdate: + writer.WriteStringValue("skip_model_update"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SnapshotUpgradeStateConverter))] +public enum SnapshotUpgradeState +{ + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "saving_new_state")] + SavingNewState, + [EnumMember(Value = "loading_old_state")] + LoadingOldState, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class SnapshotUpgradeStateConverter : JsonConverter +{ + public override SnapshotUpgradeState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopped": + return SnapshotUpgradeState.Stopped; + case "saving_new_state": + return SnapshotUpgradeState.SavingNewState; + case "loading_old_state": + return SnapshotUpgradeState.LoadingOldState; + case "failed": + return SnapshotUpgradeState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, SnapshotUpgradeState value, JsonSerializerOptions options) + { + switch (value) + { + case SnapshotUpgradeState.Stopped: + writer.WriteStringValue("stopped"); + return; + case SnapshotUpgradeState.SavingNewState: + writer.WriteStringValue("saving_new_state"); + return; + case SnapshotUpgradeState.LoadingOldState: + writer.WriteStringValue("loading_old_state"); + return; + case SnapshotUpgradeState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[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(); + } +} + +[JsonConverter(typeof(TrainedModelTypeConverter))] +public enum TrainedModelType +{ + /// + /// The model definition is an ensemble model of decision trees. + /// + [EnumMember(Value = "tree_ensemble")] + TreeEnsemble, + /// + /// The stored definition is a PyTorch (specifically a TorchScript) model.
Currently only NLP models are supported.
+ ///
+ [EnumMember(Value = "pytorch")] + Pytorch, + /// + /// A special type reserved for language identification models. + /// + [EnumMember(Value = "lang_ident")] + LangIdent +} + +internal sealed class TrainedModelTypeConverter : JsonConverter +{ + public override TrainedModelType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "tree_ensemble": + return TrainedModelType.TreeEnsemble; + case "pytorch": + return TrainedModelType.Pytorch; + case "lang_ident": + return TrainedModelType.LangIdent; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, TrainedModelType value, JsonSerializerOptions options) + { + switch (value) + { + case TrainedModelType.TreeEnsemble: + writer.WriteStringValue("tree_ensemble"); + return; + case TrainedModelType.Pytorch: + writer.WriteStringValue("pytorch"); + return; + case TrainedModelType.LangIdent: + writer.WriteStringValue("lang_ident"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TrainingPriorityConverter))] +public enum TrainingPriority +{ + [EnumMember(Value = "normal")] + Normal, + [EnumMember(Value = "low")] + Low +} + +internal sealed class TrainingPriorityConverter : JsonConverter +{ + public override TrainingPriority Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "normal": + return TrainingPriority.Normal; + case "low": + return TrainingPriority.Low; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, TrainingPriority value, JsonSerializerOptions options) + { + switch (value) + { + case TrainingPriority.Normal: + writer.WriteStringValue("normal"); + return; + case TrainingPriority.Low: + writer.WriteStringValue("low"); + 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 index 596f016f76f..cfe10bf7a26 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -58,7 +58,8 @@ public override DynamicMapping Read(ref Utf8JsonReader reader, Type typeToConver return DynamicMapping.False; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DynamicMapping value, JsonSerializerOptions options) @@ -269,7 +270,8 @@ public override FieldType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return FieldType.AggregateMetricDouble; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldType value, JsonSerializerOptions options) @@ -439,7 +441,8 @@ public override GeoOrientation Read(ref Utf8JsonReader reader, Type typeToConver return GeoOrientation.Left; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoOrientation value, JsonSerializerOptions options) @@ -480,7 +483,8 @@ public override GeoStrategy Read(ref Utf8JsonReader reader, Type typeToConvert, return GeoStrategy.Recursive; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoStrategy value, JsonSerializerOptions options) @@ -529,7 +533,8 @@ public override IndexOptions Read(ref Utf8JsonReader reader, Type typeToConvert, return IndexOptions.Docs; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexOptions value, JsonSerializerOptions options) @@ -576,7 +581,8 @@ public override MatchType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return MatchType.Regex; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MatchType value, JsonSerializerOptions options) @@ -617,7 +623,8 @@ public override OnScriptError Read(ref Utf8JsonReader reader, Type typeToConvert return OnScriptError.Continue; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, OnScriptError value, JsonSerializerOptions options) @@ -682,7 +689,8 @@ public override RuntimeFieldType Read(ref Utf8JsonReader reader, Type typeToConv return RuntimeFieldType.Boolean; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RuntimeFieldType value, JsonSerializerOptions options) @@ -748,7 +756,8 @@ public override SourceFieldMode Read(ref Utf8JsonReader reader, Type typeToConve return SourceFieldMode.Disabled; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SourceFieldMode value, JsonSerializerOptions options) @@ -812,7 +821,8 @@ public override TermVectorOption Read(ref Utf8JsonReader reader, Type typeToConv return TermVectorOption.No; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermVectorOption value, JsonSerializerOptions options) @@ -880,7 +890,8 @@ public override TimeSeriesMetricType Read(ref Utf8JsonReader reader, Type typeTo return TimeSeriesMetricType.Counter; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TimeSeriesMetricType value, JsonSerializerOptions options) 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 index 589ae9648eb..7445bf9f0e3 100644 --- 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 @@ -17,17 +17,80 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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(ClusterInfoTargetConverter))] +public enum ClusterInfoTarget +{ + [EnumMember(Value = "thread_pool")] + ThreadPool, + [EnumMember(Value = "script")] + Script, + [EnumMember(Value = "ingest")] + Ingest, + [EnumMember(Value = "http")] + Http, + [EnumMember(Value = "_all")] + All +} + +internal sealed class ClusterInfoTargetConverter : JsonConverter +{ + public override ClusterInfoTarget Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "thread_pool": + return ClusterInfoTarget.ThreadPool; + case "script": + return ClusterInfoTarget.Script; + case "ingest": + return ClusterInfoTarget.Ingest; + case "http": + return ClusterInfoTarget.Http; + case "_all": + return ClusterInfoTarget.All; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ClusterInfoTarget value, JsonSerializerOptions options) + { + switch (value) + { + case ClusterInfoTarget.ThreadPool: + writer.WriteStringValue("thread_pool"); + return; + case ClusterInfoTarget.Script: + writer.WriteStringValue("script"); + return; + case ClusterInfoTarget.Ingest: + writer.WriteStringValue("ingest"); + return; + case ClusterInfoTarget.Http: + writer.WriteStringValue("http"); + return; + case ClusterInfoTarget.All: + writer.WriteStringValue("_all"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(ClusterSearchStatusConverter))] public enum ClusterSearchStatus { @@ -62,7 +125,8 @@ public override ClusterSearchStatus Read(ref Utf8JsonReader reader, Type typeToC return ClusterSearchStatus.Failed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ClusterSearchStatus value, JsonSerializerOptions options) @@ -118,7 +182,8 @@ public override Conflicts Read(ref Utf8JsonReader reader, Type typeToConvert, Js return Conflicts.Abort; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Conflicts value, JsonSerializerOptions options) @@ -163,7 +228,8 @@ public override DFIIndependenceMeasure Read(ref Utf8JsonReader reader, Type type return DFIIndependenceMeasure.Chisquared; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFIIndependenceMeasure value, JsonSerializerOptions options) @@ -211,7 +277,8 @@ public override DFRAfterEffect Read(ref Utf8JsonReader reader, Type typeToConver return DFRAfterEffect.b; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFRAfterEffect value, JsonSerializerOptions options) @@ -275,7 +342,8 @@ public override DFRBasicModel Read(ref Utf8JsonReader reader, Type typeToConvert return DFRBasicModel.Be; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFRBasicModel value, JsonSerializerOptions options) @@ -359,7 +427,8 @@ public override DistanceUnit Read(ref Utf8JsonReader reader, Type typeToConvert, return DistanceUnit.Centimeters; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DistanceUnit value, JsonSerializerOptions options) @@ -448,7 +517,8 @@ public override ExpandWildcard Read(ref Utf8JsonReader reader, Type typeToConver return ExpandWildcard.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ExpandWildcard value, JsonSerializerOptions options) @@ -506,7 +576,8 @@ public override FieldSortNumericType Read(ref Utf8JsonReader reader, Type typeTo return FieldSortNumericType.Date; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldSortNumericType value, JsonSerializerOptions options) @@ -559,7 +630,8 @@ public override GeoDistanceType Read(ref Utf8JsonReader reader, Type typeToConve return GeoDistanceType.Arc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoDistanceType value, JsonSerializerOptions options) @@ -620,7 +692,8 @@ public override GeoShapeRelation Read(ref Utf8JsonReader reader, Type typeToConv return GeoShapeRelation.Contains; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoShapeRelation value, JsonSerializerOptions options) @@ -683,7 +756,8 @@ public override HealthStatus Read(ref Utf8JsonReader reader, Type typeToConvert, return HealthStatus.Green; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HealthStatus value, JsonSerializerOptions options) @@ -727,7 +801,8 @@ public override IBDistribution Read(ref Utf8JsonReader reader, Type typeToConver return IBDistribution.Ll; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IBDistribution value, JsonSerializerOptions options) @@ -768,7 +843,8 @@ public override IBLambda Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return IBLambda.Df; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IBLambda value, JsonSerializerOptions options) @@ -813,7 +889,8 @@ public override Level Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe return Level.Cluster; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Level value, JsonSerializerOptions options) @@ -835,6 +912,55 @@ public override void Write(Utf8JsonWriter writer, Level value, JsonSerializerOpt } } +[JsonConverter(typeof(LifecycleOperationModeConverter))] +public enum LifecycleOperationMode +{ + [EnumMember(Value = "STOPPING")] + Stopping, + [EnumMember(Value = "STOPPED")] + Stopped, + [EnumMember(Value = "RUNNING")] + Running +} + +internal sealed class LifecycleOperationModeConverter : JsonConverter +{ + public override LifecycleOperationMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "STOPPING": + return LifecycleOperationMode.Stopping; + case "STOPPED": + return LifecycleOperationMode.Stopped; + case "RUNNING": + return LifecycleOperationMode.Running; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LifecycleOperationMode value, JsonSerializerOptions options) + { + switch (value) + { + case LifecycleOperationMode.Stopping: + writer.WriteStringValue("STOPPING"); + return; + case LifecycleOperationMode.Stopped: + writer.WriteStringValue("STOPPED"); + return; + case LifecycleOperationMode.Running: + writer.WriteStringValue("RUNNING"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(NodeRoleConverter))] public enum NodeRole { @@ -905,7 +1031,8 @@ public override NodeRole Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return NodeRole.Client; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NodeRole value, JsonSerializerOptions options) @@ -994,7 +1121,8 @@ public override Normalization Read(ref Utf8JsonReader reader, Type typeToConvert return Normalization.H1; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Normalization value, JsonSerializerOptions options) @@ -1056,7 +1184,8 @@ public override Result Read(ref Utf8JsonReader reader, Type typeToConvert, JsonS return Result.Created; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) @@ -1152,7 +1281,8 @@ public override ScriptSortType Read(ref Utf8JsonReader reader, Type typeToConver return ScriptSortType.Number; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ScriptSortType value, JsonSerializerOptions options) @@ -1202,7 +1332,8 @@ public override SearchType Read(ref Utf8JsonReader reader, Type typeToConvert, J return SearchType.DfsQueryThenFetch; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SearchType value, JsonSerializerOptions options) @@ -1242,7 +1373,8 @@ public override SlicesCalculation Read(ref Utf8JsonReader reader, Type typeToCon return SlicesCalculation.Auto; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SlicesCalculation value, JsonSerializerOptions options) @@ -1292,7 +1424,8 @@ public override SortMode Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return SortMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SortMode value, JsonSerializerOptions options) @@ -1348,7 +1481,8 @@ public override SortOrder Read(ref Utf8JsonReader reader, Type typeToConvert, Js return SortOrder.Asc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SortOrder value, JsonSerializerOptions options) @@ -1402,7 +1536,8 @@ public override SuggestMode Read(ref Utf8JsonReader reader, Type typeToConvert, return SuggestMode.Always; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SuggestMode value, JsonSerializerOptions options) @@ -1424,6 +1559,69 @@ public override void Write(Utf8JsonWriter writer, SuggestMode value, JsonSeriali } } +[JsonConverter(typeof(ThreadTypeConverter))] +public enum ThreadType +{ + [EnumMember(Value = "wait")] + Wait, + [EnumMember(Value = "mem")] + Mem, + [EnumMember(Value = "gpu")] + Gpu, + [EnumMember(Value = "cpu")] + Cpu, + [EnumMember(Value = "block")] + Block +} + +internal sealed class ThreadTypeConverter : JsonConverter +{ + public override ThreadType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "wait": + return ThreadType.Wait; + case "mem": + return ThreadType.Mem; + case "gpu": + return ThreadType.Gpu; + case "cpu": + return ThreadType.Cpu; + case "block": + return ThreadType.Block; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ThreadType value, JsonSerializerOptions options) + { + switch (value) + { + case ThreadType.Wait: + writer.WriteStringValue("wait"); + return; + case ThreadType.Mem: + writer.WriteStringValue("mem"); + return; + case ThreadType.Gpu: + writer.WriteStringValue("gpu"); + return; + case ThreadType.Cpu: + writer.WriteStringValue("cpu"); + return; + case ThreadType.Block: + writer.WriteStringValue("block"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(TimeUnitConverter))] public enum TimeUnit { @@ -1431,12 +1629,12 @@ public enum TimeUnit Seconds, [EnumMember(Value = "nanos")] Nanoseconds, + [EnumMember(Value = "m")] + Minutes, [EnumMember(Value = "ms")] Milliseconds, [EnumMember(Value = "micros")] Microseconds, - [EnumMember(Value = "m")] - Minutes, [EnumMember(Value = "h")] Hours, [EnumMember(Value = "d")] @@ -1454,19 +1652,20 @@ public override TimeUnit Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return TimeUnit.Seconds; case "nanos": return TimeUnit.Nanoseconds; + case "m": + return TimeUnit.Minutes; 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; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TimeUnit value, JsonSerializerOptions options) @@ -1479,15 +1678,15 @@ public override void Write(Utf8JsonWriter writer, TimeUnit value, JsonSerializer case TimeUnit.Nanoseconds: writer.WriteStringValue("nanos"); return; + case TimeUnit.Minutes: + writer.WriteStringValue("m"); + 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; @@ -1539,7 +1738,8 @@ public override VersionType Read(ref Utf8JsonReader reader, Type typeToConvert, return VersionType.External; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, VersionType value, JsonSerializerOptions options) @@ -1602,7 +1802,8 @@ public override WaitForEvents Read(ref Utf8JsonReader reader, Type typeToConvert return WaitForEvents.High; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, WaitForEvents value, JsonSerializerOptions options) 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 index 0a89dd2408e..285be0f6877 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -62,7 +62,8 @@ public override ChildScoreMode Read(ref Utf8JsonReader reader, Type typeToConver return ChildScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ChildScoreMode value, JsonSerializerOptions options) @@ -112,7 +113,8 @@ public override CombinedFieldsOperator Read(ref Utf8JsonReader reader, Type type return CombinedFieldsOperator.And; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CombinedFieldsOperator value, JsonSerializerOptions options) @@ -159,7 +161,8 @@ public override CombinedFieldsZeroTerms Read(ref Utf8JsonReader reader, Type typ return CombinedFieldsZeroTerms.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CombinedFieldsZeroTerms value, JsonSerializerOptions options) @@ -262,7 +265,8 @@ public override FieldValueFactorModifier Read(ref Utf8JsonReader reader, Type ty return FieldValueFactorModifier.Ln; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldValueFactorModifier value, JsonSerializerOptions options) @@ -361,7 +365,8 @@ public override FunctionBoostMode Read(ref Utf8JsonReader reader, Type typeToCon return FunctionBoostMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FunctionBoostMode value, JsonSerializerOptions options) @@ -448,7 +453,8 @@ public override FunctionScoreMode Read(ref Utf8JsonReader reader, Type typeToCon return FunctionScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FunctionScoreMode value, JsonSerializerOptions options) @@ -511,7 +517,8 @@ public override GeoValidationMethod Read(ref Utf8JsonReader reader, Type typeToC return GeoValidationMethod.Coerce; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, JsonSerializerOptions options) @@ -557,7 +564,8 @@ public override Operator Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Operator.And; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Operator value, JsonSerializerOptions options) @@ -611,7 +619,8 @@ public override RangeRelation Read(ref Utf8JsonReader reader, Type typeToConvert return RangeRelation.Contains; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RangeRelation value, JsonSerializerOptions options) @@ -633,9 +642,9 @@ public override void Write(Utf8JsonWriter writer, RangeRelation value, JsonSeria } } -[JsonConverter(typeof(SimpleQueryStringFlagsConverter))] +[JsonConverter(typeof(SimpleQueryStringFlagConverter))] [Flags] -public enum SimpleQueryStringFlags +public enum SimpleQueryStringFlag { /// /// Enables whitespace as split characters. @@ -704,9 +713,9 @@ public enum SimpleQueryStringFlags All = 1 << 12 } -internal sealed class SimpleQueryStringFlagsConverter : JsonConverter +internal sealed class SimpleQueryStringFlagConverter : JsonConverter { - public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override SimpleQueryStringFlag Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var s = reader.GetString(); if (string.IsNullOrEmpty(s)) @@ -715,24 +724,24 @@ public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type type } var flags = s.Split('|'); - var result = default(SimpleQueryStringFlags); + var result = default(SimpleQueryStringFlag); 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, + "WHITESPACE" => SimpleQueryStringFlag.Whitespace, + "SLOP" => SimpleQueryStringFlag.Slop, + "PREFIX" => SimpleQueryStringFlag.Prefix, + "PRECEDENCE" => SimpleQueryStringFlag.Precedence, + "PHRASE" => SimpleQueryStringFlag.Phrase, + "OR" => SimpleQueryStringFlag.Or, + "NOT" => SimpleQueryStringFlag.Not, + "NONE" => SimpleQueryStringFlag.None, + "NEAR" => SimpleQueryStringFlag.Near, + "FUZZY" => SimpleQueryStringFlag.Fuzzy, + "ESCAPE" => SimpleQueryStringFlag.Escape, + "AND" => SimpleQueryStringFlag.And, + "ALL" => SimpleQueryStringFlag.All, _ => throw new JsonException($"Invalid flag value '{flag}' for type '{typeToConvert.Name}'.") }; } @@ -740,7 +749,7 @@ public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type type return result; } - public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlags value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlag value, JsonSerializerOptions options) { if (value == default) { @@ -749,31 +758,31 @@ public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlags value, } var sb = new StringBuilder(); - if (value.HasFlag(SimpleQueryStringFlags.Whitespace)) + if (value.HasFlag(SimpleQueryStringFlag.Whitespace)) sb.Append("WHITESPACE|"); - if (value.HasFlag(SimpleQueryStringFlags.Slop)) + if (value.HasFlag(SimpleQueryStringFlag.Slop)) sb.Append("SLOP|"); - if (value.HasFlag(SimpleQueryStringFlags.Prefix)) + if (value.HasFlag(SimpleQueryStringFlag.Prefix)) sb.Append("PREFIX|"); - if (value.HasFlag(SimpleQueryStringFlags.Precedence)) + if (value.HasFlag(SimpleQueryStringFlag.Precedence)) sb.Append("PRECEDENCE|"); - if (value.HasFlag(SimpleQueryStringFlags.Phrase)) + if (value.HasFlag(SimpleQueryStringFlag.Phrase)) sb.Append("PHRASE|"); - if (value.HasFlag(SimpleQueryStringFlags.Or)) + if (value.HasFlag(SimpleQueryStringFlag.Or)) sb.Append("OR|"); - if (value.HasFlag(SimpleQueryStringFlags.Not)) + if (value.HasFlag(SimpleQueryStringFlag.Not)) sb.Append("NOT|"); - if (value.HasFlag(SimpleQueryStringFlags.None)) + if (value.HasFlag(SimpleQueryStringFlag.None)) sb.Append("NONE|"); - if (value.HasFlag(SimpleQueryStringFlags.Near)) + if (value.HasFlag(SimpleQueryStringFlag.Near)) sb.Append("NEAR|"); - if (value.HasFlag(SimpleQueryStringFlags.Fuzzy)) + if (value.HasFlag(SimpleQueryStringFlag.Fuzzy)) sb.Append("FUZZY|"); - if (value.HasFlag(SimpleQueryStringFlags.Escape)) + if (value.HasFlag(SimpleQueryStringFlag.Escape)) sb.Append("ESCAPE|"); - if (value.HasFlag(SimpleQueryStringFlags.And)) + if (value.HasFlag(SimpleQueryStringFlag.And)) sb.Append("AND|"); - if (value.HasFlag(SimpleQueryStringFlags.All)) + if (value.HasFlag(SimpleQueryStringFlag.All)) sb.Append("ALL|"); if (sb.Length == 0) { @@ -842,7 +851,8 @@ public override TextQueryType Read(ref Utf8JsonReader reader, Type typeToConvert return TextQueryType.BestFields; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TextQueryType value, JsonSerializerOptions options) @@ -901,7 +911,8 @@ public override ZeroTermsQuery Read(ref Utf8JsonReader reader, Type typeToConver return ZeroTermsQuery.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ZeroTermsQuery value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Snapshot.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Snapshot.g.cs new file mode 100644 index 00000000000..c5bb292c907 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Snapshot.g.cs @@ -0,0 +1,184 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the 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.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +[JsonConverter(typeof(ShardsStatsStageConverter))] +public enum ShardsStatsStage +{ + /// + /// Number of shards in the snapshot that are in the started stage of being stored in the repository. + /// + [EnumMember(Value = "STARTED")] + Started, + /// + /// Number of shards in the snapshot that are in the initializing stage of being stored in the repository. + /// + [EnumMember(Value = "INIT")] + Init, + /// + /// Number of shards in the snapshot that are in the finalizing stage of being stored in the repository. + /// + [EnumMember(Value = "FINALIZE")] + Finalize, + /// + /// Number of shards in the snapshot that were not successfully stored in the repository. + /// + [EnumMember(Value = "FAILURE")] + Failure, + /// + /// Number of shards in the snapshot that were successfully stored in the repository. + /// + [EnumMember(Value = "DONE")] + Done +} + +internal sealed class ShardsStatsStageConverter : JsonConverter +{ + public override ShardsStatsStage Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "STARTED": + return ShardsStatsStage.Started; + case "INIT": + return ShardsStatsStage.Init; + case "FINALIZE": + return ShardsStatsStage.Finalize; + case "FAILURE": + return ShardsStatsStage.Failure; + case "DONE": + return ShardsStatsStage.Done; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ShardsStatsStage value, JsonSerializerOptions options) + { + switch (value) + { + case ShardsStatsStage.Started: + writer.WriteStringValue("STARTED"); + return; + case ShardsStatsStage.Init: + writer.WriteStringValue("INIT"); + return; + case ShardsStatsStage.Finalize: + writer.WriteStringValue("FINALIZE"); + return; + case ShardsStatsStage.Failure: + writer.WriteStringValue("FAILURE"); + return; + case ShardsStatsStage.Done: + writer.WriteStringValue("DONE"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SnapshotSortConverter))] +public enum SnapshotSort +{ + [EnumMember(Value = "start_time")] + StartTime, + [EnumMember(Value = "shard_count")] + ShardCount, + [EnumMember(Value = "repository")] + Repository, + [EnumMember(Value = "name")] + Name, + [EnumMember(Value = "index_count")] + IndexCount, + [EnumMember(Value = "failed_shard_count")] + FailedShardCount, + [EnumMember(Value = "duration")] + Duration +} + +internal sealed class SnapshotSortConverter : JsonConverter +{ + public override SnapshotSort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "start_time": + return SnapshotSort.StartTime; + case "shard_count": + return SnapshotSort.ShardCount; + case "repository": + return SnapshotSort.Repository; + case "name": + return SnapshotSort.Name; + case "index_count": + return SnapshotSort.IndexCount; + case "failed_shard_count": + return SnapshotSort.FailedShardCount; + case "duration": + return SnapshotSort.Duration; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, SnapshotSort value, JsonSerializerOptions options) + { + switch (value) + { + case SnapshotSort.StartTime: + writer.WriteStringValue("start_time"); + return; + case SnapshotSort.ShardCount: + writer.WriteStringValue("shard_count"); + return; + case SnapshotSort.Repository: + writer.WriteStringValue("repository"); + return; + case SnapshotSort.Name: + writer.WriteStringValue("name"); + return; + case SnapshotSort.IndexCount: + writer.WriteStringValue("index_count"); + return; + case SnapshotSort.FailedShardCount: + writer.WriteStringValue("failed_shard_count"); + return; + case SnapshotSort.Duration: + writer.WriteStringValue("duration"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Tasks.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Tasks.g.cs deleted file mode 100644 index 6ecd283d80c..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Tasks.g.cs +++ /dev/null @@ -1,86 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// 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.Tasks; - -[JsonConverter(typeof(GroupByConverter))] -public enum GroupBy -{ - /// - /// Parent task ID - /// - [EnumMember(Value = "parents")] - Parents, - /// - /// Do not group tasks. - /// - [EnumMember(Value = "none")] - None, - /// - /// Node ID - /// - [EnumMember(Value = "nodes")] - Nodes -} - -internal sealed class GroupByConverter : JsonConverter -{ - public override GroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var enumString = reader.GetString(); - switch (enumString) - { - case "parents": - return GroupBy.Parents; - case "none": - return GroupBy.None; - case "nodes": - return GroupBy.Nodes; - } - - ThrowHelper.ThrowJsonException(); return default; - } - - public override void Write(Utf8JsonWriter writer, GroupBy value, JsonSerializerOptions options) - { - switch (value) - { - case GroupBy.Parents: - writer.WriteStringValue("parents"); - return; - case GroupBy.None: - writer.WriteStringValue("none"); - return; - case GroupBy.Nodes: - writer.WriteStringValue("nodes"); - 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 index d1f3f73e36d..9a877190686 100644 --- 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 @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Serverless.Core; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using Elastic.Transport; 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; @@ -58,7 +58,8 @@ public override ActionStatusOptions Read(ref Utf8JsonReader reader, Type typeToC return ActionStatusOptions.Failure; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ActionStatusOptions value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Eql/HitsEvent.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Eql/HitsEvent.g.cs index a1c66d03be9..cf07a5c7a40 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Eql/HitsEvent.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Eql/HitsEvent.g.cs @@ -29,6 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Eql; public sealed partial class HitsEvent { + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] + public IReadOnlyDictionary>? Fields { get; init; } + /// /// Unique identifier for the event. This ID is only unique within the index. /// @@ -46,7 +50,4 @@ public sealed partial class HitsEvent /// [JsonInclude, JsonPropertyName("_source")] public TEvent Source { get; init; } - [JsonInclude, JsonPropertyName("fields")] - [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] - public IReadOnlyDictionary>? Fields { get; init; } } \ 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 index af66e79ca9d..b887b4162b3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorCause.g.cs @@ -82,12 +82,12 @@ public override ErrorCause Read(ref Utf8JsonReader reader, Type typeToConvert, J } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } - return new ErrorCause { CausedBy = causedBy, Reason = reason, RootCause = rootCause, StackTrace = stackTrace, Suppressed = suppressed, Type = type, Metadata = additionalProperties }; + return new ErrorCause { CausedBy = causedBy, Metadata = additionalProperties, Reason = reason, RootCause = rootCause, StackTrace = stackTrace, Suppressed = suppressed, Type = type }; } public override void Write(Utf8JsonWriter writer, ErrorCause value, JsonSerializerOptions options) @@ -96,13 +96,17 @@ public override void Write(Utf8JsonWriter writer, ErrorCause value, JsonSerializ } } -[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.
///
+[JsonConverter(typeof(ErrorCauseConverter))] public sealed partial class ErrorCause { public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? CausedBy { get; init; } + + /// + /// Additional details about the error + /// public IReadOnlyDictionary Metadata { get; init; } /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs index 20bf82fe8a3..8fbc5e9c6a1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ErrorResponseBase.g.cs @@ -19,7 +19,6 @@ 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; @@ -31,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless; /// /// The response returned by Elasticsearch when request execution did not succeed. /// -public abstract partial class ErrorResponseBase +public sealed partial class ErrorResponseBase { [JsonInclude, JsonPropertyName("error")] public Elastic.Clients.Elasticsearch.Serverless.ErrorCause Error { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs index a0099d7c4d4..430fc042c4c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FieldSort.g.cs @@ -32,7 +32,7 @@ public sealed partial class FieldSort [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } [JsonInclude, JsonPropertyName("missing")] - public FieldValue? Missing { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.FieldValue? Missing { get; set; } [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.Serverless.SortMode? Mode { get; set; } [JsonInclude, JsonPropertyName("nested")] @@ -54,11 +54,11 @@ public FieldSortDescriptor() : base() } private string? FormatValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { 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; } @@ -69,7 +69,7 @@ public FieldSortDescriptor Format(string? format) return Self; } - public FieldSortDescriptor Missing(FieldValue? missing) + public FieldSortDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -89,7 +89,7 @@ public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serve return Self; } - public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -97,7 +97,7 @@ public FieldSortDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public FieldSortDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -152,7 +152,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -191,11 +191,11 @@ public FieldSortDescriptor() : base() } private string? FormatValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { 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; } @@ -206,7 +206,7 @@ public FieldSortDescriptor Format(string? format) return Self; } - public FieldSortDescriptor Missing(FieldValue? missing) + public FieldSortDescriptor Missing(Elastic.Clients.Elasticsearch.Serverless.FieldValue? missing) { MissingValue = missing; return Self; @@ -226,7 +226,7 @@ public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.Neste return Self; } - public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -234,7 +234,7 @@ public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public FieldSortDescriptor Nested(Action configure) + public FieldSortDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -289,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs index 58dde2b08e1..0b2392807f0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Fuzziness.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Fuzziness : Union { - public Fuzziness(string fuzziness) : base(fuzziness) + public Fuzziness(string Fuzziness) : base(Fuzziness) { } - public Fuzziness(int 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/GeoDistanceSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs index fddd905368d..59b99d81636 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoDistanceSort.g.cs @@ -138,7 +138,7 @@ public sealed partial class GeoDistanceSort 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.SortOptions(GeoDistanceSort geoDistanceSort) => Elastic.Clients.Elasticsearch.Serverless.SortOptions.GeoDistance(geoDistanceSort); } public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor> @@ -150,12 +150,12 @@ public GeoDistanceSortDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private ICollection LocationValue { 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) { @@ -163,27 +163,27 @@ public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elastic return Self; } - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + public GeoDistanceSortDescriptor Field(Expression> field) { - ModeValue = mode; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + public GeoDistanceSortDescriptor Field(Expression> field) { - OrderValue = order; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - UnitValue = unit; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -193,15 +193,21 @@ public GeoDistanceSortDescriptor Location(ICollection Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) { - FieldValue = field; + ModeValue = mode; return Self; } - public GeoDistanceSortDescriptor Field(Expression> field) + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) { - FieldValue = field; + OrderValue = order; + return Self; + } + + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + { + UnitValue = unit; return Self; } @@ -258,12 +264,12 @@ public GeoDistanceSortDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private ICollection LocationValue { 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) { @@ -271,27 +277,27 @@ public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.Serv return Self; } - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.SortMode? mode) + public GeoDistanceSortDescriptor Field(Expression> field) { - ModeValue = mode; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) + public GeoDistanceSortDescriptor Field(Expression> field) { - OrderValue = order; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - UnitValue = unit; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -301,21 +307,21 @@ public GeoDistanceSortDescriptor Location(ICollection(Expression> field) + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.SortOrder? order) { - FieldValue = field; + OrderValue = order; return Self; } - public GeoDistanceSortDescriptor Field(Expression> field) + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.Serverless.DistanceUnit? unit) { - FieldValue = field; + UnitValue = unit; return Self; } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs index 595cf2cc946..9007964a10b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoHashLocation.g.cs @@ -53,7 +53,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("geohash"); - JsonSerializer.Serialize(writer, GeohashValue, options); + writer.WriteStringValue(GeohashValue); writer.WriteEndObject(); } } \ 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 index db9e96ee043..21fdce2ed75 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeoLocation.g.cs @@ -134,9 +134,8 @@ internal sealed class GeoLocationConverter : MultiItemUnionConverter { { 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) } }; + _types = new Dictionary { { GeoLocation.Kind.LatitudeLongitude, typeof(Elastic.Clients.Elasticsearch.Serverless.LatLonGeoLocation) }, { GeoLocation.Kind.Geohash, typeof(Elastic.Clients.Elasticsearch.Serverless.GeoHashLocation) } }; + _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) } }; _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 index f68488b3d7e..3bd5a377ab2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/GeohashPrecision.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless; +/// +/// A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". +/// public sealed partial class GeohashPrecision : Union { - public GeohashPrecision(double geohash_length) : base(geohash_length) + public GeohashPrecision(double GeohashLength) : base(GeohashLength) { } - public GeohashPrecision(string distance) : base(distance) + public GeohashPrecision(string Distance) : base(Distance) { } } \ 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 index 3f8fc75ae09..c6a2d31e7c0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/ExploreControls.g.cs @@ -63,8 +63,8 @@ public ExploreControlsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? SampleDiversityValue { get; set; } - private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } - private Action> SampleDiversityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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; } @@ -80,7 +80,7 @@ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elas return Self; } - public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversityDescriptor descriptor) { SampleDiversityValue = null; SampleDiversityDescriptorAction = null; @@ -88,7 +88,7 @@ public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescr return Self; } - public ExploreControlsDescriptor SampleDiversity(Action> configure) + public ExploreControlsDescriptor SampleDiversity(Action> configure) { SampleDiversityValue = null; SampleDiversityDescriptor = null; @@ -134,7 +134,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SampleDiversityDescriptorAction is not null) { writer.WritePropertyName("sample_diversity"); - JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); } else if (SampleDiversityValue is not null) { @@ -169,8 +169,8 @@ public ExploreControlsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversity? SampleDiversityValue { get; set; } - private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } - private Action SampleDiversityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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; } @@ -186,7 +186,7 @@ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.S return Self; } - public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversityDescriptor descriptor) { SampleDiversityValue = null; SampleDiversityDescriptorAction = null; @@ -194,7 +194,7 @@ public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descr return Self; } - public ExploreControlsDescriptor SampleDiversity(Action configure) + public ExploreControlsDescriptor SampleDiversity(Action configure) { SampleDiversityValue = null; SampleDiversityDescriptor = null; @@ -240,7 +240,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SampleDiversityDescriptorAction is not null) { writer.WritePropertyName("sample_diversity"); - JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); } else if (SampleDiversityValue is not null) { 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 index 3eb4afcbae5..a141ac52b7d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/Hop.g.cs @@ -57,15 +57,15 @@ 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.Graph.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 Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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. @@ -78,7 +78,7 @@ public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Server return Self; } - public HopDescriptor Connections(HopDescriptor descriptor) + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -86,7 +86,7 @@ public HopDescriptor Connections(HopDescriptor descriptor) return Self; } - public HopDescriptor Connections(Action> configure) + public HopDescriptor Connections(Action> configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -105,7 +105,7 @@ public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -113,7 +113,7 @@ public HopDescriptor Query(QueryDsl.QueryDescriptor descri return Self; } - public HopDescriptor Query(Action> configure) + public HopDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -133,7 +133,7 @@ public HopDescriptor Vertices(ICollection Vertices(VertexDefinitionDescriptor descriptor) + public HopDescriptor Vertices(Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor descriptor) { VerticesValue = null; VerticesDescriptorAction = null; @@ -142,7 +142,7 @@ public HopDescriptor Vertices(VertexDefinitionDescriptor d return Self; } - public HopDescriptor Vertices(Action> configure) + public HopDescriptor Vertices(Action> configure) { VerticesValue = null; VerticesDescriptor = null; @@ -151,7 +151,7 @@ public HopDescriptor Vertices(Action Vertices(params Action>[] configure) + public HopDescriptor Vertices(params Action>[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -171,7 +171,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -187,7 +187,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -206,7 +206,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -215,7 +215,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); @@ -239,15 +239,15 @@ 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.Graph.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 Elastic.Clients.Elasticsearch.Serverless.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; } + private Elastic.Clients.Elasticsearch.Serverless.Graph.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. @@ -260,7 +260,7 @@ public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph. return Self; } - public HopDescriptor Connections(HopDescriptor descriptor) + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -268,7 +268,7 @@ public HopDescriptor Connections(HopDescriptor descriptor) return Self; } - public HopDescriptor Connections(Action configure) + public HopDescriptor Connections(Action configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -287,7 +287,7 @@ public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Que return Self; } - public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public HopDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -295,7 +295,7 @@ public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public HopDescriptor Query(Action configure) + public HopDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -315,7 +315,7 @@ public HopDescriptor Vertices(ICollection configure) + public HopDescriptor Vertices(Action configure) { VerticesValue = null; VerticesDescriptor = null; @@ -333,7 +333,7 @@ public HopDescriptor Vertices(Action configure) return Self; } - public HopDescriptor Vertices(params Action[] configure) + public HopDescriptor Vertices(params Action[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -353,7 +353,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -369,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -388,7 +388,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -397,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); 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 index 8ea833e7218..a09103a43f4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/SampleDiversity.g.cs @@ -58,6 +58,12 @@ public SampleDiversityDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) { MaxDocsPerValueValue = maxDocsPerValue; 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 index d959f5620f8..43338811e74 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Graph/VertexDefinition.g.cs @@ -77,9 +77,9 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Graph.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; } @@ -111,6 +111,15 @@ public VertexDefinitionDescriptor Field(Expression + /// 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. /// @@ -123,7 +132,7 @@ public VertexDefinitionDescriptor Include(ICollection Include(VertexIncludeDescriptor descriptor) + public VertexDefinitionDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Graph.VertexIncludeDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -132,7 +141,7 @@ public VertexDefinitionDescriptor Include(VertexIncludeDescriptor des return Self; } - public VertexDefinitionDescriptor Include(Action configure) + public VertexDefinitionDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -141,7 +150,7 @@ public VertexDefinitionDescriptor Include(Action Include(params Action[] configure) + public VertexDefinitionDescriptor Include(params Action[] configure) { IncludeValue = null; IncludeDescriptor = null; @@ -199,7 +208,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("include"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexIncludeDescriptor(IncludeDescriptorAction), options); writer.WriteEndArray(); } else if (IncludeDescriptorActions is not null) @@ -208,7 +217,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IncludeDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexIncludeDescriptor(action), options); } writer.WriteEndArray(); @@ -252,9 +261,9 @@ 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 Elastic.Clients.Elasticsearch.Serverless.Graph.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; } @@ -307,7 +316,7 @@ public VertexDefinitionDescriptor Include(ICollection configure) + public VertexDefinitionDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -325,7 +334,7 @@ public VertexDefinitionDescriptor Include(Action config return Self; } - public VertexDefinitionDescriptor Include(params Action[] configure) + public VertexDefinitionDescriptor Include(params Action[] configure) { IncludeValue = null; IncludeDescriptor = null; @@ -383,7 +392,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("include"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexIncludeDescriptor(IncludeDescriptorAction), options); writer.WriteEndArray(); } else if (IncludeDescriptorActions is not null) @@ -392,7 +401,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IncludeDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Graph.VertexIncludeDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs new file mode 100644 index 00000000000..b5a01a2a30a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Configurations.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.IndexLifecycleManagement; + +public sealed partial class Configurations +{ + [JsonInclude, JsonPropertyName("forcemerge")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.ForceMergeConfiguration? Forcemerge { get; init; } + [JsonInclude, JsonPropertyName("rollover")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RolloverConditions? Rollover { get; init; } + [JsonInclude, JsonPropertyName("shrink")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.ShrinkConfiguration? Shrink { get; init; } +} \ 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/IndexLifecycleManagement/ForceMergeConfiguration.g.cs similarity index 85% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.g.cs index cd200bf6592..dc3498a4174 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StopWordsConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.g.cs @@ -17,19 +17,18 @@ #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; +namespace Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement; -internal sealed class StopWordsConverter : SingleOrManyCollectionConverter +public sealed partial class ForceMergeConfiguration { + [JsonInclude, JsonPropertyName("max_num_segments")] + public int MaxNumSegments { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phase.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phase.g.cs new file mode 100644 index 00000000000..276a65599a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phase.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.IndexLifecycleManagement; + +public sealed partial class Phase +{ + [JsonInclude, JsonPropertyName("actions")] + public object? Actions { get; init; } + [JsonInclude, JsonPropertyName("configurations")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Configurations? Configurations { get; init; } + [JsonInclude, JsonPropertyName("min_age")] + public Union? MinAge { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phases.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phases.g.cs new file mode 100644 index 00000000000..2c0adadc922 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/Phases.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.IndexLifecycleManagement; + +public sealed partial class Phases +{ + [JsonInclude, JsonPropertyName("cold")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phase? Cold { get; init; } + [JsonInclude, JsonPropertyName("delete")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phase? Delete { get; init; } + [JsonInclude, JsonPropertyName("frozen")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phase? Frozen { get; init; } + [JsonInclude, JsonPropertyName("hot")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phase? Hot { get; init; } + [JsonInclude, JsonPropertyName("warm")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phase? Warm { get; init; } +} \ 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/IndexLifecycleManagement/ShrinkConfiguration.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.g.cs index c98dbf6dd7f..bb652d94851 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/FeaturesConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.g.cs @@ -17,19 +17,18 @@ #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; +namespace Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement; -internal sealed class FeaturesConverter : SingleOrManyCollectionConverter +public sealed partial class ShrinkConfiguration { + [JsonInclude, JsonPropertyName("number_of_shards")] + public int NumberOfShards { get; init; } } \ 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 deleted file mode 100644 index ab35b2a6efc..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Action.g.cs +++ /dev/null @@ -1,237 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -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 index b4725e5e5cc..b3c4017e047 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AddAction.g.cs @@ -96,7 +96,7 @@ public sealed partial class AddAction [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction(AddAction addAction) => Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction.Add(addAction); } public sealed partial class AddActionDescriptor : SerializableDescriptor> @@ -110,8 +110,8 @@ public AddActionDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.IndexAlias? AliasValue { get; set; } private ICollection? AliasesValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { 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; } @@ -150,7 +150,7 @@ public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serve return Self; } - public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -158,7 +158,7 @@ public AddActionDescriptor Filter(QueryDsl.QueryDescriptor return Self; } - public AddActionDescriptor Filter(Action> configure) + public AddActionDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -261,7 +261,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -332,8 +332,8 @@ public AddActionDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.IndexAlias? AliasValue { get; set; } private ICollection? AliasesValue { get; set; } 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { 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; } @@ -372,7 +372,7 @@ public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.Query return Self; } - public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -380,7 +380,7 @@ public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public AddActionDescriptor Filter(Action configure) + public AddActionDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -483,7 +483,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { 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 index cd85428022f..85729426a1e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Alias.g.cs @@ -75,8 +75,8 @@ 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.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; } @@ -94,7 +94,7 @@ public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverles return Self; } - public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -102,7 +102,7 @@ public AliasDescriptor Filter(QueryDsl.QueryDescriptor des return Self; } - public AliasDescriptor Filter(Action> configure) + public AliasDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -166,7 +166,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -217,8 +217,8 @@ 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.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; } @@ -236,7 +236,7 @@ public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl. return Self; } - public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -244,7 +244,7 @@ public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public AliasDescriptor Filter(Action configure) + public AliasDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -308,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs new file mode 100644 index 00000000000..690517296ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeDetail.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.IndexManagement; + +public sealed partial class AnalyzeDetail +{ + [JsonInclude, JsonPropertyName("analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AnalyzerDetail? Analyzer { get; init; } + [JsonInclude, JsonPropertyName("charfilters")] + public IReadOnlyCollection? Charfilters { get; init; } + [JsonInclude, JsonPropertyName("custom_analyzer")] + public bool CustomAnalyzer { get; init; } + [JsonInclude, JsonPropertyName("tokenfilters")] + public IReadOnlyCollection? Tokenfilters { get; init; } + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TokenDetail? Tokenizer { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeToken.g.cs new file mode 100644 index 00000000000..31ae7caedbf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzeToken.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 AnalyzeToken +{ + [JsonInclude, JsonPropertyName("end_offset")] + public long EndOffset { get; init; } + [JsonInclude, JsonPropertyName("position")] + public long Position { get; init; } + [JsonInclude, JsonPropertyName("positionLength")] + public long? Positionlength { get; init; } + [JsonInclude, JsonPropertyName("start_offset")] + public long StartOffset { get; init; } + [JsonInclude, JsonPropertyName("token")] + public string Token { 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/IndexManagement/AnalyzerDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs new file mode 100644 index 00000000000..4926b17edba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/AnalyzerDetail.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 AnalyzerDetail +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection Tokens { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CharFilterDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CharFilterDetail.g.cs new file mode 100644 index 00000000000..db98e54ae72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/CharFilterDetail.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 CharFilterDetail +{ + [JsonInclude, JsonPropertyName("filtered_text")] + public IReadOnlyCollection FilteredText { 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/DataStream.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs index 60d46b0787e..81d181d15f1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStream.g.cs @@ -29,12 +29,6 @@ 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. /// @@ -71,6 +65,12 @@ public sealed partial class DataStream [JsonInclude, JsonPropertyName("lifecycle")] public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + /// + /// 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; } + /// /// Name of the data stream. /// @@ -81,7 +81,7 @@ public sealed partial class DataStream /// Name of the lifecycle system that'll manage the next generation of the data stream. ///
[JsonInclude, JsonPropertyName("next_generation_managed_by")] - public string NextGenerationManagedBy { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ManagedBy NextGenerationManagedBy { get; init; } /// /// Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream. 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 index 92d12ade58f..c9cc6589d7a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamIndex.g.cs @@ -51,7 +51,7 @@ public sealed partial class DataStreamIndex /// Name of the lifecycle system that's currently managing this backing index. /// [JsonInclude, JsonPropertyName("managed_by")] - public string ManagedBy { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ManagedBy ManagedBy { get; init; } /// /// Indicates if ILM should take precedence over DSL in case both are configured to manage this index. 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 index dd4b9fa2a51..8639e54aa77 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -51,8 +51,8 @@ public DataStreamLifecycleDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetentionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } - private DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } - private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { get; set; } public DataStreamLifecycleDescriptor DataRetention(Elastic.Clients.Elasticsearch.Serverless.Duration? dataRetention) { @@ -68,7 +68,7 @@ public DataStreamLifecycleDescriptor Downsampling(Elastic.Clients.Elasticsearch. return Self; } - public DataStreamLifecycleDescriptor Downsampling(DataStreamLifecycleDownsamplingDescriptor descriptor) + public DataStreamLifecycleDescriptor Downsampling(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) { DownsamplingValue = null; DownsamplingDescriptorAction = null; @@ -76,7 +76,7 @@ public DataStreamLifecycleDescriptor Downsampling(DataStreamLifecycleDownsamplin return Self; } - public DataStreamLifecycleDescriptor Downsampling(Action configure) + public DataStreamLifecycleDescriptor Downsampling(Action configure) { DownsamplingValue = null; DownsamplingDescriptor = null; @@ -101,7 +101,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DownsamplingDescriptorAction is not null) { writer.WritePropertyName("downsampling"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); } else if (DownsamplingValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs index 7cf82d806fe..298b03ac31d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs @@ -45,9 +45,9 @@ public DataStreamLifecycleDownsamplingDescriptor() : base() } private ICollection RoundsValue { get; set; } - private DownsamplingRoundDescriptor RoundsDescriptor { get; set; } - private Action RoundsDescriptorAction { get; set; } - private Action[] RoundsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsamplingRoundDescriptor RoundsDescriptor { get; set; } + private Action RoundsDescriptorAction { get; set; } + private Action[] RoundsDescriptorActions { get; set; } /// /// The list of downsampling rounds to execute as part of this downsampling configuration @@ -61,7 +61,7 @@ public DataStreamLifecycleDownsamplingDescriptor Rounds(ICollection configure) + public DataStreamLifecycleDownsamplingDescriptor Rounds(Action configure) { RoundsValue = null; RoundsDescriptor = null; @@ -79,7 +79,7 @@ public DataStreamLifecycleDownsamplingDescriptor Rounds(Action[] configure) + public DataStreamLifecycleDownsamplingDescriptor Rounds(params Action[] configure) { RoundsValue = null; RoundsDescriptor = null; @@ -102,7 +102,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("rounds"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DownsamplingRoundDescriptor(RoundsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsamplingRoundDescriptor(RoundsDescriptorAction), options); writer.WriteEndArray(); } else if (RoundsDescriptorActions is not null) @@ -111,7 +111,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RoundsDescriptorActions) { - JsonSerializer.Serialize(writer, new DownsamplingRoundDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsamplingRoundDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs index 77837c6a2b1..39b479a7884 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs @@ -30,23 +30,169 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class DataStreamLifecycleRolloverConditions { [JsonInclude, JsonPropertyName("max_age")] - public string? MaxAge { get; init; } + public string? MaxAge { get; set; } [JsonInclude, JsonPropertyName("max_docs")] - public long? MaxDocs { get; init; } + public long? MaxDocs { get; set; } [JsonInclude, JsonPropertyName("max_primary_shard_docs")] - public long? MaxPrimaryShardDocs { get; init; } + public long? MaxPrimaryShardDocs { get; set; } [JsonInclude, JsonPropertyName("max_primary_shard_size")] - public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSize { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSize { get; set; } [JsonInclude, JsonPropertyName("max_size")] - public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSize { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSize { get; set; } [JsonInclude, JsonPropertyName("min_age")] - public Elastic.Clients.Elasticsearch.Serverless.Duration? MinAge { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? MinAge { get; set; } [JsonInclude, JsonPropertyName("min_docs")] - public long? MinDocs { get; init; } + public long? MinDocs { get; set; } [JsonInclude, JsonPropertyName("min_primary_shard_docs")] - public long? MinPrimaryShardDocs { get; init; } + public long? MinPrimaryShardDocs { get; set; } [JsonInclude, JsonPropertyName("min_primary_shard_size")] - public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinPrimaryShardSize { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinPrimaryShardSize { get; set; } [JsonInclude, JsonPropertyName("min_size")] - public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSize { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSize { get; set; } +} + +public sealed partial class DataStreamLifecycleRolloverConditionsDescriptor : SerializableDescriptor +{ + internal DataStreamLifecycleRolloverConditionsDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamLifecycleRolloverConditionsDescriptor() : base() + { + } + + private string? MaxAgeValue { get; set; } + private long? MaxDocsValue { get; set; } + private long? MaxPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxPrimaryShardSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSizeValue { 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 Elastic.Clients.Elasticsearch.Serverless.ByteSize? MinSizeValue { get; set; } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxAge(string? maxAge) + { + MaxAgeValue = maxAge; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardDocs(long? maxPrimaryShardDocs) + { + MaxPrimaryShardDocsValue = maxPrimaryShardDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxPrimaryShardSize) + { + MaxPrimaryShardSizeValue = maxPrimaryShardSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSize) + { + MaxSizeValue = maxSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinAge(Elastic.Clients.Elasticsearch.Serverless.Duration? minAge) + { + MinAgeValue = minAge; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinDocs(long? minDocs) + { + MinDocsValue = minDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardDocs(long? minPrimaryShardDocs) + { + MinPrimaryShardDocsValue = minPrimaryShardDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? minPrimaryShardSize) + { + MinPrimaryShardSizeValue = minPrimaryShardSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? minSize) + { + MinSizeValue = minSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(MaxAgeValue)) + { + writer.WritePropertyName("max_age"); + writer.WriteStringValue(MaxAgeValue); + } + + 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 (MaxSizeValue is not null) + { + writer.WritePropertyName("max_size"); + JsonSerializer.Serialize(writer, MaxSizeValue, options); + } + + 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 (MinSizeValue is not null) + { + writer.WritePropertyName("min_size"); + JsonSerializer.Serialize(writer, MinSizeValue, options); + } + + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs index 22f9fa2aea1..5a0385cd7ec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs @@ -36,17 +36,144 @@ public sealed partial class DataStreamLifecycleWithRollover /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetention { get; set; } /// /// The downsampling configuration to execute for the managed backing index after rollover. /// [JsonInclude, JsonPropertyName("downsampling")] - public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? Downsampling { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? Downsampling { get; set; } /// /// 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.DataStreamLifecycleRolloverConditions? Rollover { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditions? Rollover { get; set; } +} + +/// +/// Data lifecycle with rollover can be used to display the configuration including the default rollover conditions,
if asked.
+///
+public sealed partial class DataStreamLifecycleWithRolloverDescriptor : SerializableDescriptor +{ + internal DataStreamLifecycleWithRolloverDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamLifecycleWithRolloverDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DataRetentionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditions? RolloverValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor RolloverDescriptor { get; set; } + private Action RolloverDescriptorAction { 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 DataStreamLifecycleWithRolloverDescriptor DataRetention(Elastic.Clients.Elasticsearch.Serverless.Duration? dataRetention) + { + DataRetentionValue = dataRetention; + return Self; + } + + /// + /// The downsampling configuration to execute for the managed backing index after rollover. + /// + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsampling? downsampling) + { + DownsamplingDescriptor = null; + DownsamplingDescriptorAction = null; + DownsamplingValue = downsampling; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) + { + DownsamplingValue = null; + DownsamplingDescriptorAction = null; + DownsamplingDescriptor = descriptor; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Action configure) + { + DownsamplingValue = null; + DownsamplingDescriptor = null; + DownsamplingDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public DataStreamLifecycleWithRolloverDescriptor Rollover(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditions? rollover) + { + RolloverDescriptor = null; + RolloverDescriptorAction = null; + RolloverValue = rollover; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Rollover(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor descriptor) + { + RolloverValue = null; + RolloverDescriptorAction = null; + RolloverDescriptor = descriptor; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Rollover(Action configure) + { + RolloverValue = null; + RolloverDescriptor = null; + RolloverDescriptorAction = configure; + 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); + } + + if (DownsamplingDescriptor is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, DownsamplingDescriptor, options); + } + else if (DownsamplingDescriptorAction is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + } + else if (DownsamplingValue is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, DownsamplingValue, options); + } + + if (RolloverDescriptor is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverDescriptor, options); + } + else if (RolloverDescriptorAction is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor(RolloverDescriptorAction), options); + } + else if (RolloverValue is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverValue, options); + } + + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs new file mode 100644 index 00000000000..7af1ae1aef3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DataStreamsStatsItem.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.IndexManagement; + +public sealed partial class DataStreamsStatsItem +{ + /// + /// Current number of backing indices for the data stream. + /// + [JsonInclude, JsonPropertyName("backing_indices")] + public int BackingIndices { get; init; } + + /// + /// Name of the data stream. + /// + [JsonInclude, JsonPropertyName("data_stream")] + public string DataStream { get; init; } + + /// + /// The data stream’s highest `@timestamp` value, converted to milliseconds since the Unix epoch.
NOTE: This timestamp is provided as a best effort.
The data stream may contain `@timestamp` values higher than this if one or more of the following conditions are met:
The stream contains closed backing indices;
Backing indices with a lower generation contain higher `@timestamp` values.
+ ///
+ [JsonInclude, JsonPropertyName("maximum_timestamp")] + public long MaximumTimestamp { get; init; } + + /// + /// Total size of all shards for the data stream’s backing indices.
This parameter is only returned if the `human` query parameter is `true`.
+ ///
+ [JsonInclude, JsonPropertyName("store_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? StoreSize { get; init; } + + /// + /// Total size, in bytes, of all shards for the data stream’s backing indices. + /// + [JsonInclude, JsonPropertyName("store_size_bytes")] + public long StoreSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsampleConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsampleConfig.g.cs index feb7e5d3984..229dbf8c548 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsampleConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsampleConfig.g.cs @@ -59,7 +59,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("fixed_interval"); - JsonSerializer.Serialize(writer, FixedIntervalValue, options); + writer.WriteStringValue(FixedIntervalValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsamplingRound.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsamplingRound.g.cs index fa1e551f397..f37376ed2e1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsamplingRound.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/DownsamplingRound.g.cs @@ -52,8 +52,8 @@ public DownsamplingRoundDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Duration AfterValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsampleConfig ConfigValue { get; set; } - private DownsampleConfigDescriptor ConfigDescriptor { get; set; } - private Action ConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsampleConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } /// /// The duration since rollover when this downsampling round should execute @@ -75,7 +75,7 @@ public DownsamplingRoundDescriptor Config(Elastic.Clients.Elasticsearch.Serverle return Self; } - public DownsamplingRoundDescriptor Config(DownsampleConfigDescriptor descriptor) + public DownsamplingRoundDescriptor Config(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsampleConfigDescriptor descriptor) { ConfigValue = null; ConfigDescriptorAction = null; @@ -83,7 +83,7 @@ public DownsamplingRoundDescriptor Config(DownsampleConfigDescriptor descriptor) return Self; } - public DownsamplingRoundDescriptor Config(Action configure) + public DownsamplingRoundDescriptor Config(Action configure) { ConfigValue = null; ConfigDescriptor = null; @@ -104,7 +104,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConfigDescriptorAction is not null) { writer.WritePropertyName("config"); - JsonSerializer.Serialize(writer, new DownsampleConfigDescriptor(ConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DownsampleConfigDescriptor(ConfigDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs new file mode 100644 index 00000000000..f831bdb118e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ExplainAnalyzeToken.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.IndexManagement; + +internal sealed partial class ExplainAnalyzeTokenConverter : JsonConverter +{ + public override ExplainAnalyzeToken Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + string bytes = default; + long endOffset = default; + bool? keyword = default; + long position = default; + long positionlength = default; + long startOffset = default; + long termfrequency = default; + string token = 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 == "bytes") + { + bytes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "end_offset") + { + endOffset = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "keyword") + { + keyword = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "position") + { + position = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "positionLength") + { + positionlength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "start_offset") + { + startOffset = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "termFrequency") + { + termfrequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "token") + { + token = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "type") + { + type = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new ExplainAnalyzeToken { Attributes = additionalProperties, Bytes = bytes, EndOffset = endOffset, Keyword = keyword, Position = position, Positionlength = positionlength, StartOffset = startOffset, Termfrequency = termfrequency, Token = token, Type = type }; + } + + public override void Write(Utf8JsonWriter writer, ExplainAnalyzeToken value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ExplainAnalyzeToken' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ExplainAnalyzeTokenConverter))] +public sealed partial class ExplainAnalyzeToken +{ + /// + /// Additional tokenizer-specific attributes + /// + public IReadOnlyDictionary Attributes { get; init; } + public string Bytes { get; init; } + public long EndOffset { get; init; } + public bool? Keyword { get; init; } + public long Position { get; init; } + public long Positionlength { get; init; } + public long StartOffset { get; init; } + public long Termfrequency { get; init; } + public string Token { get; init; } + public string Type { 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 index aa27b4ca978..de39dbe97a0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs @@ -37,7 +37,7 @@ public sealed partial class FielddataFrequencyFilter public int MinSegmentSize { get; set; } } -public sealed partial class FielddataFrequencyFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class FielddataFrequencyFilterDescriptor : SerializableDescriptor { internal FielddataFrequencyFilterDescriptor(Action configure) => configure.Invoke(this); @@ -78,11 +78,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/FileDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FileDetails.g.cs new file mode 100644 index 00000000000..2650773c584 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/FileDetails.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 FileDetails +{ + [JsonInclude, JsonPropertyName("length")] + public long Length { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs new file mode 100644 index 00000000000..bdfefd2d6ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexAndDataStreamAction.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 IndexAndDataStreamAction +{ + /// + /// Data stream targeted by the action. + /// + [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.Serverless.DataStreamName DataStream { get; set; } + + /// + /// Index for the action. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } +} + +public sealed partial class IndexAndDataStreamActionDescriptor : SerializableDescriptor +{ + internal IndexAndDataStreamActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexAndDataStreamActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.DataStreamName DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + + /// + /// Data stream targeted by the action. + /// + public IndexAndDataStreamActionDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.DataStreamName dataStream) + { + DataStreamValue = dataStream; + return Self; + } + + /// + /// Index for the action. + /// + public IndexAndDataStreamActionDescriptor 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("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, 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/IndexManagement/IndexModifyDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs new file mode 100644 index 00000000000..2332aca8977 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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.IndexManagement; + +[JsonConverter(typeof(IndexModifyDataStreamActionConverter))] +public sealed partial class IndexModifyDataStreamAction +{ + internal IndexModifyDataStreamAction(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 IndexModifyDataStreamAction AddBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => new IndexModifyDataStreamAction("add_backing_index", indexAndDataStreamAction); + public static IndexModifyDataStreamAction RemoveBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => new IndexModifyDataStreamAction("remove_backing_index", indexAndDataStreamAction); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class IndexModifyDataStreamActionConverter : JsonConverter +{ + public override IndexModifyDataStreamAction 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; + 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 == "add_backing_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove_backing_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IndexModifyDataStreamAction' from the response."); + } + + reader.Read(); + var result = new IndexModifyDataStreamAction(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, IndexModifyDataStreamAction 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_backing_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction)value.Variant, options); + break; + case "remove_backing_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexModifyDataStreamActionDescriptor : SerializableDescriptor> +{ + internal IndexModifyDataStreamActionDescriptor(Action> configure) => configure.Invoke(this); + + public IndexModifyDataStreamActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexModifyDataStreamActionDescriptor 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 IndexModifyDataStreamActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Action configure) => Set(configure, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "remove_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Action configure) => Set(configure, "remove_backing_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 IndexModifyDataStreamActionDescriptor : SerializableDescriptor +{ + internal IndexModifyDataStreamActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexModifyDataStreamActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexModifyDataStreamActionDescriptor 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 IndexModifyDataStreamActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Action configure) => Set(configure, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "remove_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Action configure) => Set(configure, "remove_backing_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/IndexManagement/IndexRouting.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs index b4e708a5b59..c8ff7bb5cd9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRouting.g.cs @@ -44,11 +44,11 @@ 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.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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceDescriptor RebalanceDescriptor { get; set; } + private Action RebalanceDescriptorAction { get; set; } public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocation? allocation) { @@ -58,7 +58,7 @@ public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.Serverles return Self; } - public IndexRoutingDescriptor Allocation(IndexRoutingAllocationDescriptor descriptor) + public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDescriptor descriptor) { AllocationValue = null; AllocationDescriptorAction = null; @@ -66,7 +66,7 @@ public IndexRoutingDescriptor Allocation(IndexRoutingAllocationDescriptor descri return Self; } - public IndexRoutingDescriptor Allocation(Action configure) + public IndexRoutingDescriptor Allocation(Action configure) { AllocationValue = null; AllocationDescriptor = null; @@ -82,7 +82,7 @@ public IndexRoutingDescriptor Rebalance(Elastic.Clients.Elasticsearch.Serverless return Self; } - public IndexRoutingDescriptor Rebalance(IndexRoutingRebalanceDescriptor descriptor) + public IndexRoutingDescriptor Rebalance(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceDescriptor descriptor) { RebalanceValue = null; RebalanceDescriptorAction = null; @@ -90,7 +90,7 @@ public IndexRoutingDescriptor Rebalance(IndexRoutingRebalanceDescriptor descript return Self; } - public IndexRoutingDescriptor Rebalance(Action configure) + public IndexRoutingDescriptor Rebalance(Action configure) { RebalanceValue = null; RebalanceDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllocationDescriptorAction is not null) { writer.WritePropertyName("allocation"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationDescriptor(AllocationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDescriptor(AllocationDescriptorAction), options); } else if (AllocationValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RebalanceDescriptorAction is not null) { writer.WritePropertyName("rebalance"); - JsonSerializer.Serialize(writer, new IndexRoutingRebalanceDescriptor(RebalanceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingRebalanceDescriptor(RebalanceDescriptorAction), options); } else if (RebalanceValue is not null) { 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 index 64a5d4cc6f4..aa4e229fea5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs @@ -48,15 +48,15 @@ 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.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.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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor InitialRecoveryDescriptor { get; set; } + private Action InitialRecoveryDescriptorAction { get; set; } public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDisk? disk) { @@ -66,7 +66,7 @@ public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.Serve return Self; } - public IndexRoutingAllocationDescriptor Disk(IndexRoutingAllocationDiskDescriptor descriptor) + public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDiskDescriptor descriptor) { DiskValue = null; DiskDescriptorAction = null; @@ -74,7 +74,7 @@ public IndexRoutingAllocationDescriptor Disk(IndexRoutingAllocationDiskDescripto return Self; } - public IndexRoutingAllocationDescriptor Disk(Action configure) + public IndexRoutingAllocationDescriptor Disk(Action configure) { DiskValue = null; DiskDescriptor = null; @@ -96,7 +96,7 @@ public IndexRoutingAllocationDescriptor Include(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexRoutingAllocationDescriptor Include(IndexRoutingAllocationIncludeDescriptor descriptor) + public IndexRoutingAllocationDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationIncludeDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -104,7 +104,7 @@ public IndexRoutingAllocationDescriptor Include(IndexRoutingAllocationIncludeDes return Self; } - public IndexRoutingAllocationDescriptor Include(Action configure) + public IndexRoutingAllocationDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -120,7 +120,7 @@ public IndexRoutingAllocationDescriptor InitialRecovery(Elastic.Clients.Elastics return Self; } - public IndexRoutingAllocationDescriptor InitialRecovery(IndexRoutingAllocationInitialRecoveryDescriptor descriptor) + public IndexRoutingAllocationDescriptor InitialRecovery(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor descriptor) { InitialRecoveryValue = null; InitialRecoveryDescriptorAction = null; @@ -128,7 +128,7 @@ public IndexRoutingAllocationDescriptor InitialRecovery(IndexRoutingAllocationIn return Self; } - public IndexRoutingAllocationDescriptor InitialRecovery(Action configure) + public IndexRoutingAllocationDescriptor InitialRecovery(Action configure) { InitialRecoveryValue = null; InitialRecoveryDescriptor = null; @@ -147,7 +147,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DiskDescriptorAction is not null) { writer.WritePropertyName("disk"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationDiskDescriptor(DiskDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationDiskDescriptor(DiskDescriptorAction), options); } else if (DiskValue is not null) { @@ -169,7 +169,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationIncludeDescriptor(IncludeDescriptorAction), options); } else if (IncludeValue is not null) { @@ -185,7 +185,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InitialRecoveryDescriptorAction is not null) { writer.WritePropertyName("initial_recovery"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationInitialRecoveryDescriptor(InitialRecoveryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor(InitialRecoveryDescriptorAction), options); } else if (InitialRecoveryValue is not null) { 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 index 2bd85f168bf..ceed85877f3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class IndexRoutingAllocationDisk { [JsonInclude, JsonPropertyName("threshold_enabled")] - public Union? ThresholdEnabled { get; set; } + public object? ThresholdEnabled { get; set; } } public sealed partial class IndexRoutingAllocationDiskDescriptor : SerializableDescriptor @@ -41,9 +41,9 @@ public IndexRoutingAllocationDiskDescriptor() : base() { } - private Union? ThresholdEnabledValue { get; set; } + private object? ThresholdEnabledValue { get; set; } - public IndexRoutingAllocationDiskDescriptor ThresholdEnabled(Union? thresholdEnabled) + public IndexRoutingAllocationDiskDescriptor ThresholdEnabled(object? thresholdEnabled) { ThresholdEnabledValue = thresholdEnabled; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegment.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegment.g.cs new file mode 100644 index 00000000000..dd9b4eaf9cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSegment.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 IndexSegment +{ + [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/IndexSettingBlocks.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs index f15259fdeb7..0a1817eefda 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs @@ -30,19 +30,14 @@ 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; } } @@ -93,34 +88,34 @@ public IndexSettingBlocksDescriptor Write(bool? write = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MetadataValue is not null) + if (MetadataValue.HasValue) { writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, MetadataValue, options); + writer.WriteBooleanValue(MetadataValue.Value); } - if (ReadValue is not null) + if (ReadValue.HasValue) { writer.WritePropertyName("read"); - JsonSerializer.Serialize(writer, ReadValue, options); + writer.WriteBooleanValue(ReadValue.Value); } - if (ReadOnlyValue is not null) + if (ReadOnlyValue.HasValue) { writer.WritePropertyName("read_only"); - JsonSerializer.Serialize(writer, ReadOnlyValue, options); + writer.WriteBooleanValue(ReadOnlyValue.Value); } - if (ReadOnlyAllowDeleteValue is not null) + if (ReadOnlyAllowDeleteValue.HasValue) { writer.WritePropertyName("read_only_allow_delete"); - JsonSerializer.Serialize(writer, ReadOnlyAllowDeleteValue, options); + writer.WriteBooleanValue(ReadOnlyAllowDeleteValue.Value); } - if (WriteValue is not null) + if (WriteValue.HasValue) { writer.WritePropertyName("write"); - JsonSerializer.Serialize(writer, WriteValue, options); + writer.WriteBooleanValue(WriteValue.Value); } writer.WriteEndObject(); 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 index c80731663b4..36859df462f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettings.g.cs @@ -78,7 +78,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "creation_date") { - variant.CreationDate = StringifiedLongConverter.ReadStringifiedLong(ref reader); + variant.CreationDate = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -102,7 +102,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "format") { - variant.Format = JsonSerializer.Deserialize?>(ref reader, options); + variant.Format = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -114,7 +114,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "hidden") { - variant.Hidden = JsonSerializer.Deserialize?>(ref reader, options); + variant.Hidden = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -240,7 +240,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "number_of_replicas") { - variant.NumberOfReplicas = JsonSerializer.Deserialize?>(ref reader, options); + variant.NumberOfReplicas = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -252,13 +252,13 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "number_of_shards") { - variant.NumberOfShards = JsonSerializer.Deserialize?>(ref reader, options); + variant.NumberOfShards = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "priority") { - variant.Priority = JsonSerializer.Deserialize?>(ref reader, options); + variant.Priority = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -294,7 +294,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "routing_partition_size") { - variant.RoutingPartitionSize = StringifiedIntegerConverter.ReadStringifiedInteger(ref reader); + variant.RoutingPartitionSize = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -318,7 +318,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "similarity") { - variant.Similarity = JsonSerializer.Deserialize(ref reader, options); + variant.Similarity = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -366,7 +366,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "verified_before_close") { - variant.VerifiedBeforeClose = JsonSerializer.Deserialize?>(ref reader, options); + variant.VerifiedBeforeClose = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -377,8 +377,8 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } @@ -389,7 +389,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.OtherSettings != null) + if (value.OtherSettings is not null) { foreach (var additionalProperty in value.OtherSettings) { @@ -434,10 +434,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria writer.WriteStringValue(value.Codec); } - if (value.CreationDate is not null) + if (value.CreationDate.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, value.CreationDate, options); + writer.WriteNumberValue(value.CreationDate.Value); } if (value.CreationDateString is not null) @@ -446,16 +446,16 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.CreationDateString, options); } - if (value.DefaultPipeline is not null) + if (!string.IsNullOrEmpty(value.DefaultPipeline)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, value.DefaultPipeline, options); + writer.WriteStringValue(value.DefaultPipeline); } - if (value.FinalPipeline is not null) + if (!string.IsNullOrEmpty(value.FinalPipeline)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, value.FinalPipeline, options); + writer.WriteStringValue(value.FinalPipeline); } if (value.Format is not null) @@ -650,10 +650,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.Routing, options); } - if (value.RoutingPartitionSize is not null) + if (value.RoutingPartitionSize.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, value.RoutingPartitionSize, options); + writer.WriteNumberValue(value.RoutingPartitionSize.Value); } if (value.RoutingPath is not null) @@ -716,10 +716,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.Translog, options); } - if (value.Uuid is not null) + if (!string.IsNullOrEmpty(value.Uuid)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, value.Uuid, options); + writer.WriteStringValue(value.Uuid); } if (value.VerifiedBeforeClose is not null) @@ -738,6 +738,9 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(IndexSettingsConverter))] public sealed partial class IndexSettings { @@ -751,14 +754,13 @@ public sealed partial class IndexSettings 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 object? Format { get; set; } public Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletes { get; set; } - public Union? Hidden { get; set; } + public object? Hidden { get; set; } public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlight? Highlight { get; set; } public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Index { get; set; } @@ -787,17 +789,20 @@ public sealed partial class IndexSettings 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 object? NumberOfReplicas { get; set; } public int? NumberOfRoutingShards { get; set; } - public Union? NumberOfShards { get; set; } + public object? NumberOfShards { get; set; } + + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IDictionary OtherSettings { get; set; } - public Union? Priority { get; set; } + public object? 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; } @@ -806,7 +811,7 @@ public sealed partial class IndexSettings /// /// 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.SettingsSimilarities? Similarity { get; set; } public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletes? SoftDeletes { get; set; } public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSort? Sort { get; set; } @@ -818,10 +823,13 @@ public sealed partial class IndexSettings 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 object? VerifiedBeforeClose { get; set; } public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? Version { get; set; } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class IndexSettingsDescriptor : SerializableDescriptor> { internal IndexSettingsDescriptor(Action> configure) => configure.Invoke(this); @@ -831,43 +839,43 @@ public IndexSettingsDescriptor() : base() } 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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.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 object? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletesValue { get; set; } - private Union? HiddenValue { get; set; } + private object? 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.SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } 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.IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action> IndexDescriptorAction { 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.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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } private int? MaxDocvalueFieldsSearchValue { get; set; } private int? MaxInnerResultWindowValue { get; set; } private int? MaxNgramDiffValue { get; set; } @@ -880,57 +888,55 @@ public IndexSettingsDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } private string? ModeValue { get; set; } - private Union? NumberOfReplicasValue { get; set; } + private object? NumberOfReplicasValue { get; set; } private int? NumberOfRoutingShardsValue { get; set; } - private Union? NumberOfShardsValue { get; set; } + private object? NumberOfShardsValue { get; set; } private IDictionary OtherSettingsValue { get; set; } - private Union? PriorityValue { get; set; } + private object? 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.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.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { 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.SettingsSimilarity? SimilarityValue { get; set; } - private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } - private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarities? SimilarityValue { 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.SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { 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.IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } private string? UuidValue { get; set; } - private Union? VerifiedBeforeCloseValue { get; set; } + private object? VerifiedBeforeCloseValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? VersionValue { get; set; } - private IndexVersioningDescriptor VersionDescriptor { get; set; } - private Action VersionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? analysis) { @@ -940,7 +946,7 @@ public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysisDescriptor descriptor) { AnalysisValue = null; AnalysisDescriptorAction = null; @@ -948,7 +954,7 @@ public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescript return Self; } - public IndexSettingsDescriptor Analysis(Action configure) + public IndexSettingsDescriptor Analysis(Action configure) { AnalysisValue = null; AnalysisDescriptor = null; @@ -967,7 +973,7 @@ public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyzeDescriptor descriptor) { AnalyzeValue = null; AnalyzeDescriptorAction = null; @@ -975,7 +981,7 @@ public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor desc return Self; } - public IndexSettingsDescriptor Analyze(Action configure) + public IndexSettingsDescriptor Analyze(Action configure) { AnalyzeValue = null; AnalyzeDescriptor = null; @@ -997,7 +1003,7 @@ public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.S return Self; } - public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocksDescriptor descriptor) { BlocksValue = null; BlocksDescriptorAction = null; @@ -1005,7 +1011,7 @@ public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor de return Self; } - public IndexSettingsDescriptor Blocks(Action configure) + public IndexSettingsDescriptor Blocks(Action configure) { BlocksValue = null; BlocksDescriptor = null; @@ -1049,7 +1055,7 @@ public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) return Self; } - public IndexSettingsDescriptor Format(Union? format) + public IndexSettingsDescriptor Format(object? format) { FormatValue = format; return Self; @@ -1061,7 +1067,7 @@ public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Hidden(Union? hidden) + public IndexSettingsDescriptor Hidden(object? hidden) { HiddenValue = hidden; return Self; @@ -1075,7 +1081,7 @@ public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1083,7 +1089,7 @@ public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor return Self; } - public IndexSettingsDescriptor Highlight(Action configure) + public IndexSettingsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1099,7 +1105,7 @@ public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -1107,7 +1113,7 @@ public IndexSettingsDescriptor Index(IndexSettingsDescriptor Index(Action> configure) + public IndexSettingsDescriptor Index(Action> configure) { IndexValue = null; IndexDescriptor = null; @@ -1126,7 +1132,7 @@ public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elast return Self; } - public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureDescriptor descriptor) { IndexingPressureValue = null; IndexingPressureDescriptorAction = null; @@ -1134,7 +1140,7 @@ public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescr return Self; } - public IndexSettingsDescriptor IndexingPressure(Action configure) + public IndexSettingsDescriptor IndexingPressure(Action configure) { IndexingPressureValue = null; IndexingPressureDescriptor = null; @@ -1150,7 +1156,7 @@ public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasti return Self; } - public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettingsDescriptor descriptor) { IndexingSlowlogValue = null; IndexingSlowlogDescriptorAction = null; @@ -1158,7 +1164,7 @@ public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSetting return Self; } - public IndexSettingsDescriptor IndexingSlowlog(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -1174,7 +1180,7 @@ public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -1182,7 +1188,7 @@ public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescri return Self; } - public IndexSettingsDescriptor Lifecycle(Action configure) + public IndexSettingsDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -1207,7 +1213,7 @@ public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor descriptor) { MappingValue = null; MappingDescriptorAction = null; @@ -1215,7 +1221,7 @@ public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor return Self; } - public IndexSettingsDescriptor Mapping(Action configure) + public IndexSettingsDescriptor Mapping(Action configure) { MappingValue = null; MappingDescriptor = null; @@ -1297,7 +1303,7 @@ public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor descriptor) { MergeValue = null; MergeDescriptorAction = null; @@ -1305,7 +1311,7 @@ public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Merge(Action configure) + public IndexSettingsDescriptor Merge(Action configure) { MergeValue = null; MergeDescriptor = null; @@ -1319,7 +1325,7 @@ public IndexSettingsDescriptor Mode(string? mode) return Self; } - public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + public IndexSettingsDescriptor NumberOfReplicas(object? numberOfReplicas) { NumberOfReplicasValue = numberOfReplicas; return Self; @@ -1331,19 +1337,22 @@ public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRou return Self; } - public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + public IndexSettingsDescriptor NumberOfShards(object? numberOfShards) { NumberOfShardsValue = numberOfShards; return Self; } + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) { OtherSettingsValue = selector?.Invoke(new FluentDictionary()); return Self; } - public IndexSettingsDescriptor Priority(Union? priority) + public IndexSettingsDescriptor Priority(object? priority) { PriorityValue = priority; return Self; @@ -1363,7 +1372,7 @@ public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.QueriesDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -1371,7 +1380,7 @@ public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Queries(Action configure) + public IndexSettingsDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -1387,7 +1396,7 @@ public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsea return Self; } - public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryStringDescriptor descriptor) { QueryStringValue = null; QueryStringDescriptorAction = null; @@ -1395,7 +1404,7 @@ public IndexSettingsDescriptor QueryString(SettingsQueryStringDescrip return Self; } - public IndexSettingsDescriptor QueryString(Action configure) + public IndexSettingsDescriptor QueryString(Action configure) { QueryStringValue = null; QueryStringDescriptor = null; @@ -1417,7 +1426,7 @@ public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -1425,7 +1434,7 @@ public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descrip return Self; } - public IndexSettingsDescriptor Routing(Action configure) + public IndexSettingsDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -1453,7 +1462,7 @@ public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.S return Self; } - public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor descriptor) { SearchValue = null; SearchDescriptorAction = null; @@ -1461,7 +1470,7 @@ public IndexSettingsDescriptor Search(SettingsSearchDescriptor descri return Self; } - public IndexSettingsDescriptor Search(Action configure) + public IndexSettingsDescriptor Search(Action configure) { SearchValue = null; SearchDescriptor = null; @@ -1477,7 +1486,7 @@ public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -1485,7 +1494,7 @@ public IndexSettingsDescriptor Settings(IndexSettingsDescriptor Settings(Action> configure) + public IndexSettingsDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -1496,27 +1505,23 @@ public IndexSettingsDescriptor Settings(Action /// Configure custom similarity settings to customize how search results are scored. /// - public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? similarity) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarities? similarity) { - SimilarityDescriptor = null; - SimilarityDescriptorAction = null; SimilarityValue = similarity; return Self; } - public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilaritiesDescriptor descriptor) { - SimilarityValue = null; - SimilarityDescriptorAction = null; - SimilarityDescriptor = descriptor; + SimilarityValue = descriptor.PromisedValue; return Self; } - public IndexSettingsDescriptor Similarity(Action configure) + public IndexSettingsDescriptor Similarity(Action configure) { - SimilarityValue = null; - SimilarityDescriptor = null; - SimilarityDescriptorAction = configure; + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilaritiesDescriptor(); + configure?.Invoke(descriptor); + SimilarityValue = descriptor.PromisedValue; return Self; } @@ -1528,7 +1533,7 @@ public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsea return Self; } - public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletesDescriptor descriptor) { SoftDeletesValue = null; SoftDeletesDescriptorAction = null; @@ -1536,7 +1541,7 @@ public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor desc return Self; } - public IndexSettingsDescriptor SoftDeletes(Action configure) + public IndexSettingsDescriptor SoftDeletes(Action configure) { SoftDeletesValue = null; SoftDeletesDescriptor = null; @@ -1552,7 +1557,7 @@ public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Ser return Self; } - public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1560,7 +1565,7 @@ public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor Sort(Action> configure) + public IndexSettingsDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1579,7 +1584,7 @@ public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageDescriptor descriptor) { StoreValue = null; StoreDescriptorAction = null; @@ -1587,7 +1592,7 @@ public IndexSettingsDescriptor Store(StorageDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Store(Action configure) + public IndexSettingsDescriptor Store(Action configure) { StoreValue = null; StoreDescriptor = null; @@ -1603,7 +1608,7 @@ public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsear return Self; } - public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeriesDescriptor descriptor) { TimeSeriesValue = null; TimeSeriesDescriptorAction = null; @@ -1611,7 +1616,7 @@ public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDesc return Self; } - public IndexSettingsDescriptor TimeSeries(Action configure) + public IndexSettingsDescriptor TimeSeries(Action configure) { TimeSeriesValue = null; TimeSeriesDescriptor = null; @@ -1633,7 +1638,7 @@ public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor descriptor) { TranslogValue = null; TranslogDescriptorAction = null; @@ -1641,7 +1646,7 @@ public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor return Self; } - public IndexSettingsDescriptor Translog(Action configure) + public IndexSettingsDescriptor Translog(Action configure) { TranslogValue = null; TranslogDescriptor = null; @@ -1655,7 +1660,7 @@ public IndexSettingsDescriptor Uuid(string? uuid) return Self; } - public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + public IndexSettingsDescriptor VerifiedBeforeClose(object? verifiedBeforeClose) { VerifiedBeforeCloseValue = verifiedBeforeClose; return Self; @@ -1669,7 +1674,7 @@ public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor descriptor) { VersionValue = null; VersionDescriptorAction = null; @@ -1677,7 +1682,7 @@ public IndexSettingsDescriptor Version(IndexVersioningDescriptor desc return Self; } - public IndexSettingsDescriptor Version(Action configure) + public IndexSettingsDescriptor Version(Action configure) { VersionValue = null; VersionDescriptor = null; @@ -1696,7 +1701,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalysisDescriptorAction is not null) { writer.WritePropertyName("analysis"); - JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); } else if (AnalysisValue is not null) { @@ -1712,7 +1717,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalyzeDescriptorAction is not null) { writer.WritePropertyName("analyze"); - JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); } else if (AnalyzeValue is not null) { @@ -1734,7 +1739,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BlocksDescriptorAction is not null) { writer.WritePropertyName("blocks"); - JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); } else if (BlocksValue is not null) { @@ -1754,10 +1759,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CodecValue); } - if (CreationDateValue is not null) + if (CreationDateValue.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, CreationDateValue, options); + writer.WriteNumberValue(CreationDateValue.Value); } if (CreationDateStringValue is not null) @@ -1766,16 +1771,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, CreationDateStringValue, options); } - if (DefaultPipelineValue is not null) + if (!string.IsNullOrEmpty(DefaultPipelineValue)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + writer.WriteStringValue(DefaultPipelineValue); } - if (FinalPipelineValue is not null) + if (!string.IsNullOrEmpty(FinalPipelineValue)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, FinalPipelineValue, options); + writer.WriteStringValue(FinalPipelineValue); } if (FormatValue is not null) @@ -1804,7 +1809,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1820,7 +1825,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { @@ -1836,7 +1841,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingPressureDescriptorAction is not null) { writer.WritePropertyName("indexing_pressure"); - JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); } else if (IndexingPressureValue is not null) { @@ -1852,7 +1857,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { @@ -1868,7 +1873,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -1890,7 +1895,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingDescriptorAction is not null) { writer.WritePropertyName("mapping"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor(MappingDescriptorAction), options); } else if (MappingValue is not null) { @@ -1972,7 +1977,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MergeDescriptorAction is not null) { writer.WritePropertyName("merge"); - JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor(MergeDescriptorAction), options); } else if (MergeValue is not null) { @@ -2024,7 +2029,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueriesDescriptorAction is not null) { writer.WritePropertyName("queries"); - JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.QueriesDescriptor(QueriesDescriptorAction), options); } else if (QueriesValue is not null) { @@ -2040,7 +2045,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryStringDescriptorAction is not null) { writer.WritePropertyName("query_string"); - JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); } else if (QueryStringValue is not null) { @@ -2062,7 +2067,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("routing"); - JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -2070,10 +2075,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (RoutingPartitionSizeValue is not null) + if (RoutingPartitionSizeValue.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + writer.WriteNumberValue(RoutingPartitionSizeValue.Value); } if (RoutingPathValue is not null) @@ -2090,7 +2095,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SearchDescriptorAction is not null) { writer.WritePropertyName("search"); - JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor(SearchDescriptorAction), options); } else if (SearchValue is not null) { @@ -2106,7 +2111,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -2114,17 +2119,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - 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) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); JsonSerializer.Serialize(writer, SimilarityValue, options); @@ -2138,7 +2133,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SoftDeletesDescriptorAction is not null) { writer.WritePropertyName("soft_deletes"); - JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); } else if (SoftDeletesValue is not null) { @@ -2154,7 +2149,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSortDescriptor(SortDescriptorAction), options); } else if (SortValue is not null) { @@ -2170,7 +2165,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (StoreDescriptorAction is not null) { writer.WritePropertyName("store"); - JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageDescriptor(StoreDescriptorAction), options); } else if (StoreValue is not null) { @@ -2186,7 +2181,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TimeSeriesDescriptorAction is not null) { writer.WritePropertyName("time_series"); - JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); } else if (TimeSeriesValue is not null) { @@ -2208,7 +2203,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TranslogDescriptorAction is not null) { writer.WritePropertyName("translog"); - JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor(TranslogDescriptorAction), options); } else if (TranslogValue is not null) { @@ -2216,10 +2211,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TranslogValue, options); } - if (UuidValue is not null) + if (!string.IsNullOrEmpty(UuidValue)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, UuidValue, options); + writer.WriteStringValue(UuidValue); } if (VerifiedBeforeCloseValue is not null) @@ -2236,7 +2231,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VersionDescriptorAction is not null) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor(VersionDescriptorAction), options); } else if (VersionValue is not null) { @@ -2244,7 +2239,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, VersionValue, options); } - if (OtherSettingsValue != null) + if (OtherSettingsValue is not null) { foreach (var additionalProperty in OtherSettingsValue) { @@ -2257,6 +2252,9 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class IndexSettingsDescriptor : SerializableDescriptor { internal IndexSettingsDescriptor(Action configure) => configure.Invoke(this); @@ -2266,43 +2264,43 @@ public IndexSettingsDescriptor() : base() } 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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.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 object? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? GcDeletesValue { get; set; } - private Union? HiddenValue { get; set; } + private object? 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.SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } 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.IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action IndexDescriptorAction { 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.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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } private int? MaxDocvalueFieldsSearchValue { get; set; } private int? MaxInnerResultWindowValue { get; set; } private int? MaxNgramDiffValue { get; set; } @@ -2315,57 +2313,55 @@ public IndexSettingsDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } private string? ModeValue { get; set; } - private Union? NumberOfReplicasValue { get; set; } + private object? NumberOfReplicasValue { get; set; } private int? NumberOfRoutingShardsValue { get; set; } - private Union? NumberOfShardsValue { get; set; } + private object? NumberOfShardsValue { get; set; } private IDictionary OtherSettingsValue { get; set; } - private Union? PriorityValue { get; set; } + private object? 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.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.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { 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.SettingsSimilarity? SimilarityValue { get; set; } - private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } - private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarities? SimilarityValue { 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.SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { 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.IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } private string? UuidValue { get; set; } - private Union? VerifiedBeforeCloseValue { get; set; } + private object? VerifiedBeforeCloseValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioning? VersionValue { get; set; } - private IndexVersioningDescriptor VersionDescriptor { get; set; } - private Action VersionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysis? analysis) { @@ -2375,7 +2371,7 @@ public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless return Self; } - public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysisDescriptor descriptor) { AnalysisValue = null; AnalysisDescriptorAction = null; @@ -2383,7 +2379,7 @@ public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descript return Self; } - public IndexSettingsDescriptor Analysis(Action configure) + public IndexSettingsDescriptor Analysis(Action configure) { AnalysisValue = null; AnalysisDescriptor = null; @@ -2402,7 +2398,7 @@ public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyzeDescriptor descriptor) { AnalyzeValue = null; AnalyzeDescriptorAction = null; @@ -2410,7 +2406,7 @@ public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Analyze(Action configure) + public IndexSettingsDescriptor Analyze(Action configure) { AnalyzeValue = null; AnalyzeDescriptor = null; @@ -2432,7 +2428,7 @@ public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.Serverless.I return Self; } - public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocksDescriptor descriptor) { BlocksValue = null; BlocksDescriptorAction = null; @@ -2440,7 +2436,7 @@ public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Blocks(Action configure) + public IndexSettingsDescriptor Blocks(Action configure) { BlocksValue = null; BlocksDescriptor = null; @@ -2484,7 +2480,7 @@ public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) return Self; } - public IndexSettingsDescriptor Format(Union? format) + public IndexSettingsDescriptor Format(object? format) { FormatValue = format; return Self; @@ -2496,7 +2492,7 @@ public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearch.Serverles return Self; } - public IndexSettingsDescriptor Hidden(Union? hidden) + public IndexSettingsDescriptor Hidden(object? hidden) { HiddenValue = hidden; return Self; @@ -2510,7 +2506,7 @@ public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverles return Self; } - public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2518,7 +2514,7 @@ public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Highlight(Action configure) + public IndexSettingsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2534,7 +2530,7 @@ public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -2542,7 +2538,7 @@ public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Index(Action configure) + public IndexSettingsDescriptor Index(Action configure) { IndexValue = null; IndexDescriptor = null; @@ -2561,7 +2557,7 @@ public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureDescriptor descriptor) { IndexingPressureValue = null; IndexingPressureDescriptorAction = null; @@ -2569,7 +2565,7 @@ public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descr return Self; } - public IndexSettingsDescriptor IndexingPressure(Action configure) + public IndexSettingsDescriptor IndexingPressure(Action configure) { IndexingPressureValue = null; IndexingPressureDescriptor = null; @@ -2585,7 +2581,7 @@ public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Ser return Self; } - public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettingsDescriptor descriptor) { IndexingSlowlogValue = null; IndexingSlowlogDescriptorAction = null; @@ -2593,7 +2589,7 @@ public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor return Self; } - public IndexSettingsDescriptor IndexingSlowlog(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -2609,7 +2605,7 @@ public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverles return Self; } - public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -2617,7 +2613,7 @@ public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descri return Self; } - public IndexSettingsDescriptor Lifecycle(Action configure) + public IndexSettingsDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -2642,7 +2638,7 @@ public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor descriptor) { MappingValue = null; MappingDescriptorAction = null; @@ -2650,7 +2646,7 @@ public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor return Self; } - public IndexSettingsDescriptor Mapping(Action configure) + public IndexSettingsDescriptor Mapping(Action configure) { MappingValue = null; MappingDescriptor = null; @@ -2732,7 +2728,7 @@ public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor descriptor) { MergeValue = null; MergeDescriptorAction = null; @@ -2740,7 +2736,7 @@ public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Merge(Action configure) + public IndexSettingsDescriptor Merge(Action configure) { MergeValue = null; MergeDescriptor = null; @@ -2754,7 +2750,7 @@ public IndexSettingsDescriptor Mode(string? mode) return Self; } - public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + public IndexSettingsDescriptor NumberOfReplicas(object? numberOfReplicas) { NumberOfReplicasValue = numberOfReplicas; return Self; @@ -2766,19 +2762,22 @@ public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRoutingShards) return Self; } - public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + public IndexSettingsDescriptor NumberOfShards(object? numberOfShards) { NumberOfShardsValue = numberOfShards; return Self; } + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) { OtherSettingsValue = selector?.Invoke(new FluentDictionary()); return Self; } - public IndexSettingsDescriptor Priority(Union? priority) + public IndexSettingsDescriptor Priority(object? priority) { PriorityValue = priority; return Self; @@ -2798,7 +2797,7 @@ public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.QueriesDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -2806,7 +2805,7 @@ public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Queries(Action configure) + public IndexSettingsDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -2822,7 +2821,7 @@ public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverl return Self; } - public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryStringDescriptor descriptor) { QueryStringValue = null; QueryStringDescriptorAction = null; @@ -2830,7 +2829,7 @@ public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descrip return Self; } - public IndexSettingsDescriptor QueryString(Action configure) + public IndexSettingsDescriptor QueryString(Action configure) { QueryStringValue = null; QueryStringDescriptor = null; @@ -2852,7 +2851,7 @@ public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -2860,7 +2859,7 @@ public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Routing(Action configure) + public IndexSettingsDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -2888,7 +2887,7 @@ public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.Serverless.I return Self; } - public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor descriptor) { SearchValue = null; SearchDescriptorAction = null; @@ -2896,7 +2895,7 @@ public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Search(Action configure) + public IndexSettingsDescriptor Search(Action configure) { SearchValue = null; SearchDescriptor = null; @@ -2912,7 +2911,7 @@ public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless return Self; } - public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -2920,7 +2919,7 @@ public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Settings(Action configure) + public IndexSettingsDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -2931,27 +2930,23 @@ public IndexSettingsDescriptor Settings(Action configur /// /// Configure custom similarity settings to customize how search results are scored. /// - public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarity? similarity) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarities? similarity) { - SimilarityDescriptor = null; - SimilarityDescriptorAction = null; SimilarityValue = similarity; return Self; } - public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilaritiesDescriptor descriptor) { - SimilarityValue = null; - SimilarityDescriptorAction = null; - SimilarityDescriptor = descriptor; + SimilarityValue = descriptor.PromisedValue; return Self; } - public IndexSettingsDescriptor Similarity(Action configure) + public IndexSettingsDescriptor Similarity(Action configure) { - SimilarityValue = null; - SimilarityDescriptor = null; - SimilarityDescriptorAction = configure; + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilaritiesDescriptor(); + configure?.Invoke(descriptor); + SimilarityValue = descriptor.PromisedValue; return Self; } @@ -2963,7 +2958,7 @@ public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.Serverl return Self; } - public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletesDescriptor descriptor) { SoftDeletesValue = null; SoftDeletesDescriptorAction = null; @@ -2971,7 +2966,7 @@ public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor SoftDeletes(Action configure) + public IndexSettingsDescriptor SoftDeletes(Action configure) { SoftDeletesValue = null; SoftDeletesDescriptor = null; @@ -2987,7 +2982,7 @@ public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Ind return Self; } - public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -2995,7 +2990,7 @@ public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Sort(Action configure) + public IndexSettingsDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -3014,7 +3009,7 @@ public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageDescriptor descriptor) { StoreValue = null; StoreDescriptorAction = null; @@ -3022,7 +3017,7 @@ public IndexSettingsDescriptor Store(StorageDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Store(Action configure) + public IndexSettingsDescriptor Store(Action configure) { StoreValue = null; StoreDescriptor = null; @@ -3038,7 +3033,7 @@ public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.Serverle return Self; } - public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeriesDescriptor descriptor) { TimeSeriesValue = null; TimeSeriesDescriptorAction = null; @@ -3046,7 +3041,7 @@ public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor desc return Self; } - public IndexSettingsDescriptor TimeSeries(Action configure) + public IndexSettingsDescriptor TimeSeries(Action configure) { TimeSeriesValue = null; TimeSeriesDescriptor = null; @@ -3068,7 +3063,7 @@ public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.Serverless return Self; } - public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor descriptor) { TranslogValue = null; TranslogDescriptorAction = null; @@ -3076,7 +3071,7 @@ public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Translog(Action configure) + public IndexSettingsDescriptor Translog(Action configure) { TranslogValue = null; TranslogDescriptor = null; @@ -3090,7 +3085,7 @@ public IndexSettingsDescriptor Uuid(string? uuid) return Self; } - public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + public IndexSettingsDescriptor VerifiedBeforeClose(object? verifiedBeforeClose) { VerifiedBeforeCloseValue = verifiedBeforeClose; return Self; @@ -3104,7 +3099,7 @@ public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor descriptor) { VersionValue = null; VersionDescriptorAction = null; @@ -3112,7 +3107,7 @@ public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Version(Action configure) + public IndexSettingsDescriptor Version(Action configure) { VersionValue = null; VersionDescriptor = null; @@ -3131,7 +3126,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalysisDescriptorAction is not null) { writer.WritePropertyName("analysis"); - JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); } else if (AnalysisValue is not null) { @@ -3147,7 +3142,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalyzeDescriptorAction is not null) { writer.WritePropertyName("analyze"); - JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); } else if (AnalyzeValue is not null) { @@ -3169,7 +3164,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BlocksDescriptorAction is not null) { writer.WritePropertyName("blocks"); - JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); } else if (BlocksValue is not null) { @@ -3189,10 +3184,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CodecValue); } - if (CreationDateValue is not null) + if (CreationDateValue.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, CreationDateValue, options); + writer.WriteNumberValue(CreationDateValue.Value); } if (CreationDateStringValue is not null) @@ -3201,16 +3196,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, CreationDateStringValue, options); } - if (DefaultPipelineValue is not null) + if (!string.IsNullOrEmpty(DefaultPipelineValue)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + writer.WriteStringValue(DefaultPipelineValue); } - if (FinalPipelineValue is not null) + if (!string.IsNullOrEmpty(FinalPipelineValue)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, FinalPipelineValue, options); + writer.WriteStringValue(FinalPipelineValue); } if (FormatValue is not null) @@ -3239,7 +3234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -3255,7 +3250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { @@ -3271,7 +3266,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingPressureDescriptorAction is not null) { writer.WritePropertyName("indexing_pressure"); - JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); } else if (IndexingPressureValue is not null) { @@ -3287,7 +3282,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { @@ -3303,7 +3298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -3325,7 +3320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingDescriptorAction is not null) { writer.WritePropertyName("mapping"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDescriptor(MappingDescriptorAction), options); } else if (MappingValue is not null) { @@ -3407,7 +3402,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MergeDescriptorAction is not null) { writer.WritePropertyName("merge"); - JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeDescriptor(MergeDescriptorAction), options); } else if (MergeValue is not null) { @@ -3459,7 +3454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueriesDescriptorAction is not null) { writer.WritePropertyName("queries"); - JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.QueriesDescriptor(QueriesDescriptorAction), options); } else if (QueriesValue is not null) { @@ -3475,7 +3470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryStringDescriptorAction is not null) { writer.WritePropertyName("query_string"); - JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); } else if (QueryStringValue is not null) { @@ -3497,7 +3492,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("routing"); - JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRoutingDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -3505,10 +3500,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (RoutingPartitionSizeValue is not null) + if (RoutingPartitionSizeValue.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + writer.WriteNumberValue(RoutingPartitionSizeValue.Value); } if (RoutingPathValue is not null) @@ -3525,7 +3520,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SearchDescriptorAction is not null) { writer.WritePropertyName("search"); - JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSearchDescriptor(SearchDescriptorAction), options); } else if (SearchValue is not null) { @@ -3541,7 +3536,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -3549,17 +3544,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - 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) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); JsonSerializer.Serialize(writer, SimilarityValue, options); @@ -3573,7 +3558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SoftDeletesDescriptorAction is not null) { writer.WritePropertyName("soft_deletes"); - JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); } else if (SoftDeletesValue is not null) { @@ -3589,7 +3574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSegmentSortDescriptor(SortDescriptorAction), options); } else if (SortValue is not null) { @@ -3605,7 +3590,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (StoreDescriptorAction is not null) { writer.WritePropertyName("store"); - JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.StorageDescriptor(StoreDescriptorAction), options); } else if (StoreValue is not null) { @@ -3621,7 +3606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TimeSeriesDescriptorAction is not null) { writer.WritePropertyName("time_series"); - JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); } else if (TimeSeriesValue is not null) { @@ -3643,7 +3628,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TranslogDescriptorAction is not null) { writer.WritePropertyName("translog"); - JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogDescriptor(TranslogDescriptorAction), options); } else if (TranslogValue is not null) { @@ -3651,10 +3636,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TranslogValue, options); } - if (UuidValue is not null) + if (!string.IsNullOrEmpty(UuidValue)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, UuidValue, options); + writer.WriteStringValue(UuidValue); } if (VerifiedBeforeCloseValue is not null) @@ -3671,7 +3656,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VersionDescriptorAction is not null) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexVersioningDescriptor(VersionDescriptorAction), options); } else if (VersionValue is not null) { @@ -3679,7 +3664,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, VersionValue, options); } - if (OtherSettingsValue != null) + if (OtherSettingsValue is not null) { foreach (var additionalProperty in OtherSettingsValue) { 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 index 5a657e6ff1c..569b10d9693 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs @@ -33,10 +33,10 @@ public sealed partial class IndexSettingsAnalysis 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("filter")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFilters? TokenFilters { get; set; } [JsonInclude, JsonPropertyName("tokenizer")] public Elastic.Clients.Elasticsearch.Serverless.Analysis.Tokenizers? Tokenizers { get; set; } } @@ -61,15 +61,15 @@ public IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.S return Self; } - public IndexSettingsAnalysisDescriptor Analyzers(Analysis.AnalyzersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.Serverless.Analysis.AnalyzersDescriptor descriptor) { AnalyzersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Analyzers(Action configure) + public IndexSettingsAnalysisDescriptor Analyzers(Action configure) { - var descriptor = new Analysis.AnalyzersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Analysis.AnalyzersDescriptor(); configure?.Invoke(descriptor); AnalyzersValue = descriptor.PromisedValue; return Self; @@ -81,15 +81,15 @@ public IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsAnalysisDescriptor CharFilters(Analysis.CharFiltersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch.Serverless.Analysis.CharFiltersDescriptor descriptor) { CharFiltersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor CharFilters(Action configure) + public IndexSettingsAnalysisDescriptor CharFilters(Action configure) { - var descriptor = new Analysis.CharFiltersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Analysis.CharFiltersDescriptor(); configure?.Invoke(descriptor); CharFiltersValue = descriptor.PromisedValue; return Self; @@ -101,15 +101,15 @@ public IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsAnalysisDescriptor Normalizers(Analysis.NormalizersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch.Serverless.Analysis.NormalizersDescriptor descriptor) { NormalizersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Normalizers(Action configure) + public IndexSettingsAnalysisDescriptor Normalizers(Action configure) { - var descriptor = new Analysis.NormalizersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Analysis.NormalizersDescriptor(); configure?.Invoke(descriptor); NormalizersValue = descriptor.PromisedValue; return Self; @@ -121,15 +121,15 @@ public IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsAnalysisDescriptor TokenFilters(Analysis.TokenFiltersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFiltersDescriptor descriptor) { TokenFiltersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor TokenFilters(Action configure) + public IndexSettingsAnalysisDescriptor TokenFilters(Action configure) { - var descriptor = new Analysis.TokenFiltersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenFiltersDescriptor(); configure?.Invoke(descriptor); TokenFiltersValue = descriptor.PromisedValue; return Self; @@ -141,15 +141,15 @@ public IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsAnalysisDescriptor Tokenizers(Analysis.TokenizersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenizersDescriptor descriptor) { TokenizersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Tokenizers(Action configure) + public IndexSettingsAnalysisDescriptor Tokenizers(Action configure) { - var descriptor = new Analysis.TokenizersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Analysis.TokenizersDescriptor(); configure?.Invoke(descriptor); TokenizersValue = descriptor.PromisedValue; return Self; 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 index a215bc9c5a5..05abc8b3c7a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs @@ -33,7 +33,6 @@ 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; } /// @@ -77,8 +76,8 @@ public IndexSettingsLifecycleDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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.
@@ -133,7 +132,7 @@ public IndexSettingsLifecycleDescriptor Step(Elastic.Clients.Elasticsearch.Serve return Self; } - public IndexSettingsLifecycleDescriptor Step(IndexSettingsLifecycleStepDescriptor descriptor) + public IndexSettingsLifecycleDescriptor Step(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsLifecycleStepDescriptor descriptor) { StepValue = null; StepDescriptorAction = null; @@ -141,7 +140,7 @@ public IndexSettingsLifecycleDescriptor Step(IndexSettingsLifecycleStepDescripto return Self; } - public IndexSettingsLifecycleDescriptor Step(Action configure) + public IndexSettingsLifecycleDescriptor Step(Action configure) { StepValue = null; StepDescriptor = null; @@ -152,10 +151,10 @@ public IndexSettingsLifecycleDescriptor Step(Action? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.DataStreamName? DataStreamValue { get; set; } 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.IndexManagement.IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action> DefaultsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } - public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + public IndexStateDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -97,7 +97,7 @@ public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { DefaultsValue = null; DefaultsDescriptorAction = null; @@ -105,7 +105,7 @@ public IndexStateDescriptor Defaults(IndexSettingsDescriptor Defaults(Action> configure) + public IndexStateDescriptor Defaults(Action> configure) { DefaultsValue = null; DefaultsDescriptor = null; @@ -124,7 +124,7 @@ public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.S return Self; } - public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -132,7 +132,7 @@ public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor d return Self; } - public IndexStateDescriptor Lifecycle(Action configure) + public IndexStateDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -148,7 +148,7 @@ public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -156,7 +156,7 @@ public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor Mappings(Action> configure) + public IndexStateDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -172,7 +172,7 @@ public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -180,7 +180,7 @@ public IndexStateDescriptor Settings(IndexSettingsDescriptor Settings(Action> configure) + public IndexStateDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -211,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DefaultsDescriptorAction is not null) { writer.WritePropertyName("defaults"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(DefaultsDescriptorAction), options); } else if (DefaultsValue is not null) { @@ -227,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -243,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -259,7 +259,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -279,24 +279,24 @@ public IndexStateDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.DataStreamName? DataStreamValue { get; set; } 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.IndexManagement.IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action DefaultsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } - public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + public IndexStateDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -317,7 +317,7 @@ public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { DefaultsValue = null; DefaultsDescriptorAction = null; @@ -325,7 +325,7 @@ public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) return Self; } - public IndexStateDescriptor Defaults(Action configure) + public IndexStateDescriptor Defaults(Action configure) { DefaultsValue = null; DefaultsDescriptor = null; @@ -344,7 +344,7 @@ public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.I return Self; } - public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -352,7 +352,7 @@ public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) return Self; } - public IndexStateDescriptor Lifecycle(Action configure) + public IndexStateDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -368,7 +368,7 @@ public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Ma return Self; } - public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -376,7 +376,7 @@ public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) return Self; } - public IndexStateDescriptor Mappings(Action configure) + public IndexStateDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -392,7 +392,7 @@ public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -400,7 +400,7 @@ public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public IndexStateDescriptor Settings(Action configure) + public IndexStateDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -431,7 +431,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DefaultsDescriptorAction is not null) { writer.WritePropertyName("defaults"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(DefaultsDescriptorAction), options); } else if (DefaultsValue is not null) { @@ -447,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -463,7 +463,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -479,7 +479,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { 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 index 2f9ce971731..125f4e68d19 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplate.g.cs @@ -29,47 +29,434 @@ 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; } + public bool? AllowAutoCreate { 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 IReadOnlyCollection ComposedOf { get; init; } + public ICollection ComposedOf { 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.IndexTemplateDataStreamConfiguration? DataStream { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? DataStream { get; set; } /// /// Name of the index template. /// [JsonInclude, JsonPropertyName("index_patterns")] - public IReadOnlyCollection IndexPatterns { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Names IndexPatterns { 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; } /// /// 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; } + public long? Priority { 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.IndexTemplateSummary? Template { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? Template { 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; init; } + public long? Version { get; set; } +} + +public sealed partial class IndexTemplateDescriptor : SerializableDescriptor> +{ + internal IndexTemplateDescriptor(Action> configure) => configure.Invoke(this); + + public IndexTemplateDescriptor() : base() + { + } + + private bool? AllowAutoCreateValue { get; set; } + private ICollection ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Names IndexPatternsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + public IndexTemplateDescriptor 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 IndexTemplateDescriptor 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 IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template. + /// + public IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Names indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// Optional user metadata about the index template. May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + 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 IndexTemplateDescriptor Priority(long? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexTemplateDescriptor : SerializableDescriptor +{ + internal IndexTemplateDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateDescriptor() : base() + { + } + + private bool? AllowAutoCreateValue { get; set; } + private ICollection ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Names IndexPatternsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + public IndexTemplateDescriptor 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 IndexTemplateDescriptor 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 IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfiguration? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template. + /// + public IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Serverless.Names indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// Optional user metadata about the index template. May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + 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 IndexTemplateDescriptor Priority(long? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummary? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexTemplateSummaryDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } } \ 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 index fc932e82b63..588fb446173 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs @@ -33,11 +33,59 @@ public sealed partial class IndexTemplateDataStreamConfiguration /// If true, the data stream supports custom routing. ///
[JsonInclude, JsonPropertyName("allow_custom_routing")] - public bool? AllowCustomRouting { get; init; } + public bool? AllowCustomRouting { get; set; } /// /// If true, the data stream is hidden. /// [JsonInclude, JsonPropertyName("hidden")] - public bool? Hidden { get; init; } + public bool? Hidden { get; set; } +} + +public sealed partial class IndexTemplateDataStreamConfigurationDescriptor : SerializableDescriptor +{ + internal IndexTemplateDataStreamConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateDataStreamConfigurationDescriptor() : base() + { + } + + private bool? AllowCustomRoutingValue { get; set; } + private bool? HiddenValue { get; set; } + + /// + /// If true, the data stream supports custom routing. + /// + public IndexTemplateDataStreamConfigurationDescriptor AllowCustomRouting(bool? allowCustomRouting = true) + { + AllowCustomRoutingValue = allowCustomRouting; + return Self; + } + + /// + /// If true, the data stream is hidden. + /// + public IndexTemplateDataStreamConfigurationDescriptor Hidden(bool? hidden = true) + { + HiddenValue = hidden; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowCustomRoutingValue.HasValue) + { + writer.WritePropertyName("allow_custom_routing"); + writer.WriteBooleanValue(AllowCustomRoutingValue.Value); + } + + 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/IndexTemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs index 32f35e3ec59..d7591a9a692 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs @@ -58,23 +58,23 @@ public IndexTemplateMappingDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } /// /// 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) + public IndexTemplateMappingDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -86,7 +86,7 @@ public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elast return Self; } - public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -94,7 +94,7 @@ public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDe return Self; } - public IndexTemplateMappingDescriptor Lifecycle(Action configure) + public IndexTemplateMappingDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -113,7 +113,7 @@ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasti return Self; } - public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -121,7 +121,7 @@ public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDes return Self; } - public IndexTemplateMappingDescriptor Mappings(Action> configure) + public IndexTemplateMappingDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -140,7 +140,7 @@ public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasti return Self; } - public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -148,7 +148,7 @@ public IndexTemplateMappingDescriptor Settings(IndexSettingsDescripto return Self; } - public IndexTemplateMappingDescriptor Settings(Action> configure) + public IndexTemplateMappingDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -173,7 +173,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -189,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -205,7 +205,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -225,23 +225,23 @@ public IndexTemplateMappingDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { 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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } /// /// 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) + public IndexTemplateMappingDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -253,7 +253,7 @@ public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -261,7 +261,7 @@ public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor de return Self; } - public IndexTemplateMappingDescriptor Lifecycle(Action configure) + public IndexTemplateMappingDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -280,7 +280,7 @@ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Ser return Self; } - public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -288,7 +288,7 @@ public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor des return Self; } - public IndexTemplateMappingDescriptor Mappings(Action configure) + public IndexTemplateMappingDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -307,7 +307,7 @@ public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Ser return Self; } - public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -315,7 +315,7 @@ public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descripto return Self; } - public IndexTemplateMappingDescriptor Settings(Action configure) + public IndexTemplateMappingDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -340,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -356,7 +356,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -372,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { 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 index 63f12296520..d69020dafbf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs @@ -33,20 +33,353 @@ 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; } + public IDictionary? Aliases { get; set; } [JsonInclude, JsonPropertyName("lifecycle")] - public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? 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; init; } + 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; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? Settings { get; set; } +} + +public sealed partial class IndexTemplateSummaryDescriptor : SerializableDescriptor> +{ + internal IndexTemplateSummaryDescriptor(Action> configure) => configure.Invoke(this); + + public IndexTemplateSummaryDescriptor() : base() + { + } + + private IDictionary> AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? LifecycleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + + /// + /// 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 IndexTemplateSummaryDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Action> configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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 (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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexTemplateSummaryDescriptor : SerializableDescriptor +{ + internal IndexTemplateSummaryDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateSummaryDescriptor() : base() + { + } + + private IDictionary AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? LifecycleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + + /// + /// 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 IndexTemplateSummaryDescriptor Aliases(Func, FluentDescriptorDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRollover? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Serverless.Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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 (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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, 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 Elastic.Clients.Elasticsearch.Serverless.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else 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/Types/IndexManagement/IndexUpdateAliasesAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs new file mode 100644 index 00000000000..e2f6103a2b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; + +[JsonConverter(typeof(IndexUpdateAliasesActionConverter))] +public sealed partial class IndexUpdateAliasesAction +{ + internal IndexUpdateAliasesAction(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 IndexUpdateAliasesAction Add(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AddAction addAction) => new IndexUpdateAliasesAction("add", addAction); + public static IndexUpdateAliasesAction Remove(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveAction removeAction) => new IndexUpdateAliasesAction("remove", removeAction); + public static IndexUpdateAliasesAction RemoveIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveIndexAction removeIndexAction) => new IndexUpdateAliasesAction("remove_index", removeIndexAction); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class IndexUpdateAliasesActionConverter : JsonConverter +{ + public override IndexUpdateAliasesAction 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; + 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 == "add") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IndexUpdateAliasesAction' from the response."); + } + + reader.Read(); + var result = new IndexUpdateAliasesAction(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, IndexUpdateAliasesAction 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 IndexUpdateAliasesActionDescriptor : SerializableDescriptor> +{ + internal IndexUpdateAliasesActionDescriptor(Action> configure) => configure.Invoke(this); + + public IndexUpdateAliasesActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexUpdateAliasesActionDescriptor 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 IndexUpdateAliasesActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexUpdateAliasesActionDescriptor Add(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AddAction addAction) => Set(addAction, "add"); + public IndexUpdateAliasesActionDescriptor Add(Action> configure) => Set(configure, "add"); + public IndexUpdateAliasesActionDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveAction removeAction) => Set(removeAction, "remove"); + public IndexUpdateAliasesActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 IndexUpdateAliasesActionDescriptor : SerializableDescriptor +{ + internal IndexUpdateAliasesActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexUpdateAliasesActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexUpdateAliasesActionDescriptor 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 IndexUpdateAliasesActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexUpdateAliasesActionDescriptor Add(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.AddAction addAction) => Set(addAction, "add"); + public IndexUpdateAliasesActionDescriptor Add(Action configure) => Set(configure, "add"); + public IndexUpdateAliasesActionDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveAction removeAction) => Set(removeAction, "remove"); + public IndexUpdateAliasesActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/IndexManagement/IndexVersioning.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs index 62974414db7..c6cb8a4169f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexVersioning.g.cs @@ -61,10 +61,10 @@ public IndexVersioningDescriptor CreatedString(string? createdString) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (CreatedValue is not null) + if (!string.IsNullOrEmpty(CreatedValue)) { writer.WritePropertyName("created"); - JsonSerializer.Serialize(writer, CreatedValue, options); + writer.WriteStringValue(CreatedValue); } if (!string.IsNullOrEmpty(CreatedStringValue)) 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 index df87d0a896a..5aef5f07646 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingPressure.g.cs @@ -42,8 +42,8 @@ public IndexingPressureDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemory MemoryValue { get; set; } - private IndexingPressureMemoryDescriptor MemoryDescriptor { get; set; } - private Action MemoryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemoryDescriptor MemoryDescriptor { get; set; } + private Action MemoryDescriptorAction { get; set; } public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemory memory) { @@ -53,7 +53,7 @@ public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.Serverles return Self; } - public IndexingPressureDescriptor Memory(IndexingPressureMemoryDescriptor descriptor) + public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemoryDescriptor descriptor) { MemoryValue = null; MemoryDescriptorAction = null; @@ -61,7 +61,7 @@ public IndexingPressureDescriptor Memory(IndexingPressureMemoryDescriptor descri return Self; } - public IndexingPressureDescriptor Memory(Action configure) + public IndexingPressureDescriptor Memory(Action configure) { MemoryValue = null; MemoryDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MemoryDescriptorAction is not null) { writer.WritePropertyName("memory"); - JsonSerializer.Serialize(writer, new IndexingPressureMemoryDescriptor(MemoryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingPressureMemoryDescriptor(MemoryDescriptorAction), options); } else { 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 index e192e767013..932d2b7fe8b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs @@ -51,8 +51,8 @@ public IndexingSlowlogSettingsDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } public IndexingSlowlogSettingsDescriptor Level(string? level) { @@ -80,7 +80,7 @@ public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch return Self; } - public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescriptor descriptor) + public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholdsDescriptor descriptor) { ThresholdValue = null; ThresholdDescriptorAction = null; @@ -88,7 +88,7 @@ public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescr return Self; } - public IndexingSlowlogSettingsDescriptor Threshold(Action configure) + public IndexingSlowlogSettingsDescriptor Threshold(Action configure) { ThresholdValue = null; ThresholdDescriptor = null; @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ThresholdDescriptorAction is not null) { writer.WritePropertyName("threshold"); - JsonSerializer.Serialize(writer, new IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); } else if (ThresholdValue is not null) { 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 index b5dde769778..07c33d32bb3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs @@ -45,8 +45,8 @@ public IndexingSlowlogTresholdsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? IndexValue { get; set; } - private SlowlogTresholdLevelsDescriptor IndexDescriptor { get; set; } - private Action IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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.
@@ -59,7 +59,7 @@ public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.Se return Self; } - public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor descriptor) + public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -67,7 +67,7 @@ public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor return Self; } - public IndexingSlowlogTresholdsDescriptor Index(Action configure) + public IndexingSlowlogTresholdsDescriptor Index(Action configure) { IndexValue = null; IndexDescriptor = null; @@ -86,7 +86,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs new file mode 100644 index 00000000000..7f051aa76a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/IndicesValidationExplanation.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 IndicesValidationExplanation +{ + [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + [JsonInclude, JsonPropertyName("explanation")] + public string? Explanation { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("valid")] + public bool Valid { 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 index c83388b51ba..5d098eb96b0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; /// /// Mapping Limit Settings +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class MappingLimitSettings { @@ -52,6 +53,7 @@ public sealed partial class MappingLimitSettings /// /// Mapping Limit Settings +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class MappingLimitSettingsDescriptor : SerializableDescriptor { @@ -63,24 +65,24 @@ 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.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.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 Elastic.Clients.Elasticsearch.Serverless.IndexManagement.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.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.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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor TotalFieldsDescriptor { get; set; } + private Action TotalFieldsDescriptorAction { get; set; } public MappingLimitSettingsDescriptor Coerce(bool? coerce = true) { @@ -96,7 +98,7 @@ public MappingLimitSettingsDescriptor Depth(Elastic.Clients.Elasticsearch.Server return Self; } - public MappingLimitSettingsDescriptor Depth(MappingLimitSettingsDepthDescriptor descriptor) + public MappingLimitSettingsDescriptor Depth(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDepthDescriptor descriptor) { DepthValue = null; DepthDescriptorAction = null; @@ -104,7 +106,7 @@ public MappingLimitSettingsDescriptor Depth(MappingLimitSettingsDepthDescriptor return Self; } - public MappingLimitSettingsDescriptor Depth(Action configure) + public MappingLimitSettingsDescriptor Depth(Action configure) { DepthValue = null; DepthDescriptor = null; @@ -120,7 +122,7 @@ public MappingLimitSettingsDescriptor DimensionFields(Elastic.Clients.Elasticsea return Self; } - public MappingLimitSettingsDescriptor DimensionFields(MappingLimitSettingsDimensionFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor DimensionFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDimensionFieldsDescriptor descriptor) { DimensionFieldsValue = null; DimensionFieldsDescriptorAction = null; @@ -128,7 +130,7 @@ public MappingLimitSettingsDescriptor DimensionFields(MappingLimitSettingsDimens return Self; } - public MappingLimitSettingsDescriptor DimensionFields(Action configure) + public MappingLimitSettingsDescriptor DimensionFields(Action configure) { DimensionFieldsValue = null; DimensionFieldsDescriptor = null; @@ -144,7 +146,7 @@ public MappingLimitSettingsDescriptor FieldNameLength(Elastic.Clients.Elasticsea return Self; } - public MappingLimitSettingsDescriptor FieldNameLength(MappingLimitSettingsFieldNameLengthDescriptor descriptor) + public MappingLimitSettingsDescriptor FieldNameLength(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsFieldNameLengthDescriptor descriptor) { FieldNameLengthValue = null; FieldNameLengthDescriptorAction = null; @@ -152,7 +154,7 @@ public MappingLimitSettingsDescriptor FieldNameLength(MappingLimitSettingsFieldN return Self; } - public MappingLimitSettingsDescriptor FieldNameLength(Action configure) + public MappingLimitSettingsDescriptor FieldNameLength(Action configure) { FieldNameLengthValue = null; FieldNameLengthDescriptor = null; @@ -174,7 +176,7 @@ public MappingLimitSettingsDescriptor NestedFields(Elastic.Clients.Elasticsearch return Self; } - public MappingLimitSettingsDescriptor NestedFields(MappingLimitSettingsNestedFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor NestedFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedFieldsDescriptor descriptor) { NestedFieldsValue = null; NestedFieldsDescriptorAction = null; @@ -182,7 +184,7 @@ public MappingLimitSettingsDescriptor NestedFields(MappingLimitSettingsNestedFie return Self; } - public MappingLimitSettingsDescriptor NestedFields(Action configure) + public MappingLimitSettingsDescriptor NestedFields(Action configure) { NestedFieldsValue = null; NestedFieldsDescriptor = null; @@ -198,7 +200,7 @@ public MappingLimitSettingsDescriptor NestedObjects(Elastic.Clients.Elasticsearc return Self; } - public MappingLimitSettingsDescriptor NestedObjects(MappingLimitSettingsNestedObjectsDescriptor descriptor) + public MappingLimitSettingsDescriptor NestedObjects(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedObjectsDescriptor descriptor) { NestedObjectsValue = null; NestedObjectsDescriptorAction = null; @@ -206,7 +208,7 @@ public MappingLimitSettingsDescriptor NestedObjects(MappingLimitSettingsNestedOb return Self; } - public MappingLimitSettingsDescriptor NestedObjects(Action configure) + public MappingLimitSettingsDescriptor NestedObjects(Action configure) { NestedObjectsValue = null; NestedObjectsDescriptor = null; @@ -222,7 +224,7 @@ public MappingLimitSettingsDescriptor TotalFields(Elastic.Clients.Elasticsearch. return Self; } - public MappingLimitSettingsDescriptor TotalFields(MappingLimitSettingsTotalFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor TotalFields(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor descriptor) { TotalFieldsValue = null; TotalFieldsDescriptorAction = null; @@ -230,7 +232,7 @@ public MappingLimitSettingsDescriptor TotalFields(MappingLimitSettingsTotalField return Self; } - public MappingLimitSettingsDescriptor TotalFields(Action configure) + public MappingLimitSettingsDescriptor TotalFields(Action configure) { TotalFieldsValue = null; TotalFieldsDescriptor = null; @@ -255,7 +257,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DepthDescriptorAction is not null) { writer.WritePropertyName("depth"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDepthDescriptor(DepthDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDepthDescriptor(DepthDescriptorAction), options); } else if (DepthValue is not null) { @@ -271,7 +273,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DimensionFieldsDescriptorAction is not null) { writer.WritePropertyName("dimension_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDimensionFieldsDescriptor(DimensionFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsDimensionFieldsDescriptor(DimensionFieldsDescriptorAction), options); } else if (DimensionFieldsValue is not null) { @@ -287,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNameLengthDescriptorAction is not null) { writer.WritePropertyName("field_name_length"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsFieldNameLengthDescriptor(FieldNameLengthDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsFieldNameLengthDescriptor(FieldNameLengthDescriptorAction), options); } else if (FieldNameLengthValue is not null) { @@ -309,7 +311,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedFieldsDescriptorAction is not null) { writer.WritePropertyName("nested_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedFieldsDescriptor(NestedFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedFieldsDescriptor(NestedFieldsDescriptorAction), options); } else if (NestedFieldsValue is not null) { @@ -325,7 +327,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedObjectsDescriptorAction is not null) { writer.WritePropertyName("nested_objects"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedObjectsDescriptor(NestedObjectsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsNestedObjectsDescriptor(NestedObjectsDescriptorAction), options); } else if (NestedObjectsValue is not null) { @@ -341,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TotalFieldsDescriptorAction is not null) { writer.WritePropertyName("total_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsTotalFieldsDescriptor(TotalFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor(TotalFieldsDescriptorAction), options); } else if (TotalFieldsValue is not null) { 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 index 4ef0e6e23fc..beee8fcd8d1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Merge.g.cs @@ -42,8 +42,8 @@ public MergeDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeScheduler? SchedulerValue { get; set; } - private MergeSchedulerDescriptor SchedulerDescriptor { get; set; } - private Action SchedulerDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeSchedulerDescriptor SchedulerDescriptor { get; set; } + private Action SchedulerDescriptorAction { get; set; } public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeScheduler? scheduler) { @@ -53,7 +53,7 @@ public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.Serverless.IndexM return Self; } - public MergeDescriptor Scheduler(MergeSchedulerDescriptor descriptor) + public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeSchedulerDescriptor descriptor) { SchedulerValue = null; SchedulerDescriptorAction = null; @@ -61,7 +61,7 @@ public MergeDescriptor Scheduler(MergeSchedulerDescriptor descriptor) return Self; } - public MergeDescriptor Scheduler(Action configure) + public MergeDescriptor Scheduler(Action configure) { SchedulerValue = null; SchedulerDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SchedulerDescriptorAction is not null) { writer.WritePropertyName("scheduler"); - JsonSerializer.Serialize(writer, new MergeSchedulerDescriptor(SchedulerDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.MergeSchedulerDescriptor(SchedulerDescriptorAction), options); } else if (SchedulerValue is not null) { 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 index f4b6f414245..c61ac117daa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/MergeScheduler.g.cs @@ -30,10 +30,8 @@ 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; } } @@ -63,16 +61,16 @@ public MergeSchedulerDescriptor MaxThreadCount(int? maxThreadCount) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MaxMergeCountValue is not null) + if (MaxMergeCountValue.HasValue) { writer.WritePropertyName("max_merge_count"); - JsonSerializer.Serialize(writer, MaxMergeCountValue, options); + writer.WriteNumberValue(MaxMergeCountValue.Value); } - if (MaxThreadCountValue is not null) + if (MaxThreadCountValue.HasValue) { writer.WritePropertyName("max_thread_count"); - JsonSerializer.Serialize(writer, MaxThreadCountValue, options); + writer.WriteNumberValue(MaxThreadCountValue.Value); } writer.WriteEndObject(); 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 index 9b709e60f73..4df368534fe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/NumericFielddata.g.cs @@ -33,7 +33,7 @@ public sealed partial class NumericFielddata public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataFormat Format { get; set; } } -public sealed partial class NumericFielddataDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class NumericFielddataDescriptor : SerializableDescriptor { internal NumericFielddataDescriptor(Action configure) => configure.Invoke(this); @@ -56,9 +56,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/Queries.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs index 68bce02a645..c4c86baa6e3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Queries.g.cs @@ -42,8 +42,8 @@ public QueriesDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueries? CacheValue { get; set; } - private CacheQueriesDescriptor CacheDescriptor { get; set; } - private Action CacheDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueriesDescriptor CacheDescriptor { get; set; } + private Action CacheDescriptorAction { get; set; } public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueries? cache) { @@ -53,7 +53,7 @@ public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.Serverless.IndexMan return Self; } - public QueriesDescriptor Cache(CacheQueriesDescriptor descriptor) + public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueriesDescriptor descriptor) { CacheValue = null; CacheDescriptorAction = null; @@ -61,7 +61,7 @@ public QueriesDescriptor Cache(CacheQueriesDescriptor descriptor) return Self; } - public QueriesDescriptor Cache(Action configure) + public QueriesDescriptor Cache(Action configure) { CacheValue = null; CacheDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CacheDescriptorAction is not null) { writer.WritePropertyName("cache"); - JsonSerializer.Serialize(writer, new CacheQueriesDescriptor(CacheDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.CacheQueriesDescriptor(CacheDescriptorAction), options); } else if (CacheValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryBytes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryBytes.g.cs new file mode 100644 index 00000000000..cab75889b65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryBytes.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 RecoveryBytes +{ + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Recovered { get; init; } + [JsonInclude, JsonPropertyName("recovered_from_snapshot")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? RecoveredFromSnapshot { get; init; } + [JsonInclude, JsonPropertyName("recovered_from_snapshot_in_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? RecoveredFromSnapshotInBytes { get; init; } + [JsonInclude, JsonPropertyName("recovered_in_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize RecoveredInBytes { get; init; } + [JsonInclude, JsonPropertyName("reused")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Reused { get; init; } + [JsonInclude, JsonPropertyName("reused_in_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize ReusedInBytes { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Total { get; init; } + [JsonInclude, JsonPropertyName("total_in_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryFiles.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryFiles.g.cs new file mode 100644 index 00000000000..6819948198a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryFiles.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.IndexManagement; + +public sealed partial class RecoveryFiles +{ + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyCollection? Details { get; init; } + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } + [JsonInclude, JsonPropertyName("reused")] + public long Reused { 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/IndexManagement/RecoveryIndexStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs new file mode 100644 index 00000000000..3a131cc7162 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryIndexStatus.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 RecoveryIndexStatus +{ + [JsonInclude, JsonPropertyName("bytes")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryBytes? Bytes { get; init; } + [JsonInclude, JsonPropertyName("files")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryFiles Files { get; init; } + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryBytes Size { get; init; } + [JsonInclude, JsonPropertyName("source_throttle_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? SourceThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("source_throttle_time_in_millis")] + public long SourceThrottleTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("target_throttle_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TargetThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("target_throttle_time_in_millis")] + public long TargetThrottleTimeInMillis { 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/IndexManagement/RecoveryOrigin.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs new file mode 100644 index 00000000000..4976c5cc385 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryOrigin.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.IndexManagement; + +public sealed partial class RecoveryOrigin +{ + [JsonInclude, JsonPropertyName("bootstrap_new_history_uuid")] + public bool? BootstrapNewHistoryUuid { get; init; } + [JsonInclude, JsonPropertyName("host")] + public string? Host { get; init; } + [JsonInclude, JsonPropertyName("hostname")] + public string? Hostname { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string? Index { get; init; } + [JsonInclude, JsonPropertyName("ip")] + public string? Ip { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; init; } + [JsonInclude, JsonPropertyName("restoreUUID")] + public string? Restoreuuid { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string? Snapshot { get; init; } + [JsonInclude, JsonPropertyName("transport_address")] + public string? TransportAddress { 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/IndexManagement/RecoveryStartStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs new file mode 100644 index 00000000000..7fd273ed9d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStartStatus.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 RecoveryStartStatus +{ + [JsonInclude, JsonPropertyName("check_index_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CheckIndexTime { get; init; } + [JsonInclude, JsonPropertyName("check_index_time_in_millis")] + public long CheckIndexTimeInMillis { 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/IndexManagement/RecoveryStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStatus.g.cs new file mode 100644 index 00000000000..dc8f87343fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RecoveryStatus.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 RecoveryStatus +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyCollection Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadDetails.g.cs new file mode 100644 index 00000000000..930f83fc80a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadDetails.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 ReloadDetails +{ + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("reloaded_analyzers")] + public IReadOnlyCollection ReloadedAnalyzers { get; init; } + [JsonInclude, JsonPropertyName("reloaded_node_ids")] + public IReadOnlyCollection ReloadedNodeIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadResult.g.cs new file mode 100644 index 00000000000..9bf98942a54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ReloadResult.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 ReloadResult +{ + [JsonInclude, JsonPropertyName("reload_details")] + public IReadOnlyCollection ReloadDetails { 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/Types/IndexManagement/RemoveAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs index af945b1ce56..d8feea8b1d3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveAction.g.cs @@ -60,7 +60,7 @@ public sealed partial class RemoveAction [JsonInclude, JsonPropertyName("must_exist")] public bool? MustExist { get; set; } - public static implicit operator Action(RemoveAction removeAction) => IndexManagement.Action.Remove(removeAction); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction(RemoveAction removeAction) => Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction.Remove(removeAction); } public sealed partial class RemoveActionDescriptor : SerializableDescriptor 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 index b8858db2732..67b07f7bafe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs @@ -47,7 +47,7 @@ public sealed partial class RemoveIndexAction [JsonInclude, JsonPropertyName("must_exist")] public bool? MustExist { get; set; } - public static implicit operator Action(RemoveIndexAction removeIndexAction) => IndexManagement.Action.RemoveIndex(removeIndexAction); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction(RemoveIndexAction removeIndexAction) => Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexUpdateAliasesAction.RemoveIndex(removeIndexAction); } public sealed partial class RemoveIndexActionDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs new file mode 100644 index 00000000000..593daf169b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexAliasItem.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 ResolveIndexAliasItem +{ + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { 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/ResolveIndexDataStreamsItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs new file mode 100644 index 00000000000..5d6e1cd7c74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.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 ResolveIndexDataStreamsItem +{ + [JsonInclude, JsonPropertyName("backing_indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection BackingIndices { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("timestamp_field")] + public string TimestampField { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs new file mode 100644 index 00000000000..e8d8b95fcc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ResolveIndexItem.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 ResolveIndexItem +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyCollection? Aliases { get; init; } + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyCollection Attributes { get; init; } + [JsonInclude, JsonPropertyName("data_stream")] + public string? DataStream { 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/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs index 51707573fa5..e05c9e040fc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -184,10 +184,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MaxAgeValue, options); } - if (MaxAgeMillisValue is not null) + if (MaxAgeMillisValue.HasValue) { writer.WritePropertyName("max_age_millis"); - JsonSerializer.Serialize(writer, MaxAgeMillisValue, options); + writer.WriteNumberValue(MaxAgeMillisValue.Value); } if (MaxDocsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Segment.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Segment.g.cs new file mode 100644 index 00000000000..b99bf6dc123 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Segment.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 Segment +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("committed")] + public bool Committed { get; init; } + [JsonInclude, JsonPropertyName("compound")] + public bool Compound { get; init; } + [JsonInclude, JsonPropertyName("deleted_docs")] + public long DeletedDocs { get; init; } + [JsonInclude, JsonPropertyName("generation")] + public int Generation { get; init; } + [JsonInclude, JsonPropertyName("num_docs")] + public long NumDocs { get; init; } + [JsonInclude, JsonPropertyName("search")] + public bool Search { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public double SizeInBytes { 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/IndexManagement/SettingsAnalyze.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs index f797c470310..0d482192161 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs @@ -30,7 +30,6 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class SettingsAnalyze { [JsonInclude, JsonPropertyName("max_token_count")] - [JsonConverter(typeof(StringifiedIntegerConverter))] public int? MaxTokenCount { get; set; } } @@ -53,10 +52,10 @@ public SettingsAnalyzeDescriptor MaxTokenCount(int? maxTokenCount) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MaxTokenCountValue is not null) + if (MaxTokenCountValue.HasValue) { writer.WritePropertyName("max_token_count"); - JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + writer.WriteNumberValue(MaxTokenCountValue.Value); } writer.WriteEndObject(); 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 index 66c977704ca..94126f89791 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsQueryString.g.cs @@ -30,7 +30,6 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; public sealed partial class SettingsQueryString { [JsonInclude, JsonPropertyName("lenient")] - [JsonConverter(typeof(StringifiedBoolConverter))] public bool Lenient { get; set; } } @@ -54,7 +53,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("lenient"); - JsonSerializer.Serialize(writer, LenientValue, options); + writer.WriteBooleanValue(LenientValue); 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 index daa013eb089..2cc44700515 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSearch.g.cs @@ -44,11 +44,11 @@ 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.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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettingsDescriptor SlowlogDescriptor { get; set; } + private Action SlowlogDescriptorAction { get; set; } public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdle? idle) { @@ -58,7 +58,7 @@ public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.Serverless.In return Self; } - public SettingsSearchDescriptor Idle(SearchIdleDescriptor descriptor) + public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdleDescriptor descriptor) { IdleValue = null; IdleDescriptorAction = null; @@ -66,7 +66,7 @@ public SettingsSearchDescriptor Idle(SearchIdleDescriptor descriptor) return Self; } - public SettingsSearchDescriptor Idle(Action configure) + public SettingsSearchDescriptor Idle(Action configure) { IdleValue = null; IdleDescriptor = null; @@ -82,7 +82,7 @@ public SettingsSearchDescriptor Slowlog(Elastic.Clients.Elasticsearch.Serverless return Self; } - public SettingsSearchDescriptor Slowlog(SlowlogSettingsDescriptor descriptor) + public SettingsSearchDescriptor Slowlog(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettingsDescriptor descriptor) { SlowlogValue = null; SlowlogDescriptorAction = null; @@ -90,7 +90,7 @@ public SettingsSearchDescriptor Slowlog(SlowlogSettingsDescriptor descriptor) return Self; } - public SettingsSearchDescriptor Slowlog(Action configure) + public SettingsSearchDescriptor Slowlog(Action configure) { SlowlogValue = null; SlowlogDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IdleDescriptorAction is not null) { writer.WritePropertyName("idle"); - JsonSerializer.Serialize(writer, new SearchIdleDescriptor(IdleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SearchIdleDescriptor(IdleDescriptorAction), options); } else if (IdleValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SlowlogDescriptorAction is not null) { writer.WritePropertyName("slowlog"); - JsonSerializer.Serialize(writer, new SlowlogSettingsDescriptor(SlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogSettingsDescriptor(SlowlogDescriptorAction), options); } else if (SlowlogValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs new file mode 100644 index 00000000000..bbbc27724bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the 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.IndexManagement; + +public partial class SettingsSimilarities : IsADictionary +{ + public SettingsSimilarities() + { + } + + public SettingsSimilarities(IDictionary container) : base(container) + { + } + + public void Add(string name, ISettingsSimilarity settingsSimilarity) => BackingDictionary.Add(Sanitize(name), settingsSimilarity); + public bool TryGetSettingsSimilarity(string name, [NotNullWhen(returnValue: true)] out ISettingsSimilarity settingsSimilarity) => BackingDictionary.TryGetValue(Sanitize(name), out settingsSimilarity); + + public bool TryGetSettingsSimilarity(string name, [NotNullWhen(returnValue: true)] out T? settingsSimilarity) where T : class, ISettingsSimilarity + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + settingsSimilarity = finalValue; + return true; + } + + settingsSimilarity = null; + return false; + } +} + +public sealed partial class SettingsSimilaritiesDescriptor : IsADictionaryDescriptor +{ + public SettingsSimilaritiesDescriptor() : base(new SettingsSimilarities()) + { + } + + public SettingsSimilaritiesDescriptor(SettingsSimilarities settingsSimilarities) : base(settingsSimilarities ?? new SettingsSimilarities()) + { + } + + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName, SettingsSimilarityBm25 settingsSimilarityBm25) => AssignVariant(settingsSimilarityName, settingsSimilarityBm25); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName, SettingsSimilarityBoolean settingsSimilarityBoolean) => AssignVariant(settingsSimilarityName, settingsSimilarityBoolean); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName, SettingsSimilarityDfi settingsSimilarityDfi) => AssignVariant(settingsSimilarityName, settingsSimilarityDfi); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName, SettingsSimilarityDfr settingsSimilarityDfr) => AssignVariant(settingsSimilarityName, settingsSimilarityDfr); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName, SettingsSimilarityIb settingsSimilarityIb) => AssignVariant(settingsSimilarityName, settingsSimilarityIb); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName, SettingsSimilarityLmd settingsSimilarityLmd) => AssignVariant(settingsSimilarityName, settingsSimilarityLmd); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName, SettingsSimilarityLmj settingsSimilarityLmj) => AssignVariant(settingsSimilarityName, settingsSimilarityLmj); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName, SettingsSimilarityScripted settingsSimilarityScripted) => AssignVariant(settingsSimilarityName, settingsSimilarityScripted); +} + +internal sealed partial class SettingsSimilarityInterfaceConverter : JsonConverter +{ + public override ISettingsSimilarity 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 "BM25": + return JsonSerializer.Deserialize(ref reader, options); + case "boolean": + return JsonSerializer.Deserialize(ref reader, options); + case "DFI": + return JsonSerializer.Deserialize(ref reader, options); + case "DFR": + return JsonSerializer.Deserialize(ref reader, options); + case "IB": + return JsonSerializer.Deserialize(ref reader, options); + case "LMDirichlet": + return JsonSerializer.Deserialize(ref reader, options); + case "LMJelinekMercer": + return JsonSerializer.Deserialize(ref reader, options); + case "scripted": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ISettingsSimilarity)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, ISettingsSimilarity value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "BM25": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityBm25), options); + return; + case "boolean": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityBoolean), options); + return; + case "DFI": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfi), options); + return; + case "DFR": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityDfr), options); + return; + case "IB": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityIb), options); + return; + case "LMDirichlet": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmd), options); + return; + case "LMJelinekMercer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityLmj), options); + return; + case "scripted": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SettingsSimilarityScripted), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(SettingsSimilarityInterfaceConverter))] +public partial interface ISettingsSimilarity +{ + public string? Type { get; } +} \ 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 deleted file mode 100644 index ab02a84f5a6..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs +++ /dev/null @@ -1,363 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -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 index e2c1bb5eb05..e4fffc4fc9e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs @@ -27,20 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityBm25 +public sealed partial class SettingsSimilarityBm25 : ISettingsSimilarity { [JsonInclude, JsonPropertyName("b")] - public double b { get; set; } + public double? b { get; set; } [JsonInclude, JsonPropertyName("discount_overlaps")] - public bool DiscountOverlaps { get; set; } + public bool? DiscountOverlaps { get; set; } [JsonInclude, JsonPropertyName("k1")] - public double K1 { get; set; } + public double? K1 { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "BM25"; } -public sealed partial class SettingsSimilarityBm25Descriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityBm25Descriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityBm25Descriptor(Action configure) => configure.Invoke(this); @@ -48,23 +48,23 @@ public SettingsSimilarityBm25Descriptor() : base() { } - private double bValue { get; set; } - private bool DiscountOverlapsValue { get; set; } - private double K1Value { get; set; } + private double? bValue { get; set; } + private bool? DiscountOverlapsValue { get; set; } + private double? K1Value { get; set; } - public SettingsSimilarityBm25Descriptor b(double b) + public SettingsSimilarityBm25Descriptor b(double? b) { bValue = b; return Self; } - public SettingsSimilarityBm25Descriptor DiscountOverlaps(bool discountOverlaps = true) + public SettingsSimilarityBm25Descriptor DiscountOverlaps(bool? discountOverlaps = true) { DiscountOverlapsValue = discountOverlaps; return Self; } - public SettingsSimilarityBm25Descriptor K1(double k1) + public SettingsSimilarityBm25Descriptor K1(double? k1) { K1Value = k1; return Self; @@ -73,14 +73,33 @@ public SettingsSimilarityBm25Descriptor K1(double k1) 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); + if (bValue.HasValue) + { + writer.WritePropertyName("b"); + writer.WriteNumberValue(bValue.Value); + } + + if (DiscountOverlapsValue.HasValue) + { + writer.WritePropertyName("discount_overlaps"); + writer.WriteBooleanValue(DiscountOverlapsValue.Value); + } + + if (K1Value.HasValue) + { + writer.WritePropertyName("k1"); + writer.WriteNumberValue(K1Value.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("BM25"); writer.WriteEndObject(); } + + SettingsSimilarityBm25 IBuildableDescriptor.Build() => new() + { + b = bValue, + DiscountOverlaps = DiscountOverlapsValue, + K1 = K1Value + }; } \ 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/SettingsSimilarityBoolean.g.cs similarity index 65% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs index ea5b38ab980..f30ecd4760c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs @@ -27,38 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityScriptedTfidf +public sealed partial class SettingsSimilarityBoolean : ISettingsSimilarity { - [JsonInclude, JsonPropertyName("script")] - public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } - [JsonInclude, JsonPropertyName("type")] - public string Type => "scripted"; + public string Type => "boolean"; } -public sealed partial class SettingsSimilarityScriptedTfidfDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityBooleanDescriptor : SerializableDescriptor, IBuildableDescriptor { - internal SettingsSimilarityScriptedTfidfDescriptor(Action configure) => configure.Invoke(this); + internal SettingsSimilarityBooleanDescriptor(Action configure) => configure.Invoke(this); - public SettingsSimilarityScriptedTfidfDescriptor() : base() + public SettingsSimilarityBooleanDescriptor() : 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.WriteStringValue("boolean"); writer.WriteEndObject(); } + + SettingsSimilarityBoolean IBuildableDescriptor.Build() => new() + { + }; } \ 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 index 61870cdf198..3d28c4cd67d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityDfi +public sealed partial class SettingsSimilarityDfi : ISettingsSimilarity { [JsonInclude, JsonPropertyName("independence_measure")] public Elastic.Clients.Elasticsearch.Serverless.DFIIndependenceMeasure IndependenceMeasure { get; set; } @@ -36,7 +36,7 @@ public sealed partial class SettingsSimilarityDfi public string Type => "DFI"; } -public sealed partial class SettingsSimilarityDfiDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityDfiDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityDfiDescriptor(Action configure) => configure.Invoke(this); @@ -61,4 +61,9 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("DFI"); writer.WriteEndObject(); } + + SettingsSimilarityDfi IBuildableDescriptor.Build() => new() + { + IndependenceMeasure = IndependenceMeasureValue + }; } \ 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 index 5074f29611f..86bc6723748 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityDfr +public sealed partial class SettingsSimilarityDfr : ISettingsSimilarity { [JsonInclude, JsonPropertyName("after_effect")] public Elastic.Clients.Elasticsearch.Serverless.DFRAfterEffect AfterEffect { get; set; } @@ -40,7 +40,7 @@ public sealed partial class SettingsSimilarityDfr public string Type => "DFR"; } -public sealed partial class SettingsSimilarityDfrDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityDfrDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityDfrDescriptor(Action configure) => configure.Invoke(this); @@ -83,4 +83,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("DFR"); writer.WriteEndObject(); } + + SettingsSimilarityDfr IBuildableDescriptor.Build() => new() + { + AfterEffect = AfterEffectValue, + BasicModel = BasicModelValue, + Normalization = NormalizationValue + }; } \ 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 index d926d09622a..bc6b77fa451 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityIb +public sealed partial class SettingsSimilarityIb : ISettingsSimilarity { [JsonInclude, JsonPropertyName("distribution")] public Elastic.Clients.Elasticsearch.Serverless.IBDistribution Distribution { get; set; } @@ -40,7 +40,7 @@ public sealed partial class SettingsSimilarityIb public string Type => "IB"; } -public sealed partial class SettingsSimilarityIbDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityIbDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityIbDescriptor(Action configure) => configure.Invoke(this); @@ -83,4 +83,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("IB"); writer.WriteEndObject(); } + + SettingsSimilarityIb IBuildableDescriptor.Build() => new() + { + Distribution = DistributionValue, + Lambda = LambdaValue, + Normalization = NormalizationValue + }; } \ 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 index 0f3553d742f..b5bc8d4dd27 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs @@ -27,16 +27,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityLmd +public sealed partial class SettingsSimilarityLmd : ISettingsSimilarity { [JsonInclude, JsonPropertyName("mu")] - public int Mu { get; set; } + public double? Mu { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "LMDirichlet"; } -public sealed partial class SettingsSimilarityLmdDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityLmdDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityLmdDescriptor(Action configure) => configure.Invoke(this); @@ -44,9 +44,9 @@ public SettingsSimilarityLmdDescriptor() : base() { } - private int MuValue { get; set; } + private double? MuValue { get; set; } - public SettingsSimilarityLmdDescriptor Mu(int mu) + public SettingsSimilarityLmdDescriptor Mu(double? mu) { MuValue = mu; return Self; @@ -55,10 +55,19 @@ public SettingsSimilarityLmdDescriptor Mu(int mu) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("mu"); - writer.WriteNumberValue(MuValue); + if (MuValue.HasValue) + { + writer.WritePropertyName("mu"); + writer.WriteNumberValue(MuValue.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("LMDirichlet"); writer.WriteEndObject(); } + + SettingsSimilarityLmd IBuildableDescriptor.Build() => new() + { + Mu = MuValue + }; } \ 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 index 8e08aec839c..9399095bf55 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs @@ -27,16 +27,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement; -public sealed partial class SettingsSimilarityLmj +public sealed partial class SettingsSimilarityLmj : ISettingsSimilarity { [JsonInclude, JsonPropertyName("lambda")] - public double Lambda { get; set; } + public double? Lambda { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "LMJelinekMercer"; } -public sealed partial class SettingsSimilarityLmjDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityLmjDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityLmjDescriptor(Action configure) => configure.Invoke(this); @@ -44,9 +44,9 @@ public SettingsSimilarityLmjDescriptor() : base() { } - private double LambdaValue { get; set; } + private double? LambdaValue { get; set; } - public SettingsSimilarityLmjDescriptor Lambda(double lambda) + public SettingsSimilarityLmjDescriptor Lambda(double? lambda) { LambdaValue = lambda; return Self; @@ -55,10 +55,19 @@ public SettingsSimilarityLmjDescriptor Lambda(double lambda) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("lambda"); - writer.WriteNumberValue(LambdaValue); + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("LMJelinekMercer"); writer.WriteEndObject(); } + + SettingsSimilarityLmj IBuildableDescriptor.Build() => new() + { + Lambda = LambdaValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs new file mode 100644 index 00000000000..2d9c9bf0262 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SettingsSimilarityScripted.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 SettingsSimilarityScripted : ISettingsSimilarity +{ + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "scripted"; + + [JsonInclude, JsonPropertyName("weight_script")] + public Elastic.Clients.Elasticsearch.Serverless.Script? WeightScript { get; set; } +} + +public sealed partial class SettingsSimilarityScriptedDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SettingsSimilarityScriptedDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityScriptedDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Script? WeightScriptValue { get; set; } + + public SettingsSimilarityScriptedDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) + { + ScriptValue = script; + return Self; + } + + public SettingsSimilarityScriptedDescriptor WeightScript(Elastic.Clients.Elasticsearch.Serverless.Script? weightScript) + { + WeightScriptValue = weightScript; + 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"); + if (WeightScriptValue is not null) + { + writer.WritePropertyName("weight_script"); + JsonSerializer.Serialize(writer, WeightScriptValue, options); + } + + writer.WriteEndObject(); + } + + SettingsSimilarityScripted IBuildableDescriptor.Build() => new() + { + Script = ScriptValue, + WeightScript = WeightScriptValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRecovery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRecovery.g.cs new file mode 100644 index 00000000000..f5830874bfb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardRecovery.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 ShardRecovery +{ + [JsonInclude, JsonPropertyName("id")] + public long Id { get; init; } + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryIndexStatus Index { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryOrigin Source { get; init; } + [JsonInclude, JsonPropertyName("stage")] + public string Stage { get; init; } + [JsonInclude, JsonPropertyName("start")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryStartStatus? Start { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("stop_time")] + public DateTimeOffset? StopTime { get; init; } + [JsonInclude, JsonPropertyName("stop_time_in_millis")] + public long? StopTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("target")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RecoveryOrigin Target { 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; } + [JsonInclude, JsonPropertyName("translog")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogStatus Translog { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } + [JsonInclude, JsonPropertyName("verify_index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.VerifyIndex VerifyIndex { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs new file mode 100644 index 00000000000..1bb2d1c9baa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardSegmentRouting.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 ShardSegmentRouting +{ + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { 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 index 65d802d371b..ff095a57b5e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardStats.g.cs @@ -74,6 +74,8 @@ public sealed partial class ShardStats [JsonInclude, JsonPropertyName("shards")] [ReadOnlyIndexNameDictionaryConverter(typeof(object))] public IReadOnlyDictionary? Shards { get; init; } + [JsonInclude, JsonPropertyName("shard_stats")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardsTotalStats? ShardStats2 { get; init; } [JsonInclude, JsonPropertyName("store")] public Elastic.Clients.Elasticsearch.Serverless.StoreStats? Store { get; init; } [JsonInclude, JsonPropertyName("translog")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsSegment.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsSegment.g.cs new file mode 100644 index 00000000000..bac024e1c59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/ShardsSegment.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 ShardsSegment +{ + [JsonInclude, JsonPropertyName("num_committed_segments")] + public int NumCommittedSegments { get; init; } + [JsonInclude, JsonPropertyName("num_search_segments")] + public int NumSearchSegments { get; init; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardSegmentRouting Routing { get; init; } + [JsonInclude, JsonPropertyName("segments")] + public IReadOnlyDictionary Segments { 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 index c7bd819fec8..55a56911276 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogSettings.g.cs @@ -51,8 +51,8 @@ public SlowlogSettingsDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } public SlowlogSettingsDescriptor Level(string? level) { @@ -80,7 +80,7 @@ public SlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.Serverl return Self; } - public SlowlogSettingsDescriptor Threshold(SlowlogTresholdsDescriptor descriptor) + public SlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdsDescriptor descriptor) { ThresholdValue = null; ThresholdDescriptorAction = null; @@ -88,7 +88,7 @@ public SlowlogSettingsDescriptor Threshold(SlowlogTresholdsDescriptor descriptor return Self; } - public SlowlogSettingsDescriptor Threshold(Action configure) + public SlowlogSettingsDescriptor Threshold(Action configure) { ThresholdValue = null; ThresholdDescriptor = null; @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ThresholdDescriptorAction is not null) { writer.WritePropertyName("threshold"); - JsonSerializer.Serialize(writer, new SlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); } else if (ThresholdValue is not null) { 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 index d62b4aa5027..33bd4dddd97 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs @@ -44,11 +44,11 @@ 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.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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevels? fetch) { @@ -58,7 +58,7 @@ public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.Serverless return Self; } - public SlowlogTresholdsDescriptor Fetch(SlowlogTresholdLevelsDescriptor descriptor) + public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { FetchValue = null; FetchDescriptorAction = null; @@ -66,7 +66,7 @@ public SlowlogTresholdsDescriptor Fetch(SlowlogTresholdLevelsDescriptor descript return Self; } - public SlowlogTresholdsDescriptor Fetch(Action configure) + public SlowlogTresholdsDescriptor Fetch(Action configure) { FetchValue = null; FetchDescriptor = null; @@ -82,7 +82,7 @@ public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.Serverless return Self; } - public SlowlogTresholdsDescriptor Query(SlowlogTresholdLevelsDescriptor descriptor) + public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -90,7 +90,7 @@ public SlowlogTresholdsDescriptor Query(SlowlogTresholdLevelsDescriptor descript return Self; } - public SlowlogTresholdsDescriptor Query(Action configure) + public SlowlogTresholdsDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FetchDescriptorAction is not null) { writer.WritePropertyName("fetch"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(FetchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor(FetchDescriptorAction), options); } else if (FetchValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.SlowlogTresholdLevelsDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { 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 index 1c5cc43ef1f..53b99958ef3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/SoftDeletes.g.cs @@ -52,8 +52,8 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLeaseDescriptor RetentionLeaseDescriptor { get; set; } + private Action RetentionLeaseDescriptorAction { get; set; } /// /// Indicates whether soft deletes are enabled on the index. @@ -75,7 +75,7 @@ public SoftDeletesDescriptor RetentionLease(Elastic.Clients.Elasticsearch.Server return Self; } - public SoftDeletesDescriptor RetentionLease(RetentionLeaseDescriptor descriptor) + public SoftDeletesDescriptor RetentionLease(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLeaseDescriptor descriptor) { RetentionLeaseValue = null; RetentionLeaseDescriptorAction = null; @@ -83,7 +83,7 @@ public SoftDeletesDescriptor RetentionLease(RetentionLeaseDescriptor descriptor) return Self; } - public SoftDeletesDescriptor RetentionLease(Action configure) + public SoftDeletesDescriptor RetentionLease(Action configure) { RetentionLeaseValue = null; RetentionLeaseDescriptor = null; @@ -108,7 +108,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RetentionLeaseDescriptorAction is not null) { writer.WritePropertyName("retention_lease"); - JsonSerializer.Serialize(writer, new RetentionLeaseDescriptor(RetentionLeaseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.RetentionLeaseDescriptor(RetentionLeaseDescriptorAction), options); } else if (RetentionLeaseValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TokenDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TokenDetail.g.cs new file mode 100644 index 00000000000..060b1505a10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TokenDetail.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 TokenDetail +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection Tokens { 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 index 4b98a3f7b01..6e62e1a7c3a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/Translog.g.cs @@ -61,8 +61,8 @@ 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.IndexManagement.TranslogRetentionDescriptor RetentionDescriptor { get; set; } + private Action RetentionDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Duration? SyncIntervalValue { get; set; } /// @@ -91,7 +91,7 @@ public TranslogDescriptor Retention(Elastic.Clients.Elasticsearch.Serverless.Ind return Self; } - public TranslogDescriptor Retention(TranslogRetentionDescriptor descriptor) + public TranslogDescriptor Retention(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogRetentionDescriptor descriptor) { RetentionValue = null; RetentionDescriptorAction = null; @@ -99,7 +99,7 @@ public TranslogDescriptor Retention(TranslogRetentionDescriptor descriptor) return Self; } - public TranslogDescriptor Retention(Action configure) + public TranslogDescriptor Retention(Action configure) { RetentionValue = null; RetentionDescriptor = null; @@ -139,7 +139,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RetentionDescriptorAction is not null) { writer.WritePropertyName("retention"); - JsonSerializer.Serialize(writer, new TranslogRetentionDescriptor(RetentionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.TranslogRetentionDescriptor(RetentionDescriptorAction), options); } else if (RetentionValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogStatus.g.cs new file mode 100644 index 00000000000..bd66679ffc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/TranslogStatus.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 TranslogStatus +{ + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_on_start")] + public long TotalOnStart { 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/IndexManagement/VerifyIndex.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/VerifyIndex.g.cs new file mode 100644 index 00000000000..f70d7162de6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndexManagement/VerifyIndex.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 VerifyIndex +{ + [JsonInclude, JsonPropertyName("check_index_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CheckIndexTime { get; init; } + [JsonInclude, JsonPropertyName("check_index_time_in_millis")] + public long CheckIndexTimeInMillis { 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/IndicesOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndicesOptions.g.cs new file mode 100644 index 00000000000..fd75f1f9092 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/IndicesOptions.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.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless; + +/// +/// Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded
to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.
+///
+public sealed partial class IndicesOptions +{ + /// + /// 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`.
+ ///
+ [JsonInclude, JsonPropertyName("allow_no_indices")] + public bool? AllowNoIndices { get; set; } + + /// + /// 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`.
+ ///
+ [JsonInclude, JsonPropertyName("expand_wildcards")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.ExpandWildcard))] + public ICollection? ExpandWildcards { get; set; } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + [JsonInclude, JsonPropertyName("ignore_throttled")] + public bool? IgnoreThrottled { get; set; } + + /// + /// If true, missing or closed indices are not included in the response. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } +} + +/// +/// Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded
to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.
+///
+public sealed partial class IndicesOptionsDescriptor : SerializableDescriptor +{ + internal IndicesOptionsDescriptor(Action configure) => configure.Invoke(this); + + public IndicesOptionsDescriptor() : base() + { + } + + private bool? AllowNoIndicesValue { get; set; } + private ICollection? ExpandWildcardsValue { get; set; } + private bool? IgnoreThrottledValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + + /// + /// 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 IndicesOptionsDescriptor AllowNoIndices(bool? allowNoIndices = true) + { + AllowNoIndicesValue = allowNoIndices; + return Self; + } + + /// + /// 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 IndicesOptionsDescriptor ExpandWildcards(ICollection? expandWildcards) + { + ExpandWildcardsValue = expandWildcards; + return Self; + } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + public IndicesOptionsDescriptor IgnoreThrottled(bool? ignoreThrottled = true) + { + IgnoreThrottledValue = ignoreThrottled; + return Self; + } + + /// + /// If true, missing or closed indices are not included in the response. + /// + public IndicesOptionsDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + 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 (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); + } + + writer.WriteEndObject(); + } +} \ 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 index 239e7d48242..4e58cd26243 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AppendProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class AppendProcessor ///
[JsonInclude, JsonPropertyName("allow_duplicates")] public bool? AllowDuplicates { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,12 +46,28 @@ public sealed partial class AppendProcessor ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -57,7 +77,7 @@ public sealed partial class AppendProcessor [JsonInclude, JsonPropertyName("value")] public ICollection Value { get; set; } - public static implicit operator Processor(AppendProcessor appendProcessor) => Ingest.Processor.Append(appendProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(AppendProcessor appendProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Append(appendProcessor); } public sealed partial class AppendProcessorDescriptor : SerializableDescriptor> @@ -74,9 +94,9 @@ public AppendProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private ICollection ValueValue { get; set; } @@ -89,6 +109,9 @@ public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicate return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AppendProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -113,18 +136,36 @@ public AppendProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public AppendProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public AppendProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -134,7 +175,7 @@ public AppendProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public AppendProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -143,7 +184,7 @@ public AppendProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public AppendProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -152,7 +193,7 @@ public AppendProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public AppendProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -161,6 +202,9 @@ public AppendProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public AppendProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -216,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -225,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -262,9 +306,9 @@ public AppendProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private ICollection ValueValue { get; set; } @@ -277,6 +321,9 @@ public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicates = true) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AppendProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -310,18 +357,27 @@ public AppendProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public AppendProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public AppendProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -331,7 +387,7 @@ public AppendProcessorDescriptor OnFailure(ICollection configure) + public AppendProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -349,7 +405,7 @@ public AppendProcessorDescriptor OnFailure(Action configure return Self; } - public AppendProcessorDescriptor OnFailure(params Action[] configure) + public AppendProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -358,6 +414,9 @@ public AppendProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AppendProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -413,7 +472,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -422,7 +481,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 9a9f0bbdf17..146fe7e6284 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/AttachmentProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class AttachmentProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class AttachmentProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -59,6 +70,10 @@ public sealed partial class AttachmentProcessor /// [JsonInclude, JsonPropertyName("indexed_chars_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsField { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -68,11 +83,21 @@ public sealed partial class AttachmentProcessor [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + /// + /// If true, the binary field will be removed from the document + /// + [JsonInclude, JsonPropertyName("remove_binary")] + public bool? RemoveBinary { 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; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +107,7 @@ public sealed partial class AttachmentProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(AttachmentProcessor attachmentProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Attachment(attachmentProcessor); } public sealed partial class AttachmentProcessorDescriptor : SerializableDescriptor> @@ -101,14 +126,18 @@ public AttachmentProcessorDescriptor() : base() private long? IndexedCharsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsFieldValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } + private bool? RemoveBinaryValue { get; set; } private string? ResourceNameValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AttachmentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -133,12 +162,27 @@ public AttachmentProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public AttachmentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -181,6 +225,18 @@ public AttachmentProcessorDescriptor IndexedCharsField(Expres 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; + } + + /// + /// Handle failures for the processor. + /// public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -190,7 +246,7 @@ public AttachmentProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public AttachmentProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -199,7 +255,7 @@ public AttachmentProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public AttachmentProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -208,7 +264,7 @@ public AttachmentProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public AttachmentProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -226,6 +282,15 @@ public AttachmentProcessorDescriptor Properties(ICollection? return Self; } + /// + /// If true, the binary field will be removed from the document + /// + public AttachmentProcessorDescriptor RemoveBinary(bool? removeBinary = true) + { + RemoveBinaryValue = removeBinary; + 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.
///
@@ -235,6 +300,9 @@ public AttachmentProcessorDescriptor ResourceName(string? resourceNam return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AttachmentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -259,6 +327,15 @@ public AttachmentProcessorDescriptor TargetField(Expression + /// 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(); @@ -311,7 +388,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -320,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -337,6 +414,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (RemoveBinaryValue.HasValue) + { + writer.WritePropertyName("remove_binary"); + writer.WriteBooleanValue(RemoveBinaryValue.Value); + } + if (!string.IsNullOrEmpty(ResourceNameValue)) { writer.WritePropertyName("resource_name"); @@ -375,14 +458,18 @@ public AttachmentProcessorDescriptor() : base() private long? IndexedCharsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? IndexedCharsFieldValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } + private bool? RemoveBinaryValue { get; set; } private string? ResourceNameValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AttachmentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -416,12 +503,18 @@ public AttachmentProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public AttachmentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -473,6 +566,9 @@ public AttachmentProcessorDescriptor IndexedCharsField(Expression + /// Handle failures for the processor. + /// public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -482,7 +578,7 @@ public AttachmentProcessorDescriptor OnFailure(ICollection configure) + public AttachmentProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -500,7 +596,7 @@ public AttachmentProcessorDescriptor OnFailure(Action confi return Self; } - public AttachmentProcessorDescriptor OnFailure(params Action[] configure) + public AttachmentProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -518,6 +614,15 @@ public AttachmentProcessorDescriptor Properties(ICollection? properties) return Self; } + /// + /// If true, the binary field will be removed from the document + /// + public AttachmentProcessorDescriptor RemoveBinary(bool? removeBinary = true) + { + RemoveBinaryValue = removeBinary; + 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.
///
@@ -527,6 +632,9 @@ public AttachmentProcessorDescriptor ResourceName(string? resourceName) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AttachmentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -612,7 +720,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -621,7 +729,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -638,6 +746,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (RemoveBinaryValue.HasValue) + { + writer.WritePropertyName("remove_binary"); + writer.WriteBooleanValue(RemoveBinaryValue.Value); + } + if (!string.IsNullOrEmpty(ResourceNameValue)) { writer.WritePropertyName("resource_name"); 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 index b78754ca17b..71186a3998f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/BytesProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class BytesProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class BytesProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class BytesProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class BytesProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(BytesProcessor bytesProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Bytes(bytesProcessor); } public sealed partial class BytesProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public BytesProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public BytesProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public BytesProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public BytesProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public BytesProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public BytesProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public BytesProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public BytesProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public BytesProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public BytesProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public BytesProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public BytesProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public BytesProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public BytesProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public BytesProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public BytesProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public BytesProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public BytesProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public BytesProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public BytesProcessorDescriptor OnFailure(ICollection configure) + public BytesProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public BytesProcessorDescriptor OnFailure(Action configure) return Self; } - public BytesProcessorDescriptor OnFailure(params Action[] configure) + public BytesProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public BytesProcessorDescriptor OnFailure(params Action[] c return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public BytesProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 85cc0bccd2b..edc6c3e0520 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CircleProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class CircleProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("shape_type")] public Elastic.Clients.Elasticsearch.Serverless.Ingest.ShapeType ShapeType { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class CircleProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(CircleProcessor circleProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Circle(circleProcessor); } public sealed partial class CircleProcessorDescriptor : SerializableDescriptor> @@ -88,13 +107,16 @@ public CircleProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CircleProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -128,12 +150,27 @@ public CircleProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public CircleProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -149,6 +186,9 @@ public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public CircleProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -158,7 +198,7 @@ public CircleProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public CircleProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -167,7 +207,7 @@ public CircleProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public CircleProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -176,7 +216,7 @@ public CircleProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public CircleProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsea return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CircleProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public CircleProcessorDescriptor TargetField(Expression + /// 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(); @@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -269,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -313,13 +365,16 @@ public CircleProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CircleProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -362,12 +417,18 @@ public CircleProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public CircleProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -383,6 +444,9 @@ public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public CircleProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -392,7 +456,7 @@ public CircleProcessorDescriptor OnFailure(ICollection configure) + public CircleProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -410,7 +474,7 @@ public CircleProcessorDescriptor OnFailure(Action configure return Self; } - public CircleProcessorDescriptor OnFailure(params Action[] configure) + public CircleProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -428,6 +492,9 @@ public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsearch.Serverl return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CircleProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -503,7 +570,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -512,7 +579,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 898173ee8c8..c9dbebe2bd3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ConvertProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class ConvertProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class ConvertProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class ConvertProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -64,7 +83,7 @@ public sealed partial class ConvertProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(ConvertProcessor convertProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Convert(convertProcessor); } public sealed partial class ConvertProcessorDescriptor : SerializableDescriptor> @@ -81,13 +100,16 @@ public ConvertProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ConvertProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -112,12 +134,27 @@ public ConvertProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ConvertProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -133,6 +170,9 @@ public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -142,7 +182,7 @@ public ConvertProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public ConvertProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -151,7 +191,7 @@ public ConvertProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public ConvertProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -160,7 +200,7 @@ public ConvertProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public ConvertProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -169,6 +209,9 @@ public ConvertProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public ConvertProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -193,6 +236,15 @@ public ConvertProcessorDescriptor TargetField(Expression + /// 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. /// @@ -242,7 +294,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -251,7 +303,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -294,13 +346,16 @@ public ConvertProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ConvertProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -334,12 +389,18 @@ public ConvertProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public ConvertProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -355,6 +416,9 @@ public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -364,7 +428,7 @@ public ConvertProcessorDescriptor OnFailure(ICollection configure) + public ConvertProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -382,7 +446,7 @@ public ConvertProcessorDescriptor OnFailure(Action configur return Self; } - public ConvertProcessorDescriptor OnFailure(params Action[] configure) + public ConvertProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -391,6 +455,9 @@ public ConvertProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public ConvertProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -473,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -482,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index b423088b643..8ddcf0ab1a1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/CsvProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class CsvProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -67,6 +82,10 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("separator")] public string? Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +101,7 @@ public sealed partial class CsvProcessor [JsonInclude, JsonPropertyName("trim")] public bool? Trim { get; set; } - public static implicit operator Processor(CsvProcessor csvProcessor) => Ingest.Processor.Csv(csvProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(CsvProcessor csvProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Csv(csvProcessor); } public sealed partial class CsvProcessorDescriptor : SerializableDescriptor> @@ -100,15 +119,18 @@ public CsvProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CsvProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -142,12 +164,27 @@ public CsvProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public CsvProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -163,6 +200,9 @@ public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tru return Self; } + /// + /// Handle failures for the processor. + /// public CsvProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -172,7 +212,7 @@ public CsvProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public CsvProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -181,7 +221,7 @@ public CsvProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public CsvProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -190,7 +230,7 @@ public CsvProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public CsvProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -217,6 +257,9 @@ public CsvProcessorDescriptor Separator(string? separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CsvProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -287,7 +330,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -296,7 +339,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -352,15 +395,18 @@ public CsvProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CsvProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -403,12 +449,18 @@ public CsvProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public CsvProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -424,6 +476,9 @@ public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public CsvProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -433,7 +488,7 @@ public CsvProcessorDescriptor OnFailure(ICollection configure) + public CsvProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -451,7 +506,7 @@ public CsvProcessorDescriptor OnFailure(Action configure) return Self; } - public CsvProcessorDescriptor OnFailure(params Action[] configure) + public CsvProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -478,6 +533,9 @@ public CsvProcessorDescriptor Separator(string? separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CsvProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -548,7 +606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -557,7 +615,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 590a07e6d29..e2c04753d09 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs @@ -40,6 +40,10 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("date_rounding")] public string DateRounding { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -48,8 +52,16 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -70,8 +82,16 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -81,7 +101,7 @@ public sealed partial class DateIndexNameProcessor [JsonInclude, JsonPropertyName("timezone")] public string? Timezone { get; set; } - public static implicit operator Processor(DateIndexNameProcessor dateIndexNameProcessor) => Ingest.Processor.DateIndexName(dateIndexNameProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(DateIndexNameProcessor dateIndexNameProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.DateIndexName(dateIndexNameProcessor); } public sealed partial class DateIndexNameProcessorDescriptor : SerializableDescriptor> @@ -102,9 +122,9 @@ public DateIndexNameProcessorDescriptor() : base() private string? IndexNamePrefixValue { get; set; } private string? LocaleValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private string? TimezoneValue { get; set; } @@ -126,6 +146,9 @@ public DateIndexNameProcessorDescriptor DateRounding(string dateRound return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateIndexNameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -150,12 +173,27 @@ public DateIndexNameProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public DateIndexNameProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -189,6 +227,9 @@ public DateIndexNameProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -198,7 +239,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DateIndexNameProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -207,7 +248,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ProcessorDescriptor return Self; } - public DateIndexNameProcessorDescriptor OnFailure(Action> configure) + public DateIndexNameProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -216,7 +257,7 @@ public DateIndexNameProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DateIndexNameProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -225,6 +266,9 @@ public DateIndexNameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateIndexNameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -296,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -305,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -350,9 +394,9 @@ public DateIndexNameProcessorDescriptor() : base() private string? IndexNamePrefixValue { get; set; } private string? LocaleValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private string? TimezoneValue { get; set; } @@ -374,6 +418,9 @@ public DateIndexNameProcessorDescriptor DateRounding(string dateRounding) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateIndexNameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -407,12 +454,18 @@ public DateIndexNameProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DateIndexNameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -446,6 +499,9 @@ public DateIndexNameProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -455,7 +511,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ICollection configure) + public DateIndexNameProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -473,7 +529,7 @@ public DateIndexNameProcessorDescriptor OnFailure(Action co return Self; } - public DateIndexNameProcessorDescriptor OnFailure(params Action[] configure) + public DateIndexNameProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -482,6 +538,9 @@ public DateIndexNameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateIndexNameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -553,7 +612,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -562,7 +621,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 8b45d759fd0..26fbd7373ed 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DateProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class DateProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class DateProcessor /// [JsonInclude, JsonPropertyName("formats")] public ICollection Formats { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,8 +64,16 @@ public sealed partial class DateProcessor /// [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class DateProcessor [JsonInclude, JsonPropertyName("timezone")] public string? Timezone { get; set; } - public static implicit operator Processor(DateProcessor dateProcessor) => Ingest.Processor.Date(dateProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(DateProcessor dateProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Date(dateProcessor); } public sealed partial class DateProcessorDescriptor : SerializableDescriptor> @@ -88,13 +107,16 @@ public DateProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? LocaleValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,6 +141,15 @@ public DateProcessorDescriptor Field(Expression + /// 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.
///
@@ -128,12 +159,18 @@ public DateProcessorDescriptor Formats(ICollection formats) return Self; } - public DateProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DateProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -149,6 +186,9 @@ public DateProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -158,7 +198,7 @@ public DateProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -167,7 +207,7 @@ public DateProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DateProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -176,7 +216,7 @@ public DateProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DateProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -185,6 +225,9 @@ public DateProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -209,6 +252,15 @@ public DateProcessorDescriptor TargetField(Expression + /// 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.
///
@@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -269,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -317,13 +369,16 @@ public DateProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? LocaleValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -366,12 +421,18 @@ public DateProcessorDescriptor Formats(ICollection formats) return Self; } - public DateProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DateProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -387,6 +448,9 @@ public DateProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -396,7 +460,7 @@ public DateProcessorDescriptor OnFailure(ICollection configure) + public DateProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -414,7 +478,7 @@ public DateProcessorDescriptor OnFailure(Action configure) return Self; } - public DateProcessorDescriptor OnFailure(params Action[] configure) + public DateProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -423,6 +487,9 @@ public DateProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DateProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -507,7 +574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -516,7 +583,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 2278a6b1264..de18b36c388 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DissectProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("append_separator")] public string? AppendSeparator { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,8 +46,16 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -52,6 +64,10 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -60,10 +76,14 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("pattern")] public string Pattern { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DissectProcessor dissectProcessor) => Ingest.Processor.Dissect(dissectProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(DissectProcessor dissectProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Dissect(dissectProcessor); } public sealed partial class DissectProcessorDescriptor : SerializableDescriptor> @@ -81,9 +101,9 @@ public DissectProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string? TagValue { get; set; } @@ -96,6 +116,9 @@ public DissectProcessorDescriptor AppendSeparator(string? appendSepar return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DissectProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -120,12 +143,27 @@ public DissectProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public DissectProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -141,6 +179,9 @@ public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public DissectProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -150,7 +191,7 @@ public DissectProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DissectProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -159,7 +200,7 @@ public DissectProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DissectProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -168,7 +209,7 @@ public DissectProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DissectProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -186,6 +227,9 @@ public DissectProcessorDescriptor Pattern(string pattern) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DissectProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -238,7 +282,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -247,7 +291,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -285,9 +329,9 @@ public DissectProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string? TagValue { get; set; } @@ -300,6 +344,9 @@ public DissectProcessorDescriptor AppendSeparator(string? appendSeparator) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DissectProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -333,12 +380,18 @@ public DissectProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DissectProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -354,6 +407,9 @@ public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public DissectProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -363,7 +419,7 @@ public DissectProcessorDescriptor OnFailure(ICollection configure) + public DissectProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -381,7 +437,7 @@ public DissectProcessorDescriptor OnFailure(Action configur return Self; } - public DissectProcessorDescriptor OnFailure(params Action[] configure) + public DissectProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -399,6 +455,9 @@ public DissectProcessorDescriptor Pattern(string pattern) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DissectProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -451,7 +510,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -460,7 +519,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index c17f896dbf4..1360d6e2838 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DocumentSimulation.g.cs @@ -89,12 +89,12 @@ public override DocumentSimulation Read(ref Utf8JsonReader reader, Type typeToCo } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } - return new DocumentSimulation { Id = id, Index = index, Ingest = ingest, Routing = routing, Source = source, Version = version, VersionType = versionType, Metadata = additionalProperties }; + return new DocumentSimulation { Id = id, Index = index, Ingest = ingest, Metadata = additionalProperties, Routing = routing, Source = source, Version = version, VersionType = versionType }; } public override void Write(Utf8JsonWriter writer, DocumentSimulation value, JsonSerializerOptions options) @@ -103,10 +103,10 @@ public override void Write(Utf8JsonWriter writer, DocumentSimulation value, Json } } -[JsonConverter(typeof(DocumentSimulationConverter))] /// /// The simulated document, with optional metadata. /// +[JsonConverter(typeof(DocumentSimulationConverter))] public sealed partial class DocumentSimulation { /// @@ -120,6 +120,11 @@ public sealed partial class DocumentSimulation public string Index { get; init; } public Elastic.Clients.Elasticsearch.Serverless.Ingest.IngestInfo Ingest { get; init; } + /// + /// Additional metadata + /// + public IReadOnlyDictionary Metadata { get; init; } + /// /// Value used to send the document to a specific primary shard. /// @@ -129,8 +134,6 @@ public sealed partial class DocumentSimulation /// 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 index ec7a6b1d997..ff40871399b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DotExpanderProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class DotExpanderProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class DotExpanderProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,10 +64,14 @@ public sealed partial class DotExpanderProcessor /// [JsonInclude, JsonPropertyName("path")] public string? Path { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DotExpanderProcessor dotExpanderProcessor) => Ingest.Processor.DotExpander(dotExpanderProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(DotExpanderProcessor dotExpanderProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.DotExpander(dotExpanderProcessor); } public sealed partial class DotExpanderProcessorDescriptor : SerializableDescriptor> @@ -68,12 +87,15 @@ public DotExpanderProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? PathValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DotExpanderProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -98,18 +120,36 @@ public DotExpanderProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public DotExpanderProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +159,7 @@ public DotExpanderProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DotExpanderProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +168,7 @@ public DotExpanderProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DotExpanderProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public DotExpanderProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DotExpanderProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,6 +195,9 @@ public DotExpanderProcessorDescriptor Path(string? path) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DotExpanderProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -195,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -204,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -244,12 +287,15 @@ public DotExpanderProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? PathValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DotExpanderProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -283,18 +329,27 @@ public DotExpanderProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DotExpanderProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -304,7 +359,7 @@ public DotExpanderProcessorDescriptor OnFailure(ICollection configure) + public DotExpanderProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -322,7 +377,7 @@ public DotExpanderProcessorDescriptor OnFailure(Action conf return Self; } - public DotExpanderProcessorDescriptor OnFailure(params Action[] configure) + public DotExpanderProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,6 +395,9 @@ public DotExpanderProcessorDescriptor Path(string? path) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DotExpanderProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -380,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -389,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 54a8b26b901..25277b1d45f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/DropProcessor.g.cs @@ -29,18 +29,37 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class DropProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DropProcessor dropProcessor) => Ingest.Processor.Drop(dropProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(DropProcessor dropProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Drop(dropProcessor); } public sealed partial class DropProcessorDescriptor : SerializableDescriptor> @@ -55,29 +74,41 @@ public DropProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DropProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public DropProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DropProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DropProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -87,7 +118,7 @@ public DropProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DropProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -96,7 +127,7 @@ public DropProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DropProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -105,7 +136,7 @@ public DropProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DropProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -114,6 +145,9 @@ public DropProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DropProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -152,7 +186,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -161,7 +195,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -194,29 +228,41 @@ public DropProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DropProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public DropProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DropProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DropProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -226,7 +272,7 @@ public DropProcessorDescriptor OnFailure(ICollection configure) + public DropProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -244,7 +290,7 @@ public DropProcessorDescriptor OnFailure(Action configure) return Self; } - public DropProcessorDescriptor OnFailure(params Action[] configure) + public DropProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -253,6 +299,9 @@ public DropProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DropProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -291,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -300,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 8680169880a..6cb63951c05 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/EnrichProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class EnrichProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("max_matches")] public int? MaxMatches { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -73,6 +88,10 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("shape_relation")] public Elastic.Clients.Elasticsearch.Serverless.GeoShapeRelation? ShapeRelation { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +101,7 @@ public sealed partial class EnrichProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(EnrichProcessor enrichProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Enrich(enrichProcessor); } public sealed partial class EnrichProcessorDescriptor : SerializableDescriptor> @@ -100,15 +119,18 @@ public EnrichProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private int? MaxMatchesValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public EnrichProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -133,12 +155,27 @@ public EnrichProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public EnrichProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -163,6 +200,9 @@ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) return Self; } + /// + /// Handle failures for the processor. + /// public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -172,7 +212,7 @@ public EnrichProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public EnrichProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -181,7 +221,7 @@ public EnrichProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public EnrichProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -190,7 +230,7 @@ public EnrichProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public EnrichProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -202,9 +242,9 @@ public EnrichProcessorDescriptor OnFailure(params Action /// 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) + public EnrichProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } @@ -226,6 +266,9 @@ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasti return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public EnrichProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -250,6 +293,15 @@ public EnrichProcessorDescriptor TargetField(Expression + /// 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(); @@ -296,7 +348,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -305,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -357,15 +409,18 @@ public EnrichProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private int? MaxMatchesValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public EnrichProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -399,12 +454,18 @@ public EnrichProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public EnrichProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -429,6 +490,9 @@ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) return Self; } + /// + /// Handle failures for the processor. + /// public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -438,7 +502,7 @@ public EnrichProcessorDescriptor OnFailure(ICollection configure) + public EnrichProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -456,7 +520,7 @@ public EnrichProcessorDescriptor OnFailure(Action configure return Self; } - public EnrichProcessorDescriptor OnFailure(params Action[] configure) + public EnrichProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -468,9 +532,9 @@ public EnrichProcessorDescriptor OnFailure(params Action[] /// /// 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) + public EnrichProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } @@ -492,6 +556,9 @@ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasticsearch.Ser return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public EnrichProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -571,7 +638,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -580,7 +647,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 753e3e9234a..02d73e67073 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/FailProcessor.g.cs @@ -29,10 +29,21 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class FailProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -41,12 +52,20 @@ public sealed partial class FailProcessor /// [JsonInclude, JsonPropertyName("message")] public string Message { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(FailProcessor failProcessor) => Ingest.Processor.Fail(failProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(FailProcessor failProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Fail(failProcessor); } public sealed partial class FailProcessorDescriptor : SerializableDescriptor> @@ -62,23 +81,32 @@ public FailProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string MessageValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public FailProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public FailProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public FailProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -94,6 +122,9 @@ public FailProcessorDescriptor Message(string message) return Self; } + /// + /// Handle failures for the processor. + /// public FailProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -103,7 +134,7 @@ public FailProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public FailProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -112,7 +143,7 @@ public FailProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public FailProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -121,7 +152,7 @@ public FailProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public FailProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -130,6 +161,9 @@ public FailProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public FailProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -170,7 +204,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -179,7 +213,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -213,23 +247,32 @@ public FailProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string MessageValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public FailProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public FailProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public FailProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -245,6 +288,9 @@ public FailProcessorDescriptor Message(string message) return Self; } + /// + /// Handle failures for the processor. + /// public FailProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -254,7 +300,7 @@ public FailProcessorDescriptor OnFailure(ICollection configure) + public FailProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -272,7 +318,7 @@ public FailProcessorDescriptor OnFailure(Action configure) return Self; } - public FailProcessorDescriptor OnFailure(params Action[] configure) + public FailProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -281,6 +327,9 @@ public FailProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public FailProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -321,7 +370,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -330,7 +379,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index ab2477b9fdd..0dce10f89f1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ForeachProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class ForeachProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -55,10 +70,14 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("processor")] public Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor Processor { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(ForeachProcessor foreachProcessor) => Ingest.Processor.Foreach(foreachProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(ForeachProcessor foreachProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Foreach(foreachProcessor); } public sealed partial class ForeachProcessorDescriptor : SerializableDescriptor> @@ -75,14 +94,17 @@ public ForeachProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action> ProcessorDescriptorAction { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ForeachProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -107,12 +129,27 @@ public ForeachProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ForeachProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -128,6 +165,9 @@ public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public ForeachProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -146,7 +186,7 @@ public ForeachProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public ForeachProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,7 +195,7 @@ public ForeachProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public ForeachProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -175,7 +215,7 @@ public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticse return Self; } - public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { ProcessorValue = null; ProcessorDescriptorAction = null; @@ -183,7 +223,7 @@ public ForeachProcessorDescriptor Processor(ProcessorDescriptor Processor(Action> configure) + public ForeachProcessorDescriptor Processor(Action> configure) { ProcessorValue = null; ProcessorDescriptor = null; @@ -191,6 +231,9 @@ public ForeachProcessorDescriptor Processor(Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public ForeachProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -237,7 +280,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -246,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -265,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ProcessorDescriptorAction is not null) { writer.WritePropertyName("processor"); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorDescriptorAction), options); } else { @@ -297,14 +340,17 @@ public ForeachProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action ProcessorDescriptorAction { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ForeachProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -338,12 +384,18 @@ public ForeachProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public ForeachProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -359,6 +411,9 @@ public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -368,7 +423,7 @@ public ForeachProcessorDescriptor OnFailure(ICollection configure) + public ForeachProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -386,7 +441,7 @@ public ForeachProcessorDescriptor OnFailure(Action configur return Self; } - public ForeachProcessorDescriptor OnFailure(params Action[] configure) + public ForeachProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -406,7 +461,7 @@ public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Server return Self; } - public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { ProcessorValue = null; ProcessorDescriptorAction = null; @@ -414,7 +469,7 @@ public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) return Self; } - public ForeachProcessorDescriptor Processor(Action configure) + public ForeachProcessorDescriptor Processor(Action configure) { ProcessorValue = null; ProcessorDescriptor = null; @@ -422,6 +477,9 @@ public ForeachProcessorDescriptor Processor(Action configur return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public ForeachProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -468,7 +526,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -477,7 +535,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -496,7 +554,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ProcessorDescriptorAction is not null) { writer.WritePropertyName("processor"); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorDescriptorAction), options); } else { 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 index 00a7e6099fa..5dc6651fc97 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GeoIpProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("database_file")] public string? DatabaseFile { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -48,8 +52,16 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("first_only")] public bool? FirstOnly { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,6 +70,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -66,6 +82,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -75,7 +95,7 @@ public sealed partial class GeoIpProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(GeoIpProcessor geoIpProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Geoip(geoIpProcessor); } public sealed partial class GeoIpProcessorDescriptor : SerializableDescriptor> @@ -94,9 +114,9 @@ public GeoIpProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } @@ -110,6 +130,9 @@ public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GeoIpProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -134,6 +157,15 @@ public GeoIpProcessorDescriptor Field(Expression + /// 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. /// @@ -143,12 +175,18 @@ public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) return Self; } - public GeoIpProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public GeoIpProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -164,6 +202,9 @@ public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -173,7 +214,7 @@ public GeoIpProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GeoIpProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -182,7 +223,7 @@ public GeoIpProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GeoIpProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -191,7 +232,7 @@ public GeoIpProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GeoIpProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -209,6 +250,9 @@ public GeoIpProcessorDescriptor Properties(ICollection? prope return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GeoIpProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -233,6 +277,15 @@ public GeoIpProcessorDescriptor TargetField(Expression + /// 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(); @@ -285,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -294,7 +347,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -343,9 +396,9 @@ public GeoIpProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } @@ -359,6 +412,9 @@ public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GeoIpProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -401,12 +457,18 @@ public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) return Self; } - public GeoIpProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public GeoIpProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -422,6 +484,9 @@ public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -431,7 +496,7 @@ public GeoIpProcessorDescriptor OnFailure(ICollection configure) + public GeoIpProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -449,7 +514,7 @@ public GeoIpProcessorDescriptor OnFailure(Action configure) return Self; } - public GeoIpProcessorDescriptor OnFailure(params Action[] configure) + public GeoIpProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -467,6 +532,9 @@ public GeoIpProcessorDescriptor Properties(ICollection? properties) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GeoIpProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -552,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -561,7 +629,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 71f67142872..e274a9369bb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class GrokProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("patterns")] public ICollection Patterns { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class GrokProcessor [JsonInclude, JsonPropertyName("trace_match")] public bool? TraceMatch { get; set; } - public static implicit operator Processor(GrokProcessor grokProcessor) => Ingest.Processor.Grok(grokProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(GrokProcessor grokProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Grok(grokProcessor); } public sealed partial class GrokProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public GrokProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private IDictionary? PatternDefinitionsValue { get; set; } private ICollection PatternsValue { get; set; } private string? TagValue { get; set; } private bool? TraceMatchValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GrokProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public GrokProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public GrokProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public GrokProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public GrokProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GrokProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public GrokProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GrokProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public GrokProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GrokProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public GrokProcessorDescriptor Patterns(ICollection patterns) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GrokProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -249,7 +292,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -258,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -307,14 +350,17 @@ public GrokProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private IDictionary? PatternDefinitionsValue { get; set; } private ICollection PatternsValue { get; set; } private string? TagValue { get; set; } private bool? TraceMatchValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GrokProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -348,12 +394,18 @@ public GrokProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public GrokProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -369,6 +421,9 @@ public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GrokProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -378,7 +433,7 @@ public GrokProcessorDescriptor OnFailure(ICollection configure) + public GrokProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -396,7 +451,7 @@ public GrokProcessorDescriptor OnFailure(Action configure) return Self; } - public GrokProcessorDescriptor OnFailure(params Action[] configure) + public GrokProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -423,6 +478,9 @@ public GrokProcessorDescriptor Patterns(ICollection patterns) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GrokProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -478,7 +536,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -487,7 +545,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 9b91faa96e1..7c54184cf34 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/GsubProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class GsubProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("replacement")] public string Replacement { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class GsubProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(GsubProcessor gsubProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Gsub(gsubProcessor); } public sealed partial class GsubProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public GsubProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GsubProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public GsubProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public GsubProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public GsubProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public GsubProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GsubProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public GsubProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GsubProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public GsubProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GsubProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public GsubProcessorDescriptor Replacement(string replacement) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GsubProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public GsubProcessorDescriptor TargetField(Expression + /// 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(); @@ -258,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -267,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -312,14 +364,17 @@ public GsubProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GsubProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -353,12 +408,18 @@ public GsubProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public GsubProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -374,6 +435,9 @@ public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GsubProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -383,7 +447,7 @@ public GsubProcessorDescriptor OnFailure(ICollection configure) + public GsubProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -401,7 +465,7 @@ public GsubProcessorDescriptor OnFailure(Action configure) return Self; } - public GsubProcessorDescriptor OnFailure(params Action[] configure) + public GsubProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -428,6 +492,9 @@ public GsubProcessorDescriptor Replacement(string replacement) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GsubProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -501,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -510,7 +577,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 429410e7871..92271505e34 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfig.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -47,6 +48,18 @@ internal InferenceConfig(string variantName, object variant) 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class InferenceConfigConverter : JsonConverter @@ -58,35 +71,48 @@ public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "classification") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new InferenceConfig(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "regression") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new InferenceConfig(propertyName, variant); + if (propertyName == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfig' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new InferenceConfig(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -135,29 +161,27 @@ private InferenceConfigDescriptor Set(object variant, string variantN 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action> configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -193,31 +217,27 @@ private InferenceConfigDescriptor Set(object variant, string variantName) 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index d7238fa52fd..4b0305888ea 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigClassification.g.cs @@ -59,7 +59,7 @@ public sealed partial class InferenceConfigClassification [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig(InferenceConfigClassification inferenceConfigClassification) => Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig.Classification(inferenceConfigClassification); } public sealed partial class InferenceConfigClassificationDescriptor : SerializableDescriptor> @@ -121,6 +121,15 @@ public InferenceConfigClassificationDescriptor ResultsField(E 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. /// @@ -139,6 +148,15 @@ public InferenceConfigClassificationDescriptor 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(); 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 index 5cb21f41210..1ab92895b11 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceConfigRegression.g.cs @@ -41,7 +41,7 @@ public sealed partial class InferenceConfigRegression [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig(InferenceConfigRegression inferenceConfigRegression) => Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig.Regression(inferenceConfigRegression); } public sealed partial class InferenceConfigRegressionDescriptor : SerializableDescriptor> @@ -82,6 +82,15 @@ public InferenceConfigRegressionDescriptor ResultsField(Expre 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(); 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 index dbdb64d8ac9..5e36e1916e9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/InferenceProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class InferenceProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class InferenceProcessor /// [JsonInclude, JsonPropertyName("field_map")] public IDictionary? FieldMap { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,8 +64,16 @@ public sealed partial class InferenceProcessor /// [JsonInclude, JsonPropertyName("model_id")] public Elastic.Clients.Elasticsearch.Serverless.Id ModelId { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -64,7 +83,7 @@ public sealed partial class InferenceProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(InferenceProcessor inferenceProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Inference(inferenceProcessor); } public sealed partial class InferenceProcessorDescriptor : SerializableDescriptor> @@ -80,16 +99,19 @@ public InferenceProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id ModelIdValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public InferenceProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,18 @@ public InferenceProcessorDescriptor FieldMap(Func If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public InferenceProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -128,7 +156,7 @@ public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.E return Self; } - public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -136,7 +164,7 @@ public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDe return Self; } - public InferenceProcessorDescriptor InferenceConfig(Action> configure) + public InferenceProcessorDescriptor InferenceConfig(Action> configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -153,6 +181,9 @@ public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticse return Self; } + /// + /// Handle failures for the processor. + /// public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -162,7 +193,7 @@ public InferenceProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public InferenceProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -171,7 +202,7 @@ public InferenceProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public InferenceProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -180,7 +211,7 @@ public InferenceProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public InferenceProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -189,6 +220,9 @@ public InferenceProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public InferenceProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -213,6 +247,15 @@ public InferenceProcessorDescriptor TargetField(Expression + /// 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(); @@ -248,7 +291,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -269,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -278,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -318,16 +361,19 @@ public InferenceProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id ModelIdValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public InferenceProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -343,12 +389,18 @@ public InferenceProcessorDescriptor FieldMap(Func + /// Conditionally execute the processor. + /// + public InferenceProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -366,7 +418,7 @@ public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearc return Self; } - public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -374,7 +426,7 @@ public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor de return Self; } - public InferenceProcessorDescriptor InferenceConfig(Action configure) + public InferenceProcessorDescriptor InferenceConfig(Action configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -391,6 +443,9 @@ public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticsearch.Server return Self; } + /// + /// Handle failures for the processor. + /// public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -400,7 +455,7 @@ public InferenceProcessorDescriptor OnFailure(ICollection configure) + public InferenceProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -418,7 +473,7 @@ public InferenceProcessorDescriptor OnFailure(Action config return Self; } - public InferenceProcessorDescriptor OnFailure(params Action[] configure) + public InferenceProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -427,6 +482,9 @@ public InferenceProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public InferenceProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -495,7 +553,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -516,7 +574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -525,7 +583,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 1be59429f58..760b7d655cf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JoinProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class JoinProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class JoinProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,6 +64,10 @@ public sealed partial class JoinProcessor /// [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class JoinProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(JoinProcessor joinProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Join(joinProcessor); } public sealed partial class JoinProcessorDescriptor : SerializableDescriptor> @@ -74,13 +93,16 @@ public JoinProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JoinProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,18 +127,36 @@ public JoinProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public JoinProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JoinProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -126,7 +166,7 @@ public JoinProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public JoinProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -135,7 +175,7 @@ public JoinProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public JoinProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -144,7 +184,7 @@ public JoinProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public JoinProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public JoinProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JoinProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public JoinProcessorDescriptor TargetField(Expression + /// 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(); @@ -220,7 +272,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -229,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -271,13 +323,16 @@ public JoinProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JoinProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -311,18 +366,27 @@ public JoinProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public JoinProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JoinProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -332,7 +396,7 @@ public JoinProcessorDescriptor OnFailure(ICollection configure) + public JoinProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -350,7 +414,7 @@ public JoinProcessorDescriptor OnFailure(Action configure) return Self; } - public JoinProcessorDescriptor OnFailure(params Action[] configure) + public JoinProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -368,6 +432,9 @@ public JoinProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JoinProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -435,7 +502,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -444,7 +511,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 60c4a58048a..b18517a1e0b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/JsonProcessor.g.cs @@ -46,6 +46,10 @@ public sealed partial class JsonProcessor /// [JsonInclude, JsonPropertyName("allow_duplicate_keys")] public bool? AllowDuplicateKeys { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -54,12 +58,28 @@ public sealed partial class JsonProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -69,7 +89,7 @@ public sealed partial class JsonProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(JsonProcessor jsonProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Json(jsonProcessor); } public sealed partial class JsonProcessorDescriptor : SerializableDescriptor> @@ -88,9 +108,9 @@ public JsonProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } @@ -121,6 +141,9 @@ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicat return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JsonProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -145,18 +168,36 @@ public JsonProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public JsonProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JsonProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -166,7 +207,7 @@ public JsonProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public JsonProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -175,7 +216,7 @@ public JsonProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public JsonProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -184,7 +225,7 @@ public JsonProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public JsonProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -193,6 +234,9 @@ public JsonProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public JsonProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -217,6 +261,15 @@ public JsonProcessorDescriptor TargetField(Expression + /// 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(); @@ -269,7 +322,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -278,7 +331,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -321,9 +374,9 @@ public JsonProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } @@ -354,6 +407,9 @@ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicateKeys = tru return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JsonProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -387,18 +443,27 @@ public JsonProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public JsonProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JsonProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -408,7 +473,7 @@ public JsonProcessorDescriptor OnFailure(ICollection configure) + public JsonProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -426,7 +491,7 @@ public JsonProcessorDescriptor OnFailure(Action configure) return Self; } - public JsonProcessorDescriptor OnFailure(params Action[] configure) + public JsonProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -435,6 +500,9 @@ public JsonProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JsonProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -520,7 +588,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -529,7 +597,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index f3ea9a691e5..b45158b3afa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/KeyValueProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class KeyValueProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -49,8 +52,16 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("field_split")] public string FieldSplit { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -65,6 +76,10 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("include_keys")] public ICollection? IncludeKeys { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -79,6 +94,10 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("strip_brackets")] public bool? StripBrackets { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -106,7 +125,7 @@ public sealed partial class KeyValueProcessor [JsonInclude, JsonPropertyName("value_split")] public string ValueSplit { get; set; } - public static implicit operator Processor(KeyValueProcessor keyValueProcessor) => Ingest.Processor.Kv(keyValueProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(KeyValueProcessor keyValueProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Kv(keyValueProcessor); } public sealed partial class KeyValueProcessorDescriptor : SerializableDescriptor> @@ -126,9 +145,9 @@ public KeyValueProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private ICollection? IncludeKeysValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? PrefixValue { get; set; } private bool? StripBracketsValue { get; set; } private string? TagValue { get; set; } @@ -137,6 +156,9 @@ public KeyValueProcessorDescriptor() : base() private string? TrimValueValue { get; set; } private string ValueSplitValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public KeyValueProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -170,6 +192,15 @@ public KeyValueProcessorDescriptor Field(Expression + /// 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. /// @@ -179,12 +210,18 @@ public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) return Self; } - public KeyValueProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public KeyValueProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -209,6 +246,9 @@ public KeyValueProcessorDescriptor IncludeKeys(ICollection? i return Self; } + /// + /// Handle failures for the processor. + /// public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -218,7 +258,7 @@ public KeyValueProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public KeyValueProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -227,7 +267,7 @@ public KeyValueProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public KeyValueProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -236,7 +276,7 @@ public KeyValueProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public KeyValueProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -263,6 +303,9 @@ public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public KeyValueProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -287,6 +330,15 @@ public KeyValueProcessorDescriptor TargetField(Expression + /// 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. /// @@ -368,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -377,7 +429,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -447,9 +499,9 @@ public KeyValueProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private ICollection? IncludeKeysValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? PrefixValue { get; set; } private bool? StripBracketsValue { get; set; } private string? TagValue { get; set; } @@ -458,6 +510,9 @@ public KeyValueProcessorDescriptor() : base() private string? TrimValueValue { get; set; } private string ValueSplitValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public KeyValueProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -509,12 +564,18 @@ public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) return Self; } - public KeyValueProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public KeyValueProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -539,6 +600,9 @@ public KeyValueProcessorDescriptor IncludeKeys(ICollection? includeKeys) return Self; } + /// + /// Handle failures for the processor. + /// public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -548,7 +612,7 @@ public KeyValueProcessorDescriptor OnFailure(ICollection configure) + public KeyValueProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -566,7 +630,7 @@ public KeyValueProcessorDescriptor OnFailure(Action configu return Self; } - public KeyValueProcessorDescriptor OnFailure(params Action[] configure) + public KeyValueProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -593,6 +657,9 @@ public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets = true) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public KeyValueProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -707,7 +774,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -716,7 +783,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index c0feb30dfb0..3b7f2d1213f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/LowercaseProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class LowercaseProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class LowercaseProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class LowercaseProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class LowercaseProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(LowercaseProcessor lowercaseProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Lowercase(lowercaseProcessor); } public sealed partial class LowercaseProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public LowercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public LowercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public LowercaseProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public LowercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public LowercaseProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public LowercaseProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public LowercaseProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public LowercaseProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public LowercaseProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public LowercaseProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public LowercaseProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public LowercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public LowercaseProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public LowercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public LowercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public LowercaseProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public LowercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public LowercaseProcessorDescriptor OnFailure(ICollection configure) + public LowercaseProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public LowercaseProcessorDescriptor OnFailure(Action config return Self; } - public LowercaseProcessorDescriptor OnFailure(params Action[] configure) + public LowercaseProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public LowercaseProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public LowercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index f7b733f244f..326d3906286 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Pipeline.g.cs @@ -29,18 +29,18 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class Pipeline { - /// - /// Arbitrary metadata about the ingest pipeline. 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; } + /// + /// Arbitrary metadata about the ingest pipeline. This map is not automatically generated by Elasticsearch. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + /// /// Processors to run immediately after a processor failure. /// @@ -71,13 +71,13 @@ public PipelineDescriptor() : base() private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -110,7 +110,7 @@ public PipelineDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PipelineDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -119,7 +119,7 @@ public PipelineDescriptor OnFailure(ProcessorDescriptor de return Self; } - public PipelineDescriptor OnFailure(Action> configure) + public PipelineDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -128,7 +128,7 @@ public PipelineDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PipelineDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -149,7 +149,7 @@ public PipelineDescriptor Processors(ICollection Processors(ProcessorDescriptor descriptor) + public PipelineDescriptor Processors(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { ProcessorsValue = null; ProcessorsDescriptorAction = null; @@ -158,7 +158,7 @@ public PipelineDescriptor Processors(ProcessorDescriptor d return Self; } - public PipelineDescriptor Processors(Action> configure) + public PipelineDescriptor Processors(Action> configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -167,7 +167,7 @@ public PipelineDescriptor Processors(Action Processors(params Action>[] configure) + public PipelineDescriptor Processors(params Action>[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -211,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -220,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -242,7 +242,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -251,7 +251,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -262,10 +262,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -283,13 +283,13 @@ public PipelineDescriptor() : base() private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -322,7 +322,7 @@ public PipelineDescriptor OnFailure(ICollection configure) + public PipelineDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,7 +340,7 @@ public PipelineDescriptor OnFailure(Action configure) return Self; } - public PipelineDescriptor OnFailure(params Action[] configure) + public PipelineDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -361,7 +361,7 @@ public PipelineDescriptor Processors(ICollection configure) + public PipelineDescriptor Processors(Action configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -379,7 +379,7 @@ public PipelineDescriptor Processors(Action configure) return Self; } - public PipelineDescriptor Processors(params Action[] configure) + public PipelineDescriptor Processors(params Action[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -423,7 +423,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -432,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -454,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -463,7 +463,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -474,10 +474,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index 0f3fd55d05e..0ea077575ce 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/PipelineProcessor.g.cs @@ -29,10 +29,21 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class PipelineProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,12 +58,20 @@ public sealed partial class PipelineProcessor ///
[JsonInclude, JsonPropertyName("name")] public Elastic.Clients.Elasticsearch.Serverless.Name Name { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(PipelineProcessor pipelineProcessor) => Ingest.Processor.Pipeline(pipelineProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(PipelineProcessor pipelineProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Pipeline(pipelineProcessor); } public sealed partial class PipelineProcessorDescriptor : SerializableDescriptor> @@ -69,23 +88,32 @@ public PipelineProcessorDescriptor() : base() private bool? IgnoreMissingPipelineValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public PipelineProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public PipelineProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public PipelineProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -110,6 +138,9 @@ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch return Self; } + /// + /// Handle failures for the processor. + /// public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +150,7 @@ public PipelineProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PipelineProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +159,7 @@ public PipelineProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public PipelineProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +168,7 @@ public PipelineProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PipelineProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -146,6 +177,9 @@ public PipelineProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public PipelineProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -192,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -201,7 +235,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -236,23 +270,32 @@ public PipelineProcessorDescriptor() : base() private bool? IgnoreMissingPipelineValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Name NameValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public PipelineProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public PipelineProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public PipelineProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -277,6 +320,9 @@ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch.Serverless return Self; } + /// + /// Handle failures for the processor. + /// public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -286,7 +332,7 @@ public PipelineProcessorDescriptor OnFailure(ICollection configure) + public PipelineProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -304,7 +350,7 @@ public PipelineProcessorDescriptor OnFailure(Action configu return Self; } - public PipelineProcessorDescriptor OnFailure(params Action[] configure) + public PipelineProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -313,6 +359,9 @@ public PipelineProcessorDescriptor OnFailure(params Action[ return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public PipelineProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -359,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -368,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 1729718a598..4592808ad0a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/Processor.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -71,6 +72,7 @@ internal Processor(string variantName, object variant) 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 Reroute(Elastic.Clients.Elasticsearch.Serverless.Ingest.RerouteProcessor rerouteProcessor) => new Processor("reroute", rerouteProcessor); + public static Processor Script(Elastic.Clients.Elasticsearch.Serverless.Ingest.ScriptProcessor scriptProcessor) => new Processor("script", scriptProcessor); 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); @@ -79,6 +81,18 @@ internal Processor(string variantName, object variant) 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class ProcessorConverter : JsonConverter @@ -90,259 +104,279 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "append") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "attachment") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "append") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "bytes") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "attachment") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "circle") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "bytes") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "convert") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "circle") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "csv") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "convert") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "date") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "csv") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "date_index_name") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "date") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dissect") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "date_index_name") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dot_expander") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "dissect") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "drop") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "dot_expander") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "enrich") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "drop") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fail") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "enrich") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "foreach") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "fail") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geoip") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "foreach") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "grok") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "geoip") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "gsub") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "grok") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "inference") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "gsub") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "join") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "inference") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "json") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "join") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "kv") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "json") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "lowercase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "kv") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "pipeline") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "lowercase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "remove") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "pipeline") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rename") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "remove") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "reroute") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "rename") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "set") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "reroute") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "set_security_user") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "sort") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "set") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "split") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "set_security_user") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "trim") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "sort") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "uppercase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "split") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "urldecode") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "trim") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "user_agent") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); + if (propertyName == "uppercase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "urldecode") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "user_agent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Processor' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Processor(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Processor value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -425,6 +459,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "reroute": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.RerouteProcessor)value.Variant, options); break; + case "script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.ScriptProcessor)value.Variant, options); + break; case "set": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Ingest.SetProcessor)value.Variant, options); break; @@ -487,93 +524,93 @@ private ProcessorDescriptor Set(object variant, string variantName) 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 Reroute(RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); - public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); - 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"); + public ProcessorDescriptor Append(Elastic.Clients.Elasticsearch.Serverless.Ingest.AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action> configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(Elastic.Clients.Elasticsearch.Serverless.Ingest.AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action> configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(Elastic.Clients.Elasticsearch.Serverless.Ingest.BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action> configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action> configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action> configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(Elastic.Clients.Elasticsearch.Serverless.Ingest.DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action> configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(Elastic.Clients.Elasticsearch.Serverless.Ingest.DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action> configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(Elastic.Clients.Elasticsearch.Serverless.Ingest.DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action> configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(Elastic.Clients.Elasticsearch.Serverless.Ingest.EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action> configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(Elastic.Clients.Elasticsearch.Serverless.Ingest.GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action> configure) => Set(configure, "join"); + public ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action> configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(Elastic.Clients.Elasticsearch.Serverless.Ingest.KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action> configure) => Set(configure, "rename"); + public ProcessorDescriptor Reroute(Elastic.Clients.Elasticsearch.Serverless.Ingest.RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); + public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); + public ProcessorDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Ingest.ScriptProcessor scriptProcessor) => Set(scriptProcessor, "script"); + public ProcessorDescriptor Script(Action> configure) => Set(configure, "script"); + public ProcessorDescriptor Set(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action> configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action> configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Ingest.SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -609,127 +646,93 @@ private ProcessorDescriptor Set(object variant, string variantName) 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 Reroute(RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); - public ProcessorDescriptor Reroute(Action configure) => Set(configure, "reroute"); - public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); - 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"); + public ProcessorDescriptor Append(Elastic.Clients.Elasticsearch.Serverless.Ingest.AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(Elastic.Clients.Elasticsearch.Serverless.Ingest.AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(Elastic.Clients.Elasticsearch.Serverless.Ingest.BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Serverless.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Serverless.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Serverless.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(Elastic.Clients.Elasticsearch.Serverless.Ingest.DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(Elastic.Clients.Elasticsearch.Serverless.Ingest.DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(Elastic.Clients.Elasticsearch.Serverless.Ingest.DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(Elastic.Clients.Elasticsearch.Serverless.Ingest.DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(Elastic.Clients.Elasticsearch.Serverless.Ingest.EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Serverless.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Serverless.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(Elastic.Clients.Elasticsearch.Serverless.Ingest.GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(Elastic.Clients.Elasticsearch.Serverless.Ingest.GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Serverless.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Serverless.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action configure) => Set(configure, "join"); + public ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Serverless.Ingest.JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(Elastic.Clients.Elasticsearch.Serverless.Ingest.KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Serverless.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Serverless.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Serverless.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action configure) => Set(configure, "rename"); + public ProcessorDescriptor Reroute(Elastic.Clients.Elasticsearch.Serverless.Ingest.RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); + public ProcessorDescriptor Reroute(Action configure) => Set(configure, "reroute"); + public ProcessorDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Ingest.ScriptProcessor scriptProcessor) => Set(scriptProcessor, "script"); + public ProcessorDescriptor Script(Action configure) => Set(configure, "script"); + public ProcessorDescriptor Set(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(Elastic.Clients.Elasticsearch.Serverless.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Ingest.SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Serverless.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Serverless.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Serverless.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Serverless.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Serverless.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index 3504455066b..89cc1481c37 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RemoveProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class RemoveProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class RemoveProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Fields Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,12 +58,20 @@ public sealed partial class RemoveProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(RemoveProcessor removeProcessor) => Ingest.Processor.Remove(removeProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(RemoveProcessor removeProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Remove(removeProcessor); } public sealed partial class RemoveProcessorDescriptor : SerializableDescriptor> @@ -69,11 +88,14 @@ public RemoveProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RemoveProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -89,12 +111,18 @@ public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch. return Self; } - public RemoveProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RemoveProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -110,6 +138,9 @@ public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +150,7 @@ public RemoveProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RemoveProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +159,7 @@ public RemoveProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RemoveProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +168,7 @@ public RemoveProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RemoveProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -146,6 +177,9 @@ public RemoveProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public RemoveProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -192,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -201,7 +235,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -236,11 +270,14 @@ public RemoveProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RemoveProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -256,12 +293,18 @@ public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public RemoveProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RemoveProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -277,6 +320,9 @@ public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -286,7 +332,7 @@ public RemoveProcessorDescriptor OnFailure(ICollection configure) + public RemoveProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -304,7 +350,7 @@ public RemoveProcessorDescriptor OnFailure(Action configure return Self; } - public RemoveProcessorDescriptor OnFailure(params Action[] configure) + public RemoveProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -313,6 +359,9 @@ public RemoveProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RemoveProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -359,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -368,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index de1ea2cb0ed..4148d79bf51 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RenameProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class RenameProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class RenameProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class RenameProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class RenameProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(RenameProcessor renameProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Rename(renameProcessor); } public sealed partial class RenameProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public RenameProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RenameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public RenameProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public RenameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public RenameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public RenameProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RenameProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public RenameProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RenameProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public RenameProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RenameProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public RenameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public RenameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public RenameProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -272,12 +324,15 @@ public RenameProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RenameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -311,12 +366,18 @@ public RenameProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public RenameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -332,6 +393,9 @@ public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public RenameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -341,7 +405,7 @@ public RenameProcessorDescriptor OnFailure(ICollection configure) + public RenameProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -359,7 +423,7 @@ public RenameProcessorDescriptor OnFailure(Action configure return Self; } - public RenameProcessorDescriptor OnFailure(params Action[] configure) + public RenameProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -368,6 +432,9 @@ public RenameProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RenameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -441,7 +508,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -450,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RerouteProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RerouteProcessor.g.cs index 0f883d5ac33..3f07547797b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RerouteProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/RerouteProcessor.g.cs @@ -37,6 +37,10 @@ public sealed partial class RerouteProcessor [JsonInclude, JsonPropertyName("dataset")] [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Dataset { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -45,8 +49,16 @@ public sealed partial class RerouteProcessor /// [JsonInclude, JsonPropertyName("destination")] public string? Destination { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,12 +70,20 @@ public sealed partial class RerouteProcessor [JsonInclude, JsonPropertyName("namespace")] [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Namespace { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(RerouteProcessor rerouteProcessor) => Ingest.Processor.Reroute(rerouteProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(RerouteProcessor rerouteProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Reroute(rerouteProcessor); } public sealed partial class RerouteProcessorDescriptor : SerializableDescriptor> @@ -81,9 +101,9 @@ public RerouteProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private ICollection? NamespaceValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } /// @@ -97,6 +117,9 @@ public RerouteProcessorDescriptor Dataset(ICollection? datase return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RerouteProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -112,12 +135,18 @@ public RerouteProcessorDescriptor Destination(string? destination) return Self; } - public RerouteProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RerouteProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RerouteProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -135,6 +164,9 @@ public RerouteProcessorDescriptor Namespace(ICollection? valu return Self; } + /// + /// Handle failures for the processor. + /// public RerouteProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -144,7 +176,7 @@ public RerouteProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RerouteProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -153,7 +185,7 @@ public RerouteProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RerouteProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,7 +194,7 @@ public RerouteProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RerouteProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -171,6 +203,9 @@ public RerouteProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RerouteProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -227,7 +262,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -236,7 +271,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -272,9 +307,9 @@ public RerouteProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private ICollection? NamespaceValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } /// @@ -288,6 +323,9 @@ public RerouteProcessorDescriptor Dataset(ICollection? dataset) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RerouteProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -303,12 +341,18 @@ public RerouteProcessorDescriptor Destination(string? destination) return Self; } - public RerouteProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RerouteProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RerouteProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -326,6 +370,9 @@ public RerouteProcessorDescriptor Namespace(ICollection? value) return Self; } + /// + /// Handle failures for the processor. + /// public RerouteProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -335,7 +382,7 @@ public RerouteProcessorDescriptor OnFailure(ICollection configure) + public RerouteProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -353,7 +400,7 @@ public RerouteProcessorDescriptor OnFailure(Action configur return Self; } - public RerouteProcessorDescriptor OnFailure(params Action[] configure) + public RerouteProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -362,6 +409,9 @@ public RerouteProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RerouteProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -418,7 +468,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -427,7 +477,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -446,4 +496,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ScriptProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ScriptProcessor.g.cs new file mode 100644 index 00000000000..cd9555f862f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/ScriptProcessor.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 ScriptProcessor +{ + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// Conditionally execute the processor. + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// Script language. + /// + [JsonInclude, JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Handle failures for the processor. + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Object containing parameters for the script. + /// + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(ScriptProcessor scriptProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Script(scriptProcessor); +} + +public sealed partial class ScriptProcessorDescriptor : SerializableDescriptor> +{ + internal ScriptProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LangValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + private string? TagValue { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ public ScriptProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ScriptProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// + public ScriptProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Script language. + /// + public ScriptProcessorDescriptor Lang(string? lang) + { + LangValue = lang; + return Self; + } + + /// + /// Handle failures for the processor. + /// + public ScriptProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Object containing parameters for the script. + /// + public ScriptProcessorDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ public ScriptProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, 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(LangValue)) + { + writer.WritePropertyName("lang"); + writer.WriteStringValue(LangValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Ingest.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptProcessorDescriptor : SerializableDescriptor +{ + internal ScriptProcessorDescriptor(Action configure) => configure.Invoke(this); + + public ScriptProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LangValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + private string? TagValue { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ public ScriptProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ScriptProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// + public ScriptProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Script language. + /// + public ScriptProcessorDescriptor Lang(string? lang) + { + LangValue = lang; + return Self; + } + + /// + /// Handle failures for the processor. + /// + public ScriptProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Object containing parameters for the script. + /// + public ScriptProcessorDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ public ScriptProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, 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(LangValue)) + { + writer.WritePropertyName("lang"); + writer.WriteStringValue(LangValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.Ingest.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 Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + 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/SetProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs index 8081472ac34..8fe899465b8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class SetProcessor ///
[JsonInclude, JsonPropertyName("copy_from")] public Elastic.Clients.Elasticsearch.Serverless.Field? CopyFrom { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,6 +46,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } @@ -50,6 +58,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("ignore_empty_value")] public bool? IgnoreEmptyValue { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,6 +70,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("media_type")] public string? MediaType { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -66,6 +82,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("override")] public bool? Override { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -75,7 +95,7 @@ public sealed partial class SetProcessor [JsonInclude, JsonPropertyName("value")] public object? Value { get; set; } - public static implicit operator Processor(SetProcessor setProcessor) => Ingest.Processor.Set(setProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(SetProcessor setProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Set(setProcessor); } public sealed partial class SetProcessorDescriptor : SerializableDescriptor> @@ -94,9 +114,9 @@ public SetProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? MediaTypeValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string? TagValue { get; set; } private object? ValueValue { get; set; } @@ -119,6 +139,18 @@ public SetProcessorDescriptor CopyFrom(Expression + /// 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; + } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -143,9 +175,21 @@ public SetProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SetProcessorDescriptor If(string? value) + { + IfValue = value; return Self; } @@ -158,6 +202,9 @@ public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue return Self; } + /// + /// Ignore failures for the processor. + /// public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -173,6 +220,9 @@ public SetProcessorDescriptor MediaType(string? mediaType) return Self; } + /// + /// Handle failures for the processor. + /// public SetProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -182,7 +232,7 @@ public SetProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SetProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -191,7 +241,7 @@ public SetProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SetProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -200,7 +250,7 @@ public SetProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SetProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -212,12 +262,15 @@ public SetProcessorDescriptor OnFailure(params Action /// 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) + public SetProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -285,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -294,7 +347,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -343,9 +396,9 @@ public SetProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? MediaTypeValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string? TagValue { get; set; } private object? ValueValue { get; set; } @@ -377,6 +430,9 @@ public SetProcessorDescriptor CopyFrom(Expression + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ /// public SetProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -410,9 +466,12 @@ public SetProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SetProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } @@ -425,6 +484,9 @@ public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue = true) return Self; } + /// + /// Ignore failures for the processor. + /// public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -440,6 +502,9 @@ public SetProcessorDescriptor MediaType(string? mediaType) return Self; } + /// + /// Handle failures for the processor. + /// public SetProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -449,7 +514,7 @@ public SetProcessorDescriptor OnFailure(ICollection configure) + public SetProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -467,7 +532,7 @@ public SetProcessorDescriptor OnFailure(Action configure) return Self; } - public SetProcessorDescriptor OnFailure(params Action[] configure) + public SetProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -479,12 +544,15 @@ public SetProcessorDescriptor OnFailure(params Action[] con /// /// 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) + public SetProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -552,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -561,7 +629,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 464dc7255e4..9c74c40a62b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class SetSecurityUserProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class SetSecurityUserProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,10 +64,14 @@ public sealed partial class SetSecurityUserProcessor /// [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(SetSecurityUserProcessor setSecurityUserProcessor) => Ingest.Processor.SetSecurityUser(setSecurityUserProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(SetSecurityUserProcessor setSecurityUserProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.SetSecurityUser(setSecurityUserProcessor); } public sealed partial class SetSecurityUserProcessorDescriptor : SerializableDescriptor> @@ -68,12 +87,15 @@ public SetSecurityUserProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetSecurityUserProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -98,18 +120,36 @@ public SetSecurityUserProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SetSecurityUserProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +159,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SetSecurityUserProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +168,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ProcessorDescript return Self; } - public SetSecurityUserProcessorDescriptor OnFailure(Action> configure) + public SetSecurityUserProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SetSecurityUserProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,6 +195,9 @@ public SetSecurityUserProcessorDescriptor Properties(ICollection + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public SetSecurityUserProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -195,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -204,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -244,12 +287,15 @@ public SetSecurityUserProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetSecurityUserProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -283,18 +329,27 @@ public SetSecurityUserProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SetSecurityUserProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -304,7 +359,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ICollection configure) + public SetSecurityUserProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -322,7 +377,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(Action return Self; } - public SetSecurityUserProcessorDescriptor OnFailure(params Action[] configure) + public SetSecurityUserProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,6 +395,9 @@ public SetSecurityUserProcessorDescriptor Properties(ICollection? proper return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetSecurityUserProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -380,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -389,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 36bc5e9520a..5d9f34927eb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SortProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class SortProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class SortProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,6 +64,10 @@ public sealed partial class SortProcessor /// [JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.Serverless.SortOrder? Order { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class SortProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(SortProcessor sortProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Sort(sortProcessor); } public sealed partial class SortProcessorDescriptor : SerializableDescriptor> @@ -74,13 +93,16 @@ public SortProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SortProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,18 +127,36 @@ public SortProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SortProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SortProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -126,7 +166,7 @@ public SortProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SortProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -135,7 +175,7 @@ public SortProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SortProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -144,7 +184,7 @@ public SortProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SortProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.Se return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SortProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public SortProcessorDescriptor TargetField(Expression + /// 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(); @@ -220,7 +272,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -229,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -275,13 +327,16 @@ public SortProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SortProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,18 +370,27 @@ public SortProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SortProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SortProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -336,7 +400,7 @@ public SortProcessorDescriptor OnFailure(ICollection configure) + public SortProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -354,7 +418,7 @@ public SortProcessorDescriptor OnFailure(Action configure) return Self; } - public SortProcessorDescriptor OnFailure(params Action[] configure) + public SortProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.Serverless.So return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SortProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -439,7 +506,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -448,7 +515,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 065d4991dfb..9591968e1c1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/SplitProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class SplitProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class SplitProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(SplitProcessor splitProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Split(splitProcessor); } public sealed partial class SplitProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public SplitProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SplitProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public SplitProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SplitProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public SplitProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public SplitProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SplitProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public SplitProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SplitProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public SplitProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SplitProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public SplitProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SplitProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public SplitProcessorDescriptor TargetField(Expression + /// 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(); @@ -258,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -267,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -316,14 +368,17 @@ public SplitProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SplitProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -357,12 +412,18 @@ public SplitProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SplitProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -378,6 +439,9 @@ public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public SplitProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -387,7 +451,7 @@ public SplitProcessorDescriptor OnFailure(ICollection configure) + public SplitProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -405,7 +469,7 @@ public SplitProcessorDescriptor OnFailure(Action configure) return Self; } - public SplitProcessorDescriptor OnFailure(params Action[] configure) + public SplitProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -432,6 +496,9 @@ public SplitProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SplitProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -505,7 +572,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -514,7 +581,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 7ae49edc390..8f6b2737076 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/TrimProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class TrimProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class TrimProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class TrimProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class TrimProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(TrimProcessor trimProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Trim(trimProcessor); } public sealed partial class TrimProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public TrimProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public TrimProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public TrimProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public TrimProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public TrimProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public TrimProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public TrimProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public TrimProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public TrimProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public TrimProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public TrimProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public TrimProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public TrimProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public TrimProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public TrimProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public TrimProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public TrimProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public TrimProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public TrimProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public TrimProcessorDescriptor OnFailure(ICollection configure) + public TrimProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public TrimProcessorDescriptor OnFailure(Action configure) return Self; } - public TrimProcessorDescriptor OnFailure(params Action[] configure) + public TrimProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public TrimProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public TrimProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 3652b21809e..70115968baa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UppercaseProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class UppercaseProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UppercaseProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class UppercaseProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class UppercaseProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(UppercaseProcessor uppercaseProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.Uppercase(uppercaseProcessor); } public sealed partial class UppercaseProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public UppercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UppercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public UppercaseProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UppercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public UppercaseProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UppercaseProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public UppercaseProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UppercaseProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public UppercaseProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UppercaseProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public UppercaseProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public UppercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public UppercaseProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public UppercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UppercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public UppercaseProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UppercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public UppercaseProcessorDescriptor OnFailure(ICollection configure) + public UppercaseProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public UppercaseProcessorDescriptor OnFailure(Action config return Self; } - public UppercaseProcessorDescriptor OnFailure(params Action[] configure) + public UppercaseProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public UppercaseProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UppercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index 8b3f68c364c..6f64268adb9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class UrlDecodeProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UrlDecodeProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class UrlDecodeProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class UrlDecodeProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(UrlDecodeProcessor urlDecodeProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.UrlDecode(urlDecodeProcessor); } public sealed partial class UrlDecodeProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public UrlDecodeProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UrlDecodeProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public UrlDecodeProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UrlDecodeProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UrlDecodeProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UrlDecodeProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public UrlDecodeProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UrlDecodeProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public UrlDecodeProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public UrlDecodeProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public UrlDecodeProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public UrlDecodeProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UrlDecodeProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public UrlDecodeProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UrlDecodeProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ICollection configure) + public UrlDecodeProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public UrlDecodeProcessorDescriptor OnFailure(Action config return Self; } - public UrlDecodeProcessorDescriptor OnFailure(params Action[] configure) + public UrlDecodeProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public UrlDecodeProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UrlDecodeProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); 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 index e9c7bad8c15..865ee476ce3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ingest/UserAgentProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; public sealed partial class UserAgentProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } [JsonInclude, JsonPropertyName("options")] @@ -57,6 +72,10 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("regex_file")] public string? RegexFile { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -66,7 +85,7 @@ public sealed partial class UserAgentProcessor [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor(UserAgentProcessor userAgentProcessor) => Elastic.Clients.Elasticsearch.Serverless.Ingest.Processor.UserAgent(userAgentProcessor); } public sealed partial class UserAgentProcessorDescriptor : SerializableDescriptor> @@ -83,14 +102,17 @@ public UserAgentProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UserAgentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -115,12 +137,27 @@ public UserAgentProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UserAgentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -136,6 +173,9 @@ public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -145,7 +185,7 @@ public UserAgentProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UserAgentProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -154,7 +194,7 @@ public UserAgentProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UserAgentProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -163,7 +203,7 @@ public UserAgentProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UserAgentProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -187,6 +227,9 @@ public UserAgentProcessorDescriptor RegexFile(string? regexFile) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UserAgentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -211,6 +254,15 @@ public UserAgentProcessorDescriptor TargetField(Expression + /// 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(); @@ -251,7 +303,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -313,14 +365,17 @@ public UserAgentProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } 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.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { 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; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UserAgentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -354,12 +409,18 @@ public UserAgentProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UserAgentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -375,6 +436,9 @@ public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -384,7 +448,7 @@ public UserAgentProcessorDescriptor OnFailure(ICollection configure) + public UserAgentProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -402,7 +466,7 @@ public UserAgentProcessorDescriptor OnFailure(Action config return Self; } - public UserAgentProcessorDescriptor OnFailure(params Action[] configure) + public UserAgentProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -426,6 +490,9 @@ public UserAgentProcessorDescriptor RegexFile(string? regexFile) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UserAgentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -499,7 +566,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -508,7 +575,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs index 0c60ac70aa8..57fc09cded1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineGet.g.cs @@ -27,21 +27,87 @@ namespace Elastic.Clients.Elasticsearch.Serverless; +internal sealed partial class InlineGetConverter : JsonConverter> +{ + public override InlineGet Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyDictionary? fields = default; + bool found = default; + long? primaryTerm = default; + string? routing = default; + long? seqNo = default; + TDocument? source = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "fields") + { + fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "found") + { + found = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_primary_term") + { + primaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_routing") + { + routing = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_seq_no") + { + seqNo = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_source") + { + source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new InlineGet { Fields = fields, Found = found, Metadata = additionalProperties, PrimaryTerm = primaryTerm, Routing = routing, SeqNo = seqNo, Source = source }; + } + + public override void Write(Utf8JsonWriter writer, InlineGet value, JsonSerializerOptions options) + { + throw new NotImplementedException("'InlineGet' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[GenericConverter(typeof(InlineGetConverter<>), unwrap: true)] 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")] + + /// + /// Document metadata + /// public IReadOnlyDictionary Metadata { get; init; } + public long? PrimaryTerm { get; init; } + public string? Routing { get; init; } + public long? SeqNo { get; init; } + public TDocument? Source { 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 index ee361d630b6..6bcf2f8e669 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/InlineScript.g.cs @@ -36,6 +36,10 @@ public sealed partial class InlineScript public Elastic.Clients.Elasticsearch.Serverless.ScriptLanguage? Language { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
[JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } @@ -74,6 +78,9 @@ public InlineScriptDescriptor Options(Func, Flu return Self; } + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
public InlineScriptDescriptor Params(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs index 13914d85198..40c43c6e708 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/KnnQuery.g.cs @@ -24,11 +24,10 @@ using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Serverless.QueryDsl; namespace Elastic.Clients.Elasticsearch.Serverless; -public sealed partial class KnnQuery : SearchQuery +public sealed partial class KnnQuery { /// /// Boost value to apply to kNN scores @@ -49,6 +48,12 @@ public sealed partial class KnnQuery : SearchQuery [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] public ICollection? Filter { 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; } + /// /// The final number of nearest neighbors to return as top hits /// @@ -79,9 +84,7 @@ public sealed partial class KnnQuery : SearchQuery [JsonInclude, JsonPropertyName("similarity")] public float? Similarity { get; set; } - public static implicit operator Query(KnnQuery knnQuery) => QueryDsl.Query.Knn(knnQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("knn", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(KnnQuery knnQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Knn(knnQuery); } public sealed partial class KnnQueryDescriptor : SerializableDescriptor> @@ -95,15 +98,18 @@ public KnnQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { 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 Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } private float? SimilarityValue { get; set; } /// @@ -133,6 +139,15 @@ public KnnQueryDescriptor Field(Expression + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Filters for the kNN search query /// @@ -145,7 +160,7 @@ public KnnQueryDescriptor Filter(ICollection Filter(QueryDsl.QueryDescriptor descriptor) + public KnnQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -154,7 +169,7 @@ public KnnQueryDescriptor Filter(QueryDsl.QueryDescriptor return Self; } - public KnnQueryDescriptor Filter(Action> configure) + public KnnQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -163,7 +178,7 @@ public KnnQueryDescriptor Filter(Action Filter(params Action>[] configure) + public KnnQueryDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -172,6 +187,33 @@ public KnnQueryDescriptor Filter(params Action + /// If defined, each search hit will contain inner hits. + /// + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + /// /// The final number of nearest neighbors to return as top hits /// @@ -210,7 +252,7 @@ public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elastics return Self; } - public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor descriptor) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptorAction = null; @@ -218,7 +260,7 @@ public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescri return Self; } - public KnnQueryDescriptor QueryVectorBuilder(Action configure) + public KnnQueryDescriptor QueryVectorBuilder(Action configure) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptor = null; @@ -254,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -263,7 +305,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -275,6 +317,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(FilterValue, writer, 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + writer.WritePropertyName("k"); writer.WriteNumberValue(kValue); writer.WritePropertyName("num_candidates"); @@ -293,7 +351,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryVectorBuilderDescriptorAction is not null) { writer.WritePropertyName("query_vector_builder"); - JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); } else if (QueryVectorBuilderValue is not null) { @@ -322,15 +380,18 @@ public KnnQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { 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 Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } private float? SimilarityValue { get; set; } /// @@ -381,7 +442,7 @@ public KnnQueryDescriptor Filter(ICollection configure) + public KnnQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -399,7 +460,7 @@ public KnnQueryDescriptor Filter(Action configure) return Self; } - public KnnQueryDescriptor Filter(params Action[] configure) + public KnnQueryDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -408,6 +469,33 @@ public KnnQueryDescriptor Filter(params Action[] confi return Self; } + /// + /// If defined, each search hit will contain inner hits. + /// + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + /// /// The final number of nearest neighbors to return as top hits /// @@ -446,7 +534,7 @@ public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serve return Self; } - public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor descriptor) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptorAction = null; @@ -454,7 +542,7 @@ public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descri return Self; } - public KnnQueryDescriptor QueryVectorBuilder(Action configure) + public KnnQueryDescriptor QueryVectorBuilder(Action configure) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptor = null; @@ -490,7 +578,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -499,7 +587,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -511,6 +599,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(FilterValue, writer, 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 Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + writer.WritePropertyName("k"); writer.WriteNumberValue(kValue); writer.WritePropertyName("num_candidates"); @@ -529,7 +633,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryVectorBuilderDescriptorAction is not null) { writer.WritePropertyName("query_vector_builder"); - JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); } else if (QueryVectorBuilderValue is not null) { @@ -545,4 +649,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LicenseManagement/LicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LicenseManagement/LicenseInformation.g.cs new file mode 100644 index 00000000000..5dbfc2c1e0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/LicenseManagement/LicenseInformation.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.LicenseManagement; + +public sealed partial class LicenseInformation +{ + [JsonInclude, JsonPropertyName("expiry_date")] + public DateTimeOffset? ExpiryDate { get; init; } + [JsonInclude, JsonPropertyName("expiry_date_in_millis")] + public long? ExpiryDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("issue_date")] + public DateTimeOffset IssueDate { get; init; } + [JsonInclude, JsonPropertyName("issue_date_in_millis")] + public long IssueDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("issued_to")] + public string IssuedTo { get; init; } + [JsonInclude, JsonPropertyName("issuer")] + public string Issuer { get; init; } + [JsonInclude, JsonPropertyName("max_nodes")] + public long? MaxNodes { get; init; } + [JsonInclude, JsonPropertyName("max_resource_units")] + public int? MaxResourceUnits { get; init; } + [JsonInclude, JsonPropertyName("start_date_in_millis")] + public long StartDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseStatus Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseType Type { get; init; } + [JsonInclude, JsonPropertyName("uid")] + public string Uid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AggregateOutput.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AggregateOutput.g.cs new file mode 100644 index 00000000000..468993cb908 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AggregateOutput.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class AggregateOutput +{ + [JsonInclude, JsonPropertyName("exponent")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? Exponent { get; set; } + [JsonInclude, JsonPropertyName("logistic_regression")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? LogisticRegression { get; set; } + [JsonInclude, JsonPropertyName("weighted_mode")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? WeightedMode { get; set; } + [JsonInclude, JsonPropertyName("weighted_sum")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? WeightedSum { get; set; } +} + +public sealed partial class AggregateOutputDescriptor : SerializableDescriptor +{ + internal AggregateOutputDescriptor(Action configure) => configure.Invoke(this); + + public AggregateOutputDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? ExponentValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor ExponentDescriptor { get; set; } + private Action ExponentDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? LogisticRegressionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor LogisticRegressionDescriptor { get; set; } + private Action LogisticRegressionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? WeightedModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor WeightedModeDescriptor { get; set; } + private Action WeightedModeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? WeightedSumValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor WeightedSumDescriptor { get; set; } + private Action WeightedSumDescriptorAction { get; set; } + + public AggregateOutputDescriptor Exponent(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? exponent) + { + ExponentDescriptor = null; + ExponentDescriptorAction = null; + ExponentValue = exponent; + return Self; + } + + public AggregateOutputDescriptor Exponent(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor descriptor) + { + ExponentValue = null; + ExponentDescriptorAction = null; + ExponentDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor Exponent(Action configure) + { + ExponentValue = null; + ExponentDescriptor = null; + ExponentDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? logisticRegression) + { + LogisticRegressionDescriptor = null; + LogisticRegressionDescriptorAction = null; + LogisticRegressionValue = logisticRegression; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor descriptor) + { + LogisticRegressionValue = null; + LogisticRegressionDescriptorAction = null; + LogisticRegressionDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Action configure) + { + LogisticRegressionValue = null; + LogisticRegressionDescriptor = null; + LogisticRegressionDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? weightedMode) + { + WeightedModeDescriptor = null; + WeightedModeDescriptorAction = null; + WeightedModeValue = weightedMode; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor descriptor) + { + WeightedModeValue = null; + WeightedModeDescriptorAction = null; + WeightedModeDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Action configure) + { + WeightedModeValue = null; + WeightedModeDescriptor = null; + WeightedModeDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Weights? weightedSum) + { + WeightedSumDescriptor = null; + WeightedSumDescriptorAction = null; + WeightedSumValue = weightedSum; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor descriptor) + { + WeightedSumValue = null; + WeightedSumDescriptorAction = null; + WeightedSumDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Action configure) + { + WeightedSumValue = null; + WeightedSumDescriptor = null; + WeightedSumDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExponentDescriptor is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, ExponentDescriptor, options); + } + else if (ExponentDescriptorAction is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor(ExponentDescriptorAction), options); + } + else if (ExponentValue is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, ExponentValue, options); + } + + if (LogisticRegressionDescriptor is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, LogisticRegressionDescriptor, options); + } + else if (LogisticRegressionDescriptorAction is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor(LogisticRegressionDescriptorAction), options); + } + else if (LogisticRegressionValue is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, LogisticRegressionValue, options); + } + + if (WeightedModeDescriptor is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, WeightedModeDescriptor, options); + } + else if (WeightedModeDescriptorAction is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor(WeightedModeDescriptorAction), options); + } + else if (WeightedModeValue is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, WeightedModeValue, options); + } + + if (WeightedSumDescriptor is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, WeightedSumDescriptor, options); + } + else if (WeightedSumDescriptorAction is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.WeightsDescriptor(WeightedSumDescriptorAction), options); + } + else if (WeightedSumValue is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, WeightedSumValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfig.g.cs new file mode 100644 index 00000000000..9f96a792b7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfig.g.cs @@ -0,0 +1,729 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class AnalysisConfig +{ + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BucketSpan { get; set; } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzer { get; set; } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + [JsonInclude, JsonPropertyName("categorization_field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? CategorizationFieldName { get; set; } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + [JsonInclude, JsonPropertyName("categorization_filters")] + public ICollection? CategorizationFilters { get; set; } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + [JsonInclude, JsonPropertyName("detectors")] + public ICollection Detectors { get; set; } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + [JsonInclude, JsonPropertyName("influencers")] + public ICollection? Influencers { get; set; } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + [JsonInclude, JsonPropertyName("latency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Latency { get; set; } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindow { get; set; } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + [JsonInclude, JsonPropertyName("multivariate_by_fields")] + public bool? MultivariateByFields { get; set; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; set; } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + [JsonInclude, JsonPropertyName("summary_count_field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? SummaryCountFieldName { get; set; } +} + +public sealed partial class AnalysisConfigDescriptor : SerializableDescriptor> +{ + internal AnalysisConfigDescriptor(Action> configure) => configure.Invoke(this); + + public AnalysisConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? BucketSpanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? CategorizationFieldNameValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private ICollection DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action> DetectorsDescriptorAction { get; set; } + private Action>[] DetectorsDescriptorActions { get; set; } + private ICollection? InfluencersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? LatencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; } + private bool? MultivariateByFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SummaryCountFieldNameValue { get; set; } + + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ public AnalysisConfigDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Serverless.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + public AnalysisConfigDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + public AnalysisConfigDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + public AnalysisConfigDescriptor Detectors(ICollection detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Action> configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public AnalysisConfigDescriptor Detectors(params Action>[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + public AnalysisConfigDescriptor Influencers(ICollection? influencers) + { + InfluencersValue = influencers; + return Self; + } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + public AnalysisConfigDescriptor Latency(Elastic.Clients.Elasticsearch.Serverless.Duration? latency) + { + LatencyValue = latency; + return Self; + } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + public AnalysisConfigDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Serverless.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + public AnalysisConfigDescriptor MultivariateByFields(bool? multivariateByFields = true) + { + MultivariateByFieldsValue = multivariateByFields; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFieldNameValue is not null) + { + writer.WritePropertyName("categorization_field_name"); + JsonSerializer.Serialize(writer, CategorizationFieldNameValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (InfluencersValue is not null) + { + writer.WritePropertyName("influencers"); + JsonSerializer.Serialize(writer, InfluencersValue, options); + } + + if (LatencyValue is not null) + { + writer.WritePropertyName("latency"); + JsonSerializer.Serialize(writer, LatencyValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (MultivariateByFieldsValue.HasValue) + { + writer.WritePropertyName("multivariate_by_fields"); + writer.WriteBooleanValue(MultivariateByFieldsValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (SummaryCountFieldNameValue is not null) + { + writer.WritePropertyName("summary_count_field_name"); + JsonSerializer.Serialize(writer, SummaryCountFieldNameValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AnalysisConfigDescriptor : SerializableDescriptor +{ + internal AnalysisConfigDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? BucketSpanValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? CategorizationFieldNameValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private ICollection DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action DetectorsDescriptorAction { get; set; } + private Action[] DetectorsDescriptorActions { get; set; } + private ICollection? InfluencersValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? LatencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindowValue { get; set; } + private bool? MultivariateByFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? SummaryCountFieldNameValue { get; set; } + + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ public AnalysisConfigDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Serverless.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + public AnalysisConfigDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + public AnalysisConfigDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + public AnalysisConfigDescriptor Detectors(ICollection detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Action configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public AnalysisConfigDescriptor Detectors(params Action[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + public AnalysisConfigDescriptor Influencers(ICollection? influencers) + { + InfluencersValue = influencers; + return Self; + } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + public AnalysisConfigDescriptor Latency(Elastic.Clients.Elasticsearch.Serverless.Duration? latency) + { + LatencyValue = latency; + return Self; + } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + public AnalysisConfigDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Serverless.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + public AnalysisConfigDescriptor MultivariateByFields(bool? multivariateByFields = true) + { + MultivariateByFieldsValue = multivariateByFields; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFieldNameValue is not null) + { + writer.WritePropertyName("categorization_field_name"); + JsonSerializer.Serialize(writer, CategorizationFieldNameValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (InfluencersValue is not null) + { + writer.WritePropertyName("influencers"); + JsonSerializer.Serialize(writer, InfluencersValue, options); + } + + if (LatencyValue is not null) + { + writer.WritePropertyName("latency"); + JsonSerializer.Serialize(writer, LatencyValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (MultivariateByFieldsValue.HasValue) + { + writer.WritePropertyName("multivariate_by_fields"); + writer.WriteBooleanValue(MultivariateByFieldsValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (SummaryCountFieldNameValue is not null) + { + writer.WritePropertyName("summary_count_field_name"); + JsonSerializer.Serialize(writer, SummaryCountFieldNameValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs new file mode 100644 index 00000000000..56815c20ee7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisConfigRead.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.MachineLearning; + +public sealed partial class AnalysisConfigRead +{ + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Serverless.Duration BucketSpan { get; init; } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field.
This property cannot be used at the same time as `categorization_filters`.
The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzer { get; init; } + + /// + /// If this property is specified, the values of the specified field will be categorized.
The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_field_name")] + public string? CategorizationFieldName { get; init; } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters.
This property expects an array of regular expressions.
The expressions are used to filter out matching sequences from the categorization field values.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_filters")] + public IReadOnlyCollection? CategorizationFilters { get; init; } + + /// + /// An array of detector configuration objects.
Detector configuration objects specify which data fields a job analyzes.
They also specify which analytical functions are used.
You can specify multiple detectors for a job.
+ ///
+ [JsonInclude, JsonPropertyName("detectors")] + public IReadOnlyCollection Detectors { get; init; } + + /// + /// A comma separated list of influencer field names.
Typically these can be the by, over, or partition fields that are used in the detector configuration.
You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data.
When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.
+ ///
+ [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } + + /// + /// The size of the window in which to expect data that is out of time order.
Defaults to no latency.
If you specify a non-zero value, it must be greater than or equal to one second.
+ ///
+ [JsonInclude, JsonPropertyName("latency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Latency { get; init; } + + /// + /// Advanced configuration option.
Affects the pruning of models that have not been updated for the given time duration.
The value must be set to a multiple of the `bucket_span`.
If set too low, important information may be removed from the model.
Typically, set to `30d` or longer.
If not set, model pruning only occurs if the model memory status reaches the soft limit or the hard limit.
For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`.
+ ///
+ [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ModelPruneWindow { get; init; } + + /// + /// This functionality is reserved for internal use.
It is not supported for use in customer environments and is not subject to the support SLA of official GA features.
If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold.
+ ///
+ [JsonInclude, JsonPropertyName("multivariate_by_fields")] + public bool? MultivariateByFields { get; init; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; init; } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized.
This property value is the name of the field that contains the count of raw data points that have been summarized.
The same `summary_count_field_name` applies to all detectors in the job.
+ ///
+ [JsonInclude, JsonPropertyName("summary_count_field_name")] + public string? SummaryCountFieldName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisLimits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisLimits.g.cs new file mode 100644 index 00000000000..fff15cdc0c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisLimits.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.MachineLearning; + +public sealed partial class AnalysisLimits +{ + /// + /// The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization. + /// + [JsonInclude, JsonPropertyName("categorization_examples_limit")] + public long? CategorizationExamplesLimit { get; set; } + + /// + /// The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit of `b` or `kb` and the number does not equate to a discrete number of megabytes, it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you specify a value less than 1 MiB, an error occurs. If you specify a value for the `xpack.ml.max_model_memory_limit` setting, an error occurs when you try to create jobs that have `model_memory_limit` values greater than that setting value. + /// + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } +} + +public sealed partial class AnalysisLimitsDescriptor : SerializableDescriptor +{ + internal AnalysisLimitsDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisLimitsDescriptor() : base() + { + } + + private long? CategorizationExamplesLimitValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization. + /// + public AnalysisLimitsDescriptor CategorizationExamplesLimit(long? categorizationExamplesLimit) + { + CategorizationExamplesLimitValue = categorizationExamplesLimit; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit of `b` or `kb` and the number does not equate to a discrete number of megabytes, it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you specify a value less than 1 MiB, an error occurs. If you specify a value for the `xpack.ml.max_model_memory_limit` setting, an error occurs when you try to create jobs that have `model_memory_limit` values greater than that setting value. + /// + public AnalysisLimitsDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CategorizationExamplesLimitValue.HasValue) + { + writer.WritePropertyName("categorization_examples_limit"); + writer.WriteNumberValue(CategorizationExamplesLimitValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs new file mode 100644 index 00000000000..6b9a8a19913 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnalysisMemoryLimit.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.MachineLearning; + +public sealed partial class AnalysisMemoryLimit +{ + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; set; } +} + +public sealed partial class AnalysisMemoryLimitDescriptor : SerializableDescriptor +{ + internal AnalysisMemoryLimitDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisMemoryLimitDescriptor() : base() + { + } + + private string ModelMemoryLimitValue { get; set; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public AnalysisMemoryLimitDescriptor ModelMemoryLimit(string modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Anomaly.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Anomaly.g.cs new file mode 100644 index 00000000000..70d21759e4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Anomaly.g.cs @@ -0,0 +1,175 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class Anomaly +{ + /// + /// The actual value for the bucket. + /// + [JsonInclude, JsonPropertyName("actual")] + public IReadOnlyCollection? Actual { get; init; } + + /// + /// Information about the factors impacting the initial anomaly score. + /// + [JsonInclude, JsonPropertyName("anomaly_score_explanation")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnomalyExplanation? AnomalyScoreExplanation { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + [JsonInclude, JsonPropertyName("by_field_name")] + public string? ByFieldName { get; init; } + + /// + /// The value of `by_field_name`. + /// + [JsonInclude, JsonPropertyName("by_field_value")] + public string? ByFieldValue { get; init; } + + /// + /// For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes. + /// + [JsonInclude, JsonPropertyName("causes")] + public IReadOnlyCollection? Causes { get; init; } + + /// + /// A unique identifier for the detector. + /// + [JsonInclude, JsonPropertyName("detector_index")] + public int DetectorIndex { get; init; } + + /// + /// Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed. + /// + [JsonInclude, JsonPropertyName("field_name")] + public string? FieldName { get; init; } + + /// + /// The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`. + /// + [JsonInclude, JsonPropertyName("function")] + public string? Function { get; init; } + + /// + /// The description of the function in which the anomaly occurs, as specified in the detector configuration. + /// + [JsonInclude, JsonPropertyName("function_description")] + public string? FunctionDescription { get; init; } + + /// + /// If the detector function is `lat_long`, this object contains comma delimited strings for the latitude and longitude of the actual and typical values. + /// + [JsonInclude, JsonPropertyName("geo_results")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.GeoResults? GeoResults { get; init; } + + /// + /// If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly. + /// + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection? Influencers { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed. + /// + [JsonInclude, JsonPropertyName("initial_record_score")] + public double InitialRecordScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + [JsonInclude, JsonPropertyName("over_field_name")] + public string? OverFieldName { get; init; } + + /// + /// The value of `over_field_name`. + /// + [JsonInclude, JsonPropertyName("over_field_value")] + public string? OverFieldValue { get; init; } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// The value of `partition_field_name`. + /// + [JsonInclude, JsonPropertyName("partition_field_value")] + public string? PartitionFieldValue { get; init; } + + /// + /// The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this. + /// + [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed. + /// + [JsonInclude, JsonPropertyName("record_score")] + public double RecordScore { get; init; } + + /// + /// Internal. This is always set to `record`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The typical value for the bucket, according to analytical modeling. + /// + [JsonInclude, JsonPropertyName("typical")] + public IReadOnlyCollection? Typical { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyCause.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyCause.g.cs new file mode 100644 index 00000000000..f6be27c0c37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyCause.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.MachineLearning; + +public sealed partial class AnomalyCause +{ + [JsonInclude, JsonPropertyName("actual")] + public IReadOnlyCollection Actual { get; init; } + [JsonInclude, JsonPropertyName("by_field_name")] + public string ByFieldName { get; init; } + [JsonInclude, JsonPropertyName("by_field_value")] + public string ByFieldValue { get; init; } + [JsonInclude, JsonPropertyName("correlated_by_field_value")] + public string CorrelatedByFieldValue { get; init; } + [JsonInclude, JsonPropertyName("field_name")] + public string FieldName { get; init; } + [JsonInclude, JsonPropertyName("function")] + public string Function { get; init; } + [JsonInclude, JsonPropertyName("function_description")] + public string FunctionDescription { get; init; } + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } + [JsonInclude, JsonPropertyName("over_field_name")] + public string OverFieldName { get; init; } + [JsonInclude, JsonPropertyName("over_field_value")] + public string OverFieldValue { get; init; } + [JsonInclude, JsonPropertyName("partition_field_name")] + public string PartitionFieldName { get; init; } + [JsonInclude, JsonPropertyName("partition_field_value")] + public string PartitionFieldValue { get; init; } + [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + [JsonInclude, JsonPropertyName("typical")] + public IReadOnlyCollection Typical { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs new file mode 100644 index 00000000000..cbea71ec7ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyDetectors.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.MachineLearning; + +public sealed partial class AnomalyDetectors +{ + [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzer CategorizationAnalyzer { get; init; } + [JsonInclude, JsonPropertyName("categorization_examples_limit")] + public int CategorizationExamplesLimit { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public int DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public int ModelSnapshotRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs new file mode 100644 index 00000000000..2bb7bd2a8bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/AnomalyExplanation.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.MachineLearning; + +public sealed partial class AnomalyExplanation +{ + /// + /// Impact from the duration and magnitude of the detected anomaly relative to the historical average. + /// + [JsonInclude, JsonPropertyName("anomaly_characteristics_impact")] + public int? AnomalyCharacteristicsImpact { get; init; } + + /// + /// Length of the detected anomaly in the number of buckets. + /// + [JsonInclude, JsonPropertyName("anomaly_length")] + public int? AnomalyLength { get; init; } + + /// + /// Type of the detected anomaly: `spike` or `dip`. + /// + [JsonInclude, JsonPropertyName("anomaly_type")] + public string? AnomalyType { get; init; } + + /// + /// Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced. + /// + [JsonInclude, JsonPropertyName("high_variance_penalty")] + public bool? HighVariancePenalty { get; init; } + + /// + /// If the bucket contains fewer samples than expected, the score is reduced. + /// + [JsonInclude, JsonPropertyName("incomplete_bucket_penalty")] + public bool? IncompleteBucketPenalty { get; init; } + + /// + /// Lower bound of the 95% confidence interval. + /// + [JsonInclude, JsonPropertyName("lower_confidence_bound")] + public double? LowerConfidenceBound { get; init; } + + /// + /// Impact of the deviation between actual and typical values in the past 12 buckets. + /// + [JsonInclude, JsonPropertyName("multi_bucket_impact")] + public int? MultiBucketImpact { get; init; } + + /// + /// Impact of the deviation between actual and typical values in the current bucket. + /// + [JsonInclude, JsonPropertyName("single_bucket_impact")] + public int? SingleBucketImpact { get; init; } + + /// + /// Typical (expected) value for this bucket. + /// + [JsonInclude, JsonPropertyName("typical_value")] + public double? TypicalValue { get; init; } + + /// + /// Upper bound of the 95% confidence interval. + /// + [JsonInclude, JsonPropertyName("upper_confidence_bound")] + public double? UpperConfidenceBound { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs new file mode 100644 index 00000000000..409c1b875d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ApiKeyAuthorization.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.MachineLearning; + +public sealed partial class ApiKeyAuthorization +{ + /// + /// The identifier for the API key. + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// The name of the API key. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketInfluencer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketInfluencer.g.cs new file mode 100644 index 00000000000..84cdea140d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketInfluencer.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.MachineLearning; + +public sealed partial class BucketInfluencer +{ + /// + /// A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as
newer data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("anomaly_score")] + public double AnomalyScore { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The field name of the influencer. + /// + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + + /// + /// The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the
time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_anomaly_score")] + public double InitialAnomalyScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision
of over 300 decimal places, so the `anomaly_score` is provided as a human-readable and friendly interpretation of
this.
+ ///
+ [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// Internal. + /// + [JsonInclude, JsonPropertyName("raw_anomaly_score")] + public double RawAnomalyScore { get; init; } + + /// + /// Internal. This value is always set to `bucket_influencer`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset? TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketSummary.g.cs new file mode 100644 index 00000000000..f4e8ca45f00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/BucketSummary.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.MachineLearning; + +public sealed partial class BucketSummary +{ + /// + /// The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited
score for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as
new data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("anomaly_score")] + public double AnomalyScore { get; init; } + [JsonInclude, JsonPropertyName("bucket_influencers")] + public IReadOnlyCollection BucketInfluencers { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The number of input data records processed in this bucket. + /// + [JsonInclude, JsonPropertyName("event_count")] + public long EventCount { get; init; } + + /// + /// The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the
time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_anomaly_score")] + public double InitialAnomalyScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The amount of time, in milliseconds, that it took to analyze the bucket contents and calculate results. + /// + [JsonInclude, JsonPropertyName("processing_time_ms")] + public long ProcessingTimeMs { get; init; } + + /// + /// Internal. This value is always set to bucket. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the
timestamp of the bucket are included in the results for the bucket.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the
timestamp of the bucket are included in the results for the bucket.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset? TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Calendar.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Calendar.g.cs new file mode 100644 index 00000000000..d578ac228b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Calendar.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.MachineLearning; + +public sealed partial class Calendar +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// An array of anomaly detection job identifiers. + /// + [JsonInclude, JsonPropertyName("job_ids")] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CalendarEvent.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CalendarEvent.g.cs new file mode 100644 index 00000000000..4bfe895aacc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CalendarEvent.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.MachineLearning; + +public sealed partial class CalendarEvent +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? CalendarId { get; set; } + + /// + /// A description of the scheduled event. + /// + [JsonInclude, JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("end_time")] + public DateTimeOffset EndTime { get; set; } + [JsonInclude, JsonPropertyName("event_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? EventId { get; set; } + + /// + /// The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset StartTime { get; set; } +} + +public sealed partial class CalendarEventDescriptor : SerializableDescriptor +{ + internal CalendarEventDescriptor(Action configure) => configure.Invoke(this); + + public CalendarEventDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? CalendarIdValue { get; set; } + private string DescriptionValue { get; set; } + private DateTimeOffset EndTimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? EventIdValue { get; set; } + private DateTimeOffset StartTimeValue { get; set; } + + /// + /// A string that uniquely identifies a calendar. + /// + public CalendarEventDescriptor CalendarId(Elastic.Clients.Elasticsearch.Serverless.Id? calendarId) + { + CalendarIdValue = calendarId; + return Self; + } + + /// + /// A description of the scheduled event. + /// + public CalendarEventDescriptor Description(string description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + public CalendarEventDescriptor EndTime(DateTimeOffset endTime) + { + EndTimeValue = endTime; + return Self; + } + + public CalendarEventDescriptor EventId(Elastic.Clients.Elasticsearch.Serverless.Id? eventId) + { + EventIdValue = eventId; + return Self; + } + + /// + /// The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + public CalendarEventDescriptor StartTime(DateTimeOffset startTime) + { + StartTimeValue = startTime; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CalendarIdValue is not null) + { + writer.WritePropertyName("calendar_id"); + JsonSerializer.Serialize(writer, CalendarIdValue, options); + } + + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + writer.WritePropertyName("end_time"); + JsonSerializer.Serialize(writer, EndTimeValue, options); + if (EventIdValue is not null) + { + writer.WritePropertyName("event_id"); + JsonSerializer.Serialize(writer, EventIdValue, options); + } + + 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/MachineLearning/CategorizationAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs new file mode 100644 index 00000000000..9f2dfeb68df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzer.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.MachineLearning; + +public sealed partial class CategorizationAnalyzer : Union +{ + public CategorizationAnalyzer(string Name) : base(Name) + { + } + + public CategorizationAnalyzer(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationAnalyzerDefinition Definition) : base(Definition) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs new file mode 100644 index 00000000000..6df4cbe848b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.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.MachineLearning; + +public sealed partial class CategorizationAnalyzerDefinition +{ + /// + /// One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters. + /// + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + + /// + /// One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization. + /// + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + + /// + /// The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`. + /// + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? Tokenizer { get; set; } +} + +public sealed partial class CategorizationAnalyzerDefinitionDescriptor : SerializableDescriptor +{ + internal CategorizationAnalyzerDefinitionDescriptor(Action configure) => configure.Invoke(this); + + public CategorizationAnalyzerDefinitionDescriptor() : base() + { + } + + private ICollection? CharFilterValue { get; set; } + private ICollection? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters. + /// + public CategorizationAnalyzerDefinitionDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization. + /// + public CategorizationAnalyzerDefinitionDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`. + /// + public CategorizationAnalyzerDefinitionDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Serverless.Analysis.ITokenizer? 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 (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Category.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Category.g.cs new file mode 100644 index 00000000000..30652bb6617 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Category.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.MachineLearning; + +public sealed partial class Category +{ + /// + /// A unique identifier for the category. category_id is unique at the job level, even when per-partition categorization is enabled. + /// + [JsonInclude, JsonPropertyName("category_id")] + public long CategoryId { get; init; } + + /// + /// A list of examples of actual values that matched the category. + /// + [JsonInclude, JsonPropertyName("examples")] + public IReadOnlyCollection Examples { get; init; } + + /// + /// [experimental] A Grok pattern that could be used in Logstash or an ingest pipeline to extract fields from messages that match the category. This field is experimental and may be changed or removed in a future release. The Grok patterns that are found are not optimal, but are often a good starting point for manual tweaking. + /// + [JsonInclude, JsonPropertyName("grok_pattern")] + public string? GrokPattern { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The maximum length of the fields that matched the category. The value is increased by 10% to enable matching for similar fields that have not been analyzed. + /// + [JsonInclude, JsonPropertyName("max_matching_length")] + public long MaxMatchingLength { get; init; } + [JsonInclude, JsonPropertyName("mlcategory")] + public string Mlcategory { get; init; } + + /// + /// The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close + /// + [JsonInclude, JsonPropertyName("num_matches")] + public long? NumMatches { get; init; } + [JsonInclude, JsonPropertyName("p")] + public string? p { get; init; } + + /// + /// If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled. + /// + [JsonInclude, JsonPropertyName("partition_field_value")] + public string? PartitionFieldValue { get; init; } + + /// + /// A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close + /// + [JsonInclude, JsonPropertyName("preferred_to_categories")] + public IReadOnlyCollection? PreferredToCategories { get; init; } + + /// + /// A regular expression that is used to search for values that match the category. + /// + [JsonInclude, JsonPropertyName("regex")] + public string Regex { get; init; } + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// A space separated list of the common tokens that are matched in values of the category. + /// + [JsonInclude, JsonPropertyName("terms")] + public string Terms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ChunkingConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ChunkingConfig.g.cs new file mode 100644 index 00000000000..6e357a87fd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ChunkingConfig.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.MachineLearning; + +public sealed partial class ChunkingConfig +{ + /// + /// If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
+ ///
+ [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingMode Mode { get; set; } + + /// + /// The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`. + /// + [JsonInclude, JsonPropertyName("time_span")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? TimeSpan { get; set; } +} + +public sealed partial class ChunkingConfigDescriptor : SerializableDescriptor +{ + internal ChunkingConfigDescriptor(Action configure) => configure.Invoke(this); + + public ChunkingConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingMode ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? TimeSpanValue { get; set; } + + /// + /// If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
+ ///
+ public ChunkingConfigDescriptor Mode(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingMode mode) + { + ModeValue = mode; + return Self; + } + + /// + /// The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`. + /// + public ChunkingConfigDescriptor TimeSpan(Elastic.Clients.Elasticsearch.Serverless.Duration? timeSpan) + { + TimeSpanValue = timeSpan; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + if (TimeSpanValue is not null) + { + writer.WritePropertyName("time_span"); + JsonSerializer.Serialize(writer, TimeSpanValue, options); + } + + writer.WriteEndObject(); + } +} \ 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/MachineLearning/ClassificationInferenceOptions.g.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs index bf0dad73d7a..5b046caf518 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class ClassificationInferenceOptions { @@ -58,6 +58,10 @@ public sealed partial class ClassificationInferenceOptions ///
[JsonInclude, JsonPropertyName("top_classes_results_field")] public string? TopClassesResultsField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig.Classification(classificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.Classification(classificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.Classification(classificationInferenceOptions); } public sealed partial class ClassificationInferenceOptionsDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs new file mode 100644 index 00000000000..ae90441244f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixItem.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.MachineLearning; + +public sealed partial class ConfusionMatrixItem +{ + [JsonInclude, JsonPropertyName("actual_class")] + public string ActualClass { get; init; } + [JsonInclude, JsonPropertyName("actual_class_doc_count")] + public int ActualClassDocCount { get; init; } + [JsonInclude, JsonPropertyName("other_predicted_class_doc_count")] + public int OtherPredictedClassDocCount { get; init; } + [JsonInclude, JsonPropertyName("predicted_classes")] + public IReadOnlyCollection PredictedClasses { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs new file mode 100644 index 00000000000..a3680c1a3e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.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.MachineLearning; + +public sealed partial class ConfusionMatrixPrediction +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("predicted_class")] + public string PredictedClass { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs new file mode 100644 index 00000000000..4a614bc7a97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.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.MachineLearning; + +public sealed partial class ConfusionMatrixThreshold +{ + /// + /// False Negative + /// + [JsonInclude, JsonPropertyName("fn")] + public int FalseNegative { get; init; } + + /// + /// False Positive + /// + [JsonInclude, JsonPropertyName("fp")] + public int FalsePositive { get; init; } + + /// + /// True Negative + /// + [JsonInclude, JsonPropertyName("tn")] + public int TrueNegative { get; init; } + + /// + /// True Positive + /// + [JsonInclude, JsonPropertyName("tp")] + public int TruePositive { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataCounts.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataCounts.g.cs new file mode 100644 index 00000000000..db582b7b1b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataCounts.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.MachineLearning; + +public sealed partial class DataCounts +{ + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + [JsonInclude, JsonPropertyName("earliest_record_timestamp")] + public long? EarliestRecordTimestamp { get; init; } + [JsonInclude, JsonPropertyName("empty_bucket_count")] + public long EmptyBucketCount { get; init; } + [JsonInclude, JsonPropertyName("input_bytes")] + public long InputBytes { get; init; } + [JsonInclude, JsonPropertyName("input_field_count")] + public long InputFieldCount { get; init; } + [JsonInclude, JsonPropertyName("input_record_count")] + public long InputRecordCount { get; init; } + [JsonInclude, JsonPropertyName("invalid_date_count")] + public long InvalidDateCount { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("last_data_time")] + public long? LastDataTime { get; init; } + [JsonInclude, JsonPropertyName("latest_bucket_timestamp")] + public long? LatestBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_empty_bucket_timestamp")] + public long? LatestEmptyBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_record_timestamp")] + public long? LatestRecordTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_sparse_bucket_timestamp")] + public long? LatestSparseBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("log_time")] + public long? LogTime { get; init; } + [JsonInclude, JsonPropertyName("missing_field_count")] + public long MissingFieldCount { get; init; } + [JsonInclude, JsonPropertyName("out_of_order_timestamp_count")] + public long OutOfOrderTimestampCount { get; init; } + [JsonInclude, JsonPropertyName("processed_field_count")] + public long ProcessedFieldCount { get; init; } + [JsonInclude, JsonPropertyName("processed_record_count")] + public long ProcessedRecordCount { get; init; } + [JsonInclude, JsonPropertyName("sparse_bucket_count")] + public long SparseBucketCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataDescription.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataDescription.g.cs new file mode 100644 index 00000000000..defc3f4ed54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataDescription.g.cs @@ -0,0 +1,242 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataDescription +{ + [JsonInclude, JsonPropertyName("field_delimiter")] + public string? FieldDelimiter { get; set; } + + /// + /// Only JSON format is supported at this time. + /// + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// The name of the field that contains the timestamp. + /// + [JsonInclude, JsonPropertyName("time_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TimeField { get; set; } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + [JsonInclude, JsonPropertyName("time_format")] + public string? TimeFormat { get; set; } +} + +public sealed partial class DataDescriptionDescriptor : SerializableDescriptor> +{ + internal DataDescriptionDescriptor(Action> configure) => configure.Invoke(this); + + public DataDescriptionDescriptor() : base() + { + } + + private string? FieldDelimiterValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TimeFieldValue { get; set; } + private string? TimeFormatValue { get; set; } + + public DataDescriptionDescriptor FieldDelimiter(string? fieldDelimiter) + { + FieldDelimiterValue = fieldDelimiter; + return Self; + } + + /// + /// Only JSON format is supported at this time. + /// + public DataDescriptionDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Elastic.Clients.Elasticsearch.Serverless.Field? timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + public DataDescriptionDescriptor TimeFormat(string? timeFormat) + { + TimeFormatValue = timeFormat; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FieldDelimiterValue)) + { + writer.WritePropertyName("field_delimiter"); + writer.WriteStringValue(FieldDelimiterValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (TimeFieldValue is not null) + { + writer.WritePropertyName("time_field"); + JsonSerializer.Serialize(writer, TimeFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimeFormatValue)) + { + writer.WritePropertyName("time_format"); + writer.WriteStringValue(TimeFormatValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataDescriptionDescriptor : SerializableDescriptor +{ + internal DataDescriptionDescriptor(Action configure) => configure.Invoke(this); + + public DataDescriptionDescriptor() : base() + { + } + + private string? FieldDelimiterValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TimeFieldValue { get; set; } + private string? TimeFormatValue { get; set; } + + public DataDescriptionDescriptor FieldDelimiter(string? fieldDelimiter) + { + FieldDelimiterValue = fieldDelimiter; + return Self; + } + + /// + /// Only JSON format is supported at this time. + /// + public DataDescriptionDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Elastic.Clients.Elasticsearch.Serverless.Field? timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + public DataDescriptionDescriptor TimeFormat(string? timeFormat) + { + TimeFormatValue = timeFormat; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FieldDelimiterValue)) + { + writer.WritePropertyName("field_delimiter"); + writer.WriteStringValue(FieldDelimiterValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (TimeFieldValue is not null) + { + writer.WritePropertyName("time_field"); + JsonSerializer.Serialize(writer, TimeFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimeFormatValue)) + { + writer.WritePropertyName("time_format"); + writer.WriteStringValue(TimeFormatValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeed.g.cs new file mode 100644 index 00000000000..e21491fe9e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeed.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.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +internal sealed partial class DatafeedConverter : JsonConverter +{ + public override Datafeed Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyDictionary? aggregations = default; + Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedAuthorization? authorization = default; + Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig = default; + string datafeedId = default; + Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig delayedDataCheckConfig = default; + Elastic.Clients.Elasticsearch.Serverless.Duration? frequency = default; + IReadOnlyCollection? indexes = default; + IReadOnlyCollection indices = default; + Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions = default; + string jobId = default; + int? maxEmptySearches = default; + Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query query = default; + Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay = default; + IReadOnlyDictionary? runtimeMappings = default; + IReadOnlyDictionary? scriptFields = default; + int? scrollSize = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations" || property == "aggs") + { + aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "authorization") + { + authorization = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + chunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "datafeed_id") + { + datafeedId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + delayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indexes") + { + indexes = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices") + { + indices = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + indicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + jobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + maxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + queryDelay = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + runtimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + scriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "scroll_size") + { + scrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new Datafeed { Aggregations = aggregations, Authorization = authorization, ChunkingConfig = chunkingConfig, DatafeedId = datafeedId, DelayedDataCheckConfig = delayedDataCheckConfig, Frequency = frequency, Indexes = indexes, Indices = indices, IndicesOptions = indicesOptions, JobId = jobId, MaxEmptySearches = maxEmptySearches, Query = query, QueryDelay = queryDelay, RuntimeMappings = runtimeMappings, ScriptFields = scriptFields, ScrollSize = scrollSize }; + } + + public override void Write(Utf8JsonWriter writer, Datafeed value, JsonSerializerOptions options) + { + throw new NotImplementedException("'Datafeed' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DatafeedConverter))] +public sealed partial class Datafeed +{ + public IReadOnlyDictionary? Aggregations { get; init; } + + /// + /// The security privileges that the datafeed uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the datafeed, this property is omitted. + /// + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfig { get; init; } + public string DatafeedId { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig DelayedDataCheckConfig { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; init; } + public IReadOnlyCollection? Indexes { get; init; } + public IReadOnlyCollection Indices { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; init; } + public string JobId { get; init; } + public int? MaxEmptySearches { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelay { get; init; } + public IReadOnlyDictionary? RuntimeMappings { get; init; } + public IReadOnlyDictionary? ScriptFields { get; init; } + public int? ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs new file mode 100644 index 00000000000..efa867d2bb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedAuthorization.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.MachineLearning; + +public sealed partial class DatafeedAuthorization +{ + /// + /// If an API key was used for the most recent update to the datafeed, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the datafeed, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedConfig.g.cs new file mode 100644 index 00000000000..be7f9332075 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedConfig.g.cs @@ -0,0 +1,1004 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +internal sealed partial class DatafeedConfigConverter : JsonConverter +{ + public override DatafeedConfig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DatafeedConfig(); + 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 == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "datafeed_id") + { + variant.DatafeedId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DatafeedConfig value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DatafeedId is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, value.DatafeedId, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DatafeedConfigConverter))] +public sealed partial class DatafeedConfig +{ + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public Elastic.Clients.Elasticsearch.Serverless.Id? DatafeedId { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public ICollection? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search. + /// + public Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptions { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public int? ScrollSize { get; set; } +} + +public sealed partial class DatafeedConfigDescriptor : SerializableDescriptor> +{ + internal DatafeedConfigDescriptor(Action> configure) => configure.Invoke(this); + + public DatafeedConfigDescriptor() : base() + { + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? DatafeedIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public DatafeedConfigDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public DatafeedConfigDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id? datafeedId) + { + DatafeedIdValue = datafeedId; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public DatafeedConfigDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public DatafeedConfigDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public DatafeedConfigDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public DatafeedConfigDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public DatafeedConfigDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public DatafeedConfigDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public DatafeedConfigDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public DatafeedConfigDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DatafeedIdValue is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, DatafeedIdValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DatafeedConfigDescriptor : SerializableDescriptor +{ + internal DatafeedConfigDescriptor(Action configure) => configure.Invoke(this); + + public DatafeedConfigDescriptor() : base() + { + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? DatafeedIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public DatafeedConfigDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public DatafeedConfigDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Serverless.Id? datafeedId) + { + DatafeedIdValue = datafeedId; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public DatafeedConfigDescriptor Frequency(Elastic.Clients.Elasticsearch.Serverless.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public DatafeedConfigDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public DatafeedConfigDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public DatafeedConfigDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public DatafeedConfigDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Serverless.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public DatafeedConfigDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public DatafeedConfigDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public DatafeedConfigDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DatafeedIdValue is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, DatafeedIdValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs new file mode 100644 index 00000000000..bfdbc6a85bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedRunningState.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.MachineLearning; + +public sealed partial class DatafeedRunningState +{ + /// + /// Indicates if the datafeed is "real-time"; meaning that the datafeed has no configured `end` time. + /// + [JsonInclude, JsonPropertyName("real_time_configured")] + public bool RealTimeConfigured { get; init; } + + /// + /// Indicates whether the datafeed has finished running on the available past data.
For datafeeds without a configured `end` time, this means that the datafeed is now running on "real-time" data.
+ ///
+ [JsonInclude, JsonPropertyName("real_time_running")] + public bool RealTimeRunning { get; init; } + + /// + /// Provides the latest time interval the datafeed has searched. + /// + [JsonInclude, JsonPropertyName("search_interval")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RunningStateSearchInterval? SearchInterval { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedStats.g.cs new file mode 100644 index 00000000000..a28d1e8c2dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedStats.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.MachineLearning; + +public sealed partial class DatafeedStats +{ + /// + /// For started datafeeds only, contains messages relating to the selection of a node. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// A numerical character string that uniquely identifies the datafeed.
This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
It must start and end with alphanumeric characters.
+ ///
+ [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + + /// + /// An object containing the running state for this datafeed.
It is only provided if the datafeed is started.
+ ///
+ [JsonInclude, JsonPropertyName("running_state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedRunningState? RunningState { get; init; } + + /// + /// The status of the datafeed, which can be one of the following values: `starting`, `started`, `stopping`, `stopped`. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedState State { get; init; } + + /// + /// An object that provides statistical information about timing aspect of this datafeed. + /// + [JsonInclude, JsonPropertyName("timing_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DatafeedTimingStats TimingStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs new file mode 100644 index 00000000000..9ac4c4fc85e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DatafeedTimingStats.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.MachineLearning; + +public sealed partial class DatafeedTimingStats +{ + /// + /// The average search time per bucket, in milliseconds. + /// + [JsonInclude, JsonPropertyName("average_search_time_per_bucket_ms")] + public double? AverageSearchTimePerBucketMs { get; init; } + + /// + /// The number of buckets processed. + /// + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + + /// + /// The exponential average search time per hour, in milliseconds. + /// + [JsonInclude, JsonPropertyName("exponential_average_search_time_per_hour_ms")] + public double ExponentialAverageSearchTimePerHourMs { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The number of searches run by the datafeed. + /// + [JsonInclude, JsonPropertyName("search_count")] + public long SearchCount { get; init; } + + /// + /// The total time the datafeed spent searching, in milliseconds. + /// + [JsonInclude, JsonPropertyName("total_search_time_ms")] + public double TotalSearchTimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeeds.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeeds.g.cs new file mode 100644 index 00000000000..58cedc1b910 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Datafeeds.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.MachineLearning; + +public sealed partial class Datafeeds +{ + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs new file mode 100644 index 00000000000..70d44634676 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysis.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +[JsonConverter(typeof(DataframeAnalysisConverter))] +public sealed partial class DataframeAnalysis +{ + internal DataframeAnalysis(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 DataframeAnalysis Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => new DataframeAnalysis("classification", dataframeAnalysisClassification); + public static DataframeAnalysis OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => new DataframeAnalysis("outlier_detection", dataframeAnalysisOutlierDetection); + public static DataframeAnalysis Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => new DataframeAnalysis("regression", dataframeAnalysisRegression); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeAnalysisConverter : JsonConverter +{ + public override DataframeAnalysis 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; + 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "outlier_detection") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeAnalysis' from the response."); + } + + reader.Read(); + var result = new DataframeAnalysis(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysis 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.MachineLearning.DataframeAnalysisClassification)value.Variant, options); + break; + case "outlier_detection": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisOutlierDetection)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisRegression)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisDescriptor 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 DataframeAnalysisDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => Set(dataframeAnalysisClassification, "classification"); + public DataframeAnalysisDescriptor Classification(Action> configure) => Set(configure, "classification"); + public DataframeAnalysisDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Set(dataframeAnalysisOutlierDetection, "outlier_detection"); + public DataframeAnalysisDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeAnalysisDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => Set(dataframeAnalysisRegression, "regression"); + public DataframeAnalysisDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeAnalysisDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisDescriptor 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 DataframeAnalysisDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => Set(dataframeAnalysisClassification, "classification"); + public DataframeAnalysisDescriptor Classification(Action configure) => Set(configure, "classification"); + public DataframeAnalysisDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Set(dataframeAnalysisOutlierDetection, "outlier_detection"); + public DataframeAnalysisDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeAnalysisDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => Set(dataframeAnalysisRegression, "regression"); + public DataframeAnalysisDescriptor Regression(Action configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs new file mode 100644 index 00000000000..9abae781abc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.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.MachineLearning; + +public sealed partial class DataframeAnalysisAnalyzedFields +{ + /// + /// An array of strings that defines the fields that will be included in the analysis. + /// + [JsonInclude, JsonPropertyName("excludes")] + public ICollection Excludes { get; set; } + + /// + /// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. + /// + [JsonInclude, JsonPropertyName("includes")] + public ICollection Includes { get; set; } +} + +public sealed partial class DataframeAnalysisAnalyzedFieldsDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisAnalyzedFieldsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisAnalyzedFieldsDescriptor() : base() + { + } + + private ICollection ExcludesValue { get; set; } + private ICollection IncludesValue { get; set; } + + /// + /// An array of strings that defines the fields that will be included in the analysis. + /// + public DataframeAnalysisAnalyzedFieldsDescriptor Excludes(ICollection excludes) + { + ExcludesValue = excludes; + return Self; + } + + /// + /// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. + /// + public DataframeAnalysisAnalyzedFieldsDescriptor Includes(ICollection includes) + { + IncludesValue = includes; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("excludes"); + JsonSerializer.Serialize(writer, ExcludesValue, options); + 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/MachineLearning/DataframeAnalysisClassification.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs new file mode 100644 index 00000000000..48f10e81ac6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs @@ -0,0 +1,1200 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +internal sealed partial class DataframeAnalysisClassificationConverter : JsonConverter +{ + public override DataframeAnalysisClassification Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DataframeAnalysisClassification(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "alpha") + { + variant.Alpha = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "class_assignment_objective") + { + variant.ClassAssignmentObjective = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "dependent_variable") + { + variant.DependentVariable = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "downsample_factor") + { + variant.DownsampleFactor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "early_stopping_enabled") + { + variant.EarlyStoppingEnabled = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta") + { + variant.Eta = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta_growth_rate_per_tree") + { + variant.EtaGrowthRatePerTree = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_bag_fraction") + { + variant.FeatureBagFraction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_processors") + { + variant.FeatureProcessors = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "gamma") + { + variant.Gamma = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lambda") + { + variant.Lambda = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_optimization_rounds_per_hyperparameter") + { + variant.MaxOptimizationRoundsPerHyperparameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_trees" || property == "maximum_number_trees") + { + variant.MaxTrees = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_classes") + { + variant.NumTopClasses = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_feature_importance_values") + { + variant.NumTopFeatureImportanceValues = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prediction_field_name") + { + variant.PredictionFieldName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "randomize_seed") + { + variant.RandomizeSeed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_limit") + { + variant.SoftTreeDepthLimit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_tolerance") + { + variant.SoftTreeDepthTolerance = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "training_percent") + { + variant.TrainingPercent = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisClassification value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Alpha.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(value.Alpha.Value); + } + + if (!string.IsNullOrEmpty(value.ClassAssignmentObjective)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(value.ClassAssignmentObjective); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(value.DependentVariable); + if (value.DownsampleFactor.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(value.DownsampleFactor.Value); + } + + if (value.EarlyStoppingEnabled.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(value.EarlyStoppingEnabled.Value); + } + + if (value.Eta.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(value.Eta.Value); + } + + if (value.EtaGrowthRatePerTree.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(value.EtaGrowthRatePerTree.Value); + } + + if (value.FeatureBagFraction.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(value.FeatureBagFraction.Value); + } + + if (value.FeatureProcessors is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, value.FeatureProcessors, options); + } + + if (value.Gamma.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(value.Gamma.Value); + } + + if (value.Lambda.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(value.Lambda.Value); + } + + if (value.MaxOptimizationRoundsPerHyperparameter.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(value.MaxOptimizationRoundsPerHyperparameter.Value); + } + + if (value.MaxTrees.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(value.MaxTrees.Value); + } + + if (value.NumTopClasses.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(value.NumTopClasses.Value); + } + + if (value.NumTopFeatureImportanceValues.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(value.NumTopFeatureImportanceValues.Value); + } + + if (value.PredictionFieldName is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, value.PredictionFieldName, options); + } + + if (value.RandomizeSeed.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(value.RandomizeSeed.Value); + } + + if (value.SoftTreeDepthLimit.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(value.SoftTreeDepthLimit.Value); + } + + if (value.SoftTreeDepthTolerance.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(value.SoftTreeDepthTolerance.Value); + } + + if (value.TrainingPercent.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(value.TrainingPercent.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DataframeAnalysisClassificationConverter))] +public sealed partial class DataframeAnalysisClassification +{ + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public double? Alpha { get; set; } + public string? ClassAssignmentObjective { get; set; } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public string DependentVariable { get; set; } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public double? DownsampleFactor { get; set; } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public bool? EarlyStoppingEnabled { get; set; } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public double? Eta { get; set; } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public double? EtaGrowthRatePerTree { get; set; } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public double? FeatureBagFraction { get; set; } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public ICollection? FeatureProcessors { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Gamma { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Lambda { get; set; } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxOptimizationRoundsPerHyperparameter { get; set; } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxTrees { get; set; } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public int? NumTopClasses { get; set; } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldName { get; set; } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public double? RandomizeSeed { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public int? SoftTreeDepthLimit { get; set; } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public double? SoftTreeDepthTolerance { get; set; } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public double? TrainingPercent { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis(DataframeAnalysisClassification dataframeAnalysisClassification) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis.Classification(dataframeAnalysisClassification); +} + +public sealed partial class DataframeAnalysisClassificationDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisClassificationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisClassificationDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string? ClassAssignmentObjectiveValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action> FeatureProcessorsDescriptorAction { get; set; } + private Action>[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisClassificationDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + public DataframeAnalysisClassificationDescriptor ClassAssignmentObjective(string? classAssignmentObjective) + { + ClassAssignmentObjectiveValue = classAssignmentObjective; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisClassificationDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisClassificationDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisClassificationDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisClassificationDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisClassificationDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisClassificationDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Action> configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(params Action>[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public DataframeAnalysisClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisClassificationDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisClassificationDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + if (!string.IsNullOrEmpty(ClassAssignmentObjectiveValue)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(ClassAssignmentObjectiveValue); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + 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 (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisClassificationDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisClassificationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisClassificationDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string? ClassAssignmentObjectiveValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action FeatureProcessorsDescriptorAction { get; set; } + private Action[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisClassificationDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + public DataframeAnalysisClassificationDescriptor ClassAssignmentObjective(string? classAssignmentObjective) + { + ClassAssignmentObjectiveValue = classAssignmentObjective; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisClassificationDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisClassificationDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisClassificationDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisClassificationDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisClassificationDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisClassificationDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Action configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(params Action[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public DataframeAnalysisClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisClassificationDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisClassificationDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + if (!string.IsNullOrEmpty(ClassAssignmentObjectiveValue)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(ClassAssignmentObjectiveValue); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + 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 (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs new file mode 100644 index 00000000000..759bcca648b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs @@ -0,0 +1,288 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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.MachineLearning; + +[JsonConverter(typeof(DataframeAnalysisFeatureProcessorConverter))] +public sealed partial class DataframeAnalysisFeatureProcessor +{ + internal DataframeAnalysisFeatureProcessor(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 DataframeAnalysisFeatureProcessor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => new DataframeAnalysisFeatureProcessor("frequency_encoding", dataframeAnalysisFeatureProcessorFrequencyEncoding); + public static DataframeAnalysisFeatureProcessor MultiEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => new DataframeAnalysisFeatureProcessor("multi_encoding", dataframeAnalysisFeatureProcessorMultiEncoding); + public static DataframeAnalysisFeatureProcessor NGramEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => new DataframeAnalysisFeatureProcessor("n_gram_encoding", dataframeAnalysisFeatureProcessorNGramEncoding); + public static DataframeAnalysisFeatureProcessor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => new DataframeAnalysisFeatureProcessor("one_hot_encoding", dataframeAnalysisFeatureProcessorOneHotEncoding); + public static DataframeAnalysisFeatureProcessor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => new DataframeAnalysisFeatureProcessor("target_mean_encoding", dataframeAnalysisFeatureProcessorTargetMeanEncoding); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeAnalysisFeatureProcessorConverter : JsonConverter +{ + public override DataframeAnalysisFeatureProcessor 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; + 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 == "frequency_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "multi_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "n_gram_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "one_hot_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "target_mean_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeAnalysisFeatureProcessor' from the response."); + } + + reader.Read(); + var result = new DataframeAnalysisFeatureProcessor(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisFeatureProcessor value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "frequency_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding)value.Variant, options); + break; + case "multi_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding)value.Variant, options); + break; + case "n_gram_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding)value.Variant, options); + break; + case "one_hot_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding)value.Variant, options); + break; + case "target_mean_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisFeatureProcessorDescriptor 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 DataframeAnalysisFeatureProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Set(dataframeAnalysisFeatureProcessorFrequencyEncoding, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Action> configure) => Set(configure, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Set(dataframeAnalysisFeatureProcessorMultiEncoding, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Action configure) => Set(configure, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Set(dataframeAnalysisFeatureProcessorNGramEncoding, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Action> configure) => Set(configure, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Set(dataframeAnalysisFeatureProcessorOneHotEncoding, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Action> configure) => Set(configure, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Set(dataframeAnalysisFeatureProcessorTargetMeanEncoding, "target_mean_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Action> configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeAnalysisFeatureProcessorDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisFeatureProcessorDescriptor 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 DataframeAnalysisFeatureProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Set(dataframeAnalysisFeatureProcessorFrequencyEncoding, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Set(dataframeAnalysisFeatureProcessorMultiEncoding, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Action configure) => Set(configure, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Set(dataframeAnalysisFeatureProcessorNGramEncoding, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Action configure) => Set(configure, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Set(dataframeAnalysisFeatureProcessorOneHotEncoding, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Set(dataframeAnalysisFeatureProcessorTargetMeanEncoding, "target_mean_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs new file mode 100644 index 00000000000..662ac907422 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncoding +{ + /// + /// The resulting feature name. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public Elastic.Clients.Elasticsearch.Serverless.Name FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + [JsonInclude, JsonPropertyName("frequency_map")] + public IDictionary FrequencyMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor.FrequencyEncoding(dataframeAnalysisFeatureProcessorFrequencyEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Serverless.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Serverless.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs new file mode 100644 index 00000000000..ada401aa4bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.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.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorMultiEncoding +{ + /// + /// The ordered array of custom processors to execute. Must be more than 1. + /// + [JsonInclude, JsonPropertyName("processors")] + public ICollection Processors { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor.MultiEncoding(dataframeAnalysisFeatureProcessorMultiEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorMultiEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorMultiEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorMultiEncodingDescriptor() : base() + { + } + + private ICollection ProcessorsValue { get; set; } + + /// + /// The ordered array of custom processors to execute. Must be more than 1. + /// + public DataframeAnalysisFeatureProcessorMultiEncodingDescriptor Processors(ICollection processors) + { + ProcessorsValue = processors; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs new file mode 100644 index 00000000000..c74dd6e2886 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs @@ -0,0 +1,304 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncoding +{ + [JsonInclude, JsonPropertyName("custom")] + public bool? Custom { get; set; } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + [JsonInclude, JsonPropertyName("feature_prefix")] + public string? FeaturePrefix { get; set; } + + /// + /// The name of the text field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + [JsonInclude, JsonPropertyName("length")] + public int? Length { get; set; } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + [JsonInclude, JsonPropertyName("n_grams")] + public ICollection NGrams { get; set; } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("start")] + public int? Start { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor.NGramEncoding(dataframeAnalysisFeatureProcessorNGramEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorNGramEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor() : base() + { + } + + private bool? CustomValue { get; set; } + private string? FeaturePrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? LengthValue { get; set; } + private ICollection NGramsValue { get; set; } + private int? StartValue { get; set; } + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Custom(bool? custom = true) + { + CustomValue = custom; + return Self; + } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor FeaturePrefix(string? featurePrefix) + { + FeaturePrefixValue = featurePrefix; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Length(int? length) + { + LengthValue = length; + return Self; + } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor NGrams(ICollection nGrams) + { + NGramsValue = nGrams; + return Self; + } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Start(int? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CustomValue.HasValue) + { + writer.WritePropertyName("custom"); + writer.WriteBooleanValue(CustomValue.Value); + } + + if (!string.IsNullOrEmpty(FeaturePrefixValue)) + { + writer.WritePropertyName("feature_prefix"); + writer.WriteStringValue(FeaturePrefixValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LengthValue.HasValue) + { + writer.WritePropertyName("length"); + writer.WriteNumberValue(LengthValue.Value); + } + + writer.WritePropertyName("n_grams"); + JsonSerializer.Serialize(writer, NGramsValue, options); + if (StartValue.HasValue) + { + writer.WritePropertyName("start"); + writer.WriteNumberValue(StartValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorNGramEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor() : base() + { + } + + private bool? CustomValue { get; set; } + private string? FeaturePrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private int? LengthValue { get; set; } + private ICollection NGramsValue { get; set; } + private int? StartValue { get; set; } + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Custom(bool? custom = true) + { + CustomValue = custom; + return Self; + } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor FeaturePrefix(string? featurePrefix) + { + FeaturePrefixValue = featurePrefix; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Length(int? length) + { + LengthValue = length; + return Self; + } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor NGrams(ICollection nGrams) + { + NGramsValue = nGrams; + return Self; + } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Start(int? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CustomValue.HasValue) + { + writer.WritePropertyName("custom"); + writer.WriteBooleanValue(CustomValue.Value); + } + + if (!string.IsNullOrEmpty(FeaturePrefixValue)) + { + writer.WritePropertyName("feature_prefix"); + writer.WriteStringValue(FeaturePrefixValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LengthValue.HasValue) + { + writer.WritePropertyName("length"); + writer.WriteNumberValue(LengthValue.Value); + } + + writer.WritePropertyName("n_grams"); + JsonSerializer.Serialize(writer, NGramsValue, options); + if (StartValue.HasValue) + { + writer.WritePropertyName("start"); + writer.WriteNumberValue(StartValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs new file mode 100644 index 00000000000..9c898e9b7f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncoding +{ + /// + /// The name of the field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The one hot map mapping the field value with the column name. + /// + [JsonInclude, JsonPropertyName("hot_map")] + public string HotMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor.OneHotEncoding(dataframeAnalysisFeatureProcessorOneHotEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string HotMapValue { get; set; } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The one hot map mapping the field value with the column name. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor HotMap(string hotMap) + { + HotMapValue = hotMap; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("hot_map"); + writer.WriteStringValue(HotMapValue); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string HotMapValue { get; set; } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The one hot map mapping the field value with the column name. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor HotMap(string hotMap) + { + HotMapValue = hotMap; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("hot_map"); + writer.WriteStringValue(HotMapValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs new file mode 100644 index 00000000000..fd787e8935c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs @@ -0,0 +1,221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncoding +{ + /// + /// The default value if field value is not found in the target_map. + /// + [JsonInclude, JsonPropertyName("default_value")] + public int DefaultValue { get; set; } + + /// + /// The resulting feature name. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public Elastic.Clients.Elasticsearch.Serverless.Name FeatureName { get; set; } + + /// + /// The name of the field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// The field value to target mean transition map. + /// + [JsonInclude, JsonPropertyName("target_map")] + public IDictionary TargetMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessor.TargetMeanEncoding(dataframeAnalysisFeatureProcessorTargetMeanEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor() : base() + { + } + + private int DefaultValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + /// + /// The default value if field value is not found in the target_map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor DefaultValue(int defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Serverless.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field value to target mean transition map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor() : base() + { + } + + private int DefaultValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + /// + /// The default value if field value is not found in the target_map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor DefaultValue(int defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Serverless.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field value to target mean transition map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs new file mode 100644 index 00000000000..b5266ef7597 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.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.MachineLearning; + +public sealed partial class DataframeAnalysisOutlierDetection +{ + /// + /// Specifies whether the feature influence calculation is enabled. + /// + [JsonInclude, JsonPropertyName("compute_feature_influence")] + public bool? ComputeFeatureInfluence { get; set; } + + /// + /// The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1. + /// + [JsonInclude, JsonPropertyName("feature_influence_threshold")] + public double? FeatureInfluenceThreshold { get; set; } + + /// + /// The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score. + /// + [JsonInclude, JsonPropertyName("method")] + public string? Method { get; set; } + + /// + /// Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set. + /// + [JsonInclude, JsonPropertyName("n_neighbors")] + public int? NNeighbors { get; set; } + + /// + /// The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers. + /// + [JsonInclude, JsonPropertyName("outlier_fraction")] + public double? OutlierFraction { get; set; } + + /// + /// If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`. + /// + [JsonInclude, JsonPropertyName("standardization_enabled")] + public bool? StandardizationEnabled { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis(DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis.OutlierDetection(dataframeAnalysisOutlierDetection); +} + +public sealed partial class DataframeAnalysisOutlierDetectionDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisOutlierDetectionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisOutlierDetectionDescriptor() : base() + { + } + + private bool? ComputeFeatureInfluenceValue { get; set; } + private double? FeatureInfluenceThresholdValue { get; set; } + private string? MethodValue { get; set; } + private int? NNeighborsValue { get; set; } + private double? OutlierFractionValue { get; set; } + private bool? StandardizationEnabledValue { get; set; } + + /// + /// Specifies whether the feature influence calculation is enabled. + /// + public DataframeAnalysisOutlierDetectionDescriptor ComputeFeatureInfluence(bool? computeFeatureInfluence = true) + { + ComputeFeatureInfluenceValue = computeFeatureInfluence; + return Self; + } + + /// + /// The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1. + /// + public DataframeAnalysisOutlierDetectionDescriptor FeatureInfluenceThreshold(double? featureInfluenceThreshold) + { + FeatureInfluenceThresholdValue = featureInfluenceThreshold; + return Self; + } + + /// + /// The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score. + /// + public DataframeAnalysisOutlierDetectionDescriptor Method(string? method) + { + MethodValue = method; + return Self; + } + + /// + /// Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set. + /// + public DataframeAnalysisOutlierDetectionDescriptor NNeighbors(int? nNeighbors) + { + NNeighborsValue = nNeighbors; + return Self; + } + + /// + /// The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers. + /// + public DataframeAnalysisOutlierDetectionDescriptor OutlierFraction(double? outlierFraction) + { + OutlierFractionValue = outlierFraction; + return Self; + } + + /// + /// If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`. + /// + public DataframeAnalysisOutlierDetectionDescriptor StandardizationEnabled(bool? standardizationEnabled = true) + { + StandardizationEnabledValue = standardizationEnabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ComputeFeatureInfluenceValue.HasValue) + { + writer.WritePropertyName("compute_feature_influence"); + writer.WriteBooleanValue(ComputeFeatureInfluenceValue.Value); + } + + if (FeatureInfluenceThresholdValue.HasValue) + { + writer.WritePropertyName("feature_influence_threshold"); + writer.WriteNumberValue(FeatureInfluenceThresholdValue.Value); + } + + if (!string.IsNullOrEmpty(MethodValue)) + { + writer.WritePropertyName("method"); + writer.WriteStringValue(MethodValue); + } + + if (NNeighborsValue.HasValue) + { + writer.WritePropertyName("n_neighbors"); + writer.WriteNumberValue(NNeighborsValue.Value); + } + + if (OutlierFractionValue.HasValue) + { + writer.WritePropertyName("outlier_fraction"); + writer.WriteNumberValue(OutlierFractionValue.Value); + } + + if (StandardizationEnabledValue.HasValue) + { + writer.WritePropertyName("standardization_enabled"); + writer.WriteBooleanValue(StandardizationEnabledValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs new file mode 100644 index 00000000000..7ebf67cdb35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs @@ -0,0 +1,1210 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +internal sealed partial class DataframeAnalysisRegressionConverter : JsonConverter +{ + public override DataframeAnalysisRegression Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DataframeAnalysisRegression(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "alpha") + { + variant.Alpha = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "dependent_variable") + { + variant.DependentVariable = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "downsample_factor") + { + variant.DownsampleFactor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "early_stopping_enabled") + { + variant.EarlyStoppingEnabled = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta") + { + variant.Eta = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta_growth_rate_per_tree") + { + variant.EtaGrowthRatePerTree = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_bag_fraction") + { + variant.FeatureBagFraction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_processors") + { + variant.FeatureProcessors = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "gamma") + { + variant.Gamma = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lambda") + { + variant.Lambda = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "loss_function") + { + variant.LossFunction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "loss_function_parameter") + { + variant.LossFunctionParameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_optimization_rounds_per_hyperparameter") + { + variant.MaxOptimizationRoundsPerHyperparameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_trees" || property == "maximum_number_trees") + { + variant.MaxTrees = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_feature_importance_values") + { + variant.NumTopFeatureImportanceValues = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prediction_field_name") + { + variant.PredictionFieldName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "randomize_seed") + { + variant.RandomizeSeed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_limit") + { + variant.SoftTreeDepthLimit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_tolerance") + { + variant.SoftTreeDepthTolerance = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "training_percent") + { + variant.TrainingPercent = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisRegression value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Alpha.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(value.Alpha.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(value.DependentVariable); + if (value.DownsampleFactor.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(value.DownsampleFactor.Value); + } + + if (value.EarlyStoppingEnabled.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(value.EarlyStoppingEnabled.Value); + } + + if (value.Eta.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(value.Eta.Value); + } + + if (value.EtaGrowthRatePerTree.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(value.EtaGrowthRatePerTree.Value); + } + + if (value.FeatureBagFraction.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(value.FeatureBagFraction.Value); + } + + if (value.FeatureProcessors is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, value.FeatureProcessors, options); + } + + if (value.Gamma.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(value.Gamma.Value); + } + + if (value.Lambda.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(value.Lambda.Value); + } + + if (!string.IsNullOrEmpty(value.LossFunction)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(value.LossFunction); + } + + if (value.LossFunctionParameter.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(value.LossFunctionParameter.Value); + } + + if (value.MaxOptimizationRoundsPerHyperparameter.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(value.MaxOptimizationRoundsPerHyperparameter.Value); + } + + if (value.MaxTrees.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(value.MaxTrees.Value); + } + + if (value.NumTopFeatureImportanceValues.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(value.NumTopFeatureImportanceValues.Value); + } + + if (value.PredictionFieldName is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, value.PredictionFieldName, options); + } + + if (value.RandomizeSeed.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(value.RandomizeSeed.Value); + } + + if (value.SoftTreeDepthLimit.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(value.SoftTreeDepthLimit.Value); + } + + if (value.SoftTreeDepthTolerance.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(value.SoftTreeDepthTolerance.Value); + } + + if (value.TrainingPercent.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(value.TrainingPercent.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DataframeAnalysisRegressionConverter))] +public sealed partial class DataframeAnalysisRegression +{ + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public double? Alpha { get; set; } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public string DependentVariable { get; set; } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public double? DownsampleFactor { get; set; } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public bool? EarlyStoppingEnabled { get; set; } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public double? Eta { get; set; } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public double? EtaGrowthRatePerTree { get; set; } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public double? FeatureBagFraction { get; set; } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public ICollection? FeatureProcessors { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Gamma { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Lambda { get; set; } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public string? LossFunction { get; set; } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public double? LossFunctionParameter { get; set; } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxOptimizationRoundsPerHyperparameter { get; set; } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxTrees { get; set; } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldName { get; set; } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public double? RandomizeSeed { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public int? SoftTreeDepthLimit { get; set; } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public double? SoftTreeDepthTolerance { get; set; } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public double? TrainingPercent { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis(DataframeAnalysisRegression dataframeAnalysisRegression) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis.Regression(dataframeAnalysisRegression); +} + +public sealed partial class DataframeAnalysisRegressionDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisRegressionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisRegressionDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action> FeatureProcessorsDescriptorAction { get; set; } + private Action>[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private string? LossFunctionValue { get; set; } + private double? LossFunctionParameterValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisRegressionDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisRegressionDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisRegressionDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisRegressionDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisRegressionDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisRegressionDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisRegressionDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Action> configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(params Action>[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public DataframeAnalysisRegressionDescriptor LossFunction(string? lossFunction) + { + LossFunctionValue = lossFunction; + return Self; + } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public DataframeAnalysisRegressionDescriptor LossFunctionParameter(double? lossFunctionParameter) + { + LossFunctionParameterValue = lossFunctionParameter; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisRegressionDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisRegressionDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (!string.IsNullOrEmpty(LossFunctionValue)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(LossFunctionValue); + } + + if (LossFunctionParameterValue.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(LossFunctionParameterValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisRegressionDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisRegressionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisRegressionDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action FeatureProcessorsDescriptorAction { get; set; } + private Action[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private string? LossFunctionValue { get; set; } + private double? LossFunctionParameterValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisRegressionDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisRegressionDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisRegressionDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisRegressionDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisRegressionDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisRegressionDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisRegressionDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Action configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(params Action[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public DataframeAnalysisRegressionDescriptor LossFunction(string? lossFunction) + { + LossFunctionValue = lossFunction; + return Self; + } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public DataframeAnalysisRegressionDescriptor LossFunctionParameter(double? lossFunctionParameter) + { + LossFunctionParameterValue = lossFunctionParameter; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisRegressionDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisRegressionDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (!string.IsNullOrEmpty(LossFunctionValue)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(LossFunctionValue); + } + + if (LossFunctionParameterValue.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(LossFunctionParameterValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs new file mode 100644 index 00000000000..95ed3300a35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalytics.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.MachineLearning; + +public sealed partial class DataframeAnalytics +{ + /// + /// For running jobs only, contains messages relating to the selection of a node to run the job. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// An object that provides counts for the quantity of documents skipped, used in training, or available for testing. + /// + [JsonInclude, JsonPropertyName("data_counts")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsStatsDataCounts DataCounts { get; init; } + + /// + /// The unique identifier of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// An object describing memory usage of the analytics. It is present only after the job is started and memory usage is reported. + /// + [JsonInclude, JsonPropertyName("memory_usage")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsStatsMemoryUsage MemoryUsage { get; init; } + + /// + /// The progress report of the data frame analytics job by phase. + /// + [JsonInclude, JsonPropertyName("progress")] + public IReadOnlyCollection Progress { get; init; } + + /// + /// The status of the data frame analytics job, which can be one of the following values: failed, started, starting, stopping, stopped. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeState State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs new file mode 100644 index 00000000000..a60de5b8091 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.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.MachineLearning; + +public sealed partial class DataframeAnalyticsAuthorization +{ + /// + /// If an API key was used for the most recent update to the job, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the job, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs new file mode 100644 index 00000000000..4818909dfcf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.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.MachineLearning; + +public sealed partial class DataframeAnalyticsDestination +{ + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName Index { get; set; } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + [JsonInclude, JsonPropertyName("results_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? ResultsField { get; set; } +} + +public sealed partial class DataframeAnalyticsDestinationDescriptor : SerializableDescriptor> +{ + internal DataframeAnalyticsDestinationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalyticsDestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + public DataframeAnalyticsDestinationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalyticsDestinationDescriptor : SerializableDescriptor +{ + internal DataframeAnalyticsDestinationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalyticsDestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? ResultsFieldValue { get; set; } + + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + public DataframeAnalyticsDestinationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Serverless.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + 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/MachineLearning/DataframeAnalyticsFieldSelection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs new file mode 100644 index 00000000000..abf1a9ce632 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.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.MachineLearning; + +public sealed partial class DataframeAnalyticsFieldSelection +{ + /// + /// The feature type of this field for the analysis. May be categorical or numerical. + /// + [JsonInclude, JsonPropertyName("feature_type")] + public string? FeatureType { get; init; } + + /// + /// Whether the field is selected to be included in the analysis. + /// + [JsonInclude, JsonPropertyName("is_included")] + public bool IsIncluded { get; init; } + + /// + /// Whether the field is required. + /// + [JsonInclude, JsonPropertyName("is_required")] + public bool IsRequired { get; init; } + + /// + /// The mapping types of the field. + /// + [JsonInclude, JsonPropertyName("mapping_types")] + public IReadOnlyCollection MappingTypes { get; init; } + + /// + /// The field name. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// The reason a field is not selected to be included in the analysis. + /// + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs new file mode 100644 index 00000000000..d804a0dbc44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.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.MachineLearning; + +public sealed partial class DataframeAnalyticsMemoryEstimation +{ + /// + /// Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics. + /// + [JsonInclude, JsonPropertyName("expected_memory_with_disk")] + public string ExpectedMemoryWithDisk { get; init; } + + /// + /// Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk). + /// + [JsonInclude, JsonPropertyName("expected_memory_without_disk")] + public string ExpectedMemoryWithoutDisk { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs new file mode 100644 index 00000000000..af109e48370 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs @@ -0,0 +1,327 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeAnalyticsSource +{ + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.Indices Indices { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? Source { get; set; } +} + +public sealed partial class DataframeAnalyticsSourceDescriptor : SerializableDescriptor> +{ + internal DataframeAnalyticsSourceDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalyticsSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + public DataframeAnalyticsSourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + public DataframeAnalyticsSourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalyticsSourceDescriptor : SerializableDescriptor +{ + internal DataframeAnalyticsSourceDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalyticsSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + public DataframeAnalyticsSourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + public DataframeAnalyticsSourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + 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/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs new file mode 100644 index 00000000000..cd9be8d45dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.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.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsDataCounts +{ + /// + /// The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element. + /// + [JsonInclude, JsonPropertyName("skipped_docs_count")] + public int SkippedDocsCount { get; init; } + + /// + /// The number of documents that are not used for training the model and can be used for testing. + /// + [JsonInclude, JsonPropertyName("test_docs_count")] + public int TestDocsCount { get; init; } + + /// + /// The number of documents that are used for training the model. + /// + [JsonInclude, JsonPropertyName("training_docs_count")] + public int TrainingDocsCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs new file mode 100644 index 00000000000..267a47b40c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.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.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsMemoryUsage +{ + /// + /// This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs. + /// + [JsonInclude, JsonPropertyName("memory_reestimate_bytes")] + public long? MemoryReestimateBytes { get; init; } + + /// + /// The number of bytes used at the highest peak of memory usage. + /// + [JsonInclude, JsonPropertyName("peak_usage_bytes")] + public long PeakUsageBytes { get; init; } + + /// + /// The memory usage status. + /// + [JsonInclude, JsonPropertyName("status")] + public string Status { get; init; } + + /// + /// The timestamp when memory usage was calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs new file mode 100644 index 00000000000..f5e5e406f96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.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.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsProgress +{ + /// + /// Defines the phase of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("phase")] + public string Phase { get; init; } + + /// + /// The progress that the data frame analytics job has made expressed in percentage. + /// + [JsonInclude, JsonPropertyName("progress_percent")] + public int ProgressPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs new file mode 100644 index 00000000000..8225b2f6b20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.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.MachineLearning; + +public sealed partial class DataframeAnalyticsSummary +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + + /// + /// The security privileges that the job uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the job, this property is omitted. + /// + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long? CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource Source { 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/MachineLearning/DataframeClassificationSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs new file mode 100644 index 00000000000..00c20dd5990 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummary.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.MachineLearning; + +public sealed partial class DataframeClassificationSummary +{ + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("accuracy")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeClassificationSummaryAccuracy? Accuracy { get; init; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve.
It is calculated for a specific class (provided as "class_name") treated as positive.
+ ///
+ [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationSummaryAucRoc? AucRoc { get; init; } + + /// + /// Multiclass confusion matrix. + /// + [JsonInclude, JsonPropertyName("multiclass_confusion_matrix")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix? MulticlassConfusionMatrix { get; init; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeClassificationSummaryPrecision? Precision { get; init; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeClassificationSummaryRecall? Recall { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs new file mode 100644 index 00000000000..1054f98958c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.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.MachineLearning; + +public sealed partial class DataframeClassificationSummaryAccuracy +{ + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } + [JsonInclude, JsonPropertyName("overall_accuracy")] + public double OverallAccuracy { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs new file mode 100644 index 00000000000..0ec22d13667 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.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.MachineLearning; + +public sealed partial class DataframeClassificationSummaryMulticlassConfusionMatrix +{ + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IReadOnlyCollection ConfusionMatrix { get; init; } + [JsonInclude, JsonPropertyName("other_actual_class_count")] + public int OtherActualClassCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs new file mode 100644 index 00000000000..8505fdf2805 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.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.MachineLearning; + +public sealed partial class DataframeClassificationSummaryPrecision +{ + [JsonInclude, JsonPropertyName("avg_precision")] + public double AvgPrecision { get; init; } + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs new file mode 100644 index 00000000000..724a607404f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.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.MachineLearning; + +public sealed partial class DataframeClassificationSummaryRecall +{ + [JsonInclude, JsonPropertyName("avg_recall")] + public double AvgRecall { get; init; } + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs new file mode 100644 index 00000000000..ce94cd0565c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluation.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +[JsonConverter(typeof(DataframeEvaluationConverter))] +public sealed partial class DataframeEvaluation +{ + internal DataframeEvaluation(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 DataframeEvaluation Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => new DataframeEvaluation("classification", dataframeEvaluationClassification); + public static DataframeEvaluation OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => new DataframeEvaluation("outlier_detection", dataframeEvaluationOutlierDetection); + public static DataframeEvaluation Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => new DataframeEvaluation("regression", dataframeEvaluationRegression); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeEvaluationConverter : JsonConverter +{ + public override DataframeEvaluation 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; + 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "outlier_detection") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeEvaluation' from the response."); + } + + reader.Read(); + var result = new DataframeEvaluation(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeEvaluation 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.MachineLearning.DataframeEvaluationClassification)value.Variant, options); + break; + case "outlier_detection": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetection)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegression)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeEvaluationDescriptor 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 DataframeEvaluationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeEvaluationDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => Set(dataframeEvaluationClassification, "classification"); + public DataframeEvaluationDescriptor Classification(Action> configure) => Set(configure, "classification"); + public DataframeEvaluationDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Set(dataframeEvaluationOutlierDetection, "outlier_detection"); + public DataframeEvaluationDescriptor OutlierDetection(Action> configure) => Set(configure, "outlier_detection"); + public DataframeEvaluationDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => Set(dataframeEvaluationRegression, "regression"); + public DataframeEvaluationDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeEvaluationDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeEvaluationDescriptor 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 DataframeEvaluationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeEvaluationDescriptor Classification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => Set(dataframeEvaluationClassification, "classification"); + public DataframeEvaluationDescriptor Classification(Action configure) => Set(configure, "classification"); + public DataframeEvaluationDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Set(dataframeEvaluationOutlierDetection, "outlier_detection"); + public DataframeEvaluationDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeEvaluationDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => Set(dataframeEvaluationRegression, "regression"); + public DataframeEvaluationDescriptor Regression(Action configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/MachineLearning/DataframeEvaluationClass.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs new file mode 100644 index 00000000000..d57392546ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClass.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.MachineLearning; + +public sealed partial class DataframeEvaluationClass +{ + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs new file mode 100644 index 00000000000..c82d7504932 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassification.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.MachineLearning; + +public sealed partial class DataframeEvaluationClassification +{ + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetrics? Metrics { get; set; } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + [JsonInclude, JsonPropertyName("predicted_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? PredictedField { get; set; } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + [JsonInclude, JsonPropertyName("top_classes_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation(DataframeEvaluationClassification dataframeEvaluationClassification) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation.Classification(dataframeEvaluationClassification); +} + +public sealed partial class DataframeEvaluationClassificationDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationClassificationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictedFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Elastic.Clients.Elasticsearch.Serverless.Field? predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Elastic.Clients.Elasticsearch.Serverless.Field? topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + if (PredictedFieldValue is not null) + { + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + } + + if (TopClassesFieldValue is not null) + { + writer.WritePropertyName("top_classes_field"); + JsonSerializer.Serialize(writer, TopClassesFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationClassificationDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PredictedFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TopClassesFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Elastic.Clients.Elasticsearch.Serverless.Field? predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Elastic.Clients.Elasticsearch.Serverless.Field? topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + if (PredictedFieldValue is not null) + { + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + } + + if (TopClassesFieldValue is not null) + { + writer.WritePropertyName("top_classes_field"); + JsonSerializer.Serialize(writer, TopClassesFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs new file mode 100644 index 00000000000..0468c386a0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.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.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeEvaluationClassificationMetrics +{ + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("accuracy")] + public IDictionary? Accuracy { get; set; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRoc { get; set; } + + /// + /// Multiclass confusion matrix. + /// + [JsonInclude, JsonPropertyName("multiclass_confusion_matrix")] + public IDictionary? MulticlassConfusionMatrix { get; set; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public IDictionary? Precision { get; set; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public IDictionary? Recall { get; set; } +} + +public sealed partial class DataframeEvaluationClassificationMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationMetricsDescriptor() : base() + { + } + + private IDictionary? AccuracyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRocValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor AucRocDescriptor { get; set; } + private Action AucRocDescriptorAction { get; set; } + private IDictionary? MulticlassConfusionMatrixValue { get; set; } + private IDictionary? PrecisionValue { get; set; } + private IDictionary? RecallValue { get; set; } + + /// + /// Accuracy of predictions (per-class and overall). + /// + public DataframeEvaluationClassificationMetricsDescriptor Accuracy(Func, FluentDictionary> selector) + { + AccuracyValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? aucRoc) + { + AucRocDescriptor = null; + AucRocDescriptorAction = null; + AucRocValue = aucRoc; + return Self; + } + + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor descriptor) + { + AucRocValue = null; + AucRocDescriptorAction = null; + AucRocDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Action configure) + { + AucRocValue = null; + AucRocDescriptor = null; + AucRocDescriptorAction = configure; + return Self; + } + + /// + /// Multiclass confusion matrix. + /// + public DataframeEvaluationClassificationMetricsDescriptor MulticlassConfusionMatrix(Func, FluentDictionary> selector) + { + MulticlassConfusionMatrixValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Precision of predictions (per-class and average). + /// + public DataframeEvaluationClassificationMetricsDescriptor Precision(Func, FluentDictionary> selector) + { + PrecisionValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Recall of predictions (per-class and average). + /// + public DataframeEvaluationClassificationMetricsDescriptor Recall(Func, FluentDictionary> selector) + { + RecallValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AccuracyValue is not null) + { + writer.WritePropertyName("accuracy"); + JsonSerializer.Serialize(writer, AccuracyValue, options); + } + + if (AucRocDescriptor is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocDescriptor, options); + } + else if (AucRocDescriptorAction is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor(AucRocDescriptorAction), options); + } + else if (AucRocValue is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocValue, options); + } + + if (MulticlassConfusionMatrixValue is not null) + { + writer.WritePropertyName("multiclass_confusion_matrix"); + JsonSerializer.Serialize(writer, MulticlassConfusionMatrixValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + 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/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs new file mode 100644 index 00000000000..f14f1c38e45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.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.MachineLearning; + +public sealed partial class DataframeEvaluationClassificationMetricsAucRoc +{ + /// + /// Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes. + /// + [JsonInclude, JsonPropertyName("class_name")] + public Elastic.Clients.Elasticsearch.Serverless.Name? ClassName { get; set; } + + /// + /// Whether or not the curve should be returned in addition to the score. Default value is false. + /// + [JsonInclude, JsonPropertyName("include_curve")] + public bool? IncludeCurve { get; set; } +} + +public sealed partial class DataframeEvaluationClassificationMetricsAucRocDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationMetricsAucRocDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationMetricsAucRocDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Name? ClassNameValue { get; set; } + private bool? IncludeCurveValue { get; set; } + + /// + /// Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes. + /// + public DataframeEvaluationClassificationMetricsAucRocDescriptor ClassName(Elastic.Clients.Elasticsearch.Serverless.Name? className) + { + ClassNameValue = className; + return Self; + } + + /// + /// Whether or not the curve should be returned in addition to the score. Default value is false. + /// + public DataframeEvaluationClassificationMetricsAucRocDescriptor IncludeCurve(bool? includeCurve = true) + { + IncludeCurveValue = includeCurve; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClassNameValue is not null) + { + writer.WritePropertyName("class_name"); + JsonSerializer.Serialize(writer, ClassNameValue, options); + } + + if (IncludeCurveValue.HasValue) + { + writer.WritePropertyName("include_curve"); + writer.WriteBooleanValue(IncludeCurveValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs new file mode 100644 index 00000000000..2b74fe4f547 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeEvaluationOutlierDetection +{ + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? Metrics { get; set; } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + [JsonInclude, JsonPropertyName("predicted_probability_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field PredictedProbabilityField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation(DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation.OutlierDetection(dataframeEvaluationOutlierDetection); +} + +public sealed partial class DataframeEvaluationOutlierDetectionDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationOutlierDetectionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PredictedProbabilityFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Elastic.Clients.Elasticsearch.Serverless.Field predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_probability_field"); + JsonSerializer.Serialize(writer, PredictedProbabilityFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationOutlierDetectionDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationOutlierDetectionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PredictedProbabilityFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Elastic.Clients.Elasticsearch.Serverless.Field predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_probability_field"); + JsonSerializer.Serialize(writer, PredictedProbabilityFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs new file mode 100644 index 00000000000..01852528fe3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.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.MachineLearning; + +public sealed partial class DataframeEvaluationOutlierDetectionMetrics +{ + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRoc { get; set; } + + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IDictionary? ConfusionMatrix { get; set; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public IDictionary? Precision { get; set; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public IDictionary? Recall { get; set; } +} + +public sealed partial class DataframeEvaluationOutlierDetectionMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationOutlierDetectionMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionMetricsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRocValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor AucRocDescriptor { get; set; } + private Action AucRocDescriptorAction { get; set; } + private IDictionary? ConfusionMatrixValue { get; set; } + private IDictionary? PrecisionValue { get; set; } + private IDictionary? RecallValue { get; set; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? aucRoc) + { + AucRocDescriptor = null; + AucRocDescriptorAction = null; + AucRocValue = aucRoc; + return Self; + } + + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor descriptor) + { + AucRocValue = null; + AucRocDescriptorAction = null; + AucRocDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Action configure) + { + AucRocValue = null; + AucRocDescriptor = null; + AucRocDescriptorAction = configure; + return Self; + } + + /// + /// Accuracy of predictions (per-class and overall). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor ConfusionMatrix(Func, FluentDictionary> selector) + { + ConfusionMatrixValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Precision of predictions (per-class and average). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor Precision(Func, FluentDictionary> selector) + { + PrecisionValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Recall of predictions (per-class and average). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor Recall(Func, FluentDictionary> selector) + { + RecallValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AucRocDescriptor is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocDescriptor, options); + } + else if (AucRocDescriptorAction is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor(AucRocDescriptorAction), options); + } + else if (AucRocValue is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocValue, options); + } + + if (ConfusionMatrixValue is not null) + { + writer.WritePropertyName("confusion_matrix"); + JsonSerializer.Serialize(writer, ConfusionMatrixValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + 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/MachineLearning/DataframeEvaluationRegression.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs new file mode 100644 index 00000000000..04fe0b9ccda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DataframeEvaluationRegression +{ + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetrics? Metrics { get; set; } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + [JsonInclude, JsonPropertyName("predicted_field")] + public Elastic.Clients.Elasticsearch.Serverless.Field PredictedField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation(DataframeEvaluationRegression dataframeEvaluationRegression) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluation.Regression(dataframeEvaluationRegression); +} + +public sealed partial class DataframeEvaluationRegressionDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationRegressionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PredictedFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Elastic.Clients.Elasticsearch.Serverless.Field predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationRegressionDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field PredictedFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Elastic.Clients.Elasticsearch.Serverless.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Elastic.Clients.Elasticsearch.Serverless.Field predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs new file mode 100644 index 00000000000..21620947f3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.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.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetrics +{ + /// + /// Pseudo Huber loss function. + /// + [JsonInclude, JsonPropertyName("huber")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuber? Huber { get; set; } + + /// + /// Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article. + /// + [JsonInclude, JsonPropertyName("mse")] + public IDictionary? Mse { get; set; } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value. + /// + [JsonInclude, JsonPropertyName("msle")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsle? Msle { get; set; } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + [JsonInclude, JsonPropertyName("r_squared")] + public IDictionary? RSquared { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuber? HuberValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor HuberDescriptor { get; set; } + private Action HuberDescriptorAction { get; set; } + private IDictionary? MseValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsle? MsleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor MsleDescriptor { get; set; } + private Action MsleDescriptorAction { get; set; } + private IDictionary? RSquaredValue { get; set; } + + /// + /// Pseudo Huber loss function. + /// + public DataframeEvaluationRegressionMetricsDescriptor Huber(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuber? huber) + { + HuberDescriptor = null; + HuberDescriptorAction = null; + HuberValue = huber; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Huber(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor descriptor) + { + HuberValue = null; + HuberDescriptorAction = null; + HuberDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Huber(Action configure) + { + HuberValue = null; + HuberDescriptor = null; + HuberDescriptorAction = configure; + return Self; + } + + /// + /// Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article. + /// + public DataframeEvaluationRegressionMetricsDescriptor Mse(Func, FluentDictionary> selector) + { + MseValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value. + /// + public DataframeEvaluationRegressionMetricsDescriptor Msle(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsle? msle) + { + MsleDescriptor = null; + MsleDescriptorAction = null; + MsleValue = msle; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Msle(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor descriptor) + { + MsleValue = null; + MsleDescriptorAction = null; + MsleDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Msle(Action configure) + { + MsleValue = null; + MsleDescriptor = null; + MsleDescriptorAction = configure; + return Self; + } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + public DataframeEvaluationRegressionMetricsDescriptor RSquared(Func, FluentDictionary> selector) + { + RSquaredValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HuberDescriptor is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, HuberDescriptor, options); + } + else if (HuberDescriptorAction is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor(HuberDescriptorAction), options); + } + else if (HuberValue is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, HuberValue, options); + } + + if (MseValue is not null) + { + writer.WritePropertyName("mse"); + JsonSerializer.Serialize(writer, MseValue, options); + } + + if (MsleDescriptor is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, MsleDescriptor, options); + } + else if (MsleDescriptorAction is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor(MsleDescriptorAction), options); + } + else if (MsleValue is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, MsleValue, options); + } + + if (RSquaredValue is not null) + { + writer.WritePropertyName("r_squared"); + JsonSerializer.Serialize(writer, RSquaredValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs new file mode 100644 index 00000000000..e6d7043a60b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.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.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetricsHuber +{ + /// + /// Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0. + /// + [JsonInclude, JsonPropertyName("delta")] + public double? Delta { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsHuberDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsHuberDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsHuberDescriptor() : base() + { + } + + private double? DeltaValue { get; set; } + + /// + /// Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0. + /// + public DataframeEvaluationRegressionMetricsHuberDescriptor Delta(double? delta) + { + DeltaValue = delta; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DeltaValue.HasValue) + { + writer.WritePropertyName("delta"); + writer.WriteNumberValue(DeltaValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs new file mode 100644 index 00000000000..2c01fb9eeb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.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.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetricsMsle +{ + /// + /// Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1. + /// + [JsonInclude, JsonPropertyName("offset")] + public double? Offset { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsMsleDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsMsleDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsMsleDescriptor() : base() + { + } + + private double? OffsetValue { get; set; } + + /// + /// Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1. + /// + public DataframeEvaluationRegressionMetricsMsleDescriptor Offset(double? offset) + { + OffsetValue = offset; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OffsetValue.HasValue) + { + writer.WritePropertyName("offset"); + writer.WriteNumberValue(OffsetValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs new file mode 100644 index 00000000000..b1868bf3ba3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.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.MachineLearning; + +public sealed partial class DataframeEvaluationSummaryAucRoc +{ + [JsonInclude, JsonPropertyName("curve")] + public IReadOnlyCollection? Curve { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs new file mode 100644 index 00000000000..6475a4ac6c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.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.MachineLearning; + +public sealed partial class DataframeEvaluationSummaryAucRocCurveItem +{ + [JsonInclude, JsonPropertyName("fpr")] + public double Fpr { get; init; } + [JsonInclude, JsonPropertyName("threshold")] + public double Threshold { get; init; } + [JsonInclude, JsonPropertyName("tpr")] + public double Tpr { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs new file mode 100644 index 00000000000..1fecfee17d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeEvaluationValue.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.MachineLearning; + +public sealed partial class DataframeEvaluationValue +{ + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs new file mode 100644 index 00000000000..79b56edd857 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.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.MachineLearning; + +public sealed partial class DataframeOutlierDetectionSummary +{ + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationSummaryAucRoc? AucRoc { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metrics (`tp` - true positive, `fp` - false positive, `tn` - true negative, `fn` - false negative) are calculated. + /// + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IReadOnlyDictionary? ConfusionMatrix { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metric is calculated. + /// + [JsonInclude, JsonPropertyName("precision")] + public IReadOnlyDictionary? Precision { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metric is calculated. + /// + [JsonInclude, JsonPropertyName("recall")] + public IReadOnlyDictionary? Recall { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs new file mode 100644 index 00000000000..e75fa0df884 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframePreviewConfig.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.MachineLearning; + +public sealed partial class DataframePreviewConfig +{ + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis Analysis { get; set; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource Source { get; set; } +} + +public sealed partial class DataframePreviewConfigDescriptor : SerializableDescriptor> +{ + internal DataframePreviewConfigDescriptor(Action> configure) => configure.Invoke(this); + + public DataframePreviewConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + public DataframePreviewConfigDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframePreviewConfigDescriptor : SerializableDescriptor +{ + internal DataframePreviewConfigDescriptor(Action configure) => configure.Invoke(this); + + public DataframePreviewConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + public DataframePreviewConfigDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + 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/MachineLearning/DataframeRegressionSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs new file mode 100644 index 00000000000..b4be58ea44c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DataframeRegressionSummary.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.MachineLearning; + +public sealed partial class DataframeRegressionSummary +{ + /// + /// Pseudo Huber loss function. + /// + [JsonInclude, JsonPropertyName("huber")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationValue? Huber { get; init; } + + /// + /// Average squared difference between the predicted values and the actual (`ground truth`) value. + /// + [JsonInclude, JsonPropertyName("mse")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationValue? Mse { get; init; } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (`ground truth`) value. + /// + [JsonInclude, JsonPropertyName("msle")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationValue? Msle { get; init; } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + [JsonInclude, JsonPropertyName("r_squared")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataframeEvaluationValue? RSquared { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Defaults.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Defaults.g.cs new file mode 100644 index 00000000000..425657063bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Defaults.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.MachineLearning; + +public sealed partial class Defaults +{ + [JsonInclude, JsonPropertyName("anomaly_detectors")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnomalyDetectors AnomalyDetectors { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Datafeeds Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Definition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Definition.g.cs new file mode 100644 index 00000000000..8b5862ba08d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Definition.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class Definition +{ + /// + /// Collection of preprocessors + /// + [JsonInclude, JsonPropertyName("preprocessors")] + public ICollection? Preprocessors { get; set; } + + /// + /// The definition of the trained model. + /// + [JsonInclude, JsonPropertyName("trained_model")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModel TrainedModel { get; set; } +} + +public sealed partial class DefinitionDescriptor : SerializableDescriptor +{ + internal DefinitionDescriptor(Action configure) => configure.Invoke(this); + + public DefinitionDescriptor() : base() + { + } + + private ICollection? PreprocessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PreprocessorDescriptor PreprocessorsDescriptor { get; set; } + private Action PreprocessorsDescriptorAction { get; set; } + private Action[] PreprocessorsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModel TrainedModelValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor TrainedModelDescriptor { get; set; } + private Action TrainedModelDescriptorAction { get; set; } + + /// + /// Collection of preprocessors + /// + public DefinitionDescriptor Preprocessors(ICollection? preprocessors) + { + PreprocessorsDescriptor = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = null; + PreprocessorsValue = preprocessors; + return Self; + } + + public DefinitionDescriptor Preprocessors(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PreprocessorDescriptor descriptor) + { + PreprocessorsValue = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = null; + PreprocessorsDescriptor = descriptor; + return Self; + } + + public DefinitionDescriptor Preprocessors(Action configure) + { + PreprocessorsValue = null; + PreprocessorsDescriptor = null; + PreprocessorsDescriptorActions = null; + PreprocessorsDescriptorAction = configure; + return Self; + } + + public DefinitionDescriptor Preprocessors(params Action[] configure) + { + PreprocessorsValue = null; + PreprocessorsDescriptor = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = configure; + return Self; + } + + /// + /// The definition of the trained model. + /// + public DefinitionDescriptor TrainedModel(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModel trainedModel) + { + TrainedModelDescriptor = null; + TrainedModelDescriptorAction = null; + TrainedModelValue = trainedModel; + return Self; + } + + public DefinitionDescriptor TrainedModel(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor descriptor) + { + TrainedModelValue = null; + TrainedModelDescriptorAction = null; + TrainedModelDescriptor = descriptor; + return Self; + } + + public DefinitionDescriptor TrainedModel(Action configure) + { + TrainedModelValue = null; + TrainedModelDescriptor = null; + TrainedModelDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PreprocessorsDescriptor is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, PreprocessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (PreprocessorsDescriptorAction is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PreprocessorDescriptor(PreprocessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (PreprocessorsDescriptorActions is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + foreach (var action in PreprocessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PreprocessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (PreprocessorsValue is not null) + { + writer.WritePropertyName("preprocessors"); + JsonSerializer.Serialize(writer, PreprocessorsValue, options); + } + + if (TrainedModelDescriptor is not null) + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, TrainedModelDescriptor, options); + } + else if (TrainedModelDescriptorAction is not null) + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor(TrainedModelDescriptorAction), options); + } + else + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, TrainedModelValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs new file mode 100644 index 00000000000..d18acc7b5e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DelayedDataCheckConfig.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.MachineLearning; + +public sealed partial class DelayedDataCheckConfig +{ + /// + /// The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
+ ///
+ [JsonInclude, JsonPropertyName("check_window")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CheckWindow { get; set; } + + /// + /// Specifies whether the datafeed periodically checks for delayed data. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class DelayedDataCheckConfigDescriptor : SerializableDescriptor +{ + internal DelayedDataCheckConfigDescriptor(Action configure) => configure.Invoke(this); + + public DelayedDataCheckConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? CheckWindowValue { get; set; } + private bool EnabledValue { get; set; } + + /// + /// The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
+ ///
+ public DelayedDataCheckConfigDescriptor CheckWindow(Elastic.Clients.Elasticsearch.Serverless.Duration? checkWindow) + { + CheckWindowValue = checkWindow; + return Self; + } + + /// + /// Specifies whether the datafeed periodically checks for delayed data. + /// + public DelayedDataCheckConfigDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CheckWindowValue is not null) + { + writer.WritePropertyName("check_window"); + JsonSerializer.Serialize(writer, CheckWindowValue, options); + } + + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectionRule.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectionRule.g.cs new file mode 100644 index 00000000000..98491abd25f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectionRule.g.cs @@ -0,0 +1,293 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class DetectionRule +{ + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + [JsonInclude, JsonPropertyName("actions")] + public ICollection? Actions { get; set; } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + [JsonInclude, JsonPropertyName("conditions")] + public ICollection? Conditions { get; set; } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + [JsonInclude, JsonPropertyName("scope")] + public IDictionary? Scope { get; set; } +} + +public sealed partial class DetectionRuleDescriptor : SerializableDescriptor> +{ + internal DetectionRuleDescriptor(Action> configure) => configure.Invoke(this); + + public DetectionRuleDescriptor() : base() + { + } + + private ICollection? ActionsValue { get; set; } + private ICollection? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Action[] ConditionsDescriptorActions { get; set; } + private IDictionary ScopeValue { get; set; } + + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + public DetectionRuleDescriptor Actions(ICollection? actions) + { + ActionsValue = actions; + return Self; + } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + public DetectionRuleDescriptor Conditions(ICollection? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsValue = conditions; + return Self; + } + + public DetectionRuleDescriptor Conditions(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor descriptor) + { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsDescriptor = descriptor; + return Self; + } + + public DetectionRuleDescriptor Conditions(Action configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorActions = null; + ConditionsDescriptorAction = configure; + return Self; + } + + public DetectionRuleDescriptor Conditions(params Action[] configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = configure; + return Self; + } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + public DetectionRuleDescriptor Scope(Func, FluentDescriptorDictionary> selector) + { + ScopeValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (ConditionsDescriptor is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ConditionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorAction is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor(ConditionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorActions is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + foreach (var action in ConditionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ConditionsValue is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsValue, options); + } + + if (ScopeValue is not null) + { + writer.WritePropertyName("scope"); + JsonSerializer.Serialize(writer, ScopeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DetectionRuleDescriptor : SerializableDescriptor +{ + internal DetectionRuleDescriptor(Action configure) => configure.Invoke(this); + + public DetectionRuleDescriptor() : base() + { + } + + private ICollection? ActionsValue { get; set; } + private ICollection? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Action[] ConditionsDescriptorActions { get; set; } + private IDictionary ScopeValue { get; set; } + + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + public DetectionRuleDescriptor Actions(ICollection? actions) + { + ActionsValue = actions; + return Self; + } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + public DetectionRuleDescriptor Conditions(ICollection? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsValue = conditions; + return Self; + } + + public DetectionRuleDescriptor Conditions(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor descriptor) + { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsDescriptor = descriptor; + return Self; + } + + public DetectionRuleDescriptor Conditions(Action configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorActions = null; + ConditionsDescriptorAction = configure; + return Self; + } + + public DetectionRuleDescriptor Conditions(params Action[] configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = configure; + return Self; + } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + public DetectionRuleDescriptor Scope(Func, FluentDescriptorDictionary> selector) + { + ScopeValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (ConditionsDescriptor is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ConditionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorAction is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor(ConditionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorActions is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + foreach (var action in ConditionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RuleConditionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ConditionsValue is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsValue, options); + } + + if (ScopeValue is not null) + { + writer.WritePropertyName("scope"); + JsonSerializer.Serialize(writer, ScopeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Detector.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Detector.g.cs new file mode 100644 index 00000000000..b7c21f4b33c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Detector.g.cs @@ -0,0 +1,703 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class Detector +{ + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + [JsonInclude, JsonPropertyName("by_field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? ByFieldName { get; set; } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + [JsonInclude, JsonPropertyName("custom_rules")] + public ICollection? CustomRules { get; set; } + + /// + /// A description of the detector. + /// + [JsonInclude, JsonPropertyName("detector_description")] + public string? DetectorDescription { get; set; } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + [JsonInclude, JsonPropertyName("detector_index")] + public int? DetectorIndex { get; set; } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + [JsonInclude, JsonPropertyName("exclude_frequent")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; set; } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + [JsonInclude, JsonPropertyName("field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? FieldName { get; set; } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + [JsonInclude, JsonPropertyName("function")] + public string? Function { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + [JsonInclude, JsonPropertyName("over_field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? OverFieldName { get; set; } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public Elastic.Clients.Elasticsearch.Serverless.Field? PartitionFieldName { get; set; } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + [JsonInclude, JsonPropertyName("use_null")] + public bool? UseNull { get; set; } +} + +public sealed partial class DetectorDescriptor : SerializableDescriptor> +{ + internal DetectorDescriptor(Action> configure) => configure.Invoke(this); + + public DetectorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? ByFieldNameValue { get; set; } + private ICollection? CustomRulesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor CustomRulesDescriptor { get; set; } + private Action> CustomRulesDescriptorAction { get; set; } + private Action>[] CustomRulesDescriptorActions { get; set; } + private string? DetectorDescriptionValue { get; set; } + private int? DetectorIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? ExcludeFrequentValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldNameValue { get; set; } + private string? FunctionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? OverFieldNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PartitionFieldNameValue { get; set; } + private bool? UseNullValue { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + public DetectorDescriptor CustomRules(ICollection? customRules) + { + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesValue = customRules; + return Self; + } + + public DetectorDescriptor CustomRules(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor descriptor) + { + CustomRulesValue = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptor = descriptor; + return Self; + } + + public DetectorDescriptor CustomRules(Action> configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptorAction = configure; + return Self; + } + + public DetectorDescriptor CustomRules(params Action>[] configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = configure; + return Self; + } + + /// + /// A description of the detector. + /// + public DetectorDescriptor DetectorDescription(string? detectorDescription) + { + DetectorDescriptionValue = detectorDescription; + return Self; + } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + public DetectorDescriptor DetectorIndex(int? detectorIndex) + { + DetectorIndexValue = detectorIndex; + return Self; + } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + public DetectorDescriptor ExcludeFrequent(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? excludeFrequent) + { + ExcludeFrequentValue = excludeFrequent; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Elastic.Clients.Elasticsearch.Serverless.Field? fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + public DetectorDescriptor Function(string? function) + { + FunctionValue = function; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + public DetectorDescriptor UseNull(bool? useNull = true) + { + UseNullValue = useNull; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ByFieldNameValue is not null) + { + writer.WritePropertyName("by_field_name"); + JsonSerializer.Serialize(writer, ByFieldNameValue, options); + } + + if (CustomRulesDescriptor is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CustomRulesDescriptor, options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorAction is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor(CustomRulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorActions is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + foreach (var action in CustomRulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (CustomRulesValue is not null) + { + writer.WritePropertyName("custom_rules"); + JsonSerializer.Serialize(writer, CustomRulesValue, options); + } + + if (!string.IsNullOrEmpty(DetectorDescriptionValue)) + { + writer.WritePropertyName("detector_description"); + writer.WriteStringValue(DetectorDescriptionValue); + } + + if (DetectorIndexValue.HasValue) + { + writer.WritePropertyName("detector_index"); + writer.WriteNumberValue(DetectorIndexValue.Value); + } + + if (ExcludeFrequentValue is not null) + { + writer.WritePropertyName("exclude_frequent"); + JsonSerializer.Serialize(writer, ExcludeFrequentValue, options); + } + + if (FieldNameValue is not null) + { + writer.WritePropertyName("field_name"); + JsonSerializer.Serialize(writer, FieldNameValue, options); + } + + if (!string.IsNullOrEmpty(FunctionValue)) + { + writer.WritePropertyName("function"); + writer.WriteStringValue(FunctionValue); + } + + if (OverFieldNameValue is not null) + { + writer.WritePropertyName("over_field_name"); + JsonSerializer.Serialize(writer, OverFieldNameValue, options); + } + + if (PartitionFieldNameValue is not null) + { + writer.WritePropertyName("partition_field_name"); + JsonSerializer.Serialize(writer, PartitionFieldNameValue, options); + } + + if (UseNullValue.HasValue) + { + writer.WritePropertyName("use_null"); + writer.WriteBooleanValue(UseNullValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DetectorDescriptor : SerializableDescriptor +{ + internal DetectorDescriptor(Action configure) => configure.Invoke(this); + + public DetectorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field? ByFieldNameValue { get; set; } + private ICollection? CustomRulesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor CustomRulesDescriptor { get; set; } + private Action CustomRulesDescriptorAction { get; set; } + private Action[] CustomRulesDescriptorActions { get; set; } + private string? DetectorDescriptionValue { get; set; } + private int? DetectorIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? ExcludeFrequentValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? FieldNameValue { get; set; } + private string? FunctionValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? OverFieldNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? PartitionFieldNameValue { get; set; } + private bool? UseNullValue { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + public DetectorDescriptor CustomRules(ICollection? customRules) + { + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesValue = customRules; + return Self; + } + + public DetectorDescriptor CustomRules(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor descriptor) + { + CustomRulesValue = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptor = descriptor; + return Self; + } + + public DetectorDescriptor CustomRules(Action configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptorAction = configure; + return Self; + } + + public DetectorDescriptor CustomRules(params Action[] configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = configure; + return Self; + } + + /// + /// A description of the detector. + /// + public DetectorDescriptor DetectorDescription(string? detectorDescription) + { + DetectorDescriptionValue = detectorDescription; + return Self; + } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + public DetectorDescriptor DetectorIndex(int? detectorIndex) + { + DetectorIndexValue = detectorIndex; + return Self; + } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + public DetectorDescriptor ExcludeFrequent(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? excludeFrequent) + { + ExcludeFrequentValue = excludeFrequent; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Elastic.Clients.Elasticsearch.Serverless.Field? fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + public DetectorDescriptor Function(string? function) + { + FunctionValue = function; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Elastic.Clients.Elasticsearch.Serverless.Field? partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + public DetectorDescriptor UseNull(bool? useNull = true) + { + UseNullValue = useNull; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ByFieldNameValue is not null) + { + writer.WritePropertyName("by_field_name"); + JsonSerializer.Serialize(writer, ByFieldNameValue, options); + } + + if (CustomRulesDescriptor is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CustomRulesDescriptor, options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorAction is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor(CustomRulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorActions is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + foreach (var action in CustomRulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (CustomRulesValue is not null) + { + writer.WritePropertyName("custom_rules"); + JsonSerializer.Serialize(writer, CustomRulesValue, options); + } + + if (!string.IsNullOrEmpty(DetectorDescriptionValue)) + { + writer.WritePropertyName("detector_description"); + writer.WriteStringValue(DetectorDescriptionValue); + } + + if (DetectorIndexValue.HasValue) + { + writer.WritePropertyName("detector_index"); + writer.WriteNumberValue(DetectorIndexValue.Value); + } + + if (ExcludeFrequentValue is not null) + { + writer.WritePropertyName("exclude_frequent"); + JsonSerializer.Serialize(writer, ExcludeFrequentValue, options); + } + + if (FieldNameValue is not null) + { + writer.WritePropertyName("field_name"); + JsonSerializer.Serialize(writer, FieldNameValue, options); + } + + if (!string.IsNullOrEmpty(FunctionValue)) + { + writer.WritePropertyName("function"); + writer.WriteStringValue(FunctionValue); + } + + if (OverFieldNameValue is not null) + { + writer.WritePropertyName("over_field_name"); + JsonSerializer.Serialize(writer, OverFieldNameValue, options); + } + + if (PartitionFieldNameValue is not null) + { + writer.WritePropertyName("partition_field_name"); + JsonSerializer.Serialize(writer, PartitionFieldNameValue, options); + } + + if (UseNullValue.HasValue) + { + writer.WritePropertyName("use_null"); + writer.WriteBooleanValue(UseNullValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectorRead.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectorRead.g.cs new file mode 100644 index 00000000000..71dcf24970d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/DetectorRead.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.MachineLearning; + +public sealed partial class DetectorRead +{ + /// + /// The field used to split the data.
In particular, this property is used for analyzing the splits with respect to their own history.
It is used for finding unusual values in the context of the split.
+ ///
+ [JsonInclude, JsonPropertyName("by_field_name")] + public string? ByFieldName { get; init; } + + /// + /// An array of custom rule objects, which enable you to customize the way detectors operate.
For example, a rule may dictate to the detector conditions under which results should be skipped.
Kibana refers to custom rules as job rules.
+ ///
+ [JsonInclude, JsonPropertyName("custom_rules")] + public IReadOnlyCollection? CustomRules { get; init; } + + /// + /// A description of the detector. + /// + [JsonInclude, JsonPropertyName("detector_description")] + public string? DetectorDescription { get; init; } + + /// + /// A unique identifier for the detector.
This identifier is based on the order of the detectors in the `analysis_config`, starting at zero.
+ ///
+ [JsonInclude, JsonPropertyName("detector_index")] + public int? DetectorIndex { get; init; } + + /// + /// Contains one of the following values: `all`, `none`, `by`, or `over`.
If set, frequent entities are excluded from influencing the anomaly results.
Entities can be considered frequent over time or frequent in a population.
If you are working with both over and by fields, then you can set `exclude_frequent` to all for both fields, or to `by` or `over` for those specific fields.
+ ///
+ [JsonInclude, JsonPropertyName("exclude_frequent")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; init; } + + /// + /// The field that the detector uses in the function.
If you use an event rate function such as `count` or `rare`, do not specify this field.
+ ///
+ [JsonInclude, JsonPropertyName("field_name")] + public string? FieldName { get; init; } + + /// + /// The analysis function that is used.
For example, `count`, `rare`, `mean`, `min`, `max`, and `sum`.
+ ///
+ [JsonInclude, JsonPropertyName("function")] + public string Function { get; init; } + + /// + /// The field used to split the data.
In particular, this property is used for analyzing the splits with respect to the history of all splits.
It is used for finding unusual values in the population of all splits.
+ ///
+ [JsonInclude, JsonPropertyName("over_field_name")] + public string? OverFieldName { get; init; } + + /// + /// The field used to segment the analysis.
When you use this property, you have completely independent baselines for each value of this field.
+ ///
+ [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + [JsonInclude, JsonPropertyName("use_null")] + public bool? UseNull { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Ensemble.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Ensemble.g.cs new file mode 100644 index 00000000000..833a0ffc5bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Ensemble.g.cs @@ -0,0 +1,211 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class Ensemble +{ + [JsonInclude, JsonPropertyName("aggregate_output")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutput? AggregateOutput { get; set; } + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + [JsonInclude, JsonPropertyName("feature_names")] + public ICollection? FeatureNames { get; set; } + [JsonInclude, JsonPropertyName("target_type")] + public string? TargetType { get; set; } + [JsonInclude, JsonPropertyName("trained_models")] + public ICollection TrainedModels { get; set; } +} + +public sealed partial class EnsembleDescriptor : SerializableDescriptor +{ + internal EnsembleDescriptor(Action configure) => configure.Invoke(this); + + public EnsembleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutput? AggregateOutputValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutputDescriptor AggregateOutputDescriptor { get; set; } + private Action AggregateOutputDescriptorAction { get; set; } + private ICollection? ClassificationLabelsValue { get; set; } + private ICollection? FeatureNamesValue { get; set; } + private string? TargetTypeValue { get; set; } + private ICollection TrainedModelsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor TrainedModelsDescriptor { get; set; } + private Action TrainedModelsDescriptorAction { get; set; } + private Action[] TrainedModelsDescriptorActions { get; set; } + + public EnsembleDescriptor AggregateOutput(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutput? aggregateOutput) + { + AggregateOutputDescriptor = null; + AggregateOutputDescriptorAction = null; + AggregateOutputValue = aggregateOutput; + return Self; + } + + public EnsembleDescriptor AggregateOutput(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutputDescriptor descriptor) + { + AggregateOutputValue = null; + AggregateOutputDescriptorAction = null; + AggregateOutputDescriptor = descriptor; + return Self; + } + + public EnsembleDescriptor AggregateOutput(Action configure) + { + AggregateOutputValue = null; + AggregateOutputDescriptor = null; + AggregateOutputDescriptorAction = configure; + return Self; + } + + public EnsembleDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + public EnsembleDescriptor FeatureNames(ICollection? featureNames) + { + FeatureNamesValue = featureNames; + return Self; + } + + public EnsembleDescriptor TargetType(string? targetType) + { + TargetTypeValue = targetType; + return Self; + } + + public EnsembleDescriptor TrainedModels(ICollection trainedModels) + { + TrainedModelsDescriptor = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = null; + TrainedModelsValue = trainedModels; + return Self; + } + + public EnsembleDescriptor TrainedModels(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor descriptor) + { + TrainedModelsValue = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = null; + TrainedModelsDescriptor = descriptor; + return Self; + } + + public EnsembleDescriptor TrainedModels(Action configure) + { + TrainedModelsValue = null; + TrainedModelsDescriptor = null; + TrainedModelsDescriptorActions = null; + TrainedModelsDescriptorAction = configure; + return Self; + } + + public EnsembleDescriptor TrainedModels(params Action[] configure) + { + TrainedModelsValue = null; + TrainedModelsDescriptor = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregateOutputDescriptor is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, AggregateOutputDescriptor, options); + } + else if (AggregateOutputDescriptorAction is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AggregateOutputDescriptor(AggregateOutputDescriptorAction), options); + } + else if (AggregateOutputValue is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, AggregateOutputValue, options); + } + + if (ClassificationLabelsValue is not null) + { + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + } + + if (FeatureNamesValue is not null) + { + writer.WritePropertyName("feature_names"); + JsonSerializer.Serialize(writer, FeatureNamesValue, options); + } + + if (!string.IsNullOrEmpty(TargetTypeValue)) + { + writer.WritePropertyName("target_type"); + writer.WriteStringValue(TargetTypeValue); + } + + if (TrainedModelsDescriptor is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TrainedModelsDescriptor, options); + writer.WriteEndArray(); + } + else if (TrainedModelsDescriptorAction is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor(TrainedModelsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TrainedModelsDescriptorActions is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + foreach (var action in TrainedModelsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("trained_models"); + JsonSerializer.Serialize(writer, TrainedModelsValue, options); + } + + 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/MachineLearning/FillMaskInferenceOptions.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs index 4001647f1f3..777ee973967 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Fill mask inference options @@ -54,9 +54,9 @@ public sealed partial class FillMaskInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(FillMaskInferenceOptions fillMaskInferenceOptions) => Ml.InferenceConfigCreate.FillMask(fillMaskInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(FillMaskInferenceOptions fillMaskInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.FillMask(fillMaskInferenceOptions); } /// @@ -73,9 +73,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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.
@@ -107,7 +107,7 @@ public FillMaskInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options to update when inferring /// - public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticse return Self; } - public FillMaskInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public FillMaskInferenceOptionsDescriptor Tokenization(TokenizationConfigDescrip return Self; } - public FillMaskInferenceOptionsDescriptor Tokenization(Action configure) + public FillMaskInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs similarity index 75% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs index 50763d528b0..aa81691d2bc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class FillMaskInferenceUpdateOptions { @@ -45,9 +45,9 @@ public sealed partial class FillMaskInferenceUpdateOptions /// The tokenization options to update when inferring ///
[JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Ml.InferenceConfigUpdate.FillMask(fillMaskInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.FillMask(fillMaskInferenceUpdateOptions); } public sealed partial class FillMaskInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -60,9 +60,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// Specifies the number of top class predictions to return. Defaults to 0. @@ -85,7 +85,7 @@ public FillMaskInferenceUpdateOptionsDescriptor ResultsField(string? resultsFiel /// /// The tokenization options to update when inferring /// - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -93,7 +93,7 @@ public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Ela return Self; } - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -101,7 +101,7 @@ public FillMaskInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpda return Self; } - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -132,7 +132,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Filter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Filter.g.cs new file mode 100644 index 00000000000..d1198c64405 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Filter.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.MachineLearning; + +public sealed partial class Filter +{ + /// + /// A description of the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A string that uniquely identifies a filter. + /// + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + + /// + /// An array of strings which is the filter item list. + /// + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FilterRef.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FilterRef.g.cs new file mode 100644 index 00000000000..2db507f89ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FilterRef.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.MachineLearning; + +public sealed partial class FilterRef +{ + /// + /// The identifier for the filter. + /// + [JsonInclude, JsonPropertyName("filter_id")] + public Elastic.Clients.Elasticsearch.Serverless.Id FilterId { get; set; } + + /// + /// If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter. + /// + [JsonInclude, JsonPropertyName("filter_type")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FilterType? FilterType { get; set; } +} + +public sealed partial class FilterRefDescriptor : SerializableDescriptor +{ + internal FilterRefDescriptor(Action configure) => configure.Invoke(this); + + public FilterRefDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id FilterIdValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FilterType? FilterTypeValue { get; set; } + + /// + /// The identifier for the filter. + /// + public FilterRefDescriptor FilterId(Elastic.Clients.Elasticsearch.Serverless.Id filterId) + { + FilterIdValue = filterId; + return Self; + } + + /// + /// If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter. + /// + public FilterRefDescriptor FilterType(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FilterType? filterType) + { + FilterTypeValue = filterType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filter_id"); + JsonSerializer.Serialize(writer, FilterIdValue, options); + if (FilterTypeValue is not null) + { + writer.WritePropertyName("filter_type"); + JsonSerializer.Serialize(writer, FilterTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..6e4d09f449b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.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.MachineLearning; + +public sealed partial class FrequencyEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("frequency_map")] + public IDictionary FrequencyMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor(FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor.FrequencyEncoding(frequencyEncodingPreprocessor); +} + +public sealed partial class FrequencyEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal FrequencyEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public FrequencyEncodingPreprocessorDescriptor() : base() + { + } + + private string FeatureNameValue { get; set; } + private string FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + public FrequencyEncodingPreprocessorDescriptor FeatureName(string featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public FrequencyEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public FrequencyEncodingPreprocessorDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + writer.WriteStringValue(FeatureNameValue); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/GeoResults.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/GeoResults.g.cs new file mode 100644 index 00000000000..3cf4ec32ac4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/GeoResults.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.MachineLearning; + +public sealed partial class GeoResults +{ + /// + /// The actual value for the bucket formatted as a `geo_point`. + /// + [JsonInclude, JsonPropertyName("actual_point")] + public string ActualPoint { get; init; } + + /// + /// The typical value for the bucket formatted as a `geo_point`. + /// + [JsonInclude, JsonPropertyName("typical_point")] + public string TypicalPoint { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Hyperparameter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Hyperparameter.g.cs new file mode 100644 index 00000000000..4eb545c360b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Hyperparameter.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.MachineLearning; + +public sealed partial class Hyperparameter +{ + /// + /// A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. + /// + [JsonInclude, JsonPropertyName("absolute_importance")] + public double? AbsoluteImportance { get; init; } + + /// + /// Name of the hyperparameter. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. + /// + [JsonInclude, JsonPropertyName("relative_importance")] + public double? RelativeImportance { get; init; } + + /// + /// Indicates if the hyperparameter is specified by the user (true) or optimized (false). + /// + [JsonInclude, JsonPropertyName("supplied")] + public bool Supplied { get; init; } + + /// + /// The value of the hyperparameter, either optimized or specified by the user. + /// + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs new file mode 100644 index 00000000000..4a98c67773c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigCreate.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +/// +/// Inference configuration provided when storing the model config +/// +[JsonConverter(typeof(InferenceConfigCreateConverter))] +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.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigCreate("classification", classificationInferenceOptions); + public static InferenceConfigCreate FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => new InferenceConfigCreate("fill_mask", fillMaskInferenceOptions); + public static InferenceConfigCreate Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceOptions nerInferenceOptions) => new InferenceConfigCreate("ner", nerInferenceOptions); + public static InferenceConfigCreate PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => new InferenceConfigCreate("pass_through", passThroughInferenceOptions); + public static InferenceConfigCreate QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => new InferenceConfigCreate("question_answering", questionAnsweringInferenceOptions); + public static InferenceConfigCreate Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigCreate("regression", regressionInferenceOptions); + public static InferenceConfigCreate TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => new InferenceConfigCreate("text_classification", textClassificationInferenceOptions); + public static InferenceConfigCreate TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => new InferenceConfigCreate("text_embedding", textEmbeddingInferenceOptions); + public static InferenceConfigCreate TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => new InferenceConfigCreate("text_expansion", textExpansionInferenceOptions); + public static InferenceConfigCreate ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => new InferenceConfigCreate("zero_shot_classification", zeroShotClassificationInferenceOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "fill_mask") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ner") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "pass_through") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "question_answering") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "zero_shot_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfigCreate' from the response."); + } + + reader.Read(); + var result = new InferenceConfigCreate(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + { + writer.WriteStartObject(); + 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/MachineLearning/InferenceConfigUpdate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs new file mode 100644 index 00000000000..ebd2fa5fc5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceConfigUpdate.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +[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.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigUpdate("classification", classificationInferenceOptions); + public static InferenceConfigUpdate FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => new InferenceConfigUpdate("fill_mask", fillMaskInferenceUpdateOptions); + public static InferenceConfigUpdate Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => new InferenceConfigUpdate("ner", nerInferenceUpdateOptions); + public static InferenceConfigUpdate PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => new InferenceConfigUpdate("pass_through", passThroughInferenceUpdateOptions); + public static InferenceConfigUpdate QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => new InferenceConfigUpdate("question_answering", questionAnsweringInferenceUpdateOptions); + public static InferenceConfigUpdate Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigUpdate("regression", regressionInferenceOptions); + public static InferenceConfigUpdate TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("text_classification", textClassificationInferenceUpdateOptions); + public static InferenceConfigUpdate TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => new InferenceConfigUpdate("text_embedding", textEmbeddingInferenceUpdateOptions); + public static InferenceConfigUpdate TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => new InferenceConfigUpdate("text_expansion", textExpansionInferenceUpdateOptions); + public static InferenceConfigUpdate ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("zero_shot_classification", zeroShotClassificationInferenceUpdateOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "fill_mask") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ner") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "pass_through") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "question_answering") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "zero_shot_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfigUpdate' from the response."); + } + + reader.Read(); + var result = new InferenceConfigUpdate(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceUpdateOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceUpdateOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceUpdateOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceUpdateOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceUpdateOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceUpdateOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceUpdateOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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) + { + writer.WriteStartObject(); + 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/MachineLearning/InferenceResponseResult.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs new file mode 100644 index 00000000000..259f2d9be0d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/InferenceResponseResult.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.MachineLearning; + +public sealed partial class InferenceResponseResult +{ + /// + /// If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities. + /// + [JsonInclude, JsonPropertyName("entities")] + public IReadOnlyCollection? Entities { get; init; } + + /// + /// The feature importance for the inference results. Relevant only for classification or regression models + /// + [JsonInclude, JsonPropertyName("feature_importance")] + public IReadOnlyCollection? FeatureImportance { get; init; } + + /// + /// Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property
is present only when it is true.
+ ///
+ [JsonInclude, JsonPropertyName("is_truncated")] + public bool? IsTruncated { get; init; } + + /// + /// If the model is trained for a text classification or zero shot classification task, the response is the
predicted class.
For named entity recognition (NER) tasks, it contains the annotated text output.
For fill mask tasks, it contains the top prediction for replacing the mask token.
For text embedding tasks, it contains the raw numerical text embedding values.
For regression models, its a numerical value
For classification models, it may be an integer, double, boolean or string depending on prediction type
+ ///
+ [JsonInclude, JsonPropertyName("predicted_value")] + public IReadOnlyCollection? PredictedValue { get; init; } + + /// + /// For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted
value.
Additionally
+ ///
+ [JsonInclude, JsonPropertyName("predicted_value_sequence")] + public string? PredictedValueSequence { get; init; } + + /// + /// Specifies a probability for the predicted value. + /// + [JsonInclude, JsonPropertyName("prediction_probability")] + public double? PredictionProbability { get; init; } + + /// + /// Specifies a confidence score for the predicted value. + /// + [JsonInclude, JsonPropertyName("prediction_score")] + public double? PredictionScore { get; init; } + + /// + /// For fill mask, text classification, and zero shot classification tasks, the response contains a list of top
class entries.
+ ///
+ [JsonInclude, JsonPropertyName("top_classes")] + public IReadOnlyCollection? TopClasses { get; init; } + + /// + /// If the request failed, the response contains the reason for the failure. + /// + [JsonInclude, JsonPropertyName("warning")] + public string? Warning { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influence.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influence.g.cs new file mode 100644 index 00000000000..c161ca1ae95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influence.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.MachineLearning; + +public sealed partial class Influence +{ + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + [JsonInclude, JsonPropertyName("influencer_field_values")] + public IReadOnlyCollection InfluencerFieldValues { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influencer.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influencer.g.cs new file mode 100644 index 00000000000..b17ecd0c6a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Influencer.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.MachineLearning; + +public sealed partial class Influencer +{ + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s
analyzing `user_name` as an influencer, a field `user_name` is added to the result document. This
information enables you to filter the anomaly results more easily.
+ ///
+ [JsonInclude, JsonPropertyName("foo")] + public string? Foo { get; init; } + + /// + /// The field name of the influencer. + /// + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + + /// + /// The entity that influenced, contributed to, or was to blame for the anomaly. + /// + [JsonInclude, JsonPropertyName("influencer_field_value")] + public string InfluencerFieldValue { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated
across detectors. Unlike `initial_influencer_score`, this value is updated by a re-normalization process as new
data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("influencer_score")] + public double InfluencerScore { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors.
This is the initial value that was calculated at the time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_influencer_score")] + public double InitialInfluencerScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high
precision of over 300 decimal places, so the `influencer_score` is provided as a human-readable and friendly
interpretation of this value.
+ ///
+ [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// Internal. This value is always set to `influencer`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Input.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Input.g.cs new file mode 100644 index 00000000000..281634121dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Input.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.MachineLearning; + +public sealed partial class Input +{ + [JsonInclude, JsonPropertyName("field_names")] + public Elastic.Clients.Elasticsearch.Serverless.Names FieldNames { get; set; } +} + +public sealed partial class InputDescriptor : SerializableDescriptor +{ + internal InputDescriptor(Action configure) => configure.Invoke(this); + + public InputDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Names FieldNamesValue { get; set; } + + public InputDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Names fieldNames) + { + FieldNamesValue = fieldNames; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Job.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Job.g.cs new file mode 100644 index 00000000000..8217dc26c57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Job.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.MachineLearning; + +public sealed partial class Job +{ + /// + /// Advanced configuration option.
Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + + /// + /// The analysis configuration, which specifies how to analyze the data.
After you create a job, you cannot change the analysis configuration; all the properties are informational.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisConfig AnalysisConfig { get; init; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory.
These limits are approximate and can be set per job.
They do not control the memory used by other processes, for example the Elasticsearch Java processes.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AnalysisLimits? AnalysisLimits { get; init; } + + /// + /// Advanced configuration option.
The time between each periodic persistence of the model.
The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time.
The smallest allowed value is 1 hour.
+ ///
+ [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("blocked")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobBlocked? Blocked { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Advanced configuration option.
Contains custom metadata about the job.
+ ///
+ [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; init; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job.
It specifies a period of time (in days) after which only the first snapshot per day is retained.
This period is relative to the timestamp of the most recent snapshot for this job.
Valid values range from 0 to `model_snapshot_retention_days`.
+ ///
+ [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; init; } + + /// + /// The data description defines the format of the input data when you send data to the job by using the post data API.
Note that when configuring a datafeed, these properties are automatically set.
When data is received via the post data API, it is not stored in Elasticsearch.
Only the results for anomaly detection are retained.
+ ///
+ [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataDescription DataDescription { get; init; } + + /// + /// The datafeed, which retrieves data from Elasticsearch for analysis by the job.
You can associate only one datafeed with each anomaly detection job.
+ ///
+ [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Datafeed? DatafeedConfig { get; init; } + + /// + /// Indicates that the process of deleting the job is in progress but not yet completed.
It is only reported when `true`.
+ ///
+ [JsonInclude, JsonPropertyName("deleting")] + public bool? Deleting { get; init; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// If the job closed or failed, this is the time the job finished, otherwise it is `null`.
This property is informational; you cannot change its value.
+ ///
+ [JsonInclude, JsonPropertyName("finished_time")] + public DateTimeOffset? FinishedTime { get; init; } + + /// + /// A list of job groups.
A job can belong to no groups or many.
+ ///
+ [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + + /// + /// Identifier for the anomaly detection job.
This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
It must start and end with alphanumeric characters.
+ ///
+ [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// Reserved for future use, currently set to `anomaly_detector`. + /// + [JsonInclude, JsonPropertyName("job_type")] + public string? JobType { get; init; } + + /// + /// The machine learning configuration version number at which the the job was created. + /// + [JsonInclude, JsonPropertyName("job_version")] + public string? JobVersion { get; init; } + + /// + /// This advanced configuration option stores model information along with the results.
It provides a more detailed view into anomaly detection.
Model plot provides a simplified and indicative view of the model and its bounds.
+ ///
+ [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job.
It specifies the maximum period of time (in days) that snapshots are retained.
This period is relative to the timestamp of the most recent snapshot for this job.
By default, snapshots ten days older than the newest snapshot are deleted.
+ ///
+ [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + + /// + /// Advanced configuration option.
The period over which adjustments to the score are applied, as new data is seen.
The default value is the longer of 30 days or 100 `bucket_spans`.
+ ///
+ [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + + /// + /// A text string that affects the name of the machine learning results index.
The default value is `shared`, which generates an index named `.ml-anomalies-shared`.
+ ///
+ [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + + /// + /// Advanced configuration option.
The period of time (in days) that results are retained.
Age is calculated relative to the timestamp of the latest bucket result.
If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.
The default value is null, which means all results are retained.
Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.
Annotations added by users are retained forever.
+ ///
+ [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobBlocked.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobBlocked.g.cs new file mode 100644 index 00000000000..a6f0ecc0bb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobBlocked.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.MachineLearning; + +public sealed partial class JobBlocked +{ + [JsonInclude, JsonPropertyName("reason")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobBlockedReason Reason { 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/Types/MachineLearning/JobForecastStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs new file mode 100644 index 00000000000..944103753d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobForecastStatistics.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.MachineLearning; + +public sealed partial class JobForecastStatistics +{ + [JsonInclude, JsonPropertyName("forecasted_jobs")] + public int ForecastedJobs { get; init; } + [JsonInclude, JsonPropertyName("memory_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? MemoryBytes { get; init; } + [JsonInclude, JsonPropertyName("processing_time_ms")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? ProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("records")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? Records { get; init; } + [JsonInclude, JsonPropertyName("status")] + public IReadOnlyDictionary? Status { 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/MachineLearning/JobStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStatistics.g.cs new file mode 100644 index 00000000000..95308fbafb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStatistics.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.MachineLearning; + +public sealed partial class JobStatistics +{ + [JsonInclude, JsonPropertyName("avg")] + public double Avg { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double Max { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double Min { get; init; } + [JsonInclude, JsonPropertyName("total")] + public double Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStats.g.cs new file mode 100644 index 00000000000..a636d4c7216 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobStats.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.MachineLearning; + +public sealed partial class JobStats +{ + /// + /// For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// An object that describes the quantity of input to the job and any related error counts.
The `data_count` values are cumulative for the lifetime of a job.
If a model snapshot is reverted or old results are deleted, the job counts are not reset.
+ ///
+ [JsonInclude, JsonPropertyName("data_counts")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DataCounts DataCounts { get; init; } + + /// + /// Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when `true`. + /// + [JsonInclude, JsonPropertyName("deleting")] + public bool? Deleting { get; init; } + + /// + /// An object that provides statistical information about forecasts belonging to this job.
Some statistics are omitted if no forecasts have been made.
+ ///
+ [JsonInclude, JsonPropertyName("forecasts_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobForecastStatistics ForecastsStats { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// An object that provides information about the size and contents of the model. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelSizeStats ModelSizeStats { get; init; } + + /// + /// For open jobs only, the elapsed time for which the job has been open. + /// + [JsonInclude, JsonPropertyName("open_time")] + public DateTimeOffset? OpenTime { get; init; } + + /// + /// The status of the anomaly detection job, which can be one of the following values: `closed`, `closing`, `failed`, `opened`, `opening`. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobState State { get; init; } + + /// + /// An object that provides statistical information about timing aspect of this job. + /// + [JsonInclude, JsonPropertyName("timing_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobTimingStats TimingStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobTimingStats.g.cs new file mode 100644 index 00000000000..dd6e02ace02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JobTimingStats.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.MachineLearning; + +public sealed partial class JobTimingStats +{ + [JsonInclude, JsonPropertyName("average_bucket_processing_time_ms")] + public double? AverageBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + [JsonInclude, JsonPropertyName("exponential_average_bucket_processing_time_ms")] + public double? ExponentialAverageBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("exponential_average_bucket_processing_time_per_hour_ms")] + public double ExponentialAverageBucketProcessingTimePerHourMs { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("maximum_bucket_processing_time_ms")] + public double? MaximumBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("minimum_bucket_processing_time_ms")] + public double? MinimumBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("total_bucket_processing_time_ms")] + public double TotalBucketProcessingTimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JvmStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JvmStats.g.cs new file mode 100644 index 00000000000..8648dda5fd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/JvmStats.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.MachineLearning; + +public sealed partial class JvmStats +{ + /// + /// Maximum amount of memory available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? HeapMax { get; init; } + + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public int HeapMaxInBytes { get; init; } + + /// + /// Amount of Java heap currently being used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? JavaInference { get; init; } + + /// + /// Amount of Java heap, in bytes, currently being used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_in_bytes")] + public int JavaInferenceInBytes { get; init; } + + /// + /// Maximum amount of Java heap to be used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? JavaInferenceMax { get; init; } + + /// + /// Maximum amount of Java heap, in bytes, to be used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_max_in_bytes")] + public int JavaInferenceMaxInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Limits.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Limits.g.cs new file mode 100644 index 00000000000..dfd3d33bb75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Limits.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.MachineLearning; + +public sealed partial class Limits +{ + [JsonInclude, JsonPropertyName("effective_max_model_memory_limit")] + public string EffectiveMaxModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("max_model_memory_limit")] + public string? MaxModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("total_ml_memory")] + public string TotalMlMemory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemMlStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemMlStats.g.cs new file mode 100644 index 00000000000..34f46e3806e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemMlStats.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.MachineLearning; + +public sealed partial class MemMlStats +{ + /// + /// Amount of native memory set aside for anomaly detection jobs. + /// + [JsonInclude, JsonPropertyName("anomaly_detectors")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? AnomalyDetectors { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for anomaly detection jobs. + /// + [JsonInclude, JsonPropertyName("anomaly_detectors_in_bytes")] + public int AnomalyDetectorsInBytes { get; init; } + + /// + /// Amount of native memory set aside for data frame analytics jobs. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? DataFrameAnalytics { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for data frame analytics jobs. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics_in_bytes")] + public int DataFrameAnalyticsInBytes { get; init; } + + /// + /// Maximum amount of native memory (separate to the JVM heap) that may be used by machine learning native processes. + /// + [JsonInclude, JsonPropertyName("max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Max { get; init; } + + /// + /// Maximum amount of native memory (separate to the JVM heap), in bytes, that may be used by machine learning native processes. + /// + [JsonInclude, JsonPropertyName("max_in_bytes")] + public int MaxInBytes { get; init; } + + /// + /// Amount of native memory set aside for loading machine learning native code shared libraries. + /// + [JsonInclude, JsonPropertyName("native_code_overhead")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? NativeCodeOverhead { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for loading machine learning native code shared libraries. + /// + [JsonInclude, JsonPropertyName("native_code_overhead_in_bytes")] + public int NativeCodeOverheadInBytes { get; init; } + + /// + /// Amount of native memory set aside for trained models that have a PyTorch model_type. + /// + [JsonInclude, JsonPropertyName("native_inference")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? NativeInference { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for trained models that have a PyTorch model_type. + /// + [JsonInclude, JsonPropertyName("native_inference_in_bytes")] + public int NativeInferenceInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemStats.g.cs new file mode 100644 index 00000000000..1295a7406f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/MemStats.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.MachineLearning; + +public sealed partial class MemStats +{ + /// + /// If the amount of physical memory has been overridden using the es.total_memory_bytes system property
then this reports the overridden value. Otherwise it reports the same value as total.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? AdjustedTotal { get; init; } + + /// + /// If the amount of physical memory has been overridden using the `es.total_memory_bytes` system property
then this reports the overridden value in bytes. Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public int AdjustedTotalInBytes { get; init; } + + /// + /// Contains statistics about machine learning use of native memory on the node. + /// + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.MemMlStats Ml { get; init; } + + /// + /// Total amount of physical memory. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Total { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public int TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Memory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Memory.g.cs new file mode 100644 index 00000000000..baae2a913be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Memory.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 System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class Memory +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("ephemeral_id")] + public string EphemeralId { get; init; } + + /// + /// Contains Java Virtual Machine (JVM) statistics for the node. + /// + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JvmStats Jvm { get; init; } + + /// + /// Contains statistics about memory usage for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.MemStats Mem { get; init; } + + /// + /// Human-readable identifier for the node. Based on the Node name setting setting. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// Roles assigned to the node. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection Roles { get; init; } + + /// + /// The host and port where transport HTTP connections are accepted. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs new file mode 100644 index 00000000000..2728cc9cf5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelPlotConfig.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.MachineLearning; + +public sealed partial class ModelPlotConfig +{ + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + [JsonInclude, JsonPropertyName("annotations_enabled")] + public bool? AnnotationsEnabled { get; set; } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + [JsonInclude, JsonPropertyName("terms")] + public Elastic.Clients.Elasticsearch.Serverless.Field? Terms { get; set; } +} + +public sealed partial class ModelPlotConfigDescriptor : SerializableDescriptor> +{ + internal ModelPlotConfigDescriptor(Action> configure) => configure.Invoke(this); + + public ModelPlotConfigDescriptor() : base() + { + } + + private bool? AnnotationsEnabledValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TermsValue { get; set; } + + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor AnnotationsEnabled(bool? annotationsEnabled = true) + { + AnnotationsEnabledValue = annotationsEnabled; + return Self; + } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Field? terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnnotationsEnabledValue.HasValue) + { + writer.WritePropertyName("annotations_enabled"); + writer.WriteBooleanValue(AnnotationsEnabledValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ModelPlotConfigDescriptor : SerializableDescriptor +{ + internal ModelPlotConfigDescriptor(Action configure) => configure.Invoke(this); + + public ModelPlotConfigDescriptor() : base() + { + } + + private bool? AnnotationsEnabledValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field? TermsValue { get; set; } + + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor AnnotationsEnabled(bool? annotationsEnabled = true) + { + AnnotationsEnabledValue = annotationsEnabled; + return Self; + } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.Field? terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnnotationsEnabledValue.HasValue) + { + writer.WritePropertyName("annotations_enabled"); + writer.WriteBooleanValue(AnnotationsEnabledValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSizeStats.g.cs new file mode 100644 index 00000000000..911913f0982 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSizeStats.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.MachineLearning; + +public sealed partial class ModelSizeStats +{ + [JsonInclude, JsonPropertyName("assignment_memory_basis")] + public string? AssignmentMemoryBasis { get; init; } + [JsonInclude, JsonPropertyName("bucket_allocation_failures_count")] + public long BucketAllocationFailuresCount { get; init; } + [JsonInclude, JsonPropertyName("categorization_status")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.CategorizationStatus CategorizationStatus { get; init; } + [JsonInclude, JsonPropertyName("categorized_doc_count")] + public int CategorizedDocCount { get; init; } + [JsonInclude, JsonPropertyName("dead_category_count")] + public int DeadCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("failed_category_count")] + public int FailedCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("frequent_category_count")] + public int FrequentCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("log_time")] + public DateTimeOffset LogTime { get; init; } + [JsonInclude, JsonPropertyName("memory_status")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.MemoryStatus MemoryStatus { get; init; } + [JsonInclude, JsonPropertyName("model_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize ModelBytes { get; init; } + [JsonInclude, JsonPropertyName("model_bytes_exceeded")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ModelBytesExceeded { get; init; } + [JsonInclude, JsonPropertyName("model_bytes_memory_limit")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ModelBytesMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("peak_model_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? PeakModelBytes { get; init; } + [JsonInclude, JsonPropertyName("rare_category_count")] + public int RareCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + [JsonInclude, JsonPropertyName("total_by_field_count")] + public long TotalByFieldCount { get; init; } + [JsonInclude, JsonPropertyName("total_category_count")] + public int TotalCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("total_over_field_count")] + public long TotalOverFieldCount { get; init; } + [JsonInclude, JsonPropertyName("total_partition_field_count")] + public long TotalPartitionFieldCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshot.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshot.g.cs new file mode 100644 index 00000000000..4bfafb362e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshot.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.MachineLearning; + +public sealed partial class ModelSnapshot +{ + /// + /// An optional description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A numerical character string that uniquely identifies the job that the snapshot was created for. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The timestamp of the latest processed record. + /// + [JsonInclude, JsonPropertyName("latest_record_time_stamp")] + public int? LatestRecordTimeStamp { get; init; } + + /// + /// The timestamp of the latest bucket result. + /// + [JsonInclude, JsonPropertyName("latest_result_time_stamp")] + public int? LatestResultTimeStamp { get; init; } + + /// + /// The minimum version required to be able to restore the model snapshot. + /// + [JsonInclude, JsonPropertyName("min_version")] + public string MinVersion { get; init; } + + /// + /// Summary information describing the model. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ModelSizeStats? ModelSizeStats { get; init; } + + /// + /// If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false. + /// + [JsonInclude, JsonPropertyName("retain")] + public bool Retain { get; init; } + + /// + /// For internal use only. + /// + [JsonInclude, JsonPropertyName("snapshot_doc_count")] + public long SnapshotDocCount { get; init; } + + /// + /// A numerical character string that uniquely identifies the model snapshot. + /// + [JsonInclude, JsonPropertyName("snapshot_id")] + public string SnapshotId { get; init; } + + /// + /// The creation timestamp for the snapshot. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs new file mode 100644 index 00000000000..b3f5d5fd72d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.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.MachineLearning; + +public sealed partial class ModelSnapshotUpgrade +{ + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string AssignmentExplanation { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("snapshot_id")] + public string SnapshotId { get; init; } + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.SnapshotUpgradeState State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NativeCode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NativeCode.g.cs new file mode 100644 index 00000000000..15fd1504a3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NativeCode.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.MachineLearning; + +public sealed partial class NativeCode +{ + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { 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/Ml/NerInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs similarity index 70% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs index fa72abac9cc..ce83ae501d1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Named entity recognition options @@ -48,11 +48,11 @@ public sealed partial class NerInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } [JsonInclude, JsonPropertyName("vocabulary")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? Vocabulary { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Vocabulary? Vocabulary { get; set; } - public static implicit operator InferenceConfigCreate(NerInferenceOptions nerInferenceOptions) => Ml.InferenceConfigCreate.Ner(nerInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(NerInferenceOptions nerInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.Ner(nerInferenceOptions); } /// @@ -68,12 +68,12 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Vocabulary? VocabularyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.VocabularyDescriptor VocabularyDescriptor { get; set; } + private Action VocabularyDescriptorAction { get; set; } /// /// The token classification labels. Must be IOB formatted tags @@ -96,7 +96,7 @@ public NerInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options /// - public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -104,7 +104,7 @@ public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch. return Self; } - public NerInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -112,7 +112,7 @@ public NerInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor d return Self; } - public NerInferenceOptionsDescriptor Tokenization(Action configure) + public NerInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -120,7 +120,7 @@ public NerInferenceOptionsDescriptor Tokenization(Action configure) + public NerInferenceOptionsDescriptor Vocabulary(Action configure) { VocabularyValue = null; VocabularyDescriptor = null; @@ -167,7 +167,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { @@ -183,7 +183,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VocabularyDescriptorAction is not null) { writer.WritePropertyName("vocabulary"); - JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.VocabularyDescriptor(VocabularyDescriptorAction), options); } else if (VocabularyValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs index f15c9748910..6ad3e3a2ad4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class NerInferenceUpdateOptions { @@ -39,9 +39,9 @@ public sealed partial class NerInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Ml.InferenceConfigUpdate.Ner(nerInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.Ner(nerInferenceUpdateOptions); } public sealed partial class NerInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -53,9 +53,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -69,7 +69,7 @@ public NerInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options to update when inferring /// - public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -77,7 +77,7 @@ public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elastics return Self; } - public NerInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -85,7 +85,7 @@ public NerInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOpt return Self; } - public NerInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public NerInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -110,7 +110,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs similarity index 93% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs index 23a13df5edd..3ba7af974b0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// BERT and MPNet tokenization configuration options @@ -54,7 +54,7 @@ public sealed partial class NlpBertTokenizationConfig /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? Truncate { get; set; } /// /// Is tokenization completed with special tokens @@ -77,7 +77,7 @@ 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } private bool? WithSpecialTokensValue { get; set; } /// @@ -110,7 +110,7 @@ public NlpBertTokenizationConfigDescriptor Span(int? span) /// /// Should tokenization input be automatically truncated before sending to the model for inference /// - public NlpBertTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + public NlpBertTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs index 9210d45eda4..e87a431e99d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// RoBERTa tokenization configuration options @@ -54,7 +54,7 @@ public sealed partial class NlpRobertaTokenizationConfig /// 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; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? Truncate { get; set; } /// /// Is tokenization completed with special tokens @@ -62,7 +62,7 @@ public sealed partial class NlpRobertaTokenizationConfig [JsonInclude, JsonPropertyName("with_special_tokens")] public bool? WithSpecialTokens { get; set; } - public static implicit operator TokenizationConfig(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Ml.TokenizationConfig.Roberta(nlpRobertaTokenizationConfig); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig.Roberta(nlpRobertaTokenizationConfig); } /// @@ -79,7 +79,7 @@ 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 Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } private bool? WithSpecialTokensValue { get; set; } /// @@ -112,7 +112,7 @@ public NlpRobertaTokenizationConfigDescriptor Span(int? span) /// /// Should tokenization input be automatically truncated before sending to the model for inference /// - public NlpRobertaTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + public NlpRobertaTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs index 517405c7188..81464643dbc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class NlpTokenizationUpdateOptions { @@ -39,7 +39,7 @@ public sealed partial class NlpTokenizationUpdateOptions /// Truncate options to apply /// [JsonInclude, JsonPropertyName("truncate")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? Truncate { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? Truncate { get; set; } } public sealed partial class NlpTokenizationUpdateOptionsDescriptor : SerializableDescriptor @@ -51,7 +51,7 @@ public NlpTokenizationUpdateOptionsDescriptor() : base() } private int? SpanValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? TruncateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } /// /// Span options to apply @@ -65,7 +65,7 @@ public NlpTokenizationUpdateOptionsDescriptor Span(int? span) /// /// Truncate options to apply /// - public NlpTokenizationUpdateOptionsDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationTruncate? truncate) + public NlpTokenizationUpdateOptionsDescriptor Truncate(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..5ade6587249 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.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.MachineLearning; + +public sealed partial class OneHotEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("hot_map")] + public IDictionary HotMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor(OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor.OneHotEncoding(oneHotEncodingPreprocessor); +} + +public sealed partial class OneHotEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal OneHotEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public OneHotEncodingPreprocessorDescriptor() : base() + { + } + + private string FieldValue { get; set; } + private IDictionary HotMapValue { get; set; } + + public OneHotEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public OneHotEncodingPreprocessorDescriptor HotMap(Func, FluentDictionary> selector) + { + HotMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("hot_map"); + JsonSerializer.Serialize(writer, HotMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucket.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucket.g.cs new file mode 100644 index 00000000000..15f5eff8a19 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucket.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.MachineLearning; + +public sealed partial class OverallBucket +{ + /// + /// The length of the bucket in seconds. Matches the job with the longest bucket_span value. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// An array of objects that contain the max_anomaly_score per job_id. + /// + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } + + /// + /// The top_n average of the maximum bucket anomaly_score per job. + /// + [JsonInclude, JsonPropertyName("overall_score")] + public double OverallScore { get; init; } + + /// + /// Internal. This is always set to overall_bucket. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucketJob.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucketJob.g.cs new file mode 100644 index 00000000000..205fb773271 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/OverallBucketJob.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.MachineLearning; + +public sealed partial class OverallBucketJob +{ + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_anomaly_score")] + public double MaxAnomalyScore { get; init; } +} \ 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/MachineLearning/Page.g.cs similarity index 60% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Page.g.cs index b9ff478246b..cc083922535 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsPartition.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Page.g.cs @@ -25,59 +25,67 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; -public sealed partial class TermsPartition +public sealed partial class Page { /// - /// The number of partitions. + /// Skips the specified number of items. /// - [JsonInclude, JsonPropertyName("num_partitions")] - public long NumPartitions { get; set; } + [JsonInclude, JsonPropertyName("from")] + public int? From { get; set; } /// - /// The partition number for this request. + /// Specifies the maximum number of items to obtain. /// - [JsonInclude, JsonPropertyName("partition")] - public long Partition { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } } -public sealed partial class TermsPartitionDescriptor : SerializableDescriptor +public sealed partial class PageDescriptor : SerializableDescriptor { - internal TermsPartitionDescriptor(Action configure) => configure.Invoke(this); + internal PageDescriptor(Action configure) => configure.Invoke(this); - public TermsPartitionDescriptor() : base() + public PageDescriptor() : base() { } - private long NumPartitionsValue { get; set; } - private long PartitionValue { get; set; } + private int? FromValue { get; set; } + private int? SizeValue { get; set; } /// - /// The number of partitions. + /// Skips the specified number of items. /// - public TermsPartitionDescriptor NumPartitions(long numPartitions) + public PageDescriptor From(int? from) { - NumPartitionsValue = numPartitions; + FromValue = from; return Self; } /// - /// The partition number for this request. + /// Specifies the maximum number of items to obtain. /// - public TermsPartitionDescriptor Partition(long partition) + public PageDescriptor Size(int? size) { - PartitionValue = partition; + SizeValue = size; 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); + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.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/Ml/PassThroughInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs similarity index 68% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs index 93fd9a47d7f..f7f0344ca37 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Pass through configuration options @@ -42,11 +42,11 @@ public sealed partial class PassThroughInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } [JsonInclude, JsonPropertyName("vocabulary")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.Vocabulary? Vocabulary { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Vocabulary? Vocabulary { get; set; } - public static implicit operator InferenceConfigCreate(PassThroughInferenceOptions passThroughInferenceOptions) => Ml.InferenceConfigCreate.PassThrough(passThroughInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(PassThroughInferenceOptions passThroughInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.PassThrough(passThroughInferenceOptions); } /// @@ -61,12 +61,12 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Vocabulary? VocabularyValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -80,7 +80,7 @@ public PassThroughInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options /// - public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -88,7 +88,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasti return Self; } - public PassThroughInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -96,7 +96,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(TokenizationConfigDesc return Self; } - public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -104,7 +104,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceOptionsDescriptor Vocabulary(Action configure) { VocabularyValue = null; VocabularyDescriptor = null; @@ -145,7 +145,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VocabularyDescriptorAction is not null) { writer.WritePropertyName("vocabulary"); - JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.VocabularyDescriptor(VocabularyDescriptorAction), options); } else if (VocabularyValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs similarity index 73% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs index 20827e49aa2..9bdb718fc13 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class PassThroughInferenceUpdateOptions { @@ -39,9 +39,9 @@ public sealed partial class PassThroughInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Ml.InferenceConfigUpdate.PassThrough(passThroughInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.PassThrough(passThroughInferenceUpdateOptions); } public sealed partial class PassThroughInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -53,9 +53,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -69,7 +69,7 @@ public PassThroughInferenceUpdateOptionsDescriptor ResultsField(string? resultsF /// /// The tokenization options to update when inferring /// - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -77,7 +77,7 @@ public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients. return Self; } - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -85,7 +85,7 @@ public PassThroughInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationU return Self; } - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -110,7 +110,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs new file mode 100644 index 00000000000..1c9e05fe2fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/PerPartitionCategorization.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.MachineLearning; + +public sealed partial class PerPartitionCategorization +{ + /// + /// To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly. + /// + [JsonInclude, JsonPropertyName("stop_on_warn")] + public bool? StopOnWarn { get; set; } +} + +public sealed partial class PerPartitionCategorizationDescriptor : SerializableDescriptor +{ + internal PerPartitionCategorizationDescriptor(Action configure) => configure.Invoke(this); + + public PerPartitionCategorizationDescriptor() : base() + { + } + + private bool? EnabledValue { get; set; } + private bool? StopOnWarnValue { get; set; } + + /// + /// To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails. + /// + public PerPartitionCategorizationDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly. + /// + public PerPartitionCategorizationDescriptor StopOnWarn(bool? stopOnWarn = true) + { + StopOnWarnValue = stopOnWarn; + 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 (StopOnWarnValue.HasValue) + { + writer.WritePropertyName("stop_on_warn"); + writer.WriteBooleanValue(StopOnWarnValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Preprocessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Preprocessor.g.cs new file mode 100644 index 00000000000..52d0bda3781 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Preprocessor.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +[JsonConverter(typeof(PreprocessorConverter))] +public sealed partial class Preprocessor +{ + internal Preprocessor(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 Preprocessor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => new Preprocessor("frequency_encoding", frequencyEncodingPreprocessor); + public static Preprocessor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => new Preprocessor("one_hot_encoding", oneHotEncodingPreprocessor); + public static Preprocessor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => new Preprocessor("target_mean_encoding", targetMeanEncodingPreprocessor); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class PreprocessorConverter : JsonConverter +{ + public override Preprocessor 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; + 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 == "frequency_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "one_hot_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "target_mean_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Preprocessor' from the response."); + } + + reader.Read(); + var result = new Preprocessor(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, Preprocessor value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "frequency_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FrequencyEncodingPreprocessor)value.Variant, options); + break; + case "one_hot_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.OneHotEncodingPreprocessor)value.Variant, options); + break; + case "target_mean_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TargetMeanEncodingPreprocessor)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PreprocessorDescriptor : SerializableDescriptor> +{ + internal PreprocessorDescriptor(Action> configure) => configure.Invoke(this); + + public PreprocessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PreprocessorDescriptor 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 PreprocessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PreprocessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Set(frequencyEncodingPreprocessor, "frequency_encoding"); + public PreprocessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public PreprocessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Set(oneHotEncodingPreprocessor, "one_hot_encoding"); + public PreprocessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Set(targetMeanEncodingPreprocessor, "target_mean_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 PreprocessorDescriptor : SerializableDescriptor +{ + internal PreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public PreprocessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PreprocessorDescriptor 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 PreprocessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PreprocessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Set(frequencyEncodingPreprocessor, "frequency_encoding"); + public PreprocessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public PreprocessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Set(oneHotEncodingPreprocessor, "one_hot_encoding"); + public PreprocessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Set(targetMeanEncodingPreprocessor, "target_mean_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/Ml/QuestionAnsweringInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs index ac7ea6c1b44..cce3e794931 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Question answering inference options @@ -54,9 +54,9 @@ public sealed partial class QuestionAnsweringInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Ml.InferenceConfigCreate.QuestionAnswering(questionAnsweringInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.QuestionAnswering(questionAnsweringInferenceOptions); } /// @@ -73,9 +73,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The maximum answer length to consider @@ -107,7 +107,7 @@ public QuestionAnsweringInferenceOptionsDescriptor ResultsField(string? resultsF /// /// The tokenization options to update when inferring /// - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients. return Self; } - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public QuestionAnsweringInferenceOptionsDescriptor Tokenization(TokenizationConf return Self; } - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Action configure) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs index 371f73f2df4..d433679b479 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class QuestionAnsweringInferenceUpdateOptions { @@ -57,9 +57,9 @@ public sealed partial class QuestionAnsweringInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Ml.InferenceConfigUpdate.QuestionAnswering(questionAnsweringInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.QuestionAnswering(questionAnsweringInferenceUpdateOptions); } public sealed partial class QuestionAnsweringInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -74,9 +74,9 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The maximum answer length to consider for extraction @@ -117,7 +117,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor ResultsField(string? re /// /// The tokenization options to update when inferring /// - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -125,7 +125,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Cl return Self; } - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -133,7 +133,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(NlpTokeniz return Self; } - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -172,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs index 10674b2cfca..e5b837e469e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/RegressionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class RegressionInferenceOptions { @@ -40,6 +40,10 @@ public sealed partial class RegressionInferenceOptions /// [JsonInclude, JsonPropertyName("results_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? ResultsField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.Aggregations.InferenceConfig.Regression(regressionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.Regression(regressionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.Regression(regressionInferenceOptions); } public sealed partial class RegressionInferenceOptionsDescriptor : SerializableDescriptor> @@ -80,6 +84,15 @@ public RegressionInferenceOptionsDescriptor ResultsField(Expr 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(); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RuleCondition.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RuleCondition.g.cs new file mode 100644 index 00000000000..7a336af509b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RuleCondition.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.MachineLearning; + +public sealed partial class RuleCondition +{ + /// + /// Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time. + /// + [JsonInclude, JsonPropertyName("applies_to")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AppliesTo AppliesTo { get; set; } + + /// + /// Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals. + /// + [JsonInclude, JsonPropertyName("operator")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ConditionOperator Operator { get; set; } + + /// + /// The value that is compared against the `applies_to` field using the operator. + /// + [JsonInclude, JsonPropertyName("value")] + public double Value { get; set; } +} + +public sealed partial class RuleConditionDescriptor : SerializableDescriptor +{ + internal RuleConditionDescriptor(Action configure) => configure.Invoke(this); + + public RuleConditionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AppliesTo AppliesToValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ConditionOperator OperatorValue { get; set; } + private double ValueValue { get; set; } + + /// + /// Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time. + /// + public RuleConditionDescriptor AppliesTo(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.AppliesTo appliesTo) + { + AppliesToValue = appliesTo; + return Self; + } + + /// + /// Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals. + /// + public RuleConditionDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ConditionOperator value) + { + OperatorValue = value; + return Self; + } + + /// + /// The value that is compared against the `applies_to` field using the operator. + /// + public RuleConditionDescriptor Value(double value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("applies_to"); + JsonSerializer.Serialize(writer, AppliesToValue, options); + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + writer.WritePropertyName("value"); + writer.WriteNumberValue(ValueValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs new file mode 100644 index 00000000000..3e6cd38af2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/RunningStateSearchInterval.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.MachineLearning; + +public sealed partial class RunningStateSearchInterval +{ + /// + /// The end time. + /// + [JsonInclude, JsonPropertyName("end")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? End { get; init; } + + /// + /// The end time as an epoch in milliseconds. + /// + [JsonInclude, JsonPropertyName("end_ms")] + public long EndMs { get; init; } + + /// + /// The start time. + /// + [JsonInclude, JsonPropertyName("start")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Start { get; init; } + + /// + /// The start time as an epoch in milliseconds. + /// + [JsonInclude, JsonPropertyName("start_ms")] + public long StartMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..c8c9f987ff3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.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.MachineLearning; + +public sealed partial class TargetMeanEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("default_value")] + public double DefaultValue { get; set; } + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("target_map")] + public IDictionary TargetMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor(TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Preprocessor.TargetMeanEncoding(targetMeanEncodingPreprocessor); +} + +public sealed partial class TargetMeanEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal TargetMeanEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public TargetMeanEncodingPreprocessorDescriptor() : base() + { + } + + private double DefaultValueValue { get; set; } + private string FeatureNameValue { get; set; } + private string FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + public TargetMeanEncodingPreprocessorDescriptor DefaultValue(double defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor FeatureName(string featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + writer.WriteStringValue(FeatureNameValue); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, 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/MachineLearning/TextClassificationInferenceOptions.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs index d2b2ace09a2..9965995130b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Text classification configuration options @@ -54,9 +54,9 @@ public sealed partial class TextClassificationInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextClassificationInferenceOptions textClassificationInferenceOptions) => Ml.InferenceConfigCreate.TextClassification(textClassificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(TextClassificationInferenceOptions textClassificationInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.TextClassification(textClassificationInferenceOptions); } /// @@ -73,9 +73,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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 @@ -107,7 +107,7 @@ public TextClassificationInferenceOptionsDescriptor ResultsField(string? results /// /// The tokenization options /// - public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients return Self; } - public TextClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public TextClassificationInferenceOptionsDescriptor Tokenization(TokenizationCon return Self; } - public TextClassificationInferenceOptionsDescriptor Tokenization(Action configure) + public TextClassificationInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs index b92176aa494..0d1f4c490dc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class TextClassificationInferenceUpdateOptions { @@ -51,9 +51,9 @@ public sealed partial class TextClassificationInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextClassification(textClassificationInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.TextClassification(textClassificationInferenceUpdateOptions); } public sealed partial class TextClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -67,9 +67,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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 @@ -101,7 +101,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor ResultsField(string? r /// /// The tokenization options to update when inferring /// - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -109,7 +109,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.C return Self; } - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -117,7 +117,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokeni return Self; } - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -154,7 +154,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs index ed67cce0ec6..706ffb770df 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Text embedding inference options @@ -48,9 +48,9 @@ public sealed partial class TextEmbeddingInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Ml.InferenceConfigCreate.TextEmbedding(textEmbeddingInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.TextEmbedding(textEmbeddingInferenceOptions); } /// @@ -66,9 +66,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The number of dimensions in the embedding output @@ -91,7 +91,7 @@ public TextEmbeddingInferenceOptionsDescriptor ResultsField(string? resultsField /// /// The tokenization options /// - public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -99,7 +99,7 @@ public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elas return Self; } - public TextEmbeddingInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -107,7 +107,7 @@ public TextEmbeddingInferenceOptionsDescriptor Tokenization(TokenizationConfigDe return Self; } - public TextEmbeddingInferenceOptionsDescriptor Tokenization(Action configure) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -138,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs similarity index 72% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs index 47ef9d7ce08..1d48a15a576 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class TextEmbeddingInferenceUpdateOptions { @@ -35,9 +35,9 @@ public sealed partial class TextEmbeddingInferenceUpdateOptions [JsonInclude, JsonPropertyName("results_field")] public string? ResultsField { get; set; } [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextEmbedding(textEmbeddingInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.TextEmbedding(textEmbeddingInferenceUpdateOptions); } public sealed partial class TextEmbeddingInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -49,9 +49,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -62,7 +62,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor ResultsField(string? result return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -70,7 +70,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Client return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -78,7 +78,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizatio return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -103,7 +103,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs index 0443be8ce3c..fea0b58e7fb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Text expansion inference options @@ -42,9 +42,9 @@ public sealed partial class TextExpansionInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextExpansionInferenceOptions textExpansionInferenceOptions) => Ml.InferenceConfigCreate.TextExpansion(textExpansionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(TextExpansionInferenceOptions textExpansionInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.TextExpansion(textExpansionInferenceOptions); } /// @@ -59,9 +59,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -75,7 +75,7 @@ public TextExpansionInferenceOptionsDescriptor ResultsField(string? resultsField /// /// The tokenization options /// - public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -83,7 +83,7 @@ public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elas return Self; } - public TextExpansionInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -91,7 +91,7 @@ public TextExpansionInferenceOptionsDescriptor Tokenization(TokenizationConfigDe return Self; } - public TextExpansionInferenceOptionsDescriptor Tokenization(Action configure) + public TextExpansionInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -116,7 +116,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs similarity index 72% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs index 9f2cadc7824..88e84219153 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class TextExpansionInferenceUpdateOptions { @@ -35,9 +35,9 @@ public sealed partial class TextExpansionInferenceUpdateOptions [JsonInclude, JsonPropertyName("results_field")] public string? ResultsField { get; set; } [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextExpansion(textExpansionInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.TextExpansion(textExpansionInferenceUpdateOptions); } public sealed partial class TextExpansionInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -49,9 +49,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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. @@ -62,7 +62,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor ResultsField(string? result return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -70,7 +70,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Client return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -78,7 +78,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizatio return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -103,7 +103,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TokenizationConfig.g.cs new file mode 100644 index 00000000000..84df5abc413 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TokenizationConfig.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.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +/// +/// Tokenization options stored in inference configuration +/// +[JsonConverter(typeof(TokenizationConfigConverter))] +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.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("bert", nlpBertTokenizationConfig); + public static TokenizationConfig Mpnet(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("mpnet", nlpBertTokenizationConfig); + public static TokenizationConfig Roberta(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => new TokenizationConfig("roberta", nlpRobertaTokenizationConfig); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "bert") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "mpnet") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "roberta") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'TokenizationConfig' from the response."); + } + + reader.Read(); + var result = new TokenizationConfig(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.NlpBertTokenizationConfig)value.Variant, options); + break; + case "mpnet": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig)value.Variant, options); + break; + case "roberta": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/MachineLearning/TopClassEntry.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TopClassEntry.g.cs new file mode 100644 index 00000000000..c9833c2c899 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TopClassEntry.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.MachineLearning; + +public sealed partial class TopClassEntry +{ + [JsonInclude, JsonPropertyName("class_name")] + public string 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/MachineLearning/TotalFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs new file mode 100644 index 00000000000..798e12c06d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportance.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.MachineLearning; + +public sealed partial class TotalFeatureImportance +{ + /// + /// If the trained model is a classification model, feature importance statistics are gathered per target class value. + /// + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } + + /// + /// The feature for which this importance was calculated. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; init; } + + /// + /// A collection of feature importance statistics related to the training data set for this particular feature. + /// + [JsonInclude, JsonPropertyName("importance")] + public IReadOnlyCollection Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs new file mode 100644 index 00000000000..05142eedeb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.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.MachineLearning; + +public sealed partial class TotalFeatureImportanceClass +{ + /// + /// The target class value. Could be a string, boolean, or number. + /// + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + + /// + /// A collection of feature importance statistics related to the training data set for this particular feature. + /// + [JsonInclude, JsonPropertyName("importance")] + public IReadOnlyCollection Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs new file mode 100644 index 00000000000..88c3ba5a26f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.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.MachineLearning; + +public sealed partial class TotalFeatureImportanceStatistics +{ + /// + /// The maximum importance value across all the training data for this feature. + /// + [JsonInclude, JsonPropertyName("max")] + public int Max { get; init; } + + /// + /// The average magnitude of this feature across all the training data. This value is the average of the absolute values of the importance for this feature. + /// + [JsonInclude, JsonPropertyName("mean_magnitude")] + public double MeanMagnitude { get; init; } + + /// + /// The minimum importance value across all the training data for this feature. + /// + [JsonInclude, JsonPropertyName("min")] + public int Min { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModel.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModel.g.cs new file mode 100644 index 00000000000..8f02b7b6e0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModel.g.cs @@ -0,0 +1,203 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class TrainedModel +{ + /// + /// The definition for an ensemble model + /// + [JsonInclude, JsonPropertyName("ensemble")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Ensemble? Ensemble { get; set; } + + /// + /// The definition for a binary decision tree. + /// + [JsonInclude, JsonPropertyName("tree")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTree? Tree { get; set; } + + /// + /// The definition of a node in a tree.
There are two major types of nodes: leaf nodes and not-leaf nodes.
- Leaf nodes only need node_index and leaf_value defined.
- All other nodes need split_feature, left_child, right_child, threshold, decision_type, and default_left defined.
+ ///
+ [JsonInclude, JsonPropertyName("tree_node")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNode? TreeNode { get; set; } +} + +public sealed partial class TrainedModelDescriptor : SerializableDescriptor +{ + internal TrainedModelDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Ensemble? EnsembleValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.EnsembleDescriptor EnsembleDescriptor { get; set; } + private Action EnsembleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTree? TreeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeDescriptor TreeDescriptor { get; set; } + private Action TreeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNode? TreeNodeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor TreeNodeDescriptor { get; set; } + private Action TreeNodeDescriptorAction { get; set; } + + /// + /// The definition for an ensemble model + /// + public TrainedModelDescriptor Ensemble(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.Ensemble? ensemble) + { + EnsembleDescriptor = null; + EnsembleDescriptorAction = null; + EnsembleValue = ensemble; + return Self; + } + + public TrainedModelDescriptor Ensemble(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.EnsembleDescriptor descriptor) + { + EnsembleValue = null; + EnsembleDescriptorAction = null; + EnsembleDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor Ensemble(Action configure) + { + EnsembleValue = null; + EnsembleDescriptor = null; + EnsembleDescriptorAction = configure; + return Self; + } + + /// + /// The definition for a binary decision tree. + /// + public TrainedModelDescriptor Tree(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTree? tree) + { + TreeDescriptor = null; + TreeDescriptorAction = null; + TreeValue = tree; + return Self; + } + + public TrainedModelDescriptor Tree(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeDescriptor descriptor) + { + TreeValue = null; + TreeDescriptorAction = null; + TreeDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor Tree(Action configure) + { + TreeValue = null; + TreeDescriptor = null; + TreeDescriptorAction = configure; + return Self; + } + + /// + /// The definition of a node in a tree.
There are two major types of nodes: leaf nodes and not-leaf nodes.
- Leaf nodes only need node_index and leaf_value defined.
- All other nodes need split_feature, left_child, right_child, threshold, decision_type, and default_left defined.
+ ///
+ public TrainedModelDescriptor TreeNode(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNode? treeNode) + { + TreeNodeDescriptor = null; + TreeNodeDescriptorAction = null; + TreeNodeValue = treeNode; + return Self; + } + + public TrainedModelDescriptor TreeNode(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor descriptor) + { + TreeNodeValue = null; + TreeNodeDescriptorAction = null; + TreeNodeDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor TreeNode(Action configure) + { + TreeNodeValue = null; + TreeNodeDescriptor = null; + TreeNodeDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EnsembleDescriptor is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, EnsembleDescriptor, options); + } + else if (EnsembleDescriptorAction is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.EnsembleDescriptor(EnsembleDescriptorAction), options); + } + else if (EnsembleValue is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, EnsembleValue, options); + } + + if (TreeDescriptor is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, TreeDescriptor, options); + } + else if (TreeDescriptorAction is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeDescriptor(TreeDescriptorAction), options); + } + else if (TreeValue is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, TreeValue, options); + } + + if (TreeNodeDescriptor is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, TreeNodeDescriptor, options); + } + else if (TreeNodeDescriptorAction is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor(TreeNodeDescriptorAction), options); + } + else if (TreeNodeValue is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, TreeNodeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs new file mode 100644 index 00000000000..4b36ae2d271 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class TrainedModelAssignment +{ + /// + /// The overall assignment state. + /// + [JsonInclude, JsonPropertyName("assignment_state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentAssignmentState AssignmentState { get; init; } + [JsonInclude, JsonPropertyName("max_assigned_allocations")] + public int? MaxAssignedAllocations { get; init; } + + /// + /// The allocation state for each node. + /// + [JsonInclude, JsonPropertyName("routing_table")] + public IReadOnlyDictionary RoutingTable { get; init; } + + /// + /// The timestamp when the deployment started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset StartTime { get; init; } + [JsonInclude, JsonPropertyName("task_parameters")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelAssignmentTaskParameters TaskParameters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs new file mode 100644 index 00000000000..cbfa14d5653 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.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.MachineLearning; + +public sealed partial class TrainedModelAssignmentRoutingTable +{ + /// + /// Current number of allocations. + /// + [JsonInclude, JsonPropertyName("current_allocations")] + public int CurrentAllocations { get; init; } + + /// + /// The reason for the current state. It is usually populated only when the
`routing_state` is `failed`.
+ ///
+ [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + + /// + /// The current routing state. + /// + [JsonInclude, JsonPropertyName("routing_state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.RoutingState RoutingState { get; init; } + + /// + /// Target number of allocations. + /// + [JsonInclude, JsonPropertyName("target_allocations")] + public int TargetAllocations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs new file mode 100644 index 00000000000..106d4e51237 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.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.MachineLearning; + +public sealed partial class TrainedModelAssignmentTaskParameters +{ + /// + /// The size of the trained model cache. + /// + [JsonInclude, JsonPropertyName("cache_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize CacheSize { get; init; } + + /// + /// The unique identifier for the trained model deployment. + /// + [JsonInclude, JsonPropertyName("deployment_id")] + public string DeploymentId { get; init; } + + /// + /// The size of the trained model in bytes. + /// + [JsonInclude, JsonPropertyName("model_bytes")] + public int ModelBytes { get; init; } + + /// + /// The unique identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The total number of allocations this model is assigned across ML nodes. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + [JsonInclude, JsonPropertyName("priority")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainingPriority Priority { get; init; } + + /// + /// Number of inference requests are allowed in the queue at a time. + /// + [JsonInclude, JsonPropertyName("queue_capacity")] + public int QueueCapacity { get; init; } + + /// + /// Number of threads per allocation. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs new file mode 100644 index 00000000000..b96b0be96a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfig.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.MachineLearning; + +public sealed partial class TrainedModelConfig +{ + [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; init; } + + /// + /// Information on the creator of the trained model. + /// + [JsonInclude, JsonPropertyName("created_by")] + public string? CreatedBy { get; init; } + + /// + /// The time when the trained model was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Any field map described in the inference configuration takes precedence. + /// + [JsonInclude, JsonPropertyName("default_field_map")] + public IReadOnlyDictionary? DefaultFieldMap { get; init; } + + /// + /// The free-text description of the trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The estimated heap usage in bytes to keep the trained model in memory. + /// + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public int? EstimatedHeapMemoryUsageBytes { get; init; } + + /// + /// The estimated number of operations to use the trained model. + /// + [JsonInclude, JsonPropertyName("estimated_operations")] + public int? EstimatedOperations { get; init; } + + /// + /// True if the full model definition is present. + /// + [JsonInclude, JsonPropertyName("fully_defined")] + public bool? FullyDefined { get; init; } + + /// + /// The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required. + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate? InferenceConfig { get; init; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelConfigInput Input { get; init; } + + /// + /// The license level of the trained model. + /// + [JsonInclude, JsonPropertyName("license_level")] + public string? LicenseLevel { get; init; } + [JsonInclude, JsonPropertyName("location")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelLocation? Location { get; init; } + + /// + /// An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects. + /// + [JsonInclude, JsonPropertyName("metadata")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelConfigMetadata? Metadata { get; init; } + + /// + /// Identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ModelSizeBytes { get; init; } + + /// + /// The model type + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelType? ModelType { get; init; } + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; init; } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or none. + /// + [JsonInclude, JsonPropertyName("tags")] + public IReadOnlyCollection Tags { get; init; } + + /// + /// The Elasticsearch version number in which the trained model was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs new file mode 100644 index 00000000000..7d858c25f96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigInput.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.MachineLearning; + +public sealed partial class TrainedModelConfigInput +{ + /// + /// An array of input field names for the model. + /// + [JsonInclude, JsonPropertyName("field_names")] + public IReadOnlyCollection FieldNames { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs new file mode 100644 index 00000000000..3b59229dde5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.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.MachineLearning; + +public sealed partial class TrainedModelConfigMetadata +{ + /// + /// An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class. + /// + [JsonInclude, JsonPropertyName("feature_importance_baseline")] + public IReadOnlyDictionary? FeatureImportanceBaseline { get; init; } + + /// + /// List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user. + /// + [JsonInclude, JsonPropertyName("hyperparameters")] + public IReadOnlyCollection? Hyperparameters { get; init; } + [JsonInclude, JsonPropertyName("model_aliases")] + public IReadOnlyCollection? ModelAliases { get; init; } + + /// + /// An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter. + /// + [JsonInclude, JsonPropertyName("total_feature_importance")] + public IReadOnlyCollection? TotalFeatureImportance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs new file mode 100644 index 00000000000..d4717b0317c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.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.MachineLearning; + +public sealed partial class TrainedModelDeploymentAllocationStatus +{ + /// + /// The current number of nodes where the model is allocated. + /// + [JsonInclude, JsonPropertyName("allocation_count")] + public int AllocationCount { get; init; } + + /// + /// The detailed allocation state related to the nodes. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentAllocationState State { get; init; } + + /// + /// The desired number of nodes for model allocation. + /// + [JsonInclude, JsonPropertyName("target_allocation_count")] + public int TargetAllocationCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs new file mode 100644 index 00000000000..d16c744b35a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.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.MachineLearning; + +public sealed partial class TrainedModelDeploymentNodesStats +{ + /// + /// The average time for each inference call to complete on this node. + /// + [JsonInclude, JsonPropertyName("average_inference_time_ms")] + public double AverageInferenceTimeMs { get; init; } + + /// + /// The number of errors when evaluating the trained model. + /// + [JsonInclude, JsonPropertyName("error_count")] + public int ErrorCount { get; init; } + + /// + /// The total number of inference calls made against this node for this model. + /// + [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The epoch time stamp of the last inference call for the model on this node. + /// + [JsonInclude, JsonPropertyName("last_access")] + public long LastAccess { get; init; } + + /// + /// The number of allocations assigned to this node. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + + /// + /// The number of inference requests queued to be processed. + /// + [JsonInclude, JsonPropertyName("number_of_pending_requests")] + public int NumberOfPendingRequests { get; init; } + + /// + /// The number of inference requests that were not processed because the queue was full. + /// + [JsonInclude, JsonPropertyName("rejection_execution_count")] + public int RejectionExecutionCount { get; init; } + + /// + /// The current routing state and reason for the current routing state for this allocation. + /// + [JsonInclude, JsonPropertyName("routing_state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelAssignmentRoutingTable RoutingState { get; init; } + + /// + /// The epoch timestamp when the allocation started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public long StartTime { get; init; } + + /// + /// The number of threads used by each allocation during inference. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } + + /// + /// The number of inference requests that timed out before being processed. + /// + [JsonInclude, JsonPropertyName("timeout_count")] + public int TimeoutCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs new file mode 100644 index 00000000000..63fc3ef7678 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.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.MachineLearning; + +public sealed partial class TrainedModelDeploymentStats +{ + /// + /// The detailed allocation status for the deployment. + /// + [JsonInclude, JsonPropertyName("allocation_status")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDeploymentAllocationStatus AllocationStatus { get; init; } + [JsonInclude, JsonPropertyName("cache_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? CacheSize { get; init; } + + /// + /// The unique identifier for the trained model deployment. + /// + [JsonInclude, JsonPropertyName("deployment_id")] + public string DeploymentId { get; init; } + + /// + /// The sum of `error_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("error_count")] + public int ErrorCount { get; init; } + + /// + /// The sum of `inference_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The unique identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The deployment stats for each node that currently has the model allocated.
In serverless, stats are reported for a single unnamed virtual node.
+ ///
+ [JsonInclude, JsonPropertyName("nodes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDeploymentNodesStats Nodes { get; init; } + + /// + /// The number of allocations requested. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + + /// + /// The number of inference requests that can be queued before new requests are rejected. + /// + [JsonInclude, JsonPropertyName("queue_capacity")] + public int QueueCapacity { get; init; } + + /// + /// The reason for the current deployment state. Usually only populated when
the model is not deployed to a node.
+ ///
+ [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + + /// + /// The sum of `rejected_execution_count` for all nodes in the deployment.
Individual nodes reject an inference request if the inference queue is full.
The queue size is controlled by the `queue_capacity` setting in the start
trained model deployment API.
+ ///
+ [JsonInclude, JsonPropertyName("rejected_execution_count")] + public int RejectedExecutionCount { get; init; } + + /// + /// The epoch timestamp when the deployment started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public long StartTime { get; init; } + + /// + /// The overall state of the deployment. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DeploymentState State { get; init; } + + /// + /// The number of threads used be each allocation during inference. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } + + /// + /// The sum of `timeout_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("timeout_count")] + public int TimeoutCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs new file mode 100644 index 00000000000..e9e694fab64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelEntities.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.MachineLearning; + +public sealed partial class TrainedModelEntities +{ + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + [JsonInclude, JsonPropertyName("class_probability")] + public double ClassProbability { get; init; } + [JsonInclude, JsonPropertyName("end_pos")] + public int EndPos { get; init; } + [JsonInclude, JsonPropertyName("entity")] + public string Entity { get; init; } + [JsonInclude, JsonPropertyName("start_pos")] + public int StartPos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs new file mode 100644 index 00000000000..9f7f76c9471 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.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.MachineLearning; + +public sealed partial class TrainedModelInferenceClassImportance +{ + [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/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs new file mode 100644 index 00000000000..1552eff6e06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.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.MachineLearning; + +public sealed partial class TrainedModelInferenceFeatureImportance +{ + [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/MachineLearning/TrainedModelInferenceStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs new file mode 100644 index 00000000000..69eed13c5c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelInferenceStats.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.MachineLearning; + +public sealed partial class TrainedModelInferenceStats +{ + /// + /// The number of times the model was loaded for inference and was not retrieved from the cache.
If this number is close to the `inference_count`, the cache is not being appropriately used.
This can be solved by increasing the cache size or its time-to-live (TTL).
Refer to general machine learning settings for the appropriate settings.
+ ///
+ [JsonInclude, JsonPropertyName("cache_miss_count")] + public int CacheMissCount { get; init; } + + /// + /// The number of failures when using the model for inference. + /// + [JsonInclude, JsonPropertyName("failure_count")] + public int FailureCount { get; init; } + + /// + /// The total number of times the model has been called for inference.
This is across all inference contexts, including all pipelines.
+ ///
+ [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The number of inference calls where all the training features for the model were missing. + /// + [JsonInclude, JsonPropertyName("missing_all_fields_count")] + public int MissingAllFieldsCount { get; init; } + + /// + /// The time when the statistics were last updated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public DateTimeOffset Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs new file mode 100644 index 00000000000..f1e48eed8bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocation.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.MachineLearning; + +public sealed partial class TrainedModelLocation +{ + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelLocationIndex Index { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs new file mode 100644 index 00000000000..0f4347111c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelLocationIndex.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.MachineLearning; + +public sealed partial class TrainedModelLocationIndex +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs new file mode 100644 index 00000000000..135f29d34df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.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.MachineLearning; + +public sealed partial class TrainedModelPrefixStrings +{ + /// + /// String prepended to input at ingest + /// + [JsonInclude, JsonPropertyName("ingest")] + public string? Ingest { get; set; } + + /// + /// String prepended to input at search + /// + [JsonInclude, JsonPropertyName("search")] + public string? Search { get; set; } +} + +public sealed partial class TrainedModelPrefixStringsDescriptor : SerializableDescriptor +{ + internal TrainedModelPrefixStringsDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelPrefixStringsDescriptor() : base() + { + } + + private string? IngestValue { get; set; } + private string? SearchValue { get; set; } + + /// + /// String prepended to input at ingest + /// + public TrainedModelPrefixStringsDescriptor Ingest(string? ingest) + { + IngestValue = ingest; + return Self; + } + + /// + /// String prepended to input at search + /// + public TrainedModelPrefixStringsDescriptor Search(string? search) + { + SearchValue = search; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(IngestValue)) + { + writer.WritePropertyName("ingest"); + writer.WriteStringValue(IngestValue); + } + + if (!string.IsNullOrEmpty(SearchValue)) + { + writer.WritePropertyName("search"); + writer.WriteStringValue(SearchValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs new file mode 100644 index 00000000000..daddecf4818 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelSizeStats.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.MachineLearning; + +public sealed partial class TrainedModelSizeStats +{ + /// + /// The size of the model in bytes. + /// + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize ModelSizeBytes { get; init; } + + /// + /// The amount of memory required to load the model in bytes. + /// + [JsonInclude, JsonPropertyName("required_native_memory_bytes")] + public int RequiredNativeMemoryBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelStats.g.cs new file mode 100644 index 00000000000..fdf18124614 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelStats.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.MachineLearning; + +public sealed partial class TrainedModelStats +{ + /// + /// A collection of deployment stats, which is present when the models are deployed. + /// + [JsonInclude, JsonPropertyName("deployment_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelDeploymentStats? DeploymentStats { get; init; } + + /// + /// A collection of inference stats fields. + /// + [JsonInclude, JsonPropertyName("inference_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelInferenceStats? InferenceStats { get; init; } + + /// + /// A collection of ingest stats for the model across all nodes.
The values are summations of the individual node statistics.
The format matches the ingest section in the nodes stats API.
+ ///
+ [JsonInclude, JsonPropertyName("ingest")] + public IReadOnlyDictionary? Ingest { get; init; } + + /// + /// The unique identifier of the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// A collection of model size stats. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelSizeStats ModelSizeStats { get; init; } + + /// + /// The number of ingest pipelines that currently refer to the model. + /// + [JsonInclude, JsonPropertyName("pipeline_count")] + public int PipelineCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTree.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTree.g.cs new file mode 100644 index 00000000000..f128c5a5254 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTree.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class TrainedModelTree +{ + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + [JsonInclude, JsonPropertyName("feature_names")] + public ICollection FeatureNames { get; set; } + [JsonInclude, JsonPropertyName("target_type")] + public string? TargetType { get; set; } + [JsonInclude, JsonPropertyName("tree_structure")] + public ICollection TreeStructure { get; set; } +} + +public sealed partial class TrainedModelTreeDescriptor : SerializableDescriptor +{ + internal TrainedModelTreeDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelTreeDescriptor() : base() + { + } + + private ICollection? ClassificationLabelsValue { get; set; } + private ICollection FeatureNamesValue { get; set; } + private string? TargetTypeValue { get; set; } + private ICollection TreeStructureValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor TreeStructureDescriptor { get; set; } + private Action TreeStructureDescriptorAction { get; set; } + private Action[] TreeStructureDescriptorActions { get; set; } + + public TrainedModelTreeDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + public TrainedModelTreeDescriptor FeatureNames(ICollection featureNames) + { + FeatureNamesValue = featureNames; + return Self; + } + + public TrainedModelTreeDescriptor TargetType(string? targetType) + { + TargetTypeValue = targetType; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(ICollection treeStructure) + { + TreeStructureDescriptor = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = null; + TreeStructureValue = treeStructure; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor descriptor) + { + TreeStructureValue = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = null; + TreeStructureDescriptor = descriptor; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(Action configure) + { + TreeStructureValue = null; + TreeStructureDescriptor = null; + TreeStructureDescriptorActions = null; + TreeStructureDescriptorAction = configure; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(params Action[] configure) + { + TreeStructureValue = null; + TreeStructureDescriptor = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = 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); + } + + writer.WritePropertyName("feature_names"); + JsonSerializer.Serialize(writer, FeatureNamesValue, options); + if (!string.IsNullOrEmpty(TargetTypeValue)) + { + writer.WritePropertyName("target_type"); + writer.WriteStringValue(TargetTypeValue); + } + + if (TreeStructureDescriptor is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TreeStructureDescriptor, options); + writer.WriteEndArray(); + } + else if (TreeStructureDescriptorAction is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor(TreeStructureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TreeStructureDescriptorActions is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + foreach (var action in TreeStructureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TrainedModelTreeNodeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("tree_structure"); + JsonSerializer.Serialize(writer, TreeStructureValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs new file mode 100644 index 00000000000..8e79372da26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; + +public sealed partial class TrainedModelTreeNode +{ + [JsonInclude, JsonPropertyName("decision_type")] + public string? DecisionType { get; set; } + [JsonInclude, JsonPropertyName("default_left")] + public bool? DefaultLeft { get; set; } + [JsonInclude, JsonPropertyName("leaf_value")] + public double? LeafValue { get; set; } + [JsonInclude, JsonPropertyName("left_child")] + public int? LeftChild { get; set; } + [JsonInclude, JsonPropertyName("node_index")] + public int NodeIndex { get; set; } + [JsonInclude, JsonPropertyName("right_child")] + public int? RightChild { get; set; } + [JsonInclude, JsonPropertyName("split_feature")] + public int? SplitFeature { get; set; } + [JsonInclude, JsonPropertyName("split_gain")] + public int? SplitGain { get; set; } + [JsonInclude, JsonPropertyName("threshold")] + public double? Threshold { get; set; } +} + +public sealed partial class TrainedModelTreeNodeDescriptor : SerializableDescriptor +{ + internal TrainedModelTreeNodeDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelTreeNodeDescriptor() : base() + { + } + + private string? DecisionTypeValue { get; set; } + private bool? DefaultLeftValue { get; set; } + private double? LeafValueValue { get; set; } + private int? LeftChildValue { get; set; } + private int NodeIndexValue { get; set; } + private int? RightChildValue { get; set; } + private int? SplitFeatureValue { get; set; } + private int? SplitGainValue { get; set; } + private double? ThresholdValue { get; set; } + + public TrainedModelTreeNodeDescriptor DecisionType(string? decisionType) + { + DecisionTypeValue = decisionType; + return Self; + } + + public TrainedModelTreeNodeDescriptor DefaultLeft(bool? defaultLeft = true) + { + DefaultLeftValue = defaultLeft; + return Self; + } + + public TrainedModelTreeNodeDescriptor LeafValue(double? leafValue) + { + LeafValueValue = leafValue; + return Self; + } + + public TrainedModelTreeNodeDescriptor LeftChild(int? leftChild) + { + LeftChildValue = leftChild; + return Self; + } + + public TrainedModelTreeNodeDescriptor NodeIndex(int nodeIndex) + { + NodeIndexValue = nodeIndex; + return Self; + } + + public TrainedModelTreeNodeDescriptor RightChild(int? rightChild) + { + RightChildValue = rightChild; + return Self; + } + + public TrainedModelTreeNodeDescriptor SplitFeature(int? splitFeature) + { + SplitFeatureValue = splitFeature; + return Self; + } + + public TrainedModelTreeNodeDescriptor SplitGain(int? splitGain) + { + SplitGainValue = splitGain; + return Self; + } + + public TrainedModelTreeNodeDescriptor Threshold(double? threshold) + { + ThresholdValue = threshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DecisionTypeValue)) + { + writer.WritePropertyName("decision_type"); + writer.WriteStringValue(DecisionTypeValue); + } + + if (DefaultLeftValue.HasValue) + { + writer.WritePropertyName("default_left"); + writer.WriteBooleanValue(DefaultLeftValue.Value); + } + + if (LeafValueValue.HasValue) + { + writer.WritePropertyName("leaf_value"); + writer.WriteNumberValue(LeafValueValue.Value); + } + + if (LeftChildValue.HasValue) + { + writer.WritePropertyName("left_child"); + writer.WriteNumberValue(LeftChildValue.Value); + } + + writer.WritePropertyName("node_index"); + writer.WriteNumberValue(NodeIndexValue); + if (RightChildValue.HasValue) + { + writer.WritePropertyName("right_child"); + writer.WriteNumberValue(RightChildValue.Value); + } + + if (SplitFeatureValue.HasValue) + { + writer.WritePropertyName("split_feature"); + writer.WriteNumberValue(SplitFeatureValue.Value); + } + + if (SplitGainValue.HasValue) + { + writer.WritePropertyName("split_gain"); + writer.WriteNumberValue(SplitGainValue.Value); + } + + if (ThresholdValue.HasValue) + { + writer.WritePropertyName("threshold"); + writer.WriteNumberValue(ThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TransformAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TransformAuthorization.g.cs new file mode 100644 index 00000000000..878f6d0fcb0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/TransformAuthorization.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.MachineLearning; + +public sealed partial class TransformAuthorization +{ + /// + /// If an API key was used for the most recent update to the transform, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the transform, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ 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/MachineLearning/Vocabulary.g.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Vocabulary.g.cs index ecaeb82ed85..d3f12e40fb0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/Vocabulary.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Vocabulary.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class Vocabulary { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Weights.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Weights.g.cs new file mode 100644 index 00000000000..9ce888f15bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/Weights.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.MachineLearning; + +public sealed partial class Weights +{ + [JsonInclude, JsonPropertyName("weights")] + public double WeightsValue { get; set; } +} + +public sealed partial class WeightsDescriptor : SerializableDescriptor +{ + internal WeightsDescriptor(Action configure) => configure.Invoke(this); + + public WeightsDescriptor() : base() + { + } + + private double WeightsValueValue { get; set; } + + public WeightsDescriptor WeightsValue(double weightsValue) + { + WeightsValueValue = weightsValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("weights"); + writer.WriteNumberValue(WeightsValueValue); + 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/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs index 4d630722511..93fc1a8e434 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; /// /// Zero shot classification configuration options @@ -66,9 +66,9 @@ public sealed partial class ZeroShotClassificationInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Ml.InferenceConfigCreate.ZeroShotClassification(zeroShotClassificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigCreate.ZeroShotClassification(zeroShotClassificationInferenceOptions); } /// @@ -87,9 +87,9 @@ public ZeroShotClassificationInferenceOptionsDescriptor() : base() 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.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
@@ -139,7 +139,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor ResultsField(string? res /// /// The tokenization options to update when inferring /// - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.TokenizationConfig? tokenization) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -147,7 +147,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Cli return Self; } - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -155,7 +155,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Tokenizatio return Self; } - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Action configure) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -200,7 +200,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs index 5bbe5fe5f25..bdbae85cd79 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Serverless.Ml; +namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning; public sealed partial class ZeroShotClassificationInferenceUpdateOptions { @@ -51,9 +51,9 @@ public sealed partial class ZeroShotClassificationInferenceUpdateOptions /// The tokenization options to update when inferring ///
[JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.ZeroShotClassification(zeroShotClassificationInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.Serverless.MachineLearning.InferenceConfigUpdate.ZeroShotClassification(zeroShotClassificationInferenceUpdateOptions); } public sealed partial class ZeroShotClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -67,9 +67,9 @@ 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; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The labels to predict. @@ -101,7 +101,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor ResultsField(strin /// /// The tokenization options to update when inferring /// - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.Ml.NlpTokenizationUpdateOptions? tokenization) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -109,7 +109,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elast return Self; } - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -117,7 +117,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTo return Self; } - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -150,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { 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 index 7b7780c69a6..f0b73cdae5b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs @@ -37,6 +37,10 @@ public sealed partial class AggregateMetricDoubleProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("metrics")] @@ -85,15 +89,15 @@ public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -105,6 +109,9 @@ public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignor return Self; } + /// + /// Metadata about the field. + /// public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -123,15 +130,15 @@ public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Cli return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -239,15 +246,15 @@ public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -259,6 +266,9 @@ public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -277,15 +287,15 @@ public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 2e89f8f5d36..ed41e2bcc9b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BinaryProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class BinaryProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Fields(Action> configure) + public BinaryPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Properties(Action> configure) + public BinaryPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Fields(Action> configure) + public BinaryPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverl return Self; } - public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Properties(Action> configure) + public BinaryPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 1ee8ffe1ba7..a23ba6f9454 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/BooleanProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class BooleanProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -73,8 +77,8 @@ public BooleanPropertyDescriptor() : base() 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.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; } @@ -116,7 +120,7 @@ public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsea return Self; } - public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -124,7 +128,7 @@ public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFie return Self; } - public BooleanPropertyDescriptor Fielddata(Action configure) + public BooleanPropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -138,15 +142,15 @@ public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Fields(Action> configure) + public BooleanPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -164,6 +168,9 @@ public BooleanPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -182,15 +189,15 @@ public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Properties(Action> configure) + public BooleanPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -243,7 +250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -311,15 +318,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -359,8 +366,8 @@ public BooleanPropertyDescriptor() : base() 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.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; } @@ -402,7 +409,7 @@ public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverl return Self; } - public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -410,7 +417,7 @@ public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescr return Self; } - public BooleanPropertyDescriptor Fielddata(Action configure) + public BooleanPropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -424,15 +431,15 @@ public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless return Self; } - public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Fields(Action> configure) + public BooleanPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -450,6 +457,9 @@ public BooleanPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -468,15 +478,15 @@ public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Server return Self; } - public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Properties(Action> configure) + public BooleanPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -529,7 +539,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -597,15 +607,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } 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 index faf25d2adf7..b96f2ed5ed1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ByteNumberProperty.g.cs @@ -47,10 +47,14 @@ public sealed partial class ByteNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] - public double? NullValue { get; set; } + public byte? NullValue { get; set; } [JsonInclude, JsonPropertyName("on_script_error")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -61,10 +65,6 @@ public sealed partial class ByteNumberProperty : IProperty 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"; @@ -88,14 +88,12 @@ public ByteNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private byte? 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) { @@ -133,15 +131,15 @@ public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Fields(Action> configure) + public ByteNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,13 +163,16 @@ public ByteNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ByteNumberPropertyDescriptor NullValue(double? nullValue) + public ByteNumberPropertyDescriptor NullValue(byte? nullValue) { NullValueValue = nullValue; return Self; @@ -189,15 +190,15 @@ public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Properties(Action> configure) + public ByteNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -296,10 +285,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -390,14 +365,12 @@ public ByteNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private byte? 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) { @@ -435,15 +408,15 @@ public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Fields(Action> configure) + public ByteNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,13 +440,16 @@ public ByteNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ByteNumberPropertyDescriptor NullValue(double? nullValue) + public ByteNumberPropertyDescriptor NullValue(byte? nullValue) { NullValueValue = nullValue; return Self; @@ -491,15 +467,15 @@ public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Properties(Action> configure) + public ByteNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -598,10 +562,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 314811f77f6..4bea0625fec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/CompletionProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class CompletionProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("max_input_length")] public int? MaxInputLength { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("preserve_position_increments")] @@ -74,9 +78,9 @@ public CompletionPropertyDescriptor() : base() private string? AnalyzerValue { get; set; } private ICollection? ContextsValue { get; set; } - private SuggestContextDescriptor ContextsDescriptor { get; set; } - private Action> ContextsDescriptorAction { get; set; } - private Action>[] ContextsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action> ContextsDescriptorAction { get; set; } + private Action>[] ContextsDescriptorActions { 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; } @@ -106,7 +110,7 @@ public CompletionPropertyDescriptor Contexts(ICollection Contexts(SuggestContextDescriptor descriptor) + public CompletionPropertyDescriptor Contexts(Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor descriptor) { ContextsValue = null; ContextsDescriptorAction = null; @@ -115,7 +119,7 @@ public CompletionPropertyDescriptor Contexts(SuggestContextDescriptor return Self; } - public CompletionPropertyDescriptor Contexts(Action> configure) + public CompletionPropertyDescriptor Contexts(Action> configure) { ContextsValue = null; ContextsDescriptor = null; @@ -124,7 +128,7 @@ public CompletionPropertyDescriptor Contexts(Action Contexts(params Action>[] configure) + public CompletionPropertyDescriptor Contexts(params Action>[] configure) { ContextsValue = null; ContextsDescriptor = null; @@ -157,15 +161,15 @@ public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Fields(Action> configure) + public CompletionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -183,6 +187,9 @@ public CompletionPropertyDescriptor MaxInputLength(int? maxInputLengt return Self; } + /// + /// Metadata about the field. + /// public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -207,15 +214,15 @@ public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Properties(Action> configure) + public CompletionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -259,7 +266,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("contexts"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(ContextsDescriptorAction), options); writer.WriteEndArray(); } else if (ContextsDescriptorActions is not null) @@ -268,7 +275,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ContextsDescriptorActions) { - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(action), options); } writer.WriteEndArray(); @@ -362,10 +369,34 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } + private ICollection? BuildContexts() + { + if (ContextsValue is not null) + { + return ContextsValue; + } + + if ((object)ContextsDescriptor is IBuildableDescriptor?> buildable) + { + return buildable.Build(); + } + + if (ContextsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(ContextsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor?> buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + CompletionProperty IBuildableDescriptor.Build() => new() { - Contexts = ContextsValue, Analyzer = AnalyzerValue, + Contexts = BuildContexts(), CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, @@ -392,9 +423,9 @@ public CompletionPropertyDescriptor() : base() private string? AnalyzerValue { get; set; } private ICollection? ContextsValue { get; set; } - private SuggestContextDescriptor ContextsDescriptor { get; set; } - private Action ContextsDescriptorAction { get; set; } - private Action[] ContextsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action ContextsDescriptorAction { get; set; } + private Action[] ContextsDescriptorActions { 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; } @@ -424,7 +455,7 @@ public CompletionPropertyDescriptor Contexts(ICollection configure) + public CompletionPropertyDescriptor Contexts(Action configure) { ContextsValue = null; ContextsDescriptor = null; @@ -442,7 +473,7 @@ public CompletionPropertyDescriptor Contexts(Action co return Self; } - public CompletionPropertyDescriptor Contexts(params Action[] configure) + public CompletionPropertyDescriptor Contexts(params Action[] configure) { ContextsValue = null; ContextsDescriptor = null; @@ -475,15 +506,15 @@ public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Fields(Action> configure) + public CompletionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -501,6 +532,9 @@ public CompletionPropertyDescriptor MaxInputLength(int? maxInputLength) return Self; } + /// + /// Metadata about the field. + /// public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -525,15 +559,15 @@ public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Properties(Action> configure) + public CompletionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -577,7 +611,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("contexts"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(ContextsDescriptorAction), options); writer.WriteEndArray(); } else if (ContextsDescriptorActions is not null) @@ -586,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ContextsDescriptorActions) { - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(action), options); } writer.WriteEndArray(); @@ -680,10 +714,34 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } + private ICollection? BuildContexts() + { + if (ContextsValue is not null) + { + return ContextsValue; + } + + if ((object)ContextsDescriptor is IBuildableDescriptor?> buildable) + { + return buildable.Build(); + } + + if (ContextsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.SuggestContextDescriptor(ContextsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor?> buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + CompletionProperty IBuildableDescriptor.Build() => new() { - Contexts = ContextsValue, Analyzer = AnalyzerValue, + Contexts = BuildContexts(), CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, 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 index b88a3e4ad68..928dd6730db 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class ConstantKeywordProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -74,15 +78,15 @@ public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Fields(Action> configure) + public ConstantKeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -94,6 +98,9 @@ public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove return Self; } + /// + /// Metadata about the field. + /// public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -106,15 +113,15 @@ public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.E return Self; } - public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Properties(Action> configure) + public ConstantKeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -208,15 +215,15 @@ public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Fields(Action> configure) + public ConstantKeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -228,6 +235,9 @@ public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -240,15 +250,15 @@ public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Properties(Action> configure) + public ConstantKeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 23cca717814..ab928e5f9b0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateNanosProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DateNanosProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -118,15 +122,15 @@ public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Fields(Action> configure) + public DateNanosPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -156,6 +160,9 @@ public DateNanosPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -180,15 +187,15 @@ public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Properties(Action> configure) + public DateNanosPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -378,15 +385,15 @@ public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverle return Self; } - public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Fields(Action> configure) + public DateNanosPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -416,6 +423,9 @@ public DateNanosPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -440,15 +450,15 @@ public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serv return Self; } - public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Properties(Action> configure) + public DateNanosPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index ac12570bc56..b990974fefc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateProperty.g.cs @@ -51,6 +51,10 @@ public sealed partial class DateProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -81,8 +85,8 @@ public DatePropertyDescriptor() : base() 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.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; } @@ -128,7 +132,7 @@ public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch return Self; } - public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -136,7 +140,7 @@ public DatePropertyDescriptor Fielddata(IndexManagement.NumericFieldd return Self; } - public DatePropertyDescriptor Fielddata(Action configure) + public DatePropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -150,15 +154,15 @@ public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Fields(Action> configure) + public DatePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -194,6 +198,9 @@ public DatePropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -218,15 +225,15 @@ public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Properties(Action> configure) + public DatePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -279,7 +286,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -371,15 +378,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -423,8 +430,8 @@ public DatePropertyDescriptor() : base() 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.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; } @@ -470,7 +477,7 @@ public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless return Self; } - public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -478,7 +485,7 @@ public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescript return Self; } - public DatePropertyDescriptor Fielddata(Action configure) + public DatePropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -492,15 +499,15 @@ public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Ma return Self; } - public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Fields(Action> configure) + public DatePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -536,6 +543,9 @@ public DatePropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -560,15 +570,15 @@ public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverles return Self; } - public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Properties(Action> configure) + public DatePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -621,7 +631,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -713,15 +723,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } 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 index 3630f1acbf3..b9638750fd7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DateRangeProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DateRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -118,15 +122,15 @@ public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Fields(Action> configure) + public DateRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -150,6 +154,9 @@ public DateRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -162,15 +169,15 @@ public DateRangePropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Properties(Action> configure) + public DateRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -350,15 +357,15 @@ public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverle return Self; } - public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Fields(Action> configure) + public DateRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -382,6 +389,9 @@ public DateRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -394,15 +404,15 @@ public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serv return Self; } - public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Properties(Action> configure) + public DateRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index c767be38095..2c8847c4cce 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -37,7 +37,7 @@ public sealed partial class DenseVectorIndexOptions public string Type { get; set; } } -public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor { internal DenseVectorIndexOptionsDescriptor(Action configure) => configure.Invoke(this); @@ -78,11 +78,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 326b84c60f0..b2f5992601a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; public sealed partial class DenseVectorProperty : IProperty { [JsonInclude, JsonPropertyName("dims")] - public int Dims { get; set; } + public int? Dims { get; set; } [JsonInclude, JsonPropertyName("dynamic")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? Dynamic { get; set; } [JsonInclude, JsonPropertyName("fields")] @@ -41,6 +41,10 @@ public sealed partial class DenseVectorProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -60,19 +64,19 @@ public DenseVectorPropertyDescriptor() : base() { } - private int DimsValue { get; set; } + 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 Elastic.Clients.Elasticsearch.Serverless.Mapping.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) + public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; return Self; @@ -90,15 +94,15 @@ public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Fields(Action> configure) + public DenseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -124,7 +128,7 @@ public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Ela return Self; } - public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor descriptor) { IndexOptionsValue = null; IndexOptionsDescriptorAction = null; @@ -132,7 +136,7 @@ public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOpt return Self; } - public DenseVectorPropertyDescriptor IndexOptions(Action configure) + public DenseVectorPropertyDescriptor IndexOptions(Action configure) { IndexOptionsValue = null; IndexOptionsDescriptor = null; @@ -140,6 +144,9 @@ public DenseVectorPropertyDescriptor IndexOptions(Action + /// Metadata about the field. + /// public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -152,15 +159,15 @@ public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Properties(Action> configure) + public DenseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -175,8 +182,12 @@ public DenseVectorPropertyDescriptor Similarity(string? similarity) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("dims"); - writer.WriteNumberValue(DimsValue); + if (DimsValue.HasValue) + { + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue.Value); + } + if (DynamicValue is not null) { writer.WritePropertyName("dynamic"); @@ -209,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexOptionsDescriptorAction is not null) { writer.WritePropertyName("index_options"); - JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); } else if (IndexOptionsValue is not null) { @@ -247,15 +258,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexOptionsValue; } - if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + if ((object)IndexOptionsDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexOptionsDescriptorAction is not null) { - var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -286,19 +297,19 @@ public DenseVectorPropertyDescriptor() : base() { } - private int DimsValue { get; set; } + 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 Elastic.Clients.Elasticsearch.Serverless.Mapping.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) + public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; return Self; @@ -316,15 +327,15 @@ public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Fields(Action> configure) + public DenseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -350,7 +361,7 @@ public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch. return Self; } - public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor descriptor) { IndexOptionsValue = null; IndexOptionsDescriptorAction = null; @@ -358,7 +369,7 @@ public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescrip return Self; } - public DenseVectorPropertyDescriptor IndexOptions(Action configure) + public DenseVectorPropertyDescriptor IndexOptions(Action configure) { IndexOptionsValue = null; IndexOptionsDescriptor = null; @@ -366,6 +377,9 @@ public DenseVectorPropertyDescriptor IndexOptions(Action + /// Metadata about the field. + ///
public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -378,15 +392,15 @@ public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Properties(Action> configure) + public DenseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -401,8 +415,12 @@ public DenseVectorPropertyDescriptor Similarity(string? similarity) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("dims"); - writer.WriteNumberValue(DimsValue); + if (DimsValue.HasValue) + { + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue.Value); + } + if (DynamicValue is not null) { writer.WritePropertyName("dynamic"); @@ -435,7 +453,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexOptionsDescriptorAction is not null) { writer.WritePropertyName("index_options"); - JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); } else if (IndexOptionsValue is not null) { @@ -473,15 +491,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexOptionsValue; } - if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + if ((object)IndexOptionsDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexOptionsDescriptorAction is not null) { - var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } 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 index 063642f518f..d470ee44fbc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DoubleNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class DoubleNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public DoubleNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Fields(Action> configure) + public DoubleNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public DoubleNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Properties(Action> configure) + public DoubleNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public DoubleNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serve return Self; } - public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Fields(Action> configure) + public DoubleNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public DoubleNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.S return Self; } - public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Properties(Action> configure) + public DoubleNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 47a2d1b347d..b93079c7bcf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DoubleRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class DoubleRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Fields(Action> configure) + public DoubleRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public DoubleRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Properties(Action> configure) + public DoubleRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Fields(Action> configure) + public DoubleRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public DoubleRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Properties(Action> configure) + public DoubleRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 2632193552a..0e0eedba3b8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicProperty.g.cs @@ -63,6 +63,10 @@ public sealed partial class DynamicProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -120,8 +124,8 @@ public DynamicPropertyDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private string? LocaleValue { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } @@ -192,15 +196,15 @@ public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Fields(Action> configure) + public DynamicPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -250,7 +254,7 @@ public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasti return Self; } - public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -258,7 +262,7 @@ public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescr return Self; } - public DynamicPropertyDescriptor IndexPrefixes(Action configure) + public DynamicPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -272,6 +276,9 @@ public DynamicPropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -314,15 +321,15 @@ public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Properties(Action> configure) + public DynamicPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -471,7 +478,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -581,15 +588,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -658,8 +665,8 @@ public DynamicPropertyDescriptor() : base() 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 Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private string? LocaleValue { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } @@ -730,15 +737,15 @@ public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless return Self; } - public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Fields(Action> configure) + public DynamicPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -788,7 +795,7 @@ public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Ser return Self; } - public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -796,7 +803,7 @@ public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descr return Self; } - public DynamicPropertyDescriptor IndexPrefixes(Action configure) + public DynamicPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -810,6 +817,9 @@ public DynamicPropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -852,15 +862,15 @@ public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Server return Self; } - public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Properties(Action> configure) + public DynamicPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -1009,7 +1019,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -1119,15 +1129,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } 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 index d38fb7fba9c..ca7ef1dc285 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -45,6 +45,113 @@ public sealed partial class DynamicTemplate 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(); + } +} + public sealed partial class DynamicTemplateDescriptor : SerializableDescriptor { internal DynamicTemplateDescriptor(Action configure) => configure.Invoke(this); 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 index 9ed373b6c59..49c48afdc5b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FieldAliasProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class FieldAliasProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("path")] @@ -73,15 +77,15 @@ public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Fields(Action> configure) + public FieldAliasPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -93,6 +97,9 @@ public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,21 +118,27 @@ public FieldAliasPropertyDescriptor Path(Expression 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) + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Properties(Action> configure) + public FieldAliasPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -213,15 +226,15 @@ public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Fields(Action> configure) + public FieldAliasPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -233,6 +246,9 @@ public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -263,15 +279,15 @@ public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public FieldAliasPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Properties(Action> configure) + public FieldAliasPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 3ec756cc17f..c25d5999ad5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FlattenedProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class FlattenedProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -121,15 +125,15 @@ public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Fields(Action> configure) + public FlattenedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elast return Self; } + /// + /// Metadata about the field. + /// public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Properties(Action> configure) + public FlattenedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -367,15 +374,15 @@ public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverle return Self; } - public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Fields(Action> configure) + public FlattenedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -399,6 +406,9 @@ public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Se return Self; } + /// + /// Metadata about the field. + /// public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -417,15 +427,15 @@ public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serv return Self; } - public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Properties(Action> configure) + public FlattenedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 88ba3102e35..4f6f27541d6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class FloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class FloatNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public FloatNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Fields(Action> configure) + public FloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public FloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Properties(Action> configure) + public FloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public FloatNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Fields(Action> configure) + public FloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public FloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Properties(Action> configure) + public FloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index fac08d51ffe..6bbe4514456 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/FloatRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class FloatRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Fields(Action> configure) + public FloatRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public FloatRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Properties(Action> configure) + public FloatRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Fields(Action> configure) + public FloatRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public FloatRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Properties(Action> configure) + public FloatRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 6a0fb49c287..719eeac01c0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoPointProperty.g.cs @@ -43,12 +43,22 @@ public sealed partial class GeoPointProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] public Elastic.Clients.Elasticsearch.Serverless.GeoLocation? 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")] @@ -73,9 +83,12 @@ public GeoPointPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private bool? IgnoreMalformedValue { get; set; } private bool? IgnoreZValueValue { get; set; } + private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? 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; } @@ -103,15 +116,15 @@ public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Fields(Action> configure) + public GeoPointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -135,6 +148,15 @@ public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = t return Self; } + public GeoPointPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + /// + /// Metadata about the field. + /// public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -147,26 +169,38 @@ public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticse return Self; } + public GeoPointPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Properties(Action> configure) + public GeoPointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } + public GeoPointPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + public GeoPointPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -224,6 +258,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreZValueValue.Value); } + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + if (MetaValue is not null) { writer.WritePropertyName("meta"); @@ -236,12 +276,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -268,9 +320,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, IgnoreZValue = IgnoreZValueValue, + Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, + Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue }; @@ -291,9 +346,12 @@ public GeoPointPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private bool? IgnoreMalformedValue { get; set; } private bool? IgnoreZValueValue { get; set; } + private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.GeoLocation? 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; } @@ -321,15 +379,15 @@ public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverles return Self; } - public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Fields(Action> configure) + public GeoPointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -353,6 +411,15 @@ public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + public GeoPointPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + /// + /// Metadata about the field. + /// public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -365,26 +432,38 @@ public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.Server return Self; } + public GeoPointPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Properties(Action> configure) + public GeoPointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } + public GeoPointPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script? script) + { + ScriptValue = script; + return Self; + } + public GeoPointPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -442,6 +521,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreZValueValue.Value); } + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + if (MetaValue is not null) { writer.WritePropertyName("meta"); @@ -454,12 +539,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -486,9 +583,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, IgnoreZValue = IgnoreZValueValue, + Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, + Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue }; 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 index f3f9a2f509f..9f6ca47cd13 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/GeoShapeProperty.g.cs @@ -29,6 +29,7 @@ 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.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapeProperty : IProperty { @@ -48,6 +49,10 @@ public sealed partial class GeoShapeProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("orientation")] @@ -67,6 +72,7 @@ public sealed partial class GeoShapeProperty : IProperty /// /// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor { @@ -121,15 +127,15 @@ public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Fields(Action> configure) + public GeoShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +159,9 @@ public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = t return Self; } + /// + /// Metadata about the field. + /// public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +180,15 @@ public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elastics return Self; } - public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Properties(Action> configure) + public GeoShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -316,6 +325,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o /// /// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor { @@ -370,15 +380,15 @@ public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverles return Self; } - public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Fields(Action> configure) + public GeoShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -402,6 +412,9 @@ public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -420,15 +433,15 @@ public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serve return Self; } - public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Properties(Action> configure) + public GeoShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index dcccf71f444..1c421d8b924 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class HalfFloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class HalfFloatNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public HalfFloatNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public HalfFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.E return Self; } - public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public HalfFloatNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public HalfFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 0022358f4a4..4aa89bed37d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/HistogramProperty.g.cs @@ -37,6 +37,10 @@ public sealed partial class HistogramProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("ignore_malformed")] public bool? IgnoreMalformed { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -73,15 +77,15 @@ public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Fields(Action> configure) + public HistogramPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -99,6 +103,9 @@ public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalfor return Self; } + /// + /// Metadata about the field. + /// public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,15 +118,15 @@ public HistogramPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Properties(Action> configure) + public HistogramPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -207,15 +214,15 @@ public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverle return Self; } - public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Fields(Action> configure) + public HistogramPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -233,6 +240,9 @@ public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) return Self; } + /// + /// Metadata about the field. + /// public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -245,15 +255,15 @@ public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serv return Self; } - public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Properties(Action> configure) + public HistogramPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 65f0e28a448..7deaf3c6e57 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class IntegerNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class IntegerNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public IntegerNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elastic return Self; } - public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Fields(Action> configure) + public IntegerNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public IntegerNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Ela return Self; } - public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Properties(Action> configure) + public IntegerNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public IntegerNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serv return Self; } - public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Fields(Action> configure) + public IntegerNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public IntegerNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch. return Self; } - public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Properties(Action> configure) + public IntegerNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 043e27db4fb..5d6c6151f82 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IntegerRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IntegerRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Fields(Action> configure) + public IntegerRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public IntegerRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Properties(Action> configure) + public IntegerRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serve return Self; } - public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Fields(Action> configure) + public IntegerRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public IntegerRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.S return Self; } - public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Properties(Action> configure) + public IntegerRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index af672be85df..544450edd36 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IpProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -60,12 +64,6 @@ public sealed partial class IpProperty : IProperty [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"; } @@ -93,7 +91,6 @@ public IpPropertyDescriptor() : base() 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) { @@ -125,15 +122,15 @@ public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serv return Self; } - public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Fields(Action> configure) + public IpPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -157,6 +154,9 @@ public IpPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -181,15 +181,15 @@ public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch. return Self; } - public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Properties(Action> configure) + public IpPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -213,15 +213,6 @@ public IpPropertyDescriptor Store(bool? store = true) 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(); @@ -315,12 +306,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } - if (TimeSeriesDimensionValue.HasValue) - { - writer.WritePropertyName("time_series_dimension"); - writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); - } - writer.WritePropertyName("type"); writer.WriteStringValue("ip"); writer.WriteEndObject(); @@ -342,8 +327,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue + Store = StoreValue }; } @@ -370,7 +354,6 @@ public IpPropertyDescriptor() : base() 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) { @@ -402,15 +385,15 @@ public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapp return Self; } - public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Fields(Action> configure) + public IpPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -434,6 +417,9 @@ public IpPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -458,15 +444,15 @@ public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Properties(Action> configure) + public IpPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -490,15 +476,6 @@ public IpPropertyDescriptor Store(bool? store = true) 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(); @@ -592,12 +569,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } - if (TimeSeriesDimensionValue.HasValue) - { - writer.WritePropertyName("time_series_dimension"); - writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); - } - writer.WritePropertyName("type"); writer.WriteStringValue("ip"); writer.WriteEndObject(); @@ -619,7 +590,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue + Store = StoreValue }; } \ 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 index f6925f31e42..78c3cfb55c3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/IpRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IpRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Fields(Action> configure) + public IpRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public IpRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Properties(Action> configure) + public IpRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless return Self; } - public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Fields(Action> configure) + public IpRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public IpRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Server return Self; } - public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Properties(Action> configure) + public IpRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index c758fc41134..5546819ff19 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/JoinProperty.g.cs @@ -37,12 +37,16 @@ public sealed partial class JoinProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [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; } + public IDictionary>>? Relations { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "join"; @@ -62,7 +66,7 @@ public JoinPropertyDescriptor() : base() 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; } + private IDictionary>>? RelationsValue { get; set; } public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) { @@ -82,15 +86,15 @@ public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Fields(Action> configure) + public JoinPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -102,6 +106,9 @@ public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -114,23 +121,23 @@ public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Properties(Action> configure) + public JoinPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + public JoinPropertyDescriptor Relations(Func>>, FluentDictionary>>> selector) { - RelationsValue = selector?.Invoke(new FluentDictionary>()); + RelationsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } @@ -210,7 +217,7 @@ public JoinPropertyDescriptor() : base() 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; } + private IDictionary>>? RelationsValue { get; set; } public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) { @@ -230,15 +237,15 @@ public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Ma return Self; } - public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Fields(Action> configure) + public JoinPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -250,6 +257,9 @@ public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -262,23 +272,23 @@ public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverles return Self; } - public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Properties(Action> configure) + public JoinPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + public JoinPropertyDescriptor Relations(Func>>, FluentDictionary>>> selector) { - RelationsValue = selector?.Invoke(new FluentDictionary>()); + RelationsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } 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 index b8dccab9f6c..acade25c01f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/KeywordProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class KeywordProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("normalizer")] @@ -64,12 +68,6 @@ public sealed partial class KeywordProperty : IProperty [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"; } @@ -99,7 +97,6 @@ public KeywordPropertyDescriptor() : base() 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) { @@ -137,15 +134,15 @@ public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Fields(Action> configure) + public KeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -169,6 +166,9 @@ public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elastic return Self; } + /// + /// Metadata about the field. + /// public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -199,15 +199,15 @@ public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Properties(Action> configure) + public KeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -231,15 +231,6 @@ public KeywordPropertyDescriptor Store(bool? store = true) 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(); @@ -345,12 +336,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } - if (TimeSeriesDimensionValue.HasValue) - { - writer.WritePropertyName("time_series_dimension"); - writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); - } - writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); writer.WriteEndObject(); @@ -374,8 +359,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Similarity = SimilarityValue, SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue + Store = StoreValue }; } @@ -404,7 +388,6 @@ public KeywordPropertyDescriptor() : base() 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) { @@ -442,15 +425,15 @@ public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless return Self; } - public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Fields(Action> configure) + public KeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -474,6 +457,9 @@ public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Serv return Self; } + /// + /// Metadata about the field. + /// public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -504,15 +490,15 @@ public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Server return Self; } - public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Properties(Action> configure) + public KeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -536,15 +522,6 @@ public KeywordPropertyDescriptor Store(bool? store = true) 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(); @@ -650,12 +627,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } - if (TimeSeriesDimensionValue.HasValue) - { - writer.WritePropertyName("time_series_dimension"); - writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); - } - writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); writer.WriteEndObject(); @@ -679,7 +650,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Similarity = SimilarityValue, SplitQueriesOnWhitespace = SplitQueriesOnWhitespaceValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue + Store = StoreValue }; } \ 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 index 1000f628f71..08a6ea93f51 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class LongNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class LongNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public LongNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Fields(Action> configure) + public LongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public LongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Properties(Action> configure) + public LongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public LongNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public LongNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Fields(Action> configure) + public LongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public LongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Properties(Action> configure) + public LongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public LongNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 24d8b988ab9..26f0c4ef9b1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/LongRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class LongRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Fields(Action> configure) + public LongRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public LongRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public LongRangePropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Properties(Action> configure) + public LongRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverle return Self; } - public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Fields(Action> configure) + public LongRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public LongRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serv return Self; } - public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Properties(Action> configure) + public LongRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 0b0b1f7d36e..27446e05fc8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs @@ -87,21 +87,15 @@ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elastic 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) + public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.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) + public MatchOnlyTextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -183,21 +177,15 @@ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serv 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) + public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.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) + public MatchOnlyTextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; 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 index 86adba7ef29..bd90399b3ca 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Murmur3HashProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class Murmur3HashProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Fields(Action> configure) + public Murmur3HashPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Properties(Action> configure) + public Murmur3HashPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Fields(Action> configure) + public Murmur3HashPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Properties(Action> configure) + public Murmur3HashPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 8f67f2bb4c0..dc2431c6926 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/NestedProperty.g.cs @@ -43,6 +43,10 @@ public sealed partial class NestedProperty : IProperty public bool? IncludeInParent { get; set; } [JsonInclude, JsonPropertyName("include_in_root")] public bool? IncludeInRoot { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -100,15 +104,15 @@ public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Fields(Action> configure) + public NestedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -132,6 +136,9 @@ public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = t return Self; } + /// + /// Metadata about the field. + /// public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -144,15 +151,15 @@ public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Properties(Action> configure) + public NestedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -304,15 +311,15 @@ public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Fields(Action> configure) + public NestedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -336,6 +343,9 @@ public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = true) return Self; } + /// + /// Metadata about the field. + /// public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -348,15 +358,15 @@ public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverl return Self; } - public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Properties(Action> configure) + public NestedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 36da67f3892..3ae6b25843f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ObjectProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class ObjectProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -97,15 +101,15 @@ public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Fields(Action> configure) + public ObjectPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -117,6 +121,9 @@ public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -129,15 +136,15 @@ public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Properties(Action> configure) + public ObjectPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -287,15 +294,15 @@ public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Fields(Action> configure) + public ObjectPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -307,6 +314,9 @@ public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -319,15 +329,15 @@ public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverl return Self; } - public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Properties(Action> configure) + public ObjectPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index eed264aa85e..d7416478be9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PercolatorProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class PercolatorProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -70,15 +74,15 @@ public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Fields(Action> configure) + public PercolatorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,6 +94,9 @@ public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -102,15 +109,15 @@ public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Properties(Action> configure) + public PercolatorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -190,15 +197,15 @@ public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Fields(Action> configure) + public PercolatorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,6 +217,9 @@ public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -222,15 +232,15 @@ public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Properties(Action> configure) + public PercolatorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index c0ade3b8e8e..f2fdcf01fe5 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/PointProperty.g.cs @@ -43,6 +43,10 @@ public sealed partial class PointProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -103,15 +107,15 @@ public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.S return Self; } - public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Fields(Action> configure) + public PointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -135,6 +139,9 @@ public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true return Self; } + /// + /// Metadata about the field. + /// public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsear return Self; } - public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Properties(Action> configure) + public PointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -321,15 +328,15 @@ public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.M return Self; } - public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Fields(Action> configure) + public PointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -353,6 +360,9 @@ public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverle return Self; } - public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Properties(Action> configure) + public PointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 9ff5eb279d5..4d58c5229a3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/Properties.g.cs @@ -30,22 +30,22 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Mapping; -public partial class Properties : IsADictionary +public partial class Properties : IsADictionary { public Properties() { } - public Properties(IDictionary container) : base(container) + 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 void Add(Elastic.Clients.Elasticsearch.Serverless.PropertyName name, IProperty property) => BackingDictionary.Add(Sanitize(name), property); + public bool TryGetProperty(Elastic.Clients.Elasticsearch.Serverless.PropertyName name, [NotNullWhen(returnValue: true)] out IProperty property) => BackingDictionary.TryGetValue(Sanitize(name), out property); - public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValue: true)] out T? property) where T : class, IProperty + public bool TryGetProperty(Elastic.Clients.Elasticsearch.Serverless.PropertyName name, [NotNullWhen(returnValue: true)] out T? property) where T : class, IProperty { - if (BackingDictionary.TryGetValue(Sanitize(propertyName), out var matchedValue) && matchedValue is T finalValue) + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) { property = finalValue; return true; @@ -56,7 +56,7 @@ public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValu } } -public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, PropertyName, IProperty> +public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, Elastic.Clients.Elasticsearch.Serverless.PropertyName, IProperty> { public PropertiesDescriptor() : base(new Properties()) { @@ -66,241 +66,241 @@ public PropertiesDescriptor() : base(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 SparseVector(PropertyName propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); - public PropertiesDescriptor SparseVector(PropertyName propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); - public PropertiesDescriptor SparseVector(PropertyName propertyName, SparseVectorProperty sparseVectorProperty) => AssignVariant(propertyName, sparseVectorProperty); - public PropertiesDescriptor SparseVector(Expression> propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); - public PropertiesDescriptor SparseVector(Expression> propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(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); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, null); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, configure); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, BinaryProperty>(propertyName, null); + public PropertiesDescriptor Binary(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, BinaryProperty>(propertyName, configure); + public PropertiesDescriptor Binary(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, BooleanProperty>(propertyName, null); + public PropertiesDescriptor Boolean(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, BooleanProperty>(propertyName, configure); + public PropertiesDescriptor Boolean(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ByteNumberProperty>(propertyName, null); + public PropertiesDescriptor ByteNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ByteNumberProperty>(propertyName, configure); + public PropertiesDescriptor ByteNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, CompletionProperty>(propertyName, null); + public PropertiesDescriptor Completion(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, CompletionProperty>(propertyName, configure); + public PropertiesDescriptor Completion(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ConstantKeywordProperty>(propertyName, null); + public PropertiesDescriptor ConstantKeyword(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ConstantKeywordProperty>(propertyName, configure); + public PropertiesDescriptor ConstantKeyword(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DateNanosProperty>(propertyName, null); + public PropertiesDescriptor DateNanos(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DateNanosProperty>(propertyName, configure); + public PropertiesDescriptor DateNanos(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DateProperty>(propertyName, null); + public PropertiesDescriptor Date(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DateProperty>(propertyName, configure); + public PropertiesDescriptor Date(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DateRangeProperty>(propertyName, null); + public PropertiesDescriptor DateRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DateRangeProperty>(propertyName, configure); + public PropertiesDescriptor DateRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DenseVectorProperty>(propertyName, null); + public PropertiesDescriptor DenseVector(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DenseVectorProperty>(propertyName, configure); + public PropertiesDescriptor DenseVector(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DoubleNumberProperty>(propertyName, null); + public PropertiesDescriptor DoubleNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DoubleNumberProperty>(propertyName, configure); + public PropertiesDescriptor DoubleNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DoubleRangeProperty>(propertyName, null); + public PropertiesDescriptor DoubleRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DoubleRangeProperty>(propertyName, configure); + public PropertiesDescriptor DoubleRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, DynamicProperty>(propertyName, null); + public PropertiesDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, DynamicProperty>(propertyName, configure); + public PropertiesDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, FieldAliasProperty>(propertyName, null); + public PropertiesDescriptor FieldAlias(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, FieldAliasProperty>(propertyName, configure); + public PropertiesDescriptor FieldAlias(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, FlattenedProperty>(propertyName, null); + public PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, FlattenedProperty>(propertyName, configure); + public PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, FloatNumberProperty>(propertyName, null); + public PropertiesDescriptor FloatNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, FloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor FloatNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, FloatRangeProperty>(propertyName, null); + public PropertiesDescriptor FloatRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, FloatRangeProperty>(propertyName, configure); + public PropertiesDescriptor FloatRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, GeoPointProperty>(propertyName, null); + public PropertiesDescriptor GeoPoint(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, GeoPointProperty>(propertyName, configure); + public PropertiesDescriptor GeoPoint(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, GeoShapeProperty>(propertyName, null); + public PropertiesDescriptor GeoShape(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, GeoShapeProperty>(propertyName, configure); + public PropertiesDescriptor GeoShape(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, HalfFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor HalfFloatNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, HalfFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor HalfFloatNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, HistogramProperty>(propertyName, null); + public PropertiesDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, HistogramProperty>(propertyName, configure); + public PropertiesDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, IntegerNumberProperty>(propertyName, null); + public PropertiesDescriptor IntegerNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, IntegerNumberProperty>(propertyName, configure); + public PropertiesDescriptor IntegerNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, IntegerRangeProperty>(propertyName, null); + public PropertiesDescriptor IntegerRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, IntegerRangeProperty>(propertyName, configure); + public PropertiesDescriptor IntegerRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, IpProperty>(propertyName, null); + public PropertiesDescriptor Ip(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, IpProperty>(propertyName, configure); + public PropertiesDescriptor Ip(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, IpRangeProperty>(propertyName, null); + public PropertiesDescriptor IpRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, IpRangeProperty>(propertyName, configure); + public PropertiesDescriptor IpRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, JoinProperty>(propertyName, null); + public PropertiesDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, JoinProperty>(propertyName, configure); + public PropertiesDescriptor Join(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, KeywordProperty>(propertyName, null); + public PropertiesDescriptor Keyword(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, KeywordProperty>(propertyName, configure); + public PropertiesDescriptor Keyword(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, LongNumberProperty>(propertyName, null); + public PropertiesDescriptor LongNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, LongNumberProperty>(propertyName, configure); + public PropertiesDescriptor LongNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, LongRangeProperty>(propertyName, null); + public PropertiesDescriptor LongRange(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, LongRangeProperty>(propertyName, configure); + public PropertiesDescriptor LongRange(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, MatchOnlyTextProperty>(propertyName, null); + public PropertiesDescriptor MatchOnlyText(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, MatchOnlyTextProperty>(propertyName, configure); + public PropertiesDescriptor MatchOnlyText(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, Murmur3HashProperty>(propertyName, null); + public PropertiesDescriptor Murmur3Hash(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, Murmur3HashProperty>(propertyName, configure); + public PropertiesDescriptor Murmur3Hash(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, NestedProperty>(propertyName, null); + public PropertiesDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, NestedProperty>(propertyName, configure); + public PropertiesDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ObjectProperty>(propertyName, null); + public PropertiesDescriptor Object(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ObjectProperty>(propertyName, configure); + public PropertiesDescriptor Object(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, PercolatorProperty>(propertyName, null); + public PropertiesDescriptor Percolator(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, PercolatorProperty>(propertyName, configure); + public PropertiesDescriptor Percolator(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, PointProperty>(propertyName, null); + public PropertiesDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, PointProperty>(propertyName, configure); + public PropertiesDescriptor Point(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, RankFeatureProperty>(propertyName, null); + public PropertiesDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, RankFeatureProperty>(propertyName, configure); + public PropertiesDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, RankFeaturesProperty>(propertyName, null); + public PropertiesDescriptor RankFeatures(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, RankFeaturesProperty>(propertyName, configure); + public PropertiesDescriptor RankFeatures(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ScaledFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor ScaledFloatNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ScaledFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor ScaledFloatNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, SearchAsYouTypeProperty>(propertyName, null); + public PropertiesDescriptor SearchAsYouType(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, SearchAsYouTypeProperty>(propertyName, configure); + public PropertiesDescriptor SearchAsYouType(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ShapeProperty>(propertyName, null); + public PropertiesDescriptor Shape(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ShapeProperty>(propertyName, configure); + public PropertiesDescriptor Shape(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, ShortNumberProperty>(propertyName, null); + public PropertiesDescriptor ShortNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, ShortNumberProperty>(propertyName, configure); + public PropertiesDescriptor ShortNumber(Elastic.Clients.Elasticsearch.Serverless.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 SparseVector(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); + public PropertiesDescriptor SparseVector(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); + public PropertiesDescriptor SparseVector(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, SparseVectorProperty sparseVectorProperty) => AssignVariant(propertyName, sparseVectorProperty); + public PropertiesDescriptor SparseVector(Expression> propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); + public PropertiesDescriptor SparseVector(Expression> propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, TextProperty>(propertyName, null); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, TextProperty>(propertyName, configure); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, TokenCountProperty>(propertyName, null); + public PropertiesDescriptor TokenCount(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, TokenCountProperty>(propertyName, configure); + public PropertiesDescriptor TokenCount(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, UnsignedLongNumberProperty>(propertyName, null); + public PropertiesDescriptor UnsignedLongNumber(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, UnsignedLongNumberProperty>(propertyName, configure); + public PropertiesDescriptor UnsignedLongNumber(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, VersionProperty>(propertyName, null); + public PropertiesDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, VersionProperty>(propertyName, configure); + public PropertiesDescriptor Version(Elastic.Clients.Elasticsearch.Serverless.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(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName) => AssignVariant, WildcardProperty>(propertyName, null); + public PropertiesDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.PropertyName propertyName, Action> configure) => AssignVariant, WildcardProperty>(propertyName, configure); + public PropertiesDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.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 @@ -317,105 +317,102 @@ public override IProperty Read(ref Utf8JsonReader reader, Type typeToConvert, Js 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 "aggregate_metric_double": + return JsonSerializer.Deserialize(ref reader, options); + case "binary": + return JsonSerializer.Deserialize(ref reader, options); + case "boolean": + return JsonSerializer.Deserialize(ref reader, options); + case "byte": + return JsonSerializer.Deserialize(ref reader, options); + case "completion": + return JsonSerializer.Deserialize(ref reader, options); + case "constant_keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "date_nanos": + return JsonSerializer.Deserialize(ref reader, options); + case "date": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "dense_vector": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "double_range": + return JsonSerializer.Deserialize(ref reader, options); + case "{dynamic_property}": + return JsonSerializer.Deserialize(ref reader, options); + case "alias": + return JsonSerializer.Deserialize(ref reader, options); + case "flattened": + return JsonSerializer.Deserialize(ref reader, options); + case "float": + return JsonSerializer.Deserialize(ref reader, options); + case "float_range": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "geo_shape": + return JsonSerializer.Deserialize(ref reader, options); + case "half_float": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "integer": + return JsonSerializer.Deserialize(ref reader, options); + case "integer_range": + return JsonSerializer.Deserialize(ref reader, options); + case "ip": + return JsonSerializer.Deserialize(ref reader, options); + case "ip_range": + return JsonSerializer.Deserialize(ref reader, options); + case "join": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "long": + return JsonSerializer.Deserialize(ref reader, options); + case "long_range": + return JsonSerializer.Deserialize(ref reader, options); + case "match_only_text": + return JsonSerializer.Deserialize(ref reader, options); + case "murmur3": + return JsonSerializer.Deserialize(ref reader, options); case "nested": - return JsonSerializer.Deserialize(ref reader, options); - case "flattened": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "object": + return JsonSerializer.Deserialize(ref reader, options); + case "percolator": + return JsonSerializer.Deserialize(ref reader, options); + case "point": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_feature": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_features": + return JsonSerializer.Deserialize(ref reader, options); + case "scaled_float": + return JsonSerializer.Deserialize(ref reader, options); + case "search_as_you_type": + return JsonSerializer.Deserialize(ref reader, options); + case "shape": + return JsonSerializer.Deserialize(ref reader, options); + case "short": + return JsonSerializer.Deserialize(ref reader, options); case "sparse_vector": - 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "token_count": + return JsonSerializer.Deserialize(ref reader, options); + case "unsigned_long": + return JsonSerializer.Deserialize(ref reader, options); + case "version": + return JsonSerializer.Deserialize(ref reader, options); + case "wildcard": + return JsonSerializer.Deserialize(ref reader, options); default: - ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IProperty)); - return null; + return JsonSerializer.Deserialize(ref reader, options); } } @@ -429,146 +426,146 @@ public override void Write(Utf8JsonWriter writer, IProperty value, JsonSerialize switch (value.Type) { - case "long_range": - JsonSerializer.Serialize(writer, value, typeof(LongRangeProperty), options); - return; - case "ip_range": - JsonSerializer.Serialize(writer, value, typeof(IpRangeProperty), options); + case "aggregate_metric_double": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.AggregateMetricDoubleProperty), options); return; - case "integer_range": - JsonSerializer.Serialize(writer, value, typeof(IntegerRangeProperty), options); + case "binary": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.BinaryProperty), options); return; - case "float_range": - JsonSerializer.Serialize(writer, value, typeof(FloatRangeProperty), options); + case "boolean": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.BooleanProperty), options); return; - case "double_range": - JsonSerializer.Serialize(writer, value, typeof(DoubleRangeProperty), options); + case "byte": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ByteNumberProperty), options); return; - case "date_range": - JsonSerializer.Serialize(writer, value, typeof(DateRangeProperty), options); + case "completion": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.CompletionProperty), options); return; - case "unsigned_long": - JsonSerializer.Serialize(writer, value, typeof(UnsignedLongNumberProperty), options); + case "constant_keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ConstantKeywordProperty), options); return; - case "short": - JsonSerializer.Serialize(writer, value, typeof(ShortNumberProperty), options); + case "date_nanos": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DateNanosProperty), options); return; - case "scaled_float": - JsonSerializer.Serialize(writer, value, typeof(ScaledFloatNumberProperty), options); + case "date": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DateProperty), options); return; - case "long": - JsonSerializer.Serialize(writer, value, typeof(LongNumberProperty), options); + case "date_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DateRangeProperty), options); return; - case "integer": - JsonSerializer.Serialize(writer, value, typeof(IntegerNumberProperty), options); + case "dense_vector": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DenseVectorProperty), options); return; - case "half_float": - JsonSerializer.Serialize(writer, value, typeof(HalfFloatNumberProperty), options); + case "double": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DoubleNumberProperty), options); return; - case "float": - JsonSerializer.Serialize(writer, value, typeof(FloatNumberProperty), options); + case "double_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DoubleRangeProperty), options); return; - case "double": - JsonSerializer.Serialize(writer, value, typeof(DoubleNumberProperty), options); + case "{dynamic_property}": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicProperty), options); return; - case "byte": - JsonSerializer.Serialize(writer, value, typeof(ByteNumberProperty), options); + case "alias": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldAliasProperty), options); return; - case "shape": - JsonSerializer.Serialize(writer, value, typeof(ShapeProperty), options); + case "flattened": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.FlattenedProperty), options); return; - case "point": - JsonSerializer.Serialize(writer, value, typeof(PointProperty), options); + case "float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.FloatNumberProperty), options); return; - case "geo_shape": - JsonSerializer.Serialize(writer, value, typeof(GeoShapeProperty), options); + case "float_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.FloatRangeProperty), options); return; case "geo_point": - JsonSerializer.Serialize(writer, value, typeof(GeoPointProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoPointProperty), options); return; - case "token_count": - JsonSerializer.Serialize(writer, value, typeof(TokenCountProperty), options); - return; - case "murmur3": - JsonSerializer.Serialize(writer, value, typeof(Murmur3HashProperty), options); + case "geo_shape": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.GeoShapeProperty), options); return; - case "ip": - JsonSerializer.Serialize(writer, value, typeof(IpProperty), options); + case "half_float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.HalfFloatNumberProperty), options); return; case "histogram": - JsonSerializer.Serialize(writer, value, typeof(HistogramProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.HistogramProperty), options); return; - case "alias": - JsonSerializer.Serialize(writer, value, typeof(FieldAliasProperty), options); + case "integer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.IntegerNumberProperty), options); return; - case "constant_keyword": - JsonSerializer.Serialize(writer, value, typeof(ConstantKeywordProperty), options); + case "integer_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.IntegerRangeProperty), options); return; - case "completion": - JsonSerializer.Serialize(writer, value, typeof(CompletionProperty), options); + case "ip": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.IpProperty), options); return; - case "object": - JsonSerializer.Serialize(writer, value, typeof(ObjectProperty), options); + case "ip_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.IpRangeProperty), options); return; - case "nested": - JsonSerializer.Serialize(writer, value, typeof(NestedProperty), options); + case "join": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.JoinProperty), options); return; - case "flattened": - JsonSerializer.Serialize(writer, value, typeof(FlattenedProperty), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.KeywordProperty), options); return; - case "sparse_vector": - JsonSerializer.Serialize(writer, value, typeof(SparseVectorProperty), options); + case "long": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.LongNumberProperty), options); return; - case "dense_vector": - JsonSerializer.Serialize(writer, value, typeof(DenseVectorProperty), options); + case "long_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.LongRangeProperty), options); return; - case "aggregate_metric_double": - JsonSerializer.Serialize(writer, value, typeof(AggregateMetricDoubleProperty), options); + case "match_only_text": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.MatchOnlyTextProperty), options); return; - case "date": - JsonSerializer.Serialize(writer, value, typeof(DateProperty), options); + case "murmur3": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.Murmur3HashProperty), options); return; - case "date_nanos": - JsonSerializer.Serialize(writer, value, typeof(DateNanosProperty), options); + case "nested": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.NestedProperty), options); return; - case "wildcard": - JsonSerializer.Serialize(writer, value, typeof(WildcardProperty), options); + case "object": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ObjectProperty), options); return; - case "version": - JsonSerializer.Serialize(writer, value, typeof(VersionProperty), options); + case "percolator": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.PercolatorProperty), options); return; - case "text": - JsonSerializer.Serialize(writer, value, typeof(TextProperty), options); + case "point": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.PointProperty), options); return; - case "search_as_you_type": - JsonSerializer.Serialize(writer, value, typeof(SearchAsYouTypeProperty), options); + case "rank_feature": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.RankFeatureProperty), options); return; case "rank_features": - JsonSerializer.Serialize(writer, value, typeof(RankFeaturesProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.RankFeaturesProperty), options); return; - case "rank_feature": - JsonSerializer.Serialize(writer, value, typeof(RankFeatureProperty), options); + case "scaled_float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ScaledFloatNumberProperty), options); return; - case "percolator": - JsonSerializer.Serialize(writer, value, typeof(PercolatorProperty), options); + case "search_as_you_type": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.SearchAsYouTypeProperty), options); return; - case "match_only_text": - JsonSerializer.Serialize(writer, value, typeof(MatchOnlyTextProperty), options); + case "shape": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ShapeProperty), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordProperty), options); + case "short": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.ShortNumberProperty), options); return; - case "join": - JsonSerializer.Serialize(writer, value, typeof(JoinProperty), options); + case "sparse_vector": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.SparseVectorProperty), options); return; - case "{dynamic_property}": - JsonSerializer.Serialize(writer, value, typeof(DynamicProperty), options); + case "text": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextProperty), options); return; - case "boolean": - JsonSerializer.Serialize(writer, value, typeof(BooleanProperty), options); + case "token_count": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.TokenCountProperty), options); return; - case "binary": - JsonSerializer.Serialize(writer, value, typeof(BinaryProperty), options); + case "unsigned_long": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.UnsignedLongNumberProperty), options); + return; + case "version": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.VersionProperty), options); + return; + case "wildcard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Mapping.WildcardProperty), options); return; default: var type = value.GetType(); @@ -581,5 +578,5 @@ public override void Write(Utf8JsonWriter writer, IProperty value, JsonSerialize [JsonConverter(typeof(PropertyInterfaceConverter))] public partial interface IProperty { - public string Type { get; } + 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 index 3043000010f..8484b6171be 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeatureProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class RankFeatureProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("positive_score_impact")] @@ -73,15 +77,15 @@ public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Fields(Action> configure) + public RankFeaturePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -93,6 +97,9 @@ public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,15 +118,15 @@ public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Properties(Action> configure) + public RankFeaturePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -207,15 +214,15 @@ public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Fields(Action> configure) + public RankFeaturePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -227,6 +234,9 @@ public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -245,15 +255,15 @@ public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Properties(Action> configure) + public RankFeaturePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 7ec5e00954f..4be4fd1d41f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RankFeaturesProperty.g.cs @@ -35,8 +35,14 @@ public sealed partial class RankFeaturesProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [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; } @@ -56,6 +62,7 @@ public RankFeaturesPropertyDescriptor() : base() 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 RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) @@ -70,15 +77,15 @@ public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Fields(Action> configure) + public RankFeaturesPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,27 +97,36 @@ public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } + public RankFeaturesPropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Properties(Action> configure) + public RankFeaturesPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -143,6 +159,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -160,6 +182,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, + PositiveScoreImpact = PositiveScoreImpactValue, Properties = PropertiesValue }; } @@ -176,6 +199,7 @@ public RankFeaturesPropertyDescriptor() : base() 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 RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Serverless.Mapping.DynamicMapping? dynamic) @@ -190,15 +214,15 @@ public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serve return Self; } - public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Fields(Action> configure) + public RankFeaturesPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,27 +234,36 @@ public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } + public RankFeaturesPropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Properties(Action> configure) + public RankFeaturesPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -263,6 +296,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -280,6 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/RuntimeField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs index 9ca4e400bbc..73af424a6f3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeField.g.cs @@ -81,9 +81,9 @@ public RuntimeFieldDescriptor() : base() } private ICollection? FetchFieldsValue { get; set; } - private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } - private Action> FetchFieldsDescriptorAction { get; set; } - private Action>[] FetchFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.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; } @@ -103,7 +103,7 @@ public RuntimeFieldDescriptor FetchFields(ICollection FetchFields(RuntimeFieldFetchFieldsDescriptor descriptor) + public RuntimeFieldDescriptor FetchFields(Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldFetchFieldsDescriptor descriptor) { FetchFieldsValue = null; FetchFieldsDescriptorAction = null; @@ -112,7 +112,7 @@ public RuntimeFieldDescriptor FetchFields(RuntimeFieldFetchFieldsDesc return Self; } - public RuntimeFieldDescriptor FetchFields(Action> configure) + public RuntimeFieldDescriptor FetchFields(Action> configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -121,7 +121,7 @@ public RuntimeFieldDescriptor FetchFields(Action FetchFields(params Action>[] configure) + public RuntimeFieldDescriptor FetchFields(params Action>[] configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -157,6 +157,15 @@ public RuntimeFieldDescriptor InputField(Expression + /// For type `lookup` + ///
+ public RuntimeFieldDescriptor InputField(Expression> inputField) + { + InputFieldValue = inputField; + return Self; + } + /// /// Painless script executed at query time. /// @@ -184,6 +193,15 @@ public RuntimeFieldDescriptor TargetField(Expression + /// For type `lookup` + ///
+ public RuntimeFieldDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + /// /// For type `lookup` /// @@ -216,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fetch_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FetchFieldsDescriptorActions is not null) @@ -225,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FetchFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldFetchFieldsDescriptor(action), options); } writer.WriteEndArray(); @@ -281,9 +299,9 @@ public RuntimeFieldDescriptor() : base() } private ICollection? FetchFieldsValue { get; set; } - private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } - private Action FetchFieldsDescriptorAction { get; set; } - private Action[] FetchFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.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; } @@ -303,7 +321,7 @@ public RuntimeFieldDescriptor FetchFields(ICollection configure) + public RuntimeFieldDescriptor FetchFields(Action configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -321,7 +339,7 @@ public RuntimeFieldDescriptor FetchFields(Action[] configure) + public RuntimeFieldDescriptor FetchFields(params Action[] configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -434,7 +452,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fetch_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FetchFieldsDescriptorActions is not null) @@ -443,7 +461,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FetchFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RuntimeFieldFetchFieldsDescriptor(action), options); } writer.WriteEndArray(); 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 index 4703808d523..8529c1ecd63 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs @@ -58,6 +58,12 @@ public RuntimeFieldFetchFieldsDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public RuntimeFieldFetchFieldsDescriptor Format(string? format) { FormatValue = format; 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 index 6b4be3759f5..3fa348209cf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class ScaledFloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -63,10 +67,6 @@ public sealed partial class ScaledFloatNumberProperty : IProperty 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"; @@ -97,8 +97,6 @@ public ScaledFloatNumberPropertyDescriptor() : base() 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) { @@ -136,15 +134,15 @@ public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Ela return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -168,6 +166,9 @@ public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -192,15 +193,15 @@ public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -230,18 +231,6 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -347,18 +336,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -382,9 +359,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o ScalingFactor = ScalingFactorValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -413,8 +388,6 @@ public ScaledFloatNumberPropertyDescriptor() : base() 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) { @@ -452,15 +425,15 @@ public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -484,6 +457,9 @@ public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -508,15 +484,15 @@ public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -546,18 +522,6 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -663,18 +627,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -698,8 +650,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o ScalingFactor = ScalingFactorValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index dd5d3b7c6b8..91107cafec2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class SearchAsYouTypeProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexOptions? IndexOptions { get; set; } [JsonInclude, JsonPropertyName("max_shingle_size")] public int? MaxShingleSize { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -115,15 +119,15 @@ public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShing return Self; } + /// + /// Metadata about the field. + /// public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.E return Self; } - public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -389,15 +396,15 @@ public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -427,6 +434,9 @@ public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShingleSize) return Self; } + /// + /// Metadata about the field. + /// public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -445,15 +455,15 @@ public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index f9df76b775f..89aa1420dcc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShapeProperty.g.cs @@ -29,6 +29,7 @@ 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.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapeProperty : IProperty { @@ -48,6 +49,10 @@ public sealed partial class ShapeProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("orientation")] @@ -65,6 +70,7 @@ public sealed partial class ShapeProperty : IProperty /// /// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor { @@ -118,15 +124,15 @@ public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.S return Self; } - public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Fields(Action> configure) + public ShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -150,6 +156,9 @@ public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true return Self; } + /// + /// Metadata about the field. + /// public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -168,15 +177,15 @@ public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsear return Self; } - public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Properties(Action> configure) + public ShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -300,6 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o /// /// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor { @@ -353,15 +363,15 @@ public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.M return Self; } - public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Fields(Action> configure) + public ShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -385,6 +395,9 @@ public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -403,15 +416,15 @@ public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverle return Self; } - public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Properties(Action> configure) + public ShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index d4865decb5e..07d6c0209de 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/ShortNumberProperty.g.cs @@ -47,10 +47,14 @@ public sealed partial class ShortNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] - public double? NullValue { get; set; } + public short? NullValue { get; set; } [JsonInclude, JsonPropertyName("on_script_error")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.OnScriptError? OnScriptError { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -61,10 +65,6 @@ public sealed partial class ShortNumberProperty : IProperty 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"; @@ -88,14 +88,12 @@ public ShortNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private short? 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) { @@ -133,15 +131,15 @@ public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Fields(Action> configure) + public ShortNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,13 +163,16 @@ public ShortNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ShortNumberPropertyDescriptor NullValue(double? nullValue) + public ShortNumberPropertyDescriptor NullValue(short? nullValue) { NullValueValue = nullValue; return Self; @@ -189,15 +190,15 @@ public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Properties(Action> configure) + public ShortNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -296,10 +285,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -390,14 +365,12 @@ public ShortNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private short? 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) { @@ -435,15 +408,15 @@ public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Server return Self; } - public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Fields(Action> configure) + public ShortNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,13 +440,16 @@ public ShortNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ShortNumberPropertyDescriptor NullValue(double? nullValue) + public ShortNumberPropertyDescriptor NullValue(short? nullValue) { NullValueValue = nullValue; return Self; @@ -491,15 +467,15 @@ public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Se return Self; } - public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Properties(Action> configure) + public ShortNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -598,10 +562,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SparseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SparseVectorProperty.g.cs index 25969bd0f28..e87d19f4082 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SparseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SparseVectorProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class SparseVectorProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -70,15 +74,15 @@ public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public SparseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Fields(Action> configure) + public SparseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,6 +94,9 @@ public SparseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public SparseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -102,15 +109,15 @@ public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public SparseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Properties(Action> configure) + public SparseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -190,15 +197,15 @@ public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serve return Self; } - public SparseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Fields(Action> configure) + public SparseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,6 +217,9 @@ public SparseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public SparseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -222,15 +232,15 @@ public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.S return Self; } - public SparseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Properties(Action> configure) + public SparseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 0e0151ebab2..bfefef311a7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/SuggestContext.g.cs @@ -34,7 +34,7 @@ public sealed partial class SuggestContext [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Serverless.Field? Path { get; set; } [JsonInclude, JsonPropertyName("precision")] - public Union? Precision { get; set; } + public object? Precision { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type { get; set; } } @@ -49,7 +49,7 @@ 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 object? PrecisionValue { get; set; } private string TypeValue { get; set; } public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) @@ -70,7 +70,13 @@ public SuggestContextDescriptor Path(Expression Precision(Union? precision) + public SuggestContextDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Precision(object? precision) { PrecisionValue = precision; return Self; @@ -115,7 +121,7 @@ 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 object? PrecisionValue { get; set; } private string TypeValue { get; set; } public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Serverless.Name name) @@ -142,7 +148,7 @@ public SuggestContextDescriptor Path(Expression? precision) + public SuggestContextDescriptor Precision(object? precision) { PrecisionValue = precision; return Self; 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 index d9e92bc4408..4a5f6151233 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextIndexPrefixes.g.cs @@ -35,7 +35,7 @@ public sealed partial class TextIndexPrefixes public int MinChars { get; set; } } -public sealed partial class TextIndexPrefixesDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class TextIndexPrefixesDescriptor : SerializableDescriptor { internal TextIndexPrefixesDescriptor(Action configure) => configure.Invoke(this); @@ -67,10 +67,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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 index 4830a3151e4..e1e72f9938a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TextProperty.g.cs @@ -55,6 +55,10 @@ public sealed partial class TextProperty : IProperty public bool? IndexPhrases { get; set; } [JsonInclude, JsonPropertyName("index_prefixes")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -93,16 +97,16 @@ public TextPropertyDescriptor() : base() 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.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 Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } private int? PositionIncrementGapValue { get; set; } @@ -157,7 +161,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Client return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor descriptor) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptorAction = null; @@ -165,7 +169,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagemen return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptor = null; @@ -179,15 +183,15 @@ public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Se return Self; } - public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Fields(Action> configure) + public TextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -225,7 +229,7 @@ public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticse return Self; } - public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -233,7 +237,7 @@ public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescript return Self; } - public TextPropertyDescriptor IndexPrefixes(Action configure) + public TextPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -241,6 +245,9 @@ public TextPropertyDescriptor IndexPrefixes(Action + /// Metadata about the field. + ///
public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -265,15 +272,15 @@ public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Properties(Action> configure) + public TextPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -356,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataFrequencyFilterDescriptorAction is not null) { writer.WritePropertyName("fielddata_frequency_filter"); - JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); } else if (FielddataFrequencyFilterValue is not null) { @@ -402,7 +409,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -476,15 +483,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataFrequencyFilterValue; } - if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataFrequencyFilterDescriptorAction is not null) { - var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -500,15 +507,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -559,16 +566,16 @@ public TextPropertyDescriptor() : base() 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.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 Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } private int? PositionIncrementGapValue { get; set; } @@ -623,7 +630,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticse return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor descriptor) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptorAction = null; @@ -631,7 +638,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.Fielddata return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptor = null; @@ -645,15 +652,15 @@ public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Ma return Self; } - public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Fields(Action> configure) + public TextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -691,7 +698,7 @@ public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Server return Self; } - public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -699,7 +706,7 @@ public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descript return Self; } - public TextPropertyDescriptor IndexPrefixes(Action configure) + public TextPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -707,6 +714,9 @@ public TextPropertyDescriptor IndexPrefixes(Action return Self; } + /// + /// Metadata about the field. + /// public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -731,15 +741,15 @@ public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverles return Self; } - public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Properties(Action> configure) + public TextPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -822,7 +832,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataFrequencyFilterDescriptorAction is not null) { writer.WritePropertyName("fielddata_frequency_filter"); - JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); } else if (FielddataFrequencyFilterValue is not null) { @@ -868,7 +878,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -942,15 +952,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataFrequencyFilterValue; } - if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataFrequencyFilterDescriptorAction is not null) { - var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -966,15 +976,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } 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 index b433cd569ee..949debd9a39 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TokenCountProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class TokenCountProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -127,15 +131,15 @@ public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Fields(Action> configure) + public TokenCountPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public TokenCountPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Properties(Action> configure) + public TokenCountPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -373,15 +380,15 @@ public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverl return Self; } - public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Fields(Action> configure) + public TokenCountPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -399,6 +406,9 @@ public TokenCountPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -417,15 +427,15 @@ public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ser return Self; } - public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Properties(Action> configure) + public TokenCountPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 514f7d69fb7..00444c58a91 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/TypeMapping.g.cs @@ -29,20 +29,10 @@ 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("_data_stream_timestamp")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestamp? DataStreamTimestamp { get; set; } [JsonInclude, JsonPropertyName("date_detection")] public bool? DateDetection { get; set; } [JsonInclude, JsonPropertyName("dynamic")] @@ -53,14 +43,24 @@ public sealed partial class TypeMapping public ICollection>? DynamicTemplates { get; set; } [JsonInclude, JsonPropertyName("enabled")] public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("_field_names")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesField? FieldNames { get; set; } [JsonInclude, JsonPropertyName("index_field")] public Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexField { get; set; } + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { 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("_routing")] + public Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? Routing { get; set; } [JsonInclude, JsonPropertyName("runtime")] public IDictionary? Runtime { 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("subobjects")] public bool? Subobjects { get; set; } } @@ -74,35 +74,35 @@ public TypeMappingDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? AllFieldValue { get; set; } - private AllFieldDescriptor AllFieldDescriptor { get; set; } - private Action AllFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } 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.DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { 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.FieldNamesField? FieldNamesValue { get; set; } - private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexFieldValue { get; set; } - private IndexFieldDescriptor IndexFieldDescriptor { get; set; } - private Action IndexFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } - private RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary> RuntimeValue { 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.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.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } private bool? SubobjectsValue { get; set; } public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? allField) @@ -113,7 +113,7 @@ public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.S return Self; } - public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor descriptor) { AllFieldValue = null; AllFieldDescriptorAction = null; @@ -121,7 +121,7 @@ public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor AllField(Action configure) + public TypeMappingDescriptor AllField(Action configure) { AllFieldValue = null; AllFieldDescriptor = null; @@ -137,7 +137,7 @@ public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elas return Self; } - public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestampDescriptor descriptor) { DataStreamTimestampValue = null; DataStreamTimestampDescriptorAction = null; @@ -145,7 +145,7 @@ public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampD return Self; } - public TypeMappingDescriptor DataStreamTimestamp(Action configure) + public TypeMappingDescriptor DataStreamTimestamp(Action configure) { DataStreamTimestampValue = null; DataStreamTimestampDescriptor = null; @@ -191,7 +191,7 @@ public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -199,7 +199,7 @@ public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor des return Self; } - public TypeMappingDescriptor FieldNames(Action configure) + public TypeMappingDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -215,7 +215,7 @@ public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor descriptor) { IndexFieldValue = null; IndexFieldDescriptorAction = null; @@ -223,7 +223,7 @@ public TypeMappingDescriptor IndexField(IndexFieldDescriptor descript return Self; } - public TypeMappingDescriptor IndexField(Action configure) + public TypeMappingDescriptor IndexField(Action configure) { IndexFieldValue = null; IndexFieldDescriptor = null; @@ -249,15 +249,15 @@ public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TypeMappingDescriptor Properties(Action> configure) + public TypeMappingDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -271,7 +271,7 @@ public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Se return Self; } - public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -279,7 +279,7 @@ public TypeMappingDescriptor Routing(RoutingFieldDescriptor descripto return Self; } - public TypeMappingDescriptor Routing(Action configure) + public TypeMappingDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -287,9 +287,9 @@ public TypeMappingDescriptor Routing(Action c return Self; } - public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + public TypeMappingDescriptor Runtime(Func>, FluentDescriptorDictionary>> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -301,7 +301,7 @@ public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serve return Self; } - public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeFieldDescriptor descriptor) { SizeValue = null; SizeDescriptorAction = null; @@ -309,7 +309,7 @@ public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Size(Action configure) + public TypeMappingDescriptor Size(Action configure) { SizeValue = null; SizeDescriptor = null; @@ -325,7 +325,7 @@ public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Ser return Self; } - public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -333,7 +333,7 @@ public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Source(Action configure) + public TypeMappingDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -358,7 +358,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllFieldDescriptorAction is not null) { writer.WritePropertyName("all_field"); - JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor(AllFieldDescriptorAction), options); } else if (AllFieldValue is not null) { @@ -374,7 +374,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamTimestampDescriptorAction is not null) { writer.WritePropertyName("_data_stream_timestamp"); - JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); } else if (DataStreamTimestampValue is not null) { @@ -420,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -436,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFieldDescriptorAction is not null) { writer.WritePropertyName("index_field"); - JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor(IndexFieldDescriptorAction), options); } else if (IndexFieldValue is not null) { @@ -470,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -492,7 +492,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SizeDescriptorAction is not null) { writer.WritePropertyName("_size"); - JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeFieldDescriptor(SizeDescriptorAction), options); } else if (SizeValue is not null) { @@ -508,7 +508,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { @@ -535,35 +535,35 @@ public TypeMappingDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? AllFieldValue { get; set; } - private AllFieldDescriptor AllFieldDescriptor { get; set; } - private Action AllFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } 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.DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { 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.FieldNamesField? FieldNamesValue { get; set; } - private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexField? IndexFieldValue { get; set; } - private IndexFieldDescriptor IndexFieldDescriptor { get; set; } - private Action IndexFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingField? RoutingValue { get; set; } - private RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary RuntimeValue { 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.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.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } private bool? SubobjectsValue { get; set; } public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllField? allField) @@ -574,7 +574,7 @@ public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.M return Self; } - public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor descriptor) { AllFieldValue = null; AllFieldDescriptorAction = null; @@ -582,7 +582,7 @@ public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor AllField(Action configure) + public TypeMappingDescriptor AllField(Action configure) { AllFieldValue = null; AllFieldDescriptor = null; @@ -598,7 +598,7 @@ public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.S return Self; } - public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestampDescriptor descriptor) { DataStreamTimestampValue = null; DataStreamTimestampDescriptorAction = null; @@ -606,7 +606,7 @@ public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor d return Self; } - public TypeMappingDescriptor DataStreamTimestamp(Action configure) + public TypeMappingDescriptor DataStreamTimestamp(Action configure) { DataStreamTimestampValue = null; DataStreamTimestampDescriptor = null; @@ -652,7 +652,7 @@ public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless return Self; } - public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -660,7 +660,7 @@ public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor FieldNames(Action configure) + public TypeMappingDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -676,7 +676,7 @@ public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Serverless return Self; } - public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor descriptor) { IndexFieldValue = null; IndexFieldDescriptorAction = null; @@ -684,7 +684,7 @@ public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor IndexField(Action configure) + public TypeMappingDescriptor IndexField(Action configure) { IndexFieldValue = null; IndexFieldDescriptor = null; @@ -710,15 +710,15 @@ public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless return Self; } - public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TypeMappingDescriptor Properties(Action> configure) + public TypeMappingDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -732,7 +732,7 @@ public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Ma return Self; } - public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -740,7 +740,7 @@ public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Routing(Action configure) + public TypeMappingDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -748,9 +748,9 @@ public TypeMappingDescriptor Routing(Action configure) return Self; } - public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + public TypeMappingDescriptor Runtime(Func, FluentDescriptorDictionary> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -762,7 +762,7 @@ public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.Mappi return Self; } - public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeFieldDescriptor descriptor) { SizeValue = null; SizeDescriptorAction = null; @@ -770,7 +770,7 @@ public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Size(Action configure) + public TypeMappingDescriptor Size(Action configure) { SizeValue = null; SizeDescriptor = null; @@ -786,7 +786,7 @@ public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Map return Self; } - public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -794,7 +794,7 @@ public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Source(Action configure) + public TypeMappingDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -819,7 +819,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllFieldDescriptorAction is not null) { writer.WritePropertyName("all_field"); - JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.AllFieldDescriptor(AllFieldDescriptorAction), options); } else if (AllFieldValue is not null) { @@ -835,7 +835,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamTimestampDescriptorAction is not null) { writer.WritePropertyName("_data_stream_timestamp"); - JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); } else if (DataStreamTimestampValue is not null) { @@ -881,7 +881,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -897,7 +897,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFieldDescriptorAction is not null) { writer.WritePropertyName("index_field"); - JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.IndexFieldDescriptor(IndexFieldDescriptorAction), options); } else if (IndexFieldValue is not null) { @@ -931,7 +931,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -953,7 +953,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SizeDescriptorAction is not null) { writer.WritePropertyName("_size"); - JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SizeFieldDescriptor(SizeDescriptorAction), options); } else if (SizeValue is not null) { @@ -969,7 +969,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { 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 index 95df92ca167..3f9bec78133 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class UnsignedLongNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,10 +65,6 @@ public sealed partial class UnsignedLongNumberProperty : IProperty 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"; @@ -94,8 +94,6 @@ public UnsignedLongNumberPropertyDescriptor() : base() 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) { @@ -133,15 +131,15 @@ public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.El return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +163,9 @@ public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +190,15 @@ public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Client return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,18 +222,6 @@ public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -332,18 +321,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -366,9 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } @@ -396,8 +371,6 @@ public UnsignedLongNumberPropertyDescriptor() : base() 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) { @@ -435,15 +408,15 @@ public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +440,9 @@ public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +467,15 @@ public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,18 +499,6 @@ public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) 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(); @@ -634,18 +598,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); @@ -668,8 +620,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, - Store = StoreValue, - TimeSeriesDimension = TimeSeriesDimensionValue, - TimeSeriesMetric = TimeSeriesMetricValue + Store = StoreValue }; } \ 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 index 50c12819e5e..20c3feeb030 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/VersionProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class VersionProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Fields(Action> configure) + public VersionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Properties(Action> configure) + public VersionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless return Self; } - public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Fields(Action> configure) + public VersionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Server return Self; } - public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Properties(Action> configure) + public VersionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 index 7367d4fbe0a..d9c6ecce7c0 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Mapping/WildcardProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class WildcardProperty : IProperty public Elastic.Clients.Elasticsearch.Serverless.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -97,15 +101,15 @@ public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Fields(Action> configure) + public WildcardPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -117,6 +121,9 @@ public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -135,15 +142,15 @@ public WildcardPropertyDescriptor Properties(Elastic.Clients.Elastics return Self; } - public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Properties(Action> configure) + public WildcardPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -287,15 +294,15 @@ public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverles return Self; } - public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Fields(Action> configure) + public WildcardPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -307,6 +314,9 @@ public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -325,15 +335,15 @@ public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serve return Self; } - public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Properties(Action> configure) + public WildcardPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; 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 deleted file mode 100644 index d4799ebefd3..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigCreate.g.cs +++ /dev/null @@ -1,345 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -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 deleted file mode 100644 index 93fe55a919c..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/InferenceConfigUpdate.g.cs +++ /dev/null @@ -1,342 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -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/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs deleted file mode 100644 index 0715fc85629..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Ml/TokenizationConfig.g.cs +++ /dev/null @@ -1,239 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Serverless.Fluent; -using Elastic.Clients.Elasticsearch.Serverless.Serialization; -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/NestedSortValue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs index 5ebfb0894ed..5178d99e8b7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/NestedSortValue.g.cs @@ -48,12 +48,12 @@ 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) @@ -64,7 +64,7 @@ public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch return Self; } - public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -72,7 +72,7 @@ public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public NestedSortValueDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -94,7 +94,7 @@ public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch return Self; } - public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -102,7 +102,7 @@ public NestedSortValueDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public NestedSortValueDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -122,6 +122,12 @@ public NestedSortValueDescriptor Path(Expression Path(Expression> path) + { + PathValue = path; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -133,7 +139,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -155,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -178,12 +184,12 @@ 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.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? filter) @@ -194,7 +200,7 @@ public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless return Self; } - public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -202,7 +208,7 @@ public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public NestedSortValueDescriptor Filter(Action configure) + public NestedSortValueDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -224,7 +230,7 @@ public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless return Self; } - public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -232,7 +238,7 @@ public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public NestedSortValueDescriptor Nested(Action configure) + public NestedSortValueDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -269,7 +275,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -291,7 +297,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/AdaptiveSelection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/AdaptiveSelection.g.cs new file mode 100644 index 00000000000..c9837185bdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/AdaptiveSelection.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.Nodes; + +public sealed partial class AdaptiveSelection +{ + /// + /// The exponentially weighted moving average queue size of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_queue_size")] + public long? AvgQueueSize { get; init; } + + /// + /// The exponentially weighted moving average response time of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_response_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? AvgResponseTime { get; init; } + + /// + /// The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_response_time_ns")] + public long? AvgResponseTimeNs { get; init; } + + /// + /// The exponentially weighted moving average service time of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_service_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? AvgServiceTime { get; init; } + + /// + /// The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_service_time_ns")] + public long? AvgServiceTimeNs { get; init; } + + /// + /// The number of outstanding search requests to the keyed node from the node these stats are for. + /// + [JsonInclude, JsonPropertyName("outgoing_searches")] + public long? OutgoingSearches { get; init; } + + /// + /// The rank of this node; used for shard selection when routing search requests. + /// + [JsonInclude, JsonPropertyName("rank")] + public string? Rank { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Breaker.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Breaker.g.cs new file mode 100644 index 00000000000..a7118a3e55a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Breaker.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.Nodes; + +public sealed partial class Breaker +{ + /// + /// Estimated memory used for the operation. + /// + [JsonInclude, JsonPropertyName("estimated_size")] + public string? EstimatedSize { get; init; } + + /// + /// Estimated memory used, in bytes, for the operation. + /// + [JsonInclude, JsonPropertyName("estimated_size_in_bytes")] + public long? EstimatedSizeInBytes { get; init; } + + /// + /// Memory limit for the circuit breaker. + /// + [JsonInclude, JsonPropertyName("limit_size")] + public string? LimitSize { get; init; } + + /// + /// Memory limit, in bytes, for the circuit breaker. + /// + [JsonInclude, JsonPropertyName("limit_size_in_bytes")] + public long? LimitSizeInBytes { get; init; } + + /// + /// A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. + /// + [JsonInclude, JsonPropertyName("overhead")] + public float? Overhead { get; init; } + + /// + /// Total number of times the circuit breaker has been triggered and prevented an out of memory error. + /// + [JsonInclude, JsonPropertyName("tripped")] + public float? Tripped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cgroup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cgroup.g.cs new file mode 100644 index 00000000000..e6e9f8b4629 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cgroup.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.Nodes; + +public sealed partial class Cgroup +{ + /// + /// Contains statistics about `cpu` control group for the node. + /// + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.CgroupCpu? Cpu { get; init; } + + /// + /// Contains statistics about `cpuacct` control group for the node. + /// + [JsonInclude, JsonPropertyName("cpuacct")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.CpuAcct? Cpuacct { get; init; } + + /// + /// Contains statistics about the memory control group for the node. + /// + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.CgroupMemory? Memory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpu.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpu.g.cs new file mode 100644 index 00000000000..418a83a876e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpu.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.Nodes; + +public sealed partial class CgroupCpu +{ + /// + /// The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated. + /// + [JsonInclude, JsonPropertyName("cfs_period_micros")] + public int? CfsPeriodMicros { get; init; } + + /// + /// The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`. + /// + [JsonInclude, JsonPropertyName("cfs_quota_micros")] + public int? CfsQuotaMicros { get; init; } + + /// + /// The `cpu` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// Contains CPU statistics for the node. + /// + [JsonInclude, JsonPropertyName("stat")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.CgroupCpuStat? Stat { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpuStat.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpuStat.g.cs new file mode 100644 index 00000000000..ba194afb4bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupCpuStat.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.Nodes; + +public sealed partial class CgroupCpuStat +{ + /// + /// The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed. + /// + [JsonInclude, JsonPropertyName("number_of_elapsed_periods")] + public long? NumberOfElapsedPeriods { get; init; } + + /// + /// The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled. + /// + [JsonInclude, JsonPropertyName("number_of_times_throttled")] + public long? NumberOfTimesThrottled { get; init; } + + /// + /// The total amount of time, in nanoseconds, for which all tasks in the same cgroup as the Elasticsearch process have been throttled. + /// + [JsonInclude, JsonPropertyName("time_throttled_nanos")] + public long? TimeThrottledNanos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupMemory.g.cs new file mode 100644 index 00000000000..9c4d9eca882 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CgroupMemory.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.Nodes; + +public sealed partial class CgroupMemory +{ + /// + /// The `memory` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the Elasticsearch process.
This value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns.
Any value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup.
+ ///
+ [JsonInclude, JsonPropertyName("limit_in_bytes")] + public string? LimitInBytes { get; init; } + + /// + /// The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.
This value is stored as a string for consistency with `limit_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("usage_in_bytes")] + public string? UsageInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Client.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Client.g.cs new file mode 100644 index 00000000000..ec587443469 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Client.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.Nodes; + +public sealed partial class Client +{ + /// + /// Reported agent for the HTTP client.
If unavailable, this property is not included in the response.
+ ///
+ [JsonInclude, JsonPropertyName("agent")] + public string? Agent { get; init; } + + /// + /// Time at which the client closed the connection if the connection is closed. + /// + [JsonInclude, JsonPropertyName("closed_time_millis")] + public long? ClosedTimeMillis { get; init; } + + /// + /// Unique ID for the HTTP client. + /// + [JsonInclude, JsonPropertyName("id")] + public long? Id { get; init; } + + /// + /// Time of the most recent request from this client. + /// + [JsonInclude, JsonPropertyName("last_request_time_millis")] + public long? LastRequestTimeMillis { get; init; } + + /// + /// The URI of the client’s most recent request. + /// + [JsonInclude, JsonPropertyName("last_uri")] + public string? LastUri { get; init; } + + /// + /// Local address for the HTTP connection. + /// + [JsonInclude, JsonPropertyName("local_address")] + public string? LocalAddress { get; init; } + + /// + /// Time at which the client opened the connection. + /// + [JsonInclude, JsonPropertyName("opened_time_millis")] + public long? OpenedTimeMillis { get; init; } + + /// + /// Remote address for the HTTP connection. + /// + [JsonInclude, JsonPropertyName("remote_address")] + public string? RemoteAddress { get; init; } + + /// + /// Number of requests from this client. + /// + [JsonInclude, JsonPropertyName("request_count")] + public long? RequestCount { get; init; } + + /// + /// Cumulative size in bytes of all requests from this client. + /// + [JsonInclude, JsonPropertyName("request_size_bytes")] + public long? RequestSizeBytes { get; init; } + + /// + /// Value from the client’s `x-opaque-id` HTTP header.
If unavailable, this property is not included in the response.
+ ///
+ [JsonInclude, JsonPropertyName("x_opaque_id")] + public string? XOpaqueId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterAppliedStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterAppliedStats.g.cs new file mode 100644 index 00000000000..9aabe531713 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterAppliedStats.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.Nodes; + +public sealed partial class ClusterAppliedStats +{ + [JsonInclude, JsonPropertyName("recordings")] + public IReadOnlyCollection? Recordings { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateQueue.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateQueue.g.cs new file mode 100644 index 00000000000..634f10be7f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateQueue.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.Nodes; + +public sealed partial class ClusterStateQueue +{ + /// + /// Number of committed cluster states in queue. + /// + [JsonInclude, JsonPropertyName("committed")] + public long? Committed { get; init; } + + /// + /// Number of pending cluster states in queue. + /// + [JsonInclude, JsonPropertyName("pending")] + public long? Pending { get; init; } + + /// + /// Total number of cluster states in queue. + /// + [JsonInclude, JsonPropertyName("total")] + public long? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateUpdate.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateUpdate.g.cs new file mode 100644 index 00000000000..9affd45668c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ClusterStateUpdate.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.Nodes; + +public sealed partial class ClusterStateUpdate +{ + /// + /// The cumulative amount of time spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master. + /// + [JsonInclude, JsonPropertyName("commit_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CommitTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master. + /// + [JsonInclude, JsonPropertyName("commit_time_millis")] + public long? CommitTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state. + /// + [JsonInclude, JsonPropertyName("completion_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CompletionTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state. + /// + [JsonInclude, JsonPropertyName("completion_time_millis")] + public long? CompletionTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent computing no-op cluster state updates since the node started. + /// + [JsonInclude, JsonPropertyName("computation_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ComputationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent computing no-op cluster state updates since the node started. + /// + [JsonInclude, JsonPropertyName("computation_time_millis")] + public long? ComputationTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent constructing a publication context since the node started for publications that ultimately succeeded.
This statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference.
+ ///
+ [JsonInclude, JsonPropertyName("context_construction_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? ContextConstructionTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent constructing a publication context since the node started for publications that ultimately succeeded.
This statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference.
+ ///
+ [JsonInclude, JsonPropertyName("context_construction_time_millis")] + public long? ContextConstructionTimeMillis { get; init; } + + /// + /// The number of cluster state update attempts that did not change the cluster state since the node started. + /// + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// The cumulative amount of time spent successfully applying cluster state updates on the elected master since the node started. + /// + [JsonInclude, JsonPropertyName("master_apply_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? MasterApplyTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent successfully applying cluster state updates on the elected master since the node started. + /// + [JsonInclude, JsonPropertyName("master_apply_time_millis")] + public long? MasterApplyTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent notifying listeners of a no-op cluster state update since the node started. + /// + [JsonInclude, JsonPropertyName("notification_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? NotificationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent notifying listeners of a no-op cluster state update since the node started. + /// + [JsonInclude, JsonPropertyName("notification_time_millis")] + public long? NotificationTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.
This includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`.
+ ///
+ [JsonInclude, JsonPropertyName("publication_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? PublicationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.
This includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`.
+ ///
+ [JsonInclude, JsonPropertyName("publication_time_millis")] + public long? PublicationTimeMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Context.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Context.g.cs new file mode 100644 index 00000000000..8b398ba6123 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Context.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.Nodes; + +public sealed partial class Context +{ + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + [JsonInclude, JsonPropertyName("context")] + public string? Context2 { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cpu.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cpu.g.cs new file mode 100644 index 00000000000..8bb79a6c6bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Cpu.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.Nodes; + +public sealed partial class Cpu +{ + [JsonInclude, JsonPropertyName("load_average")] + public IReadOnlyDictionary? LoadAverage { get; init; } + [JsonInclude, JsonPropertyName("percent")] + public int? Percent { get; init; } + [JsonInclude, JsonPropertyName("sys")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Sys { get; init; } + [JsonInclude, JsonPropertyName("sys_in_millis")] + public long? SysInMillis { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Total { get; init; } + [JsonInclude, JsonPropertyName("total_in_millis")] + public long? TotalInMillis { get; init; } + [JsonInclude, JsonPropertyName("user")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? User { get; init; } + [JsonInclude, JsonPropertyName("user_in_millis")] + public long? UserInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CpuAcct.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CpuAcct.g.cs new file mode 100644 index 00000000000..901dfeee3cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/CpuAcct.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.Nodes; + +public sealed partial class CpuAcct +{ + /// + /// The `cpuacct` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// The total CPU time, in nanoseconds, consumed by all tasks in the same cgroup as the Elasticsearch process. + /// + [JsonInclude, JsonPropertyName("usage_nanos")] + public long? UsageNanos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DataPathStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DataPathStats.g.cs new file mode 100644 index 00000000000..ead8704cb28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DataPathStats.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.Nodes; + +public sealed partial class DataPathStats +{ + /// + /// Total amount of disk space available to this Java virtual machine on this file store. + /// + [JsonInclude, JsonPropertyName("available")] + public string? Available { get; init; } + + /// + /// Total number of bytes available to this Java virtual machine on this file store. + /// + [JsonInclude, JsonPropertyName("available_in_bytes")] + public long? AvailableInBytes { get; init; } + [JsonInclude, JsonPropertyName("disk_queue")] + public string? DiskQueue { get; init; } + [JsonInclude, JsonPropertyName("disk_reads")] + public long? DiskReads { get; init; } + [JsonInclude, JsonPropertyName("disk_read_size")] + public string? DiskReadSize { get; init; } + [JsonInclude, JsonPropertyName("disk_read_size_in_bytes")] + public long? DiskReadSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("disk_writes")] + public long? DiskWrites { get; init; } + [JsonInclude, JsonPropertyName("disk_write_size")] + public string? DiskWriteSize { get; init; } + [JsonInclude, JsonPropertyName("disk_write_size_in_bytes")] + public long? DiskWriteSizeInBytes { get; init; } + + /// + /// Total amount of unallocated disk space in the file store. + /// + [JsonInclude, JsonPropertyName("free")] + public string? Free { get; init; } + + /// + /// Total number of unallocated bytes in the file store. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Mount point of the file store (for example: `/dev/sda2`). + /// + [JsonInclude, JsonPropertyName("mount")] + public string? Mount { get; init; } + + /// + /// Path to the file store. + /// + [JsonInclude, JsonPropertyName("path")] + public string? Path { get; init; } + + /// + /// Total size of the file store. + /// + [JsonInclude, JsonPropertyName("total")] + public string? Total { get; init; } + + /// + /// Total size of the file store in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + + /// + /// Type of the file store (ex: ext4). + /// + [JsonInclude, JsonPropertyName("type")] + public string? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DeprecationIndexing.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DeprecationIndexing.g.cs new file mode 100644 index 00000000000..8cb72e5d710 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/DeprecationIndexing.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.Nodes; + +public sealed partial class DeprecationIndexing +{ + [JsonInclude, JsonPropertyName("enabled")] + public object Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Discovery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Discovery.g.cs new file mode 100644 index 00000000000..0d6a21e2e3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Discovery.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.Nodes; + +public sealed partial class Discovery +{ + [JsonInclude, JsonPropertyName("cluster_applier_stats")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.ClusterAppliedStats? ClusterApplierStats { get; init; } + + /// + /// Contains statistics for the cluster state queue of the node. + /// + [JsonInclude, JsonPropertyName("cluster_state_queue")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.ClusterStateQueue? ClusterStateQueue { get; init; } + + /// + /// Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master.
Omitted if the node is not master-eligible.
Every field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`.
The human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter.
+ ///
+ [JsonInclude, JsonPropertyName("cluster_state_update")] + public IReadOnlyDictionary? ClusterStateUpdate { get; init; } + + /// + /// Contains statistics for the published cluster states of the node. + /// + [JsonInclude, JsonPropertyName("published_cluster_states")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.PublishedClusterStates? PublishedClusterStates { get; init; } + [JsonInclude, JsonPropertyName("serialized_cluster_states")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.SerializedClusterState? SerializedClusterStates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs new file mode 100644 index 00000000000..98c5015689c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ExtendedMemoryStats.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.Nodes; + +public sealed partial class ExtendedMemoryStats +{ + /// + /// If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.
Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public long? AdjustedTotalInBytes { get; init; } + + /// + /// Amount of free physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Percentage of free memory. + /// + [JsonInclude, JsonPropertyName("free_percent")] + public int? FreePercent { get; init; } + [JsonInclude, JsonPropertyName("resident")] + public string? Resident { get; init; } + [JsonInclude, JsonPropertyName("resident_in_bytes")] + public long? ResidentInBytes { get; init; } + [JsonInclude, JsonPropertyName("share")] + public string? Share { get; init; } + [JsonInclude, JsonPropertyName("share_in_bytes")] + public long? ShareInBytes { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_virtual")] + public string? TotalVirtual { get; init; } + [JsonInclude, JsonPropertyName("total_virtual_in_bytes")] + public long? TotalVirtualInBytes { get; init; } + + /// + /// Amount of used physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } + + /// + /// Percentage of used memory. + /// + [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/Nodes/FileSystem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystem.g.cs new file mode 100644 index 00000000000..894a6eff96a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystem.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.Nodes; + +public sealed partial class FileSystem +{ + /// + /// List of all file stores. + /// + [JsonInclude, JsonPropertyName("data")] + public IReadOnlyCollection? Data { get; init; } + + /// + /// Contains I/O statistics for the node. + /// + [JsonInclude, JsonPropertyName("io_stats")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.IoStats? IoStats { get; init; } + + /// + /// Last time the file stores statistics were refreshed.
Recorded in milliseconds since the Unix Epoch.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Contains statistics for all file stores of the node. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.FileSystemTotal? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystemTotal.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystemTotal.g.cs new file mode 100644 index 00000000000..013241b7655 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/FileSystemTotal.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.Nodes; + +public sealed partial class FileSystemTotal +{ + /// + /// Total disk space available to this Java virtual machine on all file stores.
Depending on OS or process level restrictions, this might appear less than `free`.
This is the actual amount of free disk space the Elasticsearch node can utilise.
+ ///
+ [JsonInclude, JsonPropertyName("available")] + public string? Available { get; init; } + + /// + /// Total number of bytes available to this Java virtual machine on all file stores.
Depending on OS or process level restrictions, this might appear less than `free_in_bytes`.
This is the actual amount of free disk space the Elasticsearch node can utilise.
+ ///
+ [JsonInclude, JsonPropertyName("available_in_bytes")] + public long? AvailableInBytes { get; init; } + + /// + /// Total unallocated disk space in all file stores. + /// + [JsonInclude, JsonPropertyName("free")] + public string? Free { get; init; } + + /// + /// Total number of unallocated bytes in all file stores. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Total size of all file stores. + /// + [JsonInclude, JsonPropertyName("total")] + public string? Total { get; init; } + + /// + /// Total size of all file stores in bytes. + /// + [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/Nodes/GarbageCollector.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollector.g.cs new file mode 100644 index 00000000000..95abcd0c53f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollector.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.Nodes; + +public sealed partial class GarbageCollector +{ + /// + /// Contains statistics about JVM garbage collectors for the node. + /// + [JsonInclude, JsonPropertyName("collectors")] + public IReadOnlyDictionary? Collectors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs new file mode 100644 index 00000000000..8794addb683 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/GarbageCollectorTotal.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.Nodes; + +public sealed partial class GarbageCollectorTotal +{ + /// + /// Total number of JVM garbage collectors that collect objects. + /// + [JsonInclude, JsonPropertyName("collection_count")] + public long? CollectionCount { get; init; } + + /// + /// Total time spent by JVM collecting objects. + /// + [JsonInclude, JsonPropertyName("collection_time")] + public string? CollectionTime { get; init; } + + /// + /// Total time, in milliseconds, spent by JVM collecting objects. + /// + [JsonInclude, JsonPropertyName("collection_time_in_millis")] + public long? CollectionTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/HotThread.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/HotThread.g.cs new file mode 100644 index 00000000000..1cc9efd423f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/HotThread.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.Nodes; + +public sealed partial class HotThread +{ + [JsonInclude, JsonPropertyName("hosts")] + public IReadOnlyCollection Hosts { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } + [JsonInclude, JsonPropertyName("node_name")] + public string NodeName { get; init; } + [JsonInclude, JsonPropertyName("threads")] + public IReadOnlyCollection Threads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Http.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Http.g.cs new file mode 100644 index 00000000000..9ff64891e98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Http.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.Nodes; + +public sealed partial class Http +{ + /// + /// Information on current and recently-closed HTTP client connections.
Clients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here.
+ ///
+ [JsonInclude, JsonPropertyName("clients")] + public IReadOnlyCollection? Clients { get; init; } + + /// + /// Current number of open HTTP connections for the node. + /// + [JsonInclude, JsonPropertyName("current_open")] + public int? CurrentOpen { get; init; } + + /// + /// Total number of HTTP connections opened for the node. + /// + [JsonInclude, JsonPropertyName("total_opened")] + public long? TotalOpened { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressure.g.cs new file mode 100644 index 00000000000..037417543f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressure.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.Nodes; + +public sealed partial class IndexingPressure +{ + /// + /// Contains statistics for memory consumption from indexing load. + /// + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.IndexingPressureMemory? Memory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressureMemory.g.cs new file mode 100644 index 00000000000..82d704174b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IndexingPressureMemory.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.Nodes; + +public sealed partial class IndexingPressureMemory +{ + /// + /// Contains statistics for current indexing load. + /// + [JsonInclude, JsonPropertyName("current")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.PressureMemory? Current { get; init; } + + /// + /// Configured memory limit for the indexing requests.
Replica requests have an automatic limit that is 1.5x this value.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Limit { get; init; } + + /// + /// Configured memory limit, in bytes, for the indexing requests.
Replica requests have an automatic limit that is 1.5x this value.
+ ///
+ [JsonInclude, JsonPropertyName("limit_in_bytes")] + public long? LimitInBytes { get; init; } + + /// + /// Contains statistics for the cumulative indexing load since the node started. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.PressureMemory? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Ingest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Ingest.g.cs new file mode 100644 index 00000000000..fd25a3a160c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Ingest.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.Nodes; + +public sealed partial class Ingest +{ + /// + /// Contains statistics about ingest pipelines for the node. + /// + [JsonInclude, JsonPropertyName("pipelines")] + public IReadOnlyDictionary? Pipelines { get; init; } + + /// + /// Contains statistics about ingest operations for the node. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.IngestTotal? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IngestTotal.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IngestTotal.g.cs new file mode 100644 index 00000000000..ba207391eb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IngestTotal.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.Nodes; + +public sealed partial class IngestTotal +{ + /// + /// Total number of documents ingested during the lifetime of this node. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Total number of documents currently being ingested. + /// + [JsonInclude, JsonPropertyName("current")] + public long? Current { get; init; } + + /// + /// Total number of failed ingest operations during the lifetime of this node. + /// + [JsonInclude, JsonPropertyName("failed")] + public long? Failed { get; init; } + + /// + /// Total number of ingest processors. + /// + [JsonInclude, JsonPropertyName("processors")] + public IReadOnlyCollection>? Processors { get; init; } + + /// + /// Total time, in milliseconds, spent preprocessing ingest documents during the lifetime of this node. + /// + [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/Nodes/IoStatDevice.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStatDevice.g.cs new file mode 100644 index 00000000000..7c9d023382c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStatDevice.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.Nodes; + +public sealed partial class IoStatDevice +{ + /// + /// The Linux device name. + /// + [JsonInclude, JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// The total number of read and write operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("operations")] + public long? Operations { get; init; } + + /// + /// The total number of kilobytes read for the device since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("read_kilobytes")] + public long? ReadKilobytes { get; init; } + + /// + /// The total number of read operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("read_operations")] + public long? ReadOperations { get; init; } + + /// + /// The total number of kilobytes written for the device since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("write_kilobytes")] + public long? WriteKilobytes { get; init; } + + /// + /// The total number of write operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("write_operations")] + public long? WriteOperations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStats.g.cs new file mode 100644 index 00000000000..850811950a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/IoStats.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.Nodes; + +public sealed partial class IoStats +{ + /// + /// Array of disk metrics for each device that is backing an Elasticsearch data path.
These disk metrics are probed periodically and averages between the last probe and the current probe are computed.
+ ///
+ [JsonInclude, JsonPropertyName("devices")] + public IReadOnlyCollection? Devices { get; init; } + + /// + /// The sum of the disk metrics for all devices that back an Elasticsearch data path. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.IoStatDevice? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Jvm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Jvm.g.cs new file mode 100644 index 00000000000..71c6b9aeee8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Jvm.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.Nodes; + +public sealed partial class Jvm +{ + /// + /// Contains statistics about JVM buffer pools for the node. + /// + [JsonInclude, JsonPropertyName("buffer_pools")] + public IReadOnlyDictionary? BufferPools { get; init; } + + /// + /// Contains statistics about classes loaded by JVM for the node. + /// + [JsonInclude, JsonPropertyName("classes")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.JvmClasses? Classes { get; init; } + + /// + /// Contains statistics about JVM garbage collectors for the node. + /// + [JsonInclude, JsonPropertyName("gc")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.GarbageCollector? Gc { get; init; } + + /// + /// Contains JVM memory usage statistics for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.JvmMemoryStats? Mem { get; init; } + + /// + /// Contains statistics about JVM thread usage for the node. + /// + [JsonInclude, JsonPropertyName("threads")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.JvmThreads? Threads { get; init; } + + /// + /// Last time JVM statistics were refreshed. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Human-readable JVM uptime.
Only returned if the `human` query parameter is `true`.
+ ///
+ [JsonInclude, JsonPropertyName("uptime")] + public string? Uptime { get; init; } + + /// + /// JVM uptime in milliseconds. + /// + [JsonInclude, JsonPropertyName("uptime_in_millis")] + public long? UptimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmClasses.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmClasses.g.cs new file mode 100644 index 00000000000..438d249e0c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmClasses.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.Nodes; + +public sealed partial class JvmClasses +{ + /// + /// Number of classes currently loaded by JVM. + /// + [JsonInclude, JsonPropertyName("current_loaded_count")] + public long? CurrentLoadedCount { get; init; } + + /// + /// Total number of classes loaded since the JVM started. + /// + [JsonInclude, JsonPropertyName("total_loaded_count")] + public long? TotalLoadedCount { get; init; } + + /// + /// Total number of classes unloaded since the JVM started. + /// + [JsonInclude, JsonPropertyName("total_unloaded_count")] + public long? TotalUnloadedCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmMemoryStats.g.cs new file mode 100644 index 00000000000..fe367209c76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmMemoryStats.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.Nodes; + +public sealed partial class JvmMemoryStats +{ + /// + /// Amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_committed_in_bytes")] + public long? HeapCommittedInBytes { get; init; } + + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public long? HeapMaxInBytes { get; init; } + + /// + /// Memory, in bytes, currently in use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_used_in_bytes")] + public long? HeapUsedInBytes { get; init; } + + /// + /// Percentage of memory currently in use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_used_percent")] + public long? HeapUsedPercent { get; init; } + + /// + /// Amount of non-heap memory available, in bytes. + /// + [JsonInclude, JsonPropertyName("non_heap_committed_in_bytes")] + public long? NonHeapCommittedInBytes { get; init; } + + /// + /// Non-heap memory used, in bytes. + /// + [JsonInclude, JsonPropertyName("non_heap_used_in_bytes")] + public long? NonHeapUsedInBytes { get; init; } + + /// + /// Contains statistics about heap memory usage for the node. + /// + [JsonInclude, JsonPropertyName("pools")] + public IReadOnlyDictionary? Pools { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmThreads.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmThreads.g.cs new file mode 100644 index 00000000000..8cfe52ecfad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/JvmThreads.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.Nodes; + +public sealed partial class JvmThreads +{ + /// + /// Number of active threads in use by JVM. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Highest number of threads used by JVM. + /// + [JsonInclude, JsonPropertyName("peak_count")] + public long? PeakCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/KeyedProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/KeyedProcessor.g.cs new file mode 100644 index 00000000000..244d17c4937 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/KeyedProcessor.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.Nodes; + +public sealed partial class KeyedProcessor +{ + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Processor? Stats { 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/Nodes/MemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/MemoryStats.g.cs new file mode 100644 index 00000000000..17b1c99b021 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/MemoryStats.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.Nodes; + +public sealed partial class MemoryStats +{ + /// + /// If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.
Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public long? AdjustedTotalInBytes { get; init; } + + /// + /// Amount of free physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + [JsonInclude, JsonPropertyName("resident")] + public string? Resident { get; init; } + [JsonInclude, JsonPropertyName("resident_in_bytes")] + public long? ResidentInBytes { get; init; } + [JsonInclude, JsonPropertyName("share")] + public string? Share { get; init; } + [JsonInclude, JsonPropertyName("share_in_bytes")] + public long? ShareInBytes { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_virtual")] + public string? TotalVirtual { get; init; } + [JsonInclude, JsonPropertyName("total_virtual_in_bytes")] + public long? TotalVirtualInBytes { get; init; } + + /// + /// Amount of used physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeBufferPool.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeBufferPool.g.cs new file mode 100644 index 00000000000..8632c1c72b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeBufferPool.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.Nodes; + +public sealed partial class NodeBufferPool +{ + /// + /// Number of buffer pools. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Total capacity of buffer pools. + /// + [JsonInclude, JsonPropertyName("total_capacity")] + public string? TotalCapacity { get; init; } + + /// + /// Total capacity of buffer pools in bytes. + /// + [JsonInclude, JsonPropertyName("total_capacity_in_bytes")] + public long? TotalCapacityInBytes { get; init; } + + /// + /// Size of buffer pools. + /// + [JsonInclude, JsonPropertyName("used")] + public string? Used { get; init; } + + /// + /// Size of buffer pools in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfo.g.cs new file mode 100644 index 00000000000..5244225bd2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfo.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.Nodes; + +public sealed partial class NodeInfo +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("build_flavor")] + public string BuildFlavor { get; init; } + + /// + /// Short hash of the last git commit in this release. + /// + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { get; init; } + [JsonInclude, JsonPropertyName("build_type")] + public string BuildType { get; init; } + + /// + /// The node’s host name. + /// + [JsonInclude, JsonPropertyName("host")] + public string Host { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoHttp? Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngest? Ingest { get; init; } + + /// + /// The node’s IP address. + /// + [JsonInclude, JsonPropertyName("ip")] + public string Ip { get; init; } + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeJvmInfo? Jvm { get; init; } + [JsonInclude, JsonPropertyName("modules")] + public IReadOnlyCollection? Modules { get; init; } + + /// + /// The node's name + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("network")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoNetwork? Network { get; init; } + [JsonInclude, JsonPropertyName("os")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeOperatingSystemInfo? Os { get; init; } + [JsonInclude, JsonPropertyName("plugins")] + public IReadOnlyCollection? Plugins { get; init; } + [JsonInclude, JsonPropertyName("process")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeProcessInfo? Process { get; init; } + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection Roles { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettings? Settings { get; init; } + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { get; init; } + + /// + /// Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings. + /// + [JsonInclude, JsonPropertyName("total_indexing_buffer")] + public long? TotalIndexingBuffer { get; init; } + + /// + /// Same as total_indexing_buffer, but expressed in bytes. + /// + [JsonInclude, JsonPropertyName("total_indexing_buffer_in_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? TotalIndexingBufferInBytes { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoTransport? Transport { get; init; } + + /// + /// Host and port where transport HTTP connections are accepted. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } + + /// + /// Elasticsearch version running on this node. + /// + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAction.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAction.g.cs new file mode 100644 index 00000000000..6b90ccb9ef4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAction.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.Nodes; + +public sealed partial class NodeInfoAction +{ + [JsonInclude, JsonPropertyName("destructive_requires_name")] + public string DestructiveRequiresName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAggregation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAggregation.g.cs new file mode 100644 index 00000000000..94978daa040 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoAggregation.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.Nodes; + +public sealed partial class NodeInfoAggregation +{ + [JsonInclude, JsonPropertyName("types")] + public IReadOnlyCollection Types { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs new file mode 100644 index 00000000000..d8412af0e41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoBootstrap.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.Nodes; + +public sealed partial class NodeInfoBootstrap +{ + [JsonInclude, JsonPropertyName("memory_lock")] + public string MemoryLock { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoClient.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoClient.g.cs new file mode 100644 index 00000000000..6bad11d739c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoClient.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.Nodes; + +public sealed partial class NodeInfoClient +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoDiscover.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoDiscover.g.cs new file mode 100644 index 00000000000..7fb60b09288 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoDiscover.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.Nodes; + +internal sealed partial class NodeInfoDiscoverConverter : JsonConverter +{ + public override NodeInfoDiscover Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection? seedHosts = default; + IReadOnlyCollection? seedProviders = 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 == "seed_hosts") + { + seedHosts = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "seed_providers") + { + seedProviders = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "type") + { + type = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new NodeInfoDiscover { SeedHosts = seedHosts, SeedProviders = seedProviders, Settings = additionalProperties, Type = type }; + } + + public override void Write(Utf8JsonWriter writer, NodeInfoDiscover value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NodeInfoDiscover' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NodeInfoDiscoverConverter))] +public sealed partial class NodeInfoDiscover +{ + public IReadOnlyCollection? SeedHosts { get; init; } + public IReadOnlyCollection? SeedProviders { get; init; } + + /// + /// Additional or alternative settings + /// + public IReadOnlyDictionary Settings { get; init; } + public string? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoHttp.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoHttp.g.cs new file mode 100644 index 00000000000..69945e8eb95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoHttp.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.Nodes; + +public sealed partial class NodeInfoHttp +{ + [JsonInclude, JsonPropertyName("bound_address")] + public IReadOnlyCollection BoundAddress { get; init; } + [JsonInclude, JsonPropertyName("max_content_length")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxContentLength { get; init; } + [JsonInclude, JsonPropertyName("max_content_length_in_bytes")] + public long MaxContentLengthInBytes { get; init; } + [JsonInclude, JsonPropertyName("publish_address")] + public string PublishAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngest.g.cs new file mode 100644 index 00000000000..3c2871b2405 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngest.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.Nodes; + +public sealed partial class NodeInfoIngest +{ + [JsonInclude, JsonPropertyName("processors")] + public IReadOnlyCollection Processors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs new file mode 100644 index 00000000000..6dc0ca2bc65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestDownloader.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.Nodes; + +public sealed partial class NodeInfoIngestDownloader +{ + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs new file mode 100644 index 00000000000..32628dae7f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestInfo.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.Nodes; + +public sealed partial class NodeInfoIngestInfo +{ + [JsonInclude, JsonPropertyName("downloader")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestDownloader Downloader { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs new file mode 100644 index 00000000000..79ce7c63935 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoIngestProcessor.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.Nodes; + +public sealed partial class NodeInfoIngestProcessor +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs new file mode 100644 index 00000000000..8d3df5869cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoJvmMemory.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.Nodes; + +public sealed partial class NodeInfoJvmMemory +{ + [JsonInclude, JsonPropertyName("direct_max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? DirectMax { get; init; } + [JsonInclude, JsonPropertyName("direct_max_in_bytes")] + public long DirectMaxInBytes { get; init; } + [JsonInclude, JsonPropertyName("heap_init")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? HeapInit { get; init; } + [JsonInclude, JsonPropertyName("heap_init_in_bytes")] + public long HeapInitInBytes { get; init; } + [JsonInclude, JsonPropertyName("heap_max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? HeapMax { get; init; } + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public long HeapMaxInBytes { get; init; } + [JsonInclude, JsonPropertyName("non_heap_init")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? NonHeapInit { get; init; } + [JsonInclude, JsonPropertyName("non_heap_init_in_bytes")] + public long NonHeapInitInBytes { get; init; } + [JsonInclude, JsonPropertyName("non_heap_max")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? NonHeapMax { get; init; } + [JsonInclude, JsonPropertyName("non_heap_max_in_bytes")] + public long NonHeapMaxInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoMemory.g.cs new file mode 100644 index 00000000000..c066ad19e2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoMemory.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.Nodes; + +public sealed partial class NodeInfoMemory +{ + [JsonInclude, JsonPropertyName("total")] + public string Total { get; init; } + [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/Nodes/NodeInfoNetwork.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetwork.g.cs new file mode 100644 index 00000000000..8d1191ba01e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetwork.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.Nodes; + +public sealed partial class NodeInfoNetwork +{ + [JsonInclude, JsonPropertyName("primary_interface")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoNetworkInterface PrimaryInterface { get; init; } + [JsonInclude, JsonPropertyName("refresh_interval")] + public int RefreshInterval { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs new file mode 100644 index 00000000000..956666f7e5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoNetworkInterface.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.Nodes; + +public sealed partial class NodeInfoNetworkInterface +{ + [JsonInclude, JsonPropertyName("address")] + public string Address { get; init; } + [JsonInclude, JsonPropertyName("mac_address")] + public string MacAddress { 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/Nodes/NodeInfoOSCPU.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs new file mode 100644 index 00000000000..9058a7c8060 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoOSCPU.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.Nodes; + +public sealed partial class NodeInfoOSCPU +{ + [JsonInclude, JsonPropertyName("cache_size")] + public string CacheSize { get; init; } + [JsonInclude, JsonPropertyName("cache_size_in_bytes")] + public int CacheSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("cores_per_socket")] + public int CoresPerSocket { get; init; } + [JsonInclude, JsonPropertyName("mhz")] + public int Mhz { get; init; } + [JsonInclude, JsonPropertyName("model")] + public string Model { get; init; } + [JsonInclude, JsonPropertyName("total_cores")] + public int TotalCores { get; init; } + [JsonInclude, JsonPropertyName("total_sockets")] + public int TotalSockets { get; init; } + [JsonInclude, JsonPropertyName("vendor")] + public string Vendor { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoPath.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoPath.g.cs new file mode 100644 index 00000000000..b338a0ace56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoPath.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.Nodes; + +public sealed partial class NodeInfoPath +{ + [JsonInclude, JsonPropertyName("data")] + public IReadOnlyCollection? Data { get; init; } + [JsonInclude, JsonPropertyName("home")] + public string? Home { get; init; } + [JsonInclude, JsonPropertyName("logs")] + public string? Logs { get; init; } + [JsonInclude, JsonPropertyName("repo")] + public IReadOnlyCollection? Repo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositories.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositories.g.cs new file mode 100644 index 00000000000..9718b0765a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositories.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.Nodes; + +public sealed partial class NodeInfoRepositories +{ + [JsonInclude, JsonPropertyName("url")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoRepositoriesUrl Url { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs new file mode 100644 index 00000000000..258c9dfb4fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.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.Nodes; + +public sealed partial class NodeInfoRepositoriesUrl +{ + [JsonInclude, JsonPropertyName("allowed_urls")] + public string AllowedUrls { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoScript.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoScript.g.cs new file mode 100644 index 00000000000..390077062f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoScript.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.Nodes; + +public sealed partial class NodeInfoScript +{ + [JsonInclude, JsonPropertyName("allowed_types")] + public string AllowedTypes { get; init; } + [JsonInclude, JsonPropertyName("disable_max_compilations_rate")] + public string DisableMaxCompilationsRate { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearch.g.cs new file mode 100644 index 00000000000..e9854d0e224 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearch.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.Nodes; + +public sealed partial class NodeInfoSearch +{ + [JsonInclude, JsonPropertyName("remote")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSearchRemote Remote { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs new file mode 100644 index 00000000000..3b98fd964f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSearchRemote.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.Nodes; + +public sealed partial class NodeInfoSearchRemote +{ + [JsonInclude, JsonPropertyName("connect")] + public string Connect { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettings.g.cs new file mode 100644 index 00000000000..467b8e324d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettings.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.Nodes; + +public sealed partial class NodeInfoSettings +{ + [JsonInclude, JsonPropertyName("action")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoAction? Action { get; init; } + [JsonInclude, JsonPropertyName("bootstrap")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoBootstrap? Bootstrap { get; init; } + [JsonInclude, JsonPropertyName("client")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoClient Client { get; init; } + [JsonInclude, JsonPropertyName("cluster")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsCluster Cluster { get; init; } + [JsonInclude, JsonPropertyName("discovery")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoDiscover? Discovery { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsHttp Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsIngest? Ingest { get; init; } + [JsonInclude, JsonPropertyName("network")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsNetwork? Network { get; init; } + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsNode Node { get; init; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoPath? Path { get; init; } + [JsonInclude, JsonPropertyName("repositories")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoRepositories? Repositories { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoScript? Script { get; init; } + [JsonInclude, JsonPropertyName("search")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSearch? Search { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsTransport Transport { get; init; } + [JsonInclude, JsonPropertyName("xpack")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpack? Xpack { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs new file mode 100644 index 00000000000..968c8a7151b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsCluster.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.Nodes; + +public sealed partial class NodeInfoSettingsCluster +{ + [JsonInclude, JsonPropertyName("deprecation_indexing")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.DeprecationIndexing? DeprecationIndexing { get; init; } + [JsonInclude, JsonPropertyName("election")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsClusterElection Election { get; init; } + [JsonInclude, JsonPropertyName("initial_master_nodes")] + public IReadOnlyCollection? InitialMasterNodes { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.IndexRouting? Routing { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs new file mode 100644 index 00000000000..288df779762 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.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.Nodes; + +public sealed partial class NodeInfoSettingsClusterElection +{ + [JsonInclude, JsonPropertyName("strategy")] + public string Strategy { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs new file mode 100644 index 00000000000..02888461cb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttp.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.Nodes; + +public sealed partial class NodeInfoSettingsHttp +{ + [JsonInclude, JsonPropertyName("compression")] + public object? Compression { get; init; } + [JsonInclude, JsonPropertyName("port")] + public object? Port { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsHttpType Type { get; init; } + [JsonInclude, JsonPropertyName("type.default")] + public string? TypeDefault { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs new file mode 100644 index 00000000000..ea8d393b8c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsHttpType.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.Nodes; + +public sealed partial class NodeInfoSettingsHttpType +{ + [JsonInclude, JsonPropertyName("default")] + public string Default { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs new file mode 100644 index 00000000000..151231c9ef4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsIngest.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.Nodes; + +public sealed partial class NodeInfoSettingsIngest +{ + [JsonInclude, JsonPropertyName("append")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Append { get; init; } + [JsonInclude, JsonPropertyName("attachment")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Attachment { get; init; } + [JsonInclude, JsonPropertyName("bytes")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Bytes { get; init; } + [JsonInclude, JsonPropertyName("circle")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Circle { get; init; } + [JsonInclude, JsonPropertyName("convert")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Convert { get; init; } + [JsonInclude, JsonPropertyName("csv")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Csv { get; init; } + [JsonInclude, JsonPropertyName("date")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Date { get; init; } + [JsonInclude, JsonPropertyName("date_index_name")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? DateIndexName { get; init; } + [JsonInclude, JsonPropertyName("dissect")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Dissect { get; init; } + [JsonInclude, JsonPropertyName("dot_expander")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? DotExpander { get; init; } + [JsonInclude, JsonPropertyName("drop")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Drop { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Enrich { get; init; } + [JsonInclude, JsonPropertyName("fail")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Fail { get; init; } + [JsonInclude, JsonPropertyName("foreach")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Foreach { get; init; } + [JsonInclude, JsonPropertyName("geoip")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Geoip { get; init; } + [JsonInclude, JsonPropertyName("grok")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Grok { get; init; } + [JsonInclude, JsonPropertyName("gsub")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Gsub { get; init; } + [JsonInclude, JsonPropertyName("inference")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Inference { get; init; } + [JsonInclude, JsonPropertyName("join")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Join { get; init; } + [JsonInclude, JsonPropertyName("json")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Json { get; init; } + [JsonInclude, JsonPropertyName("kv")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Kv { get; init; } + [JsonInclude, JsonPropertyName("lowercase")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Lowercase { get; init; } + [JsonInclude, JsonPropertyName("pipeline")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Pipeline { get; init; } + [JsonInclude, JsonPropertyName("remove")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Remove { get; init; } + [JsonInclude, JsonPropertyName("rename")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Rename { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Script { get; init; } + [JsonInclude, JsonPropertyName("set")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Set { get; init; } + [JsonInclude, JsonPropertyName("set_security_user")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? SetSecurityUser { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Sort { get; init; } + [JsonInclude, JsonPropertyName("split")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Split { get; init; } + [JsonInclude, JsonPropertyName("trim")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Trim { get; init; } + [JsonInclude, JsonPropertyName("uppercase")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? Uppercase { get; init; } + [JsonInclude, JsonPropertyName("urldecode")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? UrlDecode { get; init; } + [JsonInclude, JsonPropertyName("user_agent")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoIngestInfo? UserAgent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs new file mode 100644 index 00000000000..1d4f20e67be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNetwork.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.Nodes; + +public sealed partial class NodeInfoSettingsNetwork +{ + [JsonInclude, JsonPropertyName("host")] + public string Host { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs new file mode 100644 index 00000000000..8168ac2f90f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsNode.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.Nodes; + +public sealed partial class NodeInfoSettingsNode +{ + [JsonInclude, JsonPropertyName("attr")] + public IReadOnlyDictionary Attr { get; init; } + [JsonInclude, JsonPropertyName("max_local_storage_nodes")] + public string? MaxLocalStorageNodes { 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/Nodes/NodeInfoSettingsTransport.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs new file mode 100644 index 00000000000..cc28d76d736 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransport.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.Nodes; + +public sealed partial class NodeInfoSettingsTransport +{ + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsTransportFeatures? Features { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoSettingsTransportType Type { get; init; } + [JsonInclude, JsonPropertyName("type.default")] + public string? TypeDefault { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs new file mode 100644 index 00000000000..886e689d0f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.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.Nodes; + +public sealed partial class NodeInfoSettingsTransportFeatures +{ + [JsonInclude, JsonPropertyName("x-pack")] + public string XPack { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs new file mode 100644 index 00000000000..f08f1144e14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoSettingsTransportType.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.Nodes; + +public sealed partial class NodeInfoSettingsTransportType +{ + [JsonInclude, JsonPropertyName("default")] + public string Default { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoTransport.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoTransport.g.cs new file mode 100644 index 00000000000..5269e6ea2b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoTransport.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.Nodes; + +public sealed partial class NodeInfoTransport +{ + [JsonInclude, JsonPropertyName("bound_address")] + public IReadOnlyCollection BoundAddress { get; init; } + [JsonInclude, JsonPropertyName("profiles")] + public IReadOnlyDictionary Profiles { get; init; } + [JsonInclude, JsonPropertyName("publish_address")] + public string PublishAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.g.cs new file mode 100644 index 00000000000..d987cbd663c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpack.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.Nodes; + +public sealed partial class NodeInfoXpack +{ + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackLicense? License { get; init; } + [JsonInclude, JsonPropertyName("notification")] + public IReadOnlyDictionary? Notification { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurity Security { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs new file mode 100644 index 00000000000..afba9836083 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicense.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.Nodes; + +public sealed partial class NodeInfoXpackLicense +{ + [JsonInclude, JsonPropertyName("self_generated")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackLicenseType SelfGenerated { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs new file mode 100644 index 00000000000..b49b2818b15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackLicenseType.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.Nodes; + +public sealed partial class NodeInfoXpackLicenseType +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs new file mode 100644 index 00000000000..e704f5da446 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurity.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.Nodes; + +public sealed partial class NodeInfoXpackSecurity +{ + [JsonInclude, JsonPropertyName("authc")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthc? Authc { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecuritySsl Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecuritySsl? Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs new file mode 100644 index 00000000000..400a86e016a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.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.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthc +{ + [JsonInclude, JsonPropertyName("realms")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcRealms Realms { get; init; } + [JsonInclude, JsonPropertyName("token")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoXpackSecurityAuthcToken Token { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs new file mode 100644 index 00000000000..77608ca0d26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.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.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcRealms +{ + [JsonInclude, JsonPropertyName("file")] + public IReadOnlyDictionary? File { get; init; } + [JsonInclude, JsonPropertyName("native")] + public IReadOnlyDictionary? Native { get; init; } + [JsonInclude, JsonPropertyName("pki")] + public IReadOnlyDictionary? Pki { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs new file mode 100644 index 00000000000..bfb4d658e7a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.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.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcRealmsStatus +{ + [JsonInclude, JsonPropertyName("enabled")] + public string? Enabled { get; init; } + [JsonInclude, JsonPropertyName("order")] + public string Order { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs new file mode 100644 index 00000000000..c9fdc45c15a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.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.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcToken +{ + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs new file mode 100644 index 00000000000..0e8ee43122f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.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.Nodes; + +public sealed partial class NodeInfoXpackSecuritySsl +{ + [JsonInclude, JsonPropertyName("ssl")] + public IReadOnlyDictionary Ssl { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeJvmInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeJvmInfo.g.cs new file mode 100644 index 00000000000..9c93c25fd84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeJvmInfo.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.Nodes; + +internal sealed partial class NodeJvmInfoConverter : JsonConverter +{ + public override NodeJvmInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection gcCollectors = default; + IReadOnlyCollection inputArguments = default; + Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoJvmMemory mem = default; + IReadOnlyCollection memoryPools = default; + int pid = default; + long startTimeInMillis = default; + bool usingBundledJdk = default; + object? usingCompressedOrdinaryObjectPointers = default; + string version = default; + string vmName = default; + string vmVendor = default; + string vmVersion = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "gc_collectors") + { + gcCollectors = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "input_arguments") + { + inputArguments = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "mem") + { + mem = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "memory_pools") + { + memoryPools = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "pid") + { + pid = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "start_time_in_millis") + { + startTimeInMillis = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "using_bundled_jdk" || property == "bundled_jdk") + { + usingBundledJdk = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "using_compressed_ordinary_object_pointers") + { + usingCompressedOrdinaryObjectPointers = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_name") + { + vmName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_vendor") + { + vmVendor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_version") + { + vmVersion = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new NodeJvmInfo { GcCollectors = gcCollectors, InputArguments = inputArguments, Mem = mem, MemoryPools = memoryPools, Pid = pid, StartTimeInMillis = startTimeInMillis, UsingBundledJdk = usingBundledJdk, UsingCompressedOrdinaryObjectPointers = usingCompressedOrdinaryObjectPointers, Version = version, VmName = vmName, VmVendor = vmVendor, VmVersion = vmVersion }; + } + + public override void Write(Utf8JsonWriter writer, NodeJvmInfo value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NodeJvmInfo' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NodeJvmInfoConverter))] +public sealed partial class NodeJvmInfo +{ + public IReadOnlyCollection GcCollectors { get; init; } + public IReadOnlyCollection InputArguments { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoJvmMemory Mem { get; init; } + public IReadOnlyCollection MemoryPools { get; init; } + public int Pid { get; init; } + public long StartTimeInMillis { get; init; } + public bool UsingBundledJdk { get; init; } + public object? UsingCompressedOrdinaryObjectPointers { get; init; } + public string Version { get; init; } + public string VmName { get; init; } + public string VmVendor { get; init; } + public string VmVersion { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs new file mode 100644 index 00000000000..0defbb396b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeOperatingSystemInfo.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.Nodes; + +public sealed partial class NodeOperatingSystemInfo +{ + /// + /// The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS. + /// + [JsonInclude, JsonPropertyName("allocated_processors")] + public int? AllocatedProcessors { get; init; } + + /// + /// Name of the JVM architecture (ex: amd64, x86) + /// + [JsonInclude, JsonPropertyName("arch")] + public string Arch { get; init; } + + /// + /// Number of processors available to the Java virtual machine + /// + [JsonInclude, JsonPropertyName("available_processors")] + public int AvailableProcessors { get; init; } + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoOSCPU? Cpu { get; init; } + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoMemory? Mem { get; init; } + + /// + /// Name of the operating system (ex: Linux, Windows, Mac OS X) + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("pretty_name")] + public string PrettyName { get; init; } + + /// + /// Refresh interval for the OS statistics + /// + [JsonInclude, JsonPropertyName("refresh_interval_in_millis")] + public long RefreshIntervalInMillis { get; init; } + [JsonInclude, JsonPropertyName("swap")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.NodeInfoMemory? Swap { get; init; } + + /// + /// Version of the operating system + /// + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeProcessInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeProcessInfo.g.cs new file mode 100644 index 00000000000..5f18b54281a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeProcessInfo.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.Nodes; + +public sealed partial class NodeProcessInfo +{ + /// + /// Process identifier (PID) + /// + [JsonInclude, JsonPropertyName("id")] + public long Id { get; init; } + + /// + /// Indicates if the process address space has been successfully locked in memory + /// + [JsonInclude, JsonPropertyName("mlockall")] + public bool Mlockall { get; init; } + + /// + /// Refresh interval for the process statistics + /// + [JsonInclude, JsonPropertyName("refresh_interval_in_millis")] + public long RefreshIntervalInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs new file mode 100644 index 00000000000..a84f939b43d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeThreadPoolInfo.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.Nodes; + +public sealed partial class NodeThreadPoolInfo +{ + [JsonInclude, JsonPropertyName("core")] + public int? Core { get; init; } + [JsonInclude, JsonPropertyName("keep_alive")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get; init; } + [JsonInclude, JsonPropertyName("max")] + public int? Max { get; init; } + [JsonInclude, JsonPropertyName("queue_size")] + public int QueueSize { get; init; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { 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/Nodes/NodeUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeUsage.g.cs new file mode 100644 index 00000000000..863d6b5e813 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/NodeUsage.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.Nodes; + +public sealed partial class NodeUsage +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary Aggregations { get; init; } + [JsonInclude, JsonPropertyName("rest_actions")] + public IReadOnlyDictionary RestActions { get; init; } + [JsonInclude, JsonPropertyName("since")] + public long Since { 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/Nodes/OperatingSystem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/OperatingSystem.g.cs new file mode 100644 index 00000000000..52814ad83fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/OperatingSystem.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.Nodes; + +public sealed partial class OperatingSystem +{ + [JsonInclude, JsonPropertyName("cgroup")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Cgroup? Cgroup { get; init; } + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Cpu? Cpu { get; init; } + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.ExtendedMemoryStats? Mem { get; init; } + [JsonInclude, JsonPropertyName("swap")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.MemoryStats? Swap { 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/Nodes/Pool.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Pool.g.cs new file mode 100644 index 00000000000..34a454e88b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Pool.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.Nodes; + +public sealed partial class Pool +{ + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("max_in_bytes")] + public long? MaxInBytes { get; init; } + + /// + /// Largest amount of memory, in bytes, historically used by the heap. + /// + [JsonInclude, JsonPropertyName("peak_max_in_bytes")] + public long? PeakMaxInBytes { get; init; } + + /// + /// Largest amount of memory, in bytes, historically used by the heap. + /// + [JsonInclude, JsonPropertyName("peak_used_in_bytes")] + public long? PeakUsedInBytes { get; init; } + + /// + /// Memory, in bytes, used by the heap. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PressureMemory.g.cs new file mode 100644 index 00000000000..19567ed42e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PressureMemory.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.Nodes; + +public sealed partial class PressureMemory +{ + /// + /// Memory consumed by indexing requests in the coordinating, primary, or replica stage. + /// + [JsonInclude, JsonPropertyName("all")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? All { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage. + /// + [JsonInclude, JsonPropertyName("all_in_bytes")] + public long? AllInBytes { get; init; } + + /// + /// Memory consumed by indexing requests in the coordinating or primary stage.
This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.
+ ///
+ [JsonInclude, JsonPropertyName("combined_coordinating_and_primary")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? CombinedCoordinatingAndPrimary { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.
This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.
+ ///
+ [JsonInclude, JsonPropertyName("combined_coordinating_and_primary_in_bytes")] + public long? CombinedCoordinatingAndPrimaryInBytes { get; init; } + + /// + /// Memory consumed by indexing requests in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Coordinating { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating_in_bytes")] + public long? CoordinatingInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating_rejections")] + public long? CoordinatingRejections { get; init; } + + /// + /// Memory consumed by indexing requests in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Primary { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary_in_bytes")] + public long? PrimaryInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary_rejections")] + public long? PrimaryRejections { get; init; } + + /// + /// Memory consumed by indexing requests in the replica stage. + /// + [JsonInclude, JsonPropertyName("replica")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Replica { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the replica stage. + /// + [JsonInclude, JsonPropertyName("replica_in_bytes")] + public long? ReplicaInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the replica stage. + /// + [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/Nodes/Process.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Process.g.cs new file mode 100644 index 00000000000..87defee51e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Process.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.Nodes; + +public sealed partial class Process +{ + /// + /// Contains CPU statistics for the node. + /// + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Cpu? Cpu { get; init; } + + /// + /// Maximum number of file descriptors allowed on the system, or `-1` if not supported. + /// + [JsonInclude, JsonPropertyName("max_file_descriptors")] + public int? MaxFileDescriptors { get; init; } + + /// + /// Contains virtual memory statistics for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.MemoryStats? Mem { get; init; } + + /// + /// Number of opened file descriptors associated with the current or `-1` if not supported. + /// + [JsonInclude, JsonPropertyName("open_file_descriptors")] + public int? OpenFileDescriptors { get; init; } + + /// + /// Last time the statistics were refreshed.
Recorded in milliseconds since the Unix Epoch.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Processor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Processor.g.cs new file mode 100644 index 00000000000..17ed5cba1ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Processor.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.Nodes; + +public sealed partial class Processor +{ + /// + /// Number of documents transformed by the processor. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Number of documents currently being transformed by the processor. + /// + [JsonInclude, JsonPropertyName("current")] + public long? Current { get; init; } + + /// + /// Number of failed operations for the processor. + /// + [JsonInclude, JsonPropertyName("failed")] + public long? Failed { get; init; } + + /// + /// Time, in milliseconds, spent by the processor transforming documents. + /// + [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/Nodes/PublishedClusterStates.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PublishedClusterStates.g.cs new file mode 100644 index 00000000000..6cd9ce97cc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/PublishedClusterStates.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.Nodes; + +public sealed partial class PublishedClusterStates +{ + /// + /// Number of compatible differences between published cluster states. + /// + [JsonInclude, JsonPropertyName("compatible_diffs")] + public long? CompatibleDiffs { get; init; } + + /// + /// Number of published cluster states. + /// + [JsonInclude, JsonPropertyName("full_states")] + public long? FullStates { get; init; } + + /// + /// Number of incompatible differences between published cluster states. + /// + [JsonInclude, JsonPropertyName("incompatible_diffs")] + public long? IncompatibleDiffs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Recording.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Recording.g.cs new file mode 100644 index 00000000000..f2b7043c8ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Recording.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.Nodes; + +public sealed partial class Recording +{ + [JsonInclude, JsonPropertyName("cumulative_execution_count")] + public long? CumulativeExecutionCount { get; init; } + [JsonInclude, JsonPropertyName("cumulative_execution_time")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? CumulativeExecutionTime { get; init; } + [JsonInclude, JsonPropertyName("cumulative_execution_time_millis")] + public long? CumulativeExecutionTimeMillis { 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/Nodes/ScriptCache.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ScriptCache.g.cs new file mode 100644 index 00000000000..08173895289 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ScriptCache.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.Nodes; + +public sealed partial class ScriptCache +{ + /// + /// Total number of times the script cache has evicted old data. + /// + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + + /// + /// Total number of times the script compilation circuit breaker has limited inline script compilations. + /// + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + + /// + /// Total number of inline script compilations performed by the node. + /// + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + [JsonInclude, JsonPropertyName("context")] + public string? Context { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Scripting.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Scripting.g.cs new file mode 100644 index 00000000000..bc12d375a5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Scripting.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Nodes; + +public sealed partial class Scripting +{ + /// + /// Total number of times the script cache has evicted old data. + /// + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + + /// + /// Total number of times the script compilation circuit breaker has limited inline script compilations. + /// + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + + /// + /// Total number of inline script compilations performed by the node. + /// + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + + /// + /// Contains this recent history of script compilations. + /// + [JsonInclude, JsonPropertyName("compilations_history")] + public IReadOnlyDictionary? CompilationsHistory { get; init; } + [JsonInclude, JsonPropertyName("contexts")] + public IReadOnlyCollection? Contexts { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterState.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterState.g.cs new file mode 100644 index 00000000000..12a91e4784d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterState.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.Nodes; + +public sealed partial class SerializedClusterState +{ + [JsonInclude, JsonPropertyName("diffs")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.SerializedClusterStateDetail? Diffs { get; init; } + + /// + /// Number of published cluster states. + /// + [JsonInclude, JsonPropertyName("full_states")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.SerializedClusterStateDetail? FullStates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs new file mode 100644 index 00000000000..3fd7c5a09f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/SerializedClusterStateDetail.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.Nodes; + +public sealed partial class SerializedClusterStateDetail +{ + [JsonInclude, JsonPropertyName("compressed_size")] + public string? CompressedSize { get; init; } + [JsonInclude, JsonPropertyName("compressed_size_in_bytes")] + public long? CompressedSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + [JsonInclude, JsonPropertyName("uncompressed_size")] + public string? UncompressedSize { get; init; } + [JsonInclude, JsonPropertyName("uncompressed_size_in_bytes")] + public long? UncompressedSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Stats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Stats.g.cs new file mode 100644 index 00000000000..fe123cb279c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Stats.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.Nodes; + +public sealed partial class Stats +{ + /// + /// Statistics about adaptive replica selection. + /// + [JsonInclude, JsonPropertyName("adaptive_selection")] + public IReadOnlyDictionary? AdaptiveSelection { get; init; } + + /// + /// Contains a list of attributes for the node. + /// + [JsonInclude, JsonPropertyName("attributes")] + [ReadOnlyFieldDictionaryConverter(typeof(string))] + public IReadOnlyDictionary? Attributes { get; init; } + + /// + /// Statistics about the field data circuit breaker. + /// + [JsonInclude, JsonPropertyName("breakers")] + public IReadOnlyDictionary? Breakers { get; init; } + + /// + /// Contains node discovery statistics for the node. + /// + [JsonInclude, JsonPropertyName("discovery")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Discovery? Discovery { get; init; } + + /// + /// File system information, data path, free disk space, read/write stats. + /// + [JsonInclude, JsonPropertyName("fs")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.FileSystem? Fs { get; init; } + + /// + /// Network host for the node, based on the network host setting. + /// + [JsonInclude, JsonPropertyName("host")] + public string? Host { get; init; } + + /// + /// HTTP connection information. + /// + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Http? Http { get; init; } + + /// + /// Contains indexing pressure statistics for the node. + /// + [JsonInclude, JsonPropertyName("indexing_pressure")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.IndexingPressure? IndexingPressure { get; init; } + + /// + /// Indices stats about size, document count, indexing and deletion times, search times, field cache size, merges and flushes. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.IndexManagement.ShardStats? Indices { get; init; } + + /// + /// Statistics about ingest preprocessing. + /// + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Ingest? Ingest { get; init; } + + /// + /// IP address and port for the node. + /// + [JsonInclude, JsonPropertyName("ip")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Ip { get; init; } + + /// + /// JVM stats, memory pool information, garbage collection, buffer pools, number of loaded/unloaded classes. + /// + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Jvm? Jvm { get; init; } + + /// + /// Human-readable identifier for the node.
Based on the node name setting.
+ ///
+ [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Operating system stats, load average, mem, swap. + /// + [JsonInclude, JsonPropertyName("os")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.OperatingSystem? Os { get; init; } + + /// + /// Process statistics, memory consumption, cpu usage, open file descriptors. + /// + [JsonInclude, JsonPropertyName("process")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Process? Process { get; init; } + + /// + /// Roles assigned to the node. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// Contains script statistics for the node. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Scripting? Script { get; init; } + [JsonInclude, JsonPropertyName("script_cache")] + public IReadOnlyDictionary>>? ScriptCache { get; init; } + + /// + /// Statistics about each thread pool, including current size, queue and rejected tasks. + /// + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Transport statistics about sent and received bytes in cluster communication. + /// + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Nodes.Transport? Transport { get; init; } + + /// + /// Host and port for the transport layer, used for internal communication between nodes in a cluster. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string? TransportAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ThreadCount.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ThreadCount.g.cs new file mode 100644 index 00000000000..d884b5d45cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/ThreadCount.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.Nodes; + +public sealed partial class ThreadCount +{ + /// + /// Number of active threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("active")] + public long? Active { get; init; } + + /// + /// Number of tasks completed by the thread pool executor. + /// + [JsonInclude, JsonPropertyName("completed")] + public long? Completed { get; init; } + + /// + /// Highest number of active threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("largest")] + public long? Largest { get; init; } + + /// + /// Number of tasks in queue for the thread pool. + /// + [JsonInclude, JsonPropertyName("queue")] + public long? Queue { get; init; } + + /// + /// Number of tasks rejected by the thread pool executor. + /// + [JsonInclude, JsonPropertyName("rejected")] + public long? Rejected { get; init; } + + /// + /// Number of threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("threads")] + public long? Threads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Transport.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Transport.g.cs new file mode 100644 index 00000000000..7041c92133f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/Transport.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.Nodes; + +public sealed partial class Transport +{ + /// + /// The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram. + /// + [JsonInclude, JsonPropertyName("inbound_handling_time_histogram")] + public IReadOnlyCollection? InboundHandlingTimeHistogram { get; init; } + + /// + /// The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram. + /// + [JsonInclude, JsonPropertyName("outbound_handling_time_histogram")] + public IReadOnlyCollection? OutboundHandlingTimeHistogram { get; init; } + + /// + /// Total number of RX (receive) packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_count")] + public long? RxCount { get; init; } + + /// + /// Size of RX packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_size")] + public string? RxSize { get; init; } + + /// + /// Size, in bytes, of RX packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_size_in_bytes")] + public long? RxSizeInBytes { get; init; } + + /// + /// Current number of inbound TCP connections used for internal communication between nodes. + /// + [JsonInclude, JsonPropertyName("server_open")] + public int? ServerOpen { get; init; } + + /// + /// The cumulative number of outbound transport connections that this node has opened since it started.
Each transport connection may comprise multiple TCP connections but is only counted once in this statistic.
Transport connections are typically long-lived so this statistic should remain constant in a stable cluster.
+ ///
+ [JsonInclude, JsonPropertyName("total_outbound_connections")] + public long? TotalOutboundConnections { get; init; } + + /// + /// Total number of TX (transmit) packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_count")] + public long? TxCount { get; init; } + + /// + /// Size of TX packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_size")] + public string? TxSize { get; init; } + + /// + /// Size, in bytes, of TX packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_size_in_bytes")] + public long? TxSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/TransportHistogram.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/TransportHistogram.g.cs new file mode 100644 index 00000000000..0e7cb2c11ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Nodes/TransportHistogram.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.Nodes; + +public sealed partial class TransportHistogram +{ + /// + /// The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound. + /// + [JsonInclude, JsonPropertyName("ge_millis")] + public long? GeMillis { get; init; } + + /// + /// The exclusive upper bound of the bucket in milliseconds.
May be omitted on the last bucket if this bucket has no upper bound.
+ ///
+ [JsonInclude, JsonPropertyName("lt_millis")] + public long? LtMillis { 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 index 838cfc89731..d0e01026cf4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoolQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class BoolQuery : SearchQuery +public sealed partial class BoolQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -60,6 +61,8 @@ public sealed partial class BoolQuery : SearchQuery [JsonInclude, JsonPropertyName("must_not")] [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query))] public ICollection? MustNot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// The clause (query) should appear in the matching document. @@ -68,9 +71,7 @@ public sealed partial class BoolQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(BoolQuery boolQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Bool(boolQuery); } public sealed partial class BoolQueryDescriptor : SerializableDescriptor> @@ -83,24 +84,27 @@ public BoolQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private ICollection? MustValue { get; set; } - private QueryDescriptor MustDescriptor { get; set; } - private Action> MustDescriptorAction { get; set; } - private Action>[] MustDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor MustNotDescriptor { get; set; } + private Action> MustNotDescriptorAction { get; set; } + private Action>[] MustNotDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private ICollection? ShouldValue { get; set; } - private QueryDescriptor ShouldDescriptor { get; set; } - private Action> ShouldDescriptorAction { get; set; } - private Action>[] ShouldDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor ShouldDescriptor { get; set; } + private Action> ShouldDescriptorAction { get; set; } + private Action>[] ShouldDescriptorActions { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoolQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -119,7 +123,7 @@ public BoolQueryDescriptor Filter(ICollection Filter(QueryDescriptor descriptor) + public BoolQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -128,7 +132,7 @@ public BoolQueryDescriptor Filter(QueryDescriptor descript return Self; } - public BoolQueryDescriptor Filter(Action> configure) + public BoolQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -137,7 +141,7 @@ public BoolQueryDescriptor Filter(Action> return Self; } - public BoolQueryDescriptor Filter(params Action>[] configure) + public BoolQueryDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -167,7 +171,7 @@ public BoolQueryDescriptor Must(ICollection Must(QueryDescriptor descriptor) + public BoolQueryDescriptor Must(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { MustValue = null; MustDescriptorAction = null; @@ -176,7 +180,7 @@ public BoolQueryDescriptor Must(QueryDescriptor descriptor return Self; } - public BoolQueryDescriptor Must(Action> configure) + public BoolQueryDescriptor Must(Action> configure) { MustValue = null; MustDescriptor = null; @@ -185,7 +189,7 @@ public BoolQueryDescriptor Must(Action> co return Self; } - public BoolQueryDescriptor Must(params Action>[] configure) + public BoolQueryDescriptor Must(params Action>[] configure) { MustValue = null; MustDescriptor = null; @@ -206,7 +210,7 @@ public BoolQueryDescriptor MustNot(ICollection MustNot(QueryDescriptor descriptor) + public BoolQueryDescriptor MustNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { MustNotValue = null; MustNotDescriptorAction = null; @@ -215,7 +219,7 @@ public BoolQueryDescriptor MustNot(QueryDescriptor descrip return Self; } - public BoolQueryDescriptor MustNot(Action> configure) + public BoolQueryDescriptor MustNot(Action> configure) { MustNotValue = null; MustNotDescriptor = null; @@ -224,7 +228,7 @@ public BoolQueryDescriptor MustNot(Action> return Self; } - public BoolQueryDescriptor MustNot(params Action>[] configure) + public BoolQueryDescriptor MustNot(params Action>[] configure) { MustNotValue = null; MustNotDescriptor = null; @@ -251,7 +255,7 @@ public BoolQueryDescriptor Should(ICollection Should(QueryDescriptor descriptor) + public BoolQueryDescriptor Should(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { ShouldValue = null; ShouldDescriptorAction = null; @@ -260,7 +264,7 @@ public BoolQueryDescriptor Should(QueryDescriptor descript return Self; } - public BoolQueryDescriptor Should(Action> configure) + public BoolQueryDescriptor Should(Action> configure) { ShouldValue = null; ShouldDescriptor = null; @@ -269,7 +273,7 @@ public BoolQueryDescriptor Should(Action> return Self; } - public BoolQueryDescriptor Should(params Action>[] configure) + public BoolQueryDescriptor Should(params Action>[] configure) { ShouldValue = null; ShouldDescriptor = null; @@ -295,7 +299,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -304,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -330,7 +334,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustDescriptorAction is not null) { writer.WritePropertyName("must"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MustDescriptorAction), options); } else if (MustDescriptorActions is not null) { @@ -339,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (MustDescriptorActions.Length > 1) @@ -359,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustNotDescriptorAction is not null) { writer.WritePropertyName("must_not"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MustNotDescriptorAction), options); } else if (MustNotDescriptorActions is not null) { @@ -368,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustNotDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (MustNotDescriptorActions.Length > 1) @@ -394,7 +398,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ShouldDescriptorAction is not null) { writer.WritePropertyName("should"); - JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(ShouldDescriptorAction), options); } else if (ShouldDescriptorActions is not null) { @@ -403,7 +407,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ShouldDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (ShouldDescriptorActions.Length > 1) @@ -429,24 +433,27 @@ public BoolQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Serverless.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private ICollection? MustValue { get; set; } - private QueryDescriptor MustDescriptor { get; set; } - private Action MustDescriptorAction { get; set; } - private Action[] MustDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor MustNotDescriptor { get; set; } + private Action MustNotDescriptorAction { get; set; } + private Action[] MustNotDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private ICollection? ShouldValue { get; set; } - private QueryDescriptor ShouldDescriptor { get; set; } - private Action ShouldDescriptorAction { get; set; } - private Action[] ShouldDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor ShouldDescriptor { get; set; } + private Action ShouldDescriptorAction { get; set; } + private Action[] ShouldDescriptorActions { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoolQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -465,7 +472,7 @@ public BoolQueryDescriptor Filter(ICollection configure) + public BoolQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -483,7 +490,7 @@ public BoolQueryDescriptor Filter(Action configure) return Self; } - public BoolQueryDescriptor Filter(params Action[] configure) + public BoolQueryDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -513,7 +520,7 @@ public BoolQueryDescriptor Must(ICollection configure) + public BoolQueryDescriptor Must(Action configure) { MustValue = null; MustDescriptor = null; @@ -531,7 +538,7 @@ public BoolQueryDescriptor Must(Action configure) return Self; } - public BoolQueryDescriptor Must(params Action[] configure) + public BoolQueryDescriptor Must(params Action[] configure) { MustValue = null; MustDescriptor = null; @@ -552,7 +559,7 @@ public BoolQueryDescriptor MustNot(ICollection configure) + public BoolQueryDescriptor MustNot(Action configure) { MustNotValue = null; MustNotDescriptor = null; @@ -570,7 +577,7 @@ public BoolQueryDescriptor MustNot(Action configure) return Self; } - public BoolQueryDescriptor MustNot(params Action[] configure) + public BoolQueryDescriptor MustNot(params Action[] configure) { MustNotValue = null; MustNotDescriptor = null; @@ -597,7 +604,7 @@ public BoolQueryDescriptor Should(ICollection configure) + public BoolQueryDescriptor Should(Action configure) { ShouldValue = null; ShouldDescriptor = null; @@ -615,7 +622,7 @@ public BoolQueryDescriptor Should(Action configure) return Self; } - public BoolQueryDescriptor Should(params Action[] configure) + public BoolQueryDescriptor Should(params Action[] configure) { ShouldValue = null; ShouldDescriptor = null; @@ -641,7 +648,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -650,7 +657,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -676,7 +683,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustDescriptorAction is not null) { writer.WritePropertyName("must"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MustDescriptorAction), options); } else if (MustDescriptorActions is not null) { @@ -685,7 +692,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (MustDescriptorActions.Length > 1) @@ -705,7 +712,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustNotDescriptorAction is not null) { writer.WritePropertyName("must_not"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MustNotDescriptorAction), options); } else if (MustNotDescriptorActions is not null) { @@ -714,7 +721,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustNotDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (MustNotDescriptorActions.Length > 1) @@ -740,7 +747,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ShouldDescriptorAction is not null) { writer.WritePropertyName("should"); - JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(ShouldDescriptorAction), options); } else if (ShouldDescriptorActions is not null) { @@ -749,7 +756,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ShouldDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } if (ShouldDescriptorActions.Length > 1) 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 index 4ffc12d58e4..4236314ff58 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/BoostingQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class BoostingQuery : SearchQuery +public sealed partial class BoostingQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -51,10 +52,10 @@ public sealed partial class BoostingQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("positive")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Positive { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(BoostingQuery boostingQuery) => QueryDsl.Query.Boosting(boostingQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("boosting", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(BoostingQuery boostingQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Boosting(boostingQuery); } public sealed partial class BoostingQueryDescriptor : SerializableDescriptor> @@ -67,14 +68,17 @@ public BoostingQueryDescriptor() : base() private float? BoostValue { get; set; } 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.QueryDescriptor NegativeDescriptor { get; set; } + private Action> NegativeDescriptorAction { get; set; } private double NegativeBoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query PositiveValue { get; set; } - private QueryDescriptor PositiveDescriptor { get; set; } - private Action> PositiveDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor PositiveDescriptor { get; set; } + private Action> PositiveDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoostingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -92,7 +96,7 @@ public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch return Self; } - public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { NegativeValue = null; NegativeDescriptorAction = null; @@ -100,7 +104,7 @@ public BoostingQueryDescriptor Negative(QueryDescriptor de return Self; } - public BoostingQueryDescriptor Negative(Action> configure) + public BoostingQueryDescriptor Negative(Action> configure) { NegativeValue = null; NegativeDescriptor = null; @@ -128,7 +132,7 @@ public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch return Self; } - public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PositiveValue = null; PositiveDescriptorAction = null; @@ -136,7 +140,7 @@ public BoostingQueryDescriptor Positive(QueryDescriptor de return Self; } - public BoostingQueryDescriptor Positive(Action> configure) + public BoostingQueryDescriptor Positive(Action> configure) { PositiveValue = null; PositiveDescriptor = null; @@ -167,7 +171,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NegativeDescriptorAction is not null) { writer.WritePropertyName("negative"); - JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(NegativeDescriptorAction), options); } else { @@ -185,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PositiveDescriptorAction is not null) { writer.WritePropertyName("positive"); - JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PositiveDescriptorAction), options); } else { @@ -213,14 +217,17 @@ public BoostingQueryDescriptor() : base() private float? BoostValue { get; set; } 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.QueryDescriptor NegativeDescriptor { get; set; } + private Action NegativeDescriptorAction { get; set; } private double NegativeBoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query PositiveValue { get; set; } - private QueryDescriptor PositiveDescriptor { get; set; } - private Action PositiveDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor PositiveDescriptor { get; set; } + private Action PositiveDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoostingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -238,7 +245,7 @@ public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.Serverless return Self; } - public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { NegativeValue = null; NegativeDescriptorAction = null; @@ -246,7 +253,7 @@ public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) return Self; } - public BoostingQueryDescriptor Negative(Action configure) + public BoostingQueryDescriptor Negative(Action configure) { NegativeValue = null; NegativeDescriptor = null; @@ -274,7 +281,7 @@ public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.Serverless return Self; } - public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { PositiveValue = null; PositiveDescriptorAction = null; @@ -282,7 +289,7 @@ public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) return Self; } - public BoostingQueryDescriptor Positive(Action configure) + public BoostingQueryDescriptor Positive(Action configure) { PositiveValue = null; PositiveDescriptor = null; @@ -313,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NegativeDescriptorAction is not null) { writer.WritePropertyName("negative"); - JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(NegativeDescriptorAction), options); } else { @@ -331,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PositiveDescriptorAction is not null) { writer.WritePropertyName("positive"); - JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(PositiveDescriptorAction), options); } else { 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 index bdb63b3bf87..42a3b153ea2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class CombinedFieldsQuery : SearchQuery +public sealed partial class CombinedFieldsQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -44,7 +45,7 @@ public sealed partial class CombinedFieldsQuery : SearchQuery /// 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; } + public ICollection Fields { get; set; } /// /// Minimum number of clauses that must match for a document to be returned. @@ -63,6 +64,8 @@ public sealed partial class CombinedFieldsQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. @@ -70,9 +73,7 @@ public sealed partial class CombinedFieldsQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(CombinedFieldsQuery combinedFieldsQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.CombinedFields(combinedFieldsQuery); } public sealed partial class CombinedFieldsQueryDescriptor : SerializableDescriptor> @@ -85,7 +86,7 @@ public CombinedFieldsQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } - private Fields FieldsValue { get; set; } + private ICollection 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; } @@ -101,6 +102,9 @@ public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery( return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public CombinedFieldsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +114,7 @@ public CombinedFieldsQueryDescriptor Boost(float? boost) /// /// 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) + public CombinedFieldsQueryDescriptor Fields(ICollection fields) { FieldsValue = fields; return Self; @@ -128,9 +132,9 @@ public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clien /// /// Boolean logic used to interpret text in the query value. /// - public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? op) + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -215,7 +219,7 @@ public CombinedFieldsQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } - private Fields FieldsValue { get; set; } + private ICollection 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; } @@ -231,6 +235,9 @@ public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoG return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public CombinedFieldsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -240,7 +247,7 @@ public CombinedFieldsQueryDescriptor Boost(float? boost) /// /// 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) + public CombinedFieldsQueryDescriptor Fields(ICollection fields) { FieldsValue = fields; return Self; @@ -258,9 +265,9 @@ public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elastics /// /// Boolean logic used to interpret text in the query value. /// - public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? op) + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsOperator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } 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 index 6eebdf41c7d..bcb413eb1c3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class ConstantScoreQuery : SearchQuery +public sealed partial class ConstantScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class ConstantScoreQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("filter")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Filter { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(ConstantScoreQuery constantScoreQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.ConstantScore(constantScoreQuery); } public sealed partial class ConstantScoreQueryDescriptor : SerializableDescriptor> @@ -55,10 +56,13 @@ public ConstantScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ConstantScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -76,7 +80,7 @@ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsea return Self; } - public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -84,7 +88,7 @@ public ConstantScoreQueryDescriptor Filter(QueryDescriptor return Self; } - public ConstantScoreQueryDescriptor Filter(Action> configure) + public ConstantScoreQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -115,7 +119,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else { @@ -143,10 +147,13 @@ public ConstantScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ConstantScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -164,7 +171,7 @@ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverl return Self; } - public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -172,7 +179,7 @@ public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) return Self; } - public ConstantScoreQueryDescriptor Filter(Action configure) + public ConstantScoreQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -203,7 +210,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else { 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 index a135bcc8bf4..26e06b85255 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -118,98 +118,97 @@ public override void Write(Utf8JsonWriter writer, DateRangeQuery value, JsonSeri { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.From is not null) - { - writer.WritePropertyName("from"); - JsonSerializer.Serialize(writer, value.From, options); - } + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } - if (value.Gt is not null) - { - writer.WritePropertyName("gt"); - JsonSerializer.Serialize(writer, value.Gt, options); - } + if (value.From is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, value.From, options); + } - if (value.Gte is not null) - { - writer.WritePropertyName("gte"); - JsonSerializer.Serialize(writer, value.Gte, options); - } + if (value.Gt is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, value.Gt, options); + } - if (value.Lt is not null) - { - writer.WritePropertyName("lt"); - JsonSerializer.Serialize(writer, value.Lt, options); - } + if (value.Gte is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, value.Gte, options); + } - if (value.Lte is not null) - { - writer.WritePropertyName("lte"); - JsonSerializer.Serialize(writer, value.Lte, options); - } + if (value.Lt is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, value.Lt, options); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.TimeZone is not null) - { - writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, value.TimeZone, options); - } + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } - if (value.To is not null) - { - writer.WritePropertyName("to"); - JsonSerializer.Serialize(writer, value.To, options); - } + if (!string.IsNullOrEmpty(value.TimeZone)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(value.TimeZone); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.To is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, value.To, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(DateRangeQueryConverter))] -public sealed partial class DateRangeQuery : RangeQuery +public sealed partial class DateRangeQuery { - public DateRangeQuery(Field field) + public DateRangeQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Date format used to convert `date` values in the query. @@ -236,6 +235,11 @@ public DateRangeQuery(Field field) /// Less than or equal to. /// public Elastic.Clients.Elasticsearch.Serverless.DateMath? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? Relation { get; set; } /// @@ -243,33 +247,14 @@ public DateRangeQuery(Field field) /// 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) + public DateRangeQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -285,6 +270,9 @@ public DateRangeQueryDescriptor(Expression> field) private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.DateMath? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DateRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -303,6 +291,12 @@ public DateRangeQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Date format used to convert `date` values in the query. /// @@ -360,6 +354,9 @@ public DateRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -394,10 +391,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - if (FormatValue is not null) + if (!string.IsNullOrEmpty(FormatValue)) { writer.WritePropertyName("format"); - JsonSerializer.Serialize(writer, FormatValue, options); + writer.WriteStringValue(FormatValue); } if (FromValue is not null) @@ -442,10 +439,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RelationValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (ToValue is not null) @@ -463,15 +460,8 @@ public sealed partial class DateRangeQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal DateRangeQueryDescriptor() : base() - { - } - - public DateRangeQueryDescriptor(Field field) + public DateRangeQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -487,6 +477,9 @@ public DateRangeQueryDescriptor(Field field) private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.DateMath? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DateRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -568,6 +561,9 @@ public DateRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -602,10 +598,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - if (FormatValue is not null) + if (!string.IsNullOrEmpty(FormatValue)) { writer.WritePropertyName("format"); - JsonSerializer.Serialize(writer, FormatValue, options); + writer.WriteStringValue(FormatValue); } if (FromValue is not null) @@ -650,10 +646,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RelationValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (ToValue is not null) 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 index 3d9e603b538..6d5026d4349 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/DisMaxQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class DisMaxQuery : SearchQuery +public sealed partial class DisMaxQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,6 +40,8 @@ public sealed partial class DisMaxQuery : SearchQuery /// [JsonInclude, JsonPropertyName("queries")] public ICollection Queries { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. @@ -46,9 +49,7 @@ public sealed partial class DisMaxQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(DisMaxQuery disMaxQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.DisMax(disMaxQuery); } public sealed partial class DisMaxQueryDescriptor : SerializableDescriptor> @@ -61,12 +62,15 @@ public DisMaxQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection QueriesValue { get; set; } - private QueryDescriptor QueriesDescriptor { get; set; } - private Action> QueriesDescriptorAction { get; set; } - private Action>[] QueriesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueriesDescriptor { get; set; } + private Action> QueriesDescriptorAction { get; set; } + private Action>[] QueriesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private double? TieBreakerValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DisMaxQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -85,7 +89,7 @@ public DisMaxQueryDescriptor Queries(ICollection Queries(QueryDescriptor descriptor) + public DisMaxQueryDescriptor Queries(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -94,7 +98,7 @@ public DisMaxQueryDescriptor Queries(QueryDescriptor descr return Self; } - public DisMaxQueryDescriptor Queries(Action> configure) + public DisMaxQueryDescriptor Queries(Action> configure) { QueriesValue = null; QueriesDescriptor = null; @@ -103,7 +107,7 @@ public DisMaxQueryDescriptor Queries(Action Queries(params Action>[] configure) + public DisMaxQueryDescriptor Queries(params Action>[] configure) { QueriesValue = null; QueriesDescriptor = null; @@ -147,7 +151,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("queries"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueriesDescriptorAction), options); writer.WriteEndArray(); } else if (QueriesDescriptorActions is not null) @@ -156,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in QueriesDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } writer.WriteEndArray(); @@ -193,12 +197,15 @@ public DisMaxQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection QueriesValue { get; set; } - private QueryDescriptor QueriesDescriptor { get; set; } - private Action QueriesDescriptorAction { get; set; } - private Action[] QueriesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } + private Action[] QueriesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private double? TieBreakerValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DisMaxQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -217,7 +224,7 @@ public DisMaxQueryDescriptor Queries(ICollection configure) + public DisMaxQueryDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -235,7 +242,7 @@ public DisMaxQueryDescriptor Queries(Action configure) return Self; } - public DisMaxQueryDescriptor Queries(params Action[] configure) + public DisMaxQueryDescriptor Queries(params Action[] configure) { QueriesValue = null; QueriesDescriptor = null; @@ -279,7 +286,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("queries"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueriesDescriptorAction), options); writer.WriteEndArray(); } else if (QueriesDescriptorActions is not null) @@ -288,7 +295,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in QueriesDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(action), options); } writer.WriteEndArray(); 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 index 0e1012e0092..e03da878d74 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ExistsQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class ExistsQuery : SearchQuery +public sealed partial class ExistsQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class ExistsQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(ExistsQuery existsQuery) => QueryDsl.Query.Exists(existsQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("exists", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(ExistsQuery existsQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Exists(existsQuery); } public sealed partial class ExistsQueryDescriptor : SerializableDescriptor> @@ -57,6 +58,9 @@ public ExistsQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ExistsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -81,6 +85,15 @@ public ExistsQueryDescriptor Field(Expression + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public ExistsQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -120,6 +133,9 @@ public ExistsQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ExistsQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index 64aad325775..26e1bce8da8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldAndFormat.g.cs @@ -80,6 +80,15 @@ public FieldAndFormatDescriptor Field(Expression + /// 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. /// 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 index 0eaf611eee6..89a20843b88 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs @@ -53,7 +53,7 @@ public sealed partial class FieldValueFactorScoreFunction [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore.FieldValueFactor(fieldValueFactorScoreFunction); } public sealed partial class FieldValueFactorScoreFunctionDescriptor : SerializableDescriptor> @@ -96,6 +96,15 @@ public FieldValueFactorScoreFunctionDescriptor Field(Expressi 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.
///
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 index 01c4c26fc0c..0bb1a870e90 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -53,6 +54,18 @@ internal FunctionScore(string variantName, object variant) public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Filter { get; set; } [JsonInclude, JsonPropertyName("weight")] public double? Weight { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class FunctionScoreConverter : JsonConverter @@ -140,7 +153,7 @@ public override void Write(Utf8JsonWriter writer, FunctionScore value, JsonSeria writer.WriteNumberValue(value.Weight.Value); } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -193,61 +206,31 @@ private FunctionScoreDescriptor Set(object variant, string variantNam } 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"); + public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (FilterValue is not null) { writer.WritePropertyName("filter"); JsonSerializer.Serialize(writer, FilterValue, options); @@ -308,63 +291,31 @@ private FunctionScoreDescriptor Set(object variant, string variantName) } 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"); + public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (FilterValue is not null) { writer.WritePropertyName("filter"); JsonSerializer.Serialize(writer, FilterValue, options); 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 index 98c8dc192f1..903aa6c499d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class FunctionScoreQuery : SearchQuery +public sealed partial class FunctionScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,6 +64,8 @@ public sealed partial class FunctionScoreQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Specifies how the computed scores are combined @@ -70,9 +73,7 @@ public sealed partial class FunctionScoreQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(FunctionScoreQuery functionScoreQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.FunctionScore(functionScoreQuery); } public sealed partial class FunctionScoreQueryDescriptor : SerializableDescriptor> @@ -86,17 +87,20 @@ public FunctionScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } 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.FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action> FunctionsDescriptorAction { get; set; } + private Action>[] FunctionsDescriptorActions { get; set; } private double? MaxBoostValue { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FunctionScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -124,7 +128,7 @@ public FunctionScoreQueryDescriptor Functions(ICollection Functions(FunctionScoreDescriptor descriptor) + public FunctionScoreQueryDescriptor Functions(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreDescriptor descriptor) { FunctionsValue = null; FunctionsDescriptorAction = null; @@ -133,7 +137,7 @@ public FunctionScoreQueryDescriptor Functions(FunctionScoreDescriptor return Self; } - public FunctionScoreQueryDescriptor Functions(Action> configure) + public FunctionScoreQueryDescriptor Functions(Action> configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -142,7 +146,7 @@ public FunctionScoreQueryDescriptor Functions(Action Functions(params Action>[] configure) + public FunctionScoreQueryDescriptor Functions(params Action>[] configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -180,7 +184,7 @@ public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsear return Self; } - public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -188,7 +192,7 @@ public FunctionScoreQueryDescriptor Query(QueryDescriptor return Self; } - public FunctionScoreQueryDescriptor Query(Action> configure) + public FunctionScoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -237,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("functions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreDescriptor(FunctionsDescriptorAction), options); writer.WriteEndArray(); } else if (FunctionsDescriptorActions is not null) @@ -246,7 +250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FunctionsDescriptorActions) { - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreDescriptor(action), options); } writer.WriteEndArray(); @@ -277,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -312,17 +316,20 @@ public FunctionScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } 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.FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action FunctionsDescriptorAction { get; set; } + private Action[] FunctionsDescriptorActions { get; set; } private double? MaxBoostValue { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FunctionScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -350,7 +357,7 @@ public FunctionScoreQueryDescriptor Functions(ICollection configure) + public FunctionScoreQueryDescriptor Functions(Action configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -368,7 +375,7 @@ public FunctionScoreQueryDescriptor Functions(Action co return Self; } - public FunctionScoreQueryDescriptor Functions(params Action[] configure) + public FunctionScoreQueryDescriptor Functions(params Action[] configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -406,7 +413,7 @@ public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverle return Self; } - public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -414,7 +421,7 @@ public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public FunctionScoreQueryDescriptor Query(Action configure) + public FunctionScoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -463,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("functions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreDescriptor(FunctionsDescriptorAction), options); writer.WriteEndArray(); } else if (FunctionsDescriptorActions is not null) @@ -472,7 +479,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FunctionsDescriptorActions) { - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreDescriptor(action), options); } writer.WriteEndArray(); @@ -503,7 +510,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { 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 index c35a9134d65..a46c0b00b63 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/FuzzyQuery.g.cs @@ -100,76 +100,75 @@ public override void Write(Utf8JsonWriter writer, FuzzyQuery value, JsonSerializ { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.Transpositions.HasValue) - { - writer.WritePropertyName("transpositions"); - writer.WriteBooleanValue(value.Transpositions.Value); - } + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); + } - writer.WritePropertyName("value"); - JsonSerializer.Serialize(writer, value.Value, options); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.Transpositions.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(value.Transpositions.Value); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(FuzzyQueryConverter))] -public sealed partial class FuzzyQuery : SearchQuery +public sealed partial class FuzzyQuery { - public FuzzyQuery(Field field) + public FuzzyQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Maximum edit distance allowed for matching. @@ -185,6 +184,7 @@ public FuzzyQuery(Field field) /// Number of beginning characters left unchanged when creating expansions. /// public int? PrefixLength { get; set; } + public string? QueryName { get; set; } /// /// Number of beginning characters left unchanged when creating expansions. @@ -200,33 +200,16 @@ public FuzzyQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(FuzzyQuery fuzzyQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Fuzzy(fuzzyQuery); } 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) + public FuzzyQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -239,6 +222,9 @@ public FuzzyQueryDescriptor(Expression> field) private bool? TranspositionsValue { get; set; } private object ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FuzzyQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -257,6 +243,12 @@ public FuzzyQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum edit distance allowed for matching. /// @@ -354,10 +346,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TranspositionsValue.HasValue) @@ -377,17 +369,10 @@ public sealed partial class FuzzyQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal FuzzyQueryDescriptor() : base() + public FuzzyQueryDescriptor() : base() { } - public FuzzyQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } @@ -398,6 +383,9 @@ public FuzzyQueryDescriptor(Field field) private bool? TranspositionsValue { get; set; } private object ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FuzzyQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -519,10 +507,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TranspositionsValue.HasValue) 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 index 06fa0d93d7e..1ccd8c63653 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs @@ -116,9 +116,11 @@ public override void Write(Utf8JsonWriter writer, GeoBoundingBoxQuery value, Jso } [JsonConverter(typeof(GeoBoundingBoxQueryConverter))] -public sealed partial class GeoBoundingBoxQuery : SearchQuery +public sealed partial class GeoBoundingBoxQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBox { get; set; } public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } @@ -127,15 +129,14 @@ public sealed partial class GeoBoundingBoxQuery : SearchQuery /// 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; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(GeoBoundingBoxQuery geoBoundingBoxQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.GeoBoundingBox(geoBoundingBoxQuery); } public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor> @@ -147,57 +148,66 @@ public GeoBoundingBoxQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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) + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) { - IgnoreUnmappedValue = ignoreUnmapped; + BoundingBoxValue = boundingBox; return Self; } - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - QueryNameValue = queryName; + FieldValue = field; 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) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - BoundingBoxValue = boundingBox; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + /// + /// 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) { - FieldValue = field; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + 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; } @@ -248,63 +258,66 @@ public GeoBoundingBoxQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.GeoBounds BoundingBoxValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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) + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) { - IgnoreUnmappedValue = ignoreUnmapped; + BoundingBoxValue = boundingBox; return Self; } - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - QueryNameValue = queryName; + FieldValue = field; 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) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.Serverless.GeoBounds boundingBox) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - BoundingBoxValue = boundingBox; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + /// + /// 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) { - FieldValue = field; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + /// + /// 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) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } 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 index dbb8b244607..e71b7653fbe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs @@ -106,7 +106,7 @@ public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSe } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, value.Distance, options); + writer.WriteStringValue(value.Distance); if (value.DistanceType is not null) { writer.WritePropertyName("distance_type"); @@ -136,9 +136,11 @@ public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSe } [JsonConverter(typeof(GeoDistanceQueryConverter))] -public sealed partial class GeoDistanceQuery : SearchQuery +public sealed partial class GeoDistanceQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } /// @@ -157,15 +159,14 @@ public sealed partial class GeoDistanceQuery : SearchQuery /// public bool? IgnoreUnmapped { get; set; } public Elastic.Clients.Elasticsearch.Serverless.GeoLocation Location { get; set; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(GeoDistanceQuery geoDistanceQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.GeoDistance(geoDistanceQuery); } public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor> @@ -179,12 +180,15 @@ public GeoDistanceQueryDescriptor() : base() private float? BoostValue { get; set; } private string DistanceValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation LocationValue { get; set; } private string? QueryNameValue { 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoDistanceQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -209,27 +213,30 @@ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasti 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor QueryName(string? queryName) + public GeoDistanceQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Expression> field) + { + FieldValue = field; 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.
+ /// 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 GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + public GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - ValidationMethodValue = validationMethod; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -239,15 +246,18 @@ public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsea return Self; } - public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public GeoDistanceQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + /// + /// 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) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } @@ -268,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); + writer.WriteStringValue(DistanceValue); if (DistanceTypeValue is not null) { writer.WritePropertyName("distance_type"); @@ -308,12 +318,15 @@ public GeoDistanceQueryDescriptor() : base() private float? BoostValue { get; set; } private string DistanceValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.GeoLocation LocationValue { get; set; } private string? QueryNameValue { 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoDistanceQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -338,51 +351,51 @@ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.Ser 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor QueryName(string? queryName) + public GeoDistanceQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; 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) + public GeoDistanceQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) + /// + /// 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - LocationValue = location; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.Serverless.GeoLocation location) { - FieldValue = field; + LocationValue = location; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + public GeoDistanceQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + /// + /// 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) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } @@ -403,7 +416,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); + writer.WriteStringValue(DistanceValue); if (DistanceTypeValue is not null) { writer.WritePropertyName("distance_type"); 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 index 64070fb2317..8cfb6c8141b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs @@ -116,18 +116,19 @@ public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSer } [JsonConverter(typeof(GeoPolygonQueryConverter))] -public sealed partial class GeoPolygonQuery : SearchQuery +public sealed partial class GeoPolygonQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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 string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(GeoPolygonQuery geoPolygonQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.GeoPolygon(geoPolygonQuery); } public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> @@ -139,51 +140,56 @@ public GeoPolygonQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } private string? QueryNameValue { 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoPolygonQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor QueryName(string? queryName) + public GeoPolygonQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + public GeoPolygonQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - PolygonValue = polygon; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) { - FieldValue = field; + PolygonDescriptor = null; + PolygonDescriptorAction = null; + PolygonValue = polygon; return Self; } - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor descriptor) { PolygonValue = null; PolygonDescriptorAction = null; @@ -191,7 +197,7 @@ public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor d return Self; } - public GeoPolygonQueryDescriptor Polygon(Action configure) + public GeoPolygonQueryDescriptor Polygon(Action configure) { PolygonValue = null; PolygonDescriptor = null; @@ -199,32 +205,26 @@ public GeoPolygonQueryDescriptor Polygon(Action Field(Expression> field) + public GeoPolygonQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + return Self; + } + + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; 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)) + if (FieldValue is not null && PolygonValue 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); - } + JsonSerializer.Serialize(writer, PolygonValue, options); } if (BoostValue.HasValue) @@ -264,51 +264,56 @@ public GeoPolygonQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } private string? QueryNameValue { 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoPolygonQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor QueryName(string? queryName) + public GeoPolygonQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) + public GeoPolygonQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - PolygonValue = polygon; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPoints polygon) { - FieldValue = field; + PolygonDescriptor = null; + PolygonDescriptorAction = null; + PolygonValue = polygon; return Self; } - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonPointsDescriptor descriptor) { PolygonValue = null; PolygonDescriptorAction = null; @@ -316,7 +321,7 @@ public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) return Self; } - public GeoPolygonQueryDescriptor Polygon(Action configure) + public GeoPolygonQueryDescriptor Polygon(Action configure) { PolygonValue = null; PolygonDescriptor = null; @@ -324,38 +329,26 @@ public GeoPolygonQueryDescriptor Polygon(Action conf return Self; } - public GeoPolygonQueryDescriptor Field(Expression> field) + public GeoPolygonQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoPolygonQueryDescriptor Field(Expression> field) + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoValidationMethod? validationMethod) { - FieldValue = field; + ValidationMethodValue = validationMethod; 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)) + if (FieldValue is not null && PolygonValue 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); - } + JsonSerializer.Serialize(writer, PolygonValue, options); } if (BoostValue.HasValue) 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 index 690fe97a5fc..a3996855ce3 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasChildQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class HasChildQuery : SearchQuery +public sealed partial class HasChildQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,6 +64,8 @@ public sealed partial class HasChildQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates how scores for matching child documents affect the root parent document’s relevance score. @@ -76,9 +79,7 @@ public sealed partial class HasChildQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(HasChildQuery hasChildQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.HasChild(hasChildQuery); } public sealed partial class HasChildQueryDescriptor : SerializableDescriptor> @@ -92,17 +93,20 @@ public HasChildQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private int? MinChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } private string TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasChildQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -129,7 +133,7 @@ public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearc return Self; } - public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -137,7 +141,7 @@ public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescrip return Self; } - public HasChildQueryDescriptor InnerHits(Action> configure) + public HasChildQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -174,7 +178,7 @@ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Se return Self; } - public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -182,7 +186,7 @@ public HasChildQueryDescriptor Query(QueryDescriptor descr return Self; } - public HasChildQueryDescriptor Query(Action> configure) + public HasChildQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -237,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -265,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -286,7 +290,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); writer.WriteEndObject(); } } @@ -302,17 +306,20 @@ public HasChildQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private int? MinChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } private string TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasChildQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -339,7 +346,7 @@ public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverles return Self; } - public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -347,7 +354,7 @@ public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descrip return Self; } - public HasChildQueryDescriptor InnerHits(Action configure) + public HasChildQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -384,7 +391,7 @@ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Qu return Self; } - public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -392,7 +399,7 @@ public HasChildQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public HasChildQueryDescriptor Query(Action configure) + public HasChildQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -447,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -475,7 +482,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -496,7 +503,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); 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 index 92d2f737add..407bc8dc4a7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/HasParentQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class HasParentQuery : SearchQuery +public sealed partial class HasParentQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -57,6 +58,8 @@ public sealed partial class HasParentQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates whether the relevance score of a matching parent document is aggregated into its child documents. @@ -64,9 +67,7 @@ public sealed partial class HasParentQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(HasParentQuery hasParentQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.HasParent(hasParentQuery); } public sealed partial class HasParentQueryDescriptor : SerializableDescriptor> @@ -80,15 +81,18 @@ public HasParentQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private string ParentTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private bool? ScoreValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasParentQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -115,7 +119,7 @@ public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsear return Self; } - public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -123,7 +127,7 @@ public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescri return Self; } - public HasParentQueryDescriptor InnerHits(Action> configure) + public HasParentQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -151,7 +155,7 @@ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.S return Self; } - public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -159,7 +163,7 @@ public HasParentQueryDescriptor Query(QueryDescriptor desc return Self; } - public HasParentQueryDescriptor Query(Action> configure) + public HasParentQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -205,7 +209,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -214,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("parent_type"); - JsonSerializer.Serialize(writer, ParentTypeValue, options); + writer.WriteStringValue(ParentTypeValue); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -223,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -258,15 +262,18 @@ public HasParentQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private string ParentTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private bool? ScoreValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasParentQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -293,7 +300,7 @@ public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverle return Self; } - public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -301,7 +308,7 @@ public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descri return Self; } - public HasParentQueryDescriptor InnerHits(Action configure) + public HasParentQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -329,7 +336,7 @@ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -337,7 +344,7 @@ public HasParentQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public HasParentQueryDescriptor Query(Action configure) + public HasParentQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -383,7 +390,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -392,7 +399,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("parent_type"); - JsonSerializer.Serialize(writer, ParentTypeValue, options); + writer.WriteStringValue(ParentTypeValue); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -401,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { 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 index f9bc940abe6..4dd37e79e77 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IdsQuery.g.cs @@ -27,12 +27,15 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class IdsQuery : SearchQuery +public sealed partial class IdsQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// An array of document IDs. @@ -40,9 +43,7 @@ public sealed partial class IdsQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(IdsQuery idsQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Ids(idsQuery); } public sealed partial class IdsQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public IdsQueryDescriptor() : base() private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Ids? ValuesValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public IdsQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index e1fb71f65db..8f56bc03d9a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Intervals.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -51,6 +52,18 @@ internal Intervals(string variantName, object variant) 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class IntervalsConverter : JsonConverter @@ -62,63 +75,76 @@ public override Intervals Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "any_of") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "all_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fuzzy") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "any_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "fuzzy") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wildcard") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); + 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 'Intervals' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Intervals(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Intervals value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -179,37 +205,35 @@ private IntervalsDescriptor Set(object variant, string variantName) 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"); + public IntervalsDescriptor AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -245,43 +269,35 @@ private IntervalsDescriptor Set(object variant, string variantName) 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"); + public IntervalsDescriptor AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index b162b7de11d..12aa0393570 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs @@ -52,6 +52,9 @@ public sealed partial class IntervalsAllOf ///
[JsonInclude, JsonPropertyName("ordered")] public bool? Ordered { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsAllOf intervalsAllOf) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.AllOf(intervalsAllOf); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsAllOf intervalsAllOf) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.AllOf(intervalsAllOf); } public sealed partial class IntervalsAllOfDescriptor : SerializableDescriptor> @@ -63,12 +66,12 @@ public IntervalsAllOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } 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.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } @@ -83,7 +86,7 @@ public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -91,7 +94,7 @@ public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsAllOfDescriptor Filter(Action configure) + public IntervalsAllOfDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -111,7 +114,7 @@ public IntervalsAllOfDescriptor Intervals(ICollection Intervals(IntervalsDescriptor descriptor) + public IntervalsAllOfDescriptor Intervals(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor descriptor) { IntervalsValue = null; IntervalsDescriptorAction = null; @@ -120,7 +123,7 @@ public IntervalsAllOfDescriptor Intervals(IntervalsDescriptor Intervals(Action> configure) + public IntervalsAllOfDescriptor Intervals(Action> configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -129,7 +132,7 @@ public IntervalsAllOfDescriptor Intervals(Action Intervals(params Action>[] configure) + public IntervalsAllOfDescriptor Intervals(params Action>[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -167,7 +170,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -186,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -195,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); @@ -231,12 +234,12 @@ public IntervalsAllOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } 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.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } @@ -251,7 +254,7 @@ public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -259,7 +262,7 @@ public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsAllOfDescriptor Filter(Action configure) + public IntervalsAllOfDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -279,7 +282,7 @@ public IntervalsAllOfDescriptor Intervals(ICollection configure) + public IntervalsAllOfDescriptor Intervals(Action configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -297,7 +300,7 @@ public IntervalsAllOfDescriptor Intervals(Action configure) return Self; } - public IntervalsAllOfDescriptor Intervals(params Action[] configure) + public IntervalsAllOfDescriptor Intervals(params Action[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -335,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -354,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -363,7 +366,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); 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 index 9968532d45f..5339d45c91f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs @@ -40,6 +40,9 @@ public sealed partial class IntervalsAnyOf ///
[JsonInclude, JsonPropertyName("intervals")] public ICollection Intervals { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsAnyOf intervalsAnyOf) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.AnyOf(intervalsAnyOf); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsAnyOf intervalsAnyOf) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.AnyOf(intervalsAnyOf); } public sealed partial class IntervalsAnyOfDescriptor : SerializableDescriptor> @@ -51,12 +54,12 @@ public IntervalsAnyOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } 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.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } /// /// Rule used to filter returned intervals. @@ -69,7 +72,7 @@ public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -77,7 +80,7 @@ public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsAnyOfDescriptor Filter(Action configure) + public IntervalsAnyOfDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -97,7 +100,7 @@ public IntervalsAnyOfDescriptor Intervals(ICollection Intervals(IntervalsDescriptor descriptor) + public IntervalsAnyOfDescriptor Intervals(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor descriptor) { IntervalsValue = null; IntervalsDescriptorAction = null; @@ -106,7 +109,7 @@ public IntervalsAnyOfDescriptor Intervals(IntervalsDescriptor Intervals(Action> configure) + public IntervalsAnyOfDescriptor Intervals(Action> configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -115,7 +118,7 @@ public IntervalsAnyOfDescriptor Intervals(Action Intervals(params Action>[] configure) + public IntervalsAnyOfDescriptor Intervals(params Action>[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -135,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -154,7 +157,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -163,7 +166,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); @@ -187,12 +190,12 @@ public IntervalsAnyOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } 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.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } /// /// Rule used to filter returned intervals. @@ -205,7 +208,7 @@ public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -213,7 +216,7 @@ public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsAnyOfDescriptor Filter(Action configure) + public IntervalsAnyOfDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -233,7 +236,7 @@ public IntervalsAnyOfDescriptor Intervals(ICollection configure) + public IntervalsAnyOfDescriptor Intervals(Action configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -251,7 +254,7 @@ public IntervalsAnyOfDescriptor Intervals(Action configure) return Self; } - public IntervalsAnyOfDescriptor Intervals(params Action[] configure) + public IntervalsAnyOfDescriptor Intervals(params Action[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -271,7 +274,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -290,7 +293,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -299,7 +302,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); 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 index e2463371437..c60292064fe 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFilter.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -44,6 +45,28 @@ internal IntervalsFilter(string variantName, object variant) internal object Variant { get; } internal string VariantName { get; } + + public static IntervalsFilter After(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("after", intervalsContainer); + public static IntervalsFilter Before(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("before", intervalsContainer); + public static IntervalsFilter ContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("contained_by", intervalsContainer); + public static IntervalsFilter Containing(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("containing", intervalsContainer); + public static IntervalsFilter NotContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_contained_by", intervalsContainer); + public static IntervalsFilter NotContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_containing", intervalsContainer); + public static IntervalsFilter NotOverlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_overlapping", intervalsContainer); + public static IntervalsFilter Overlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("overlapping", intervalsContainer); + public static IntervalsFilter Script(Elastic.Clients.Elasticsearch.Serverless.Script script) => new IntervalsFilter("script", script); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class IntervalsFilterConverter : JsonConverter @@ -55,23 +78,129 @@ public override IntervalsFilter Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); + 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 == "after") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "before") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "contained_by") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_contained_by") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_overlapping") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "overlapping") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IntervalsFilter' from the response."); } - var propertyName = reader.GetString(); reader.Read(); - throw new JsonException(); + var result = new IntervalsFilter(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, IntervalsFilter value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "after": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "before": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "contained_by": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "not_contained_by": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "not_containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "not_overlapping": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "overlapping": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals)value.Variant, options); + break; + case "script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.Script)value.Variant, options); + break; + } } writer.WriteEndObject(); @@ -109,24 +238,40 @@ private IntervalsFilterDescriptor Set(object variant, string variantN return Self; } + public IntervalsFilterDescriptor After(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "after"); + public IntervalsFilterDescriptor After(Action> configure) => Set(configure, "after"); + public IntervalsFilterDescriptor Before(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "before"); + public IntervalsFilterDescriptor Before(Action> configure) => Set(configure, "before"); + public IntervalsFilterDescriptor ContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "contained_by"); + public IntervalsFilterDescriptor ContainedBy(Action> configure) => Set(configure, "contained_by"); + public IntervalsFilterDescriptor Containing(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "containing"); + public IntervalsFilterDescriptor Containing(Action> configure) => Set(configure, "containing"); + public IntervalsFilterDescriptor NotContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_contained_by"); + public IntervalsFilterDescriptor NotContainedBy(Action> configure) => Set(configure, "not_contained_by"); + public IntervalsFilterDescriptor NotContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_containing"); + public IntervalsFilterDescriptor NotContaining(Action> configure) => Set(configure, "not_containing"); + public IntervalsFilterDescriptor NotOverlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_overlapping"); + public IntervalsFilterDescriptor NotOverlapping(Action> configure) => Set(configure, "not_overlapping"); + public IntervalsFilterDescriptor Overlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "overlapping"); + public IntervalsFilterDescriptor Overlapping(Action> configure) => Set(configure, "overlapping"); + public IntervalsFilterDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) => Set(script, "script"); + 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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -162,24 +307,40 @@ private IntervalsFilterDescriptor Set(object variant, string variantName) return Self; } + public IntervalsFilterDescriptor After(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "after"); + public IntervalsFilterDescriptor After(Action configure) => Set(configure, "after"); + public IntervalsFilterDescriptor Before(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "before"); + public IntervalsFilterDescriptor Before(Action configure) => Set(configure, "before"); + public IntervalsFilterDescriptor ContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "contained_by"); + public IntervalsFilterDescriptor ContainedBy(Action configure) => Set(configure, "contained_by"); + public IntervalsFilterDescriptor Containing(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "containing"); + public IntervalsFilterDescriptor Containing(Action configure) => Set(configure, "containing"); + public IntervalsFilterDescriptor NotContainedBy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_contained_by"); + public IntervalsFilterDescriptor NotContainedBy(Action configure) => Set(configure, "not_contained_by"); + public IntervalsFilterDescriptor NotContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_containing"); + public IntervalsFilterDescriptor NotContaining(Action configure) => Set(configure, "not_containing"); + public IntervalsFilterDescriptor NotOverlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_overlapping"); + public IntervalsFilterDescriptor NotOverlapping(Action configure) => Set(configure, "not_overlapping"); + public IntervalsFilterDescriptor Overlapping(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "overlapping"); + public IntervalsFilterDescriptor Overlapping(Action configure) => Set(configure, "overlapping"); + public IntervalsFilterDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.Script script) => Set(script, "script"); + 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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index 27f900fcf5f..8376943d820 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs @@ -64,6 +64,9 @@ public sealed partial class IntervalsFuzzy /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsFuzzy intervalsFuzzy) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.Fuzzy(intervalsFuzzy); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsFuzzy intervalsFuzzy) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.Fuzzy(intervalsFuzzy); } public sealed partial class IntervalsFuzzyDescriptor : SerializableDescriptor> @@ -144,6 +147,15 @@ public IntervalsFuzzyDescriptor UseField(Expression + /// 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(); 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 index 4a095aa4dff..61c710c01bd 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsMatch.g.cs @@ -64,6 +64,9 @@ public sealed partial class IntervalsMatch /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsMatch intervalsMatch) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.Match(intervalsMatch); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsMatch intervalsMatch) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.Match(intervalsMatch); } public sealed partial class IntervalsMatchDescriptor : SerializableDescriptor> @@ -76,8 +79,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } private string QueryValue { get; set; } @@ -103,7 +106,7 @@ public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -111,7 +114,7 @@ public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsMatchDescriptor Filter(Action configure) + public IntervalsMatchDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -164,6 +167,15 @@ public IntervalsMatchDescriptor UseField(Expression + /// 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(); @@ -181,7 +193,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -223,8 +235,8 @@ 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } private string QueryValue { get; set; } @@ -250,7 +262,7 @@ public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -258,7 +270,7 @@ public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsMatchDescriptor Filter(Action configure) + public IntervalsMatchDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -337,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { 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 index 34e8838333c..c68c1da0c37 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs @@ -46,6 +46,9 @@ public sealed partial class IntervalsPrefix /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsPrefix intervalsPrefix) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.Prefix(intervalsPrefix); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsPrefix intervalsPrefix) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.Prefix(intervalsPrefix); } public sealed partial class IntervalsPrefixDescriptor : SerializableDescriptor> @@ -96,6 +99,15 @@ public IntervalsPrefixDescriptor UseField(Expression + /// 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(); 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 index 115e8522daf..47a9abda774 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -28,11 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; [JsonConverter(typeof(IntervalsQueryConverter))] -public sealed partial class IntervalsQuery : SearchQuery +public sealed partial class IntervalsQuery { - internal object Variant { get; } - - internal IntervalsQuery(Field field, string variantName, object variant) + internal IntervalsQuery(string variantName, object variant) { if (variantName is null) throw new ArgumentNullException(nameof(variantName)); @@ -40,32 +39,39 @@ internal IntervalsQuery(Field field, string variantName, object variant) 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 object Variant { get; } 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); + public static IntervalsQuery AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => new IntervalsQuery("all_of", intervalsAllOf); + public static IntervalsQuery AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => new IntervalsQuery("any_of", intervalsAnyOf); + public static IntervalsQuery Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => new IntervalsQuery("fuzzy", intervalsFuzzy); + public static IntervalsQuery Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => new IntervalsQuery("match", intervalsMatch); + public static IntervalsQuery Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => new IntervalsQuery("prefix", intervalsPrefix); + public static IntervalsQuery Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsWildcard intervalsWildcard) => new IntervalsQuery("wildcard", intervalsWildcard); - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } - [JsonInclude, JsonPropertyName("field")] - public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(IntervalsQuery intervalsQuery) => QueryDsl.Query.Intervals(intervalsQuery); + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("intervals", this); + return false; + } } internal sealed partial class IntervalsQueryConverter : JsonConverter @@ -77,18 +83,10 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver 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; + string? queryNameValue = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -103,15 +101,15 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver var propertyName = reader.GetString(); reader.Read(); - if (propertyName == "_name") + if (propertyName == "boost") { - nameValue = JsonSerializer.Deserialize(ref reader, options); + boostValue = JsonSerializer.Deserialize(ref reader, options); continue; } - if (propertyName == "boost") + if (propertyName == "_name") { - boostValue = JsonSerializer.Deserialize(ref reader, options); + queryNameValue = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -161,65 +159,54 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver } reader.Read(); - var result = new IntervalsQuery(fieldName, variantNameValue, variantValue); - result.QueryName = nameValue; + var result = new IntervalsQuery(variantNameValue, variantValue); result.Boost = boostValue; + result.QueryName = queryNameValue; 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(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) { - 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; - } + 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."); + writer.WriteEndObject(); } } @@ -227,17 +214,10 @@ public sealed partial class IntervalsQueryDescriptor : SerializableDe { internal IntervalsQueryDescriptor(Action> configure) => configure.Invoke(this); - internal IntervalsQueryDescriptor() : base() + public 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; } @@ -262,50 +242,38 @@ private IntervalsQueryDescriptor Set(object variant, string variantNa } private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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 QueryName(string? queryName) { QueryNameValue = queryName; 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"); + public IntervalsQueryDescriptor AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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 (BoostValue.HasValue) { @@ -326,7 +294,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); writer.WriteEndObject(); - writer.WriteEndObject(); return; } @@ -334,7 +301,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WriteEndObject(); - writer.WriteEndObject(); } } @@ -342,17 +308,10 @@ public sealed partial class IntervalsQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal IntervalsQueryDescriptor() : base() + public 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; } @@ -377,62 +336,38 @@ private IntervalsQueryDescriptor Set(object variant, string variantName) } private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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 QueryName(string? queryName) { QueryNameValue = queryName; 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"); + public IntervalsQueryDescriptor AllOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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 (BoostValue.HasValue) { @@ -453,7 +388,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); writer.WriteEndObject(); - writer.WriteEndObject(); return; } @@ -461,6 +395,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } 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 index dc2f2fbfaae..a6433dfe037 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs @@ -46,6 +46,9 @@ public sealed partial class IntervalsWildcard /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Serverless.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals(IntervalsWildcard intervalsWildcard) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Intervals.Wildcard(intervalsWildcard); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery(IntervalsWildcard intervalsWildcard) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery.Wildcard(intervalsWildcard); } public sealed partial class IntervalsWildcardDescriptor : SerializableDescriptor> @@ -96,6 +99,15 @@ public IntervalsWildcardDescriptor UseField(Expression + /// 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(); 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 index 8c57686c5b6..caec2fa8784 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Like.g.cs @@ -30,13 +30,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; +/// +/// Text that we want similar documents for or a lookup to a document's field for the text. +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Like : Union { - public Like(string text) : base(text) + public Like(string Text) : base(Text) { } - public Like(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.LikeDocument document) : base(document) + 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 index 1be042da166..4b60fca4ae1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/LikeDocument.g.cs @@ -29,6 +29,14 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; public sealed partial class LikeDocument { + /// + /// A document not present in the index. + /// + [JsonInclude, JsonPropertyName("doc")] + public object? Doc { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + /// /// ID of a document. /// @@ -40,14 +48,6 @@ public sealed partial class LikeDocument /// [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")] @@ -67,7 +67,7 @@ public LikeDocumentDescriptor() : base() } private object? DocValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } @@ -84,7 +84,7 @@ public LikeDocumentDescriptor Doc(object? doc) return Self; } - public LikeDocumentDescriptor Fields(Fields? fields) + public LikeDocumentDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -171,10 +171,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -196,7 +196,7 @@ public LikeDocumentDescriptor() : base() } private object? DocValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } @@ -213,7 +213,7 @@ public LikeDocumentDescriptor Doc(object? doc) return Self; } - public LikeDocumentDescriptor Fields(Fields? fields) + public LikeDocumentDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -300,10 +300,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) 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 index 1fc62e8e4be..784586fbd0b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchAllQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class MatchAllQuery : SearchQuery +public sealed partial class MatchAllQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchAllQuery matchAllQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MatchAll(matchAllQuery); } public sealed partial class MatchAllQueryDescriptor : SerializableDescriptor @@ -50,6 +51,9 @@ public MatchAllQueryDescriptor() : base() private float? BoostValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchAllQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index bfbac530ec8..1c17ad45ddc 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs @@ -118,99 +118,98 @@ public override void Write(Utf8JsonWriter writer, MatchBoolPrefixQuery value, Js { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.Fuzziness is not null) - { - writer.WritePropertyName("fuzziness"); - JsonSerializer.Serialize(writer, value.Fuzziness, options); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.FuzzyRewrite is not null) - { - writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.FuzzyTranspositions.HasValue) - { - writer.WritePropertyName("fuzzy_transpositions"); - writer.WriteBooleanValue(value.FuzzyTranspositions.Value); - } + if (!string.IsNullOrEmpty(value.FuzzyRewrite)) + { + writer.WritePropertyName("fuzzy_rewrite"); + writer.WriteStringValue(value.FuzzyRewrite); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.FuzzyTranspositions.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(value.FuzzyTranspositions.Value); + } - if (value.MinimumShouldMatch is not null) - { - writer.WritePropertyName("minimum_should_match"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Operator is not null) - { - writer.WritePropertyName("operator"); - JsonSerializer.Serialize(writer, value.Operator, options); - } + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchBoolPrefixQueryConverter))] -public sealed partial class MatchBoolPrefixQuery : SearchQuery +public sealed partial class MatchBoolPrefixQuery { - public MatchBoolPrefixQuery(Field field) + public MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.Serverless.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Maximum edit distance allowed for matching.
Can be applied to the term subqueries constructed for all terms but the final term.
@@ -251,35 +250,19 @@ public MatchBoolPrefixQuery(Field field) /// 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); + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_bool_prefix", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchBoolPrefixQuery matchBoolPrefixQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MatchBoolPrefix(matchBoolPrefixQuery); } public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescriptor> { internal MatchBoolPrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchBoolPrefixQueryDescriptor() : base() + public 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? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -302,6 +285,9 @@ public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchBoolPrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -320,6 +306,12 @@ public MatchBoolPrefixQueryDescriptor Field(Expression 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.
///
@@ -368,9 +360,9 @@ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clie /// /// 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) + public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -423,10 +415,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -476,17 +468,10 @@ public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescrip { internal MatchBoolPrefixQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchBoolPrefixQueryDescriptor() : base() + public MatchBoolPrefixQueryDescriptor() : base() { } - public MatchBoolPrefixQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -509,6 +494,9 @@ public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchBoolPrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -581,9 +569,9 @@ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elastic /// /// 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) + public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -636,10 +624,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) 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 index c50371fde72..d84946b65b9 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class MatchNoneQuery : SearchQuery +public sealed partial class MatchNoneQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchNoneQuery matchNoneQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MatchNone(matchNoneQuery); } public sealed partial class MatchNoneQueryDescriptor : SerializableDescriptor @@ -50,6 +51,9 @@ public MatchNoneQueryDescriptor() : base() private float? BoostValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchNoneQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index 777d87b202c..cb67ab91328 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs @@ -94,75 +94,74 @@ public override void Write(Utf8JsonWriter writer, MatchPhrasePrefixQuery value, { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Slop.HasValue) - { - writer.WritePropertyName("slop"); - writer.WriteNumberValue(value.Slop.Value); - } + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchPhrasePrefixQueryConverter))] -public sealed partial class MatchPhrasePrefixQuery : SearchQuery +public sealed partial class MatchPhrasePrefixQuery { - public MatchPhrasePrefixQuery(Field field) + public MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.Serverless.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Maximum number of terms to which the last provided term of the query value will expand. @@ -173,6 +172,7 @@ public MatchPhrasePrefixQuery(Field field) /// Text you wish to find in the provided field. /// public string Query { get; set; } + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -183,33 +183,16 @@ public MatchPhrasePrefixQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MatchPhrasePrefix(matchPhrasePrefixQuery); } public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescriptor> { internal MatchPhrasePrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchPhrasePrefixQueryDescriptor() : base() - { - } - - public MatchPhrasePrefixQueryDescriptor(Field field) + public MatchPhrasePrefixQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -230,6 +213,9 @@ public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhrasePrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -248,6 +234,12 @@ public MatchPhrasePrefixQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum number of terms to which the last provided term of the query value will expand. /// @@ -344,17 +336,10 @@ public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescr { internal MatchPhrasePrefixQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchPhrasePrefixQueryDescriptor() : base() + public MatchPhrasePrefixQueryDescriptor() : base() { } - public MatchPhrasePrefixQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -373,6 +358,9 @@ public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhrasePrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index e660587bfa3..5f170d6376a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs @@ -88,74 +88,74 @@ public override void Write(Utf8JsonWriter writer, MatchPhraseQuery value, JsonSe { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - 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.Slop.HasValue) - { - writer.WritePropertyName("slop"); - writer.WriteNumberValue(value.Slop.Value); - } + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchPhraseQueryConverter))] -public sealed partial class MatchPhraseQuery : SearchQuery +public sealed partial class MatchPhraseQuery { - public MatchPhraseQuery(Field field) + public MatchPhraseQuery(Elastic.Clients.Elasticsearch.Serverless.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Query terms that are analyzed and turned into a phrase query. /// public string Query { get; set; } + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -166,33 +166,16 @@ public MatchPhraseQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchPhraseQuery matchPhraseQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MatchPhrase(matchPhraseQuery); } public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor> { internal MatchPhraseQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchPhraseQueryDescriptor() : base() - { - } - - public MatchPhraseQueryDescriptor(Field field) + public MatchPhraseQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -212,6 +195,9 @@ public MatchPhraseQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhraseQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -230,6 +216,12 @@ public MatchPhraseQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Query terms that are analyzed and turned into a phrase query. /// @@ -311,17 +303,10 @@ public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor< { internal MatchPhraseQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchPhraseQueryDescriptor() : base() + public MatchPhraseQueryDescriptor() : base() { } - public MatchPhraseQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -339,6 +324,9 @@ public MatchPhraseQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhraseQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index c6886f31af9..8441e796b25 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MatchQuery.g.cs @@ -110,7 +110,7 @@ public override MatchQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J if (property == "query") { - variant.Query = JsonSerializer.Deserialize(ref reader, options); + variant.Query = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -136,112 +136,106 @@ public override void Write(Utf8JsonWriter writer, MatchQuery value, JsonSerializ { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } + if (value.AutoGenerateSynonymsPhraseQuery.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(value.AutoGenerateSynonymsPhraseQuery.Value); + } - if (value.Fuzziness is not null) - { - writer.WritePropertyName("fuzziness"); - JsonSerializer.Serialize(writer, value.Fuzziness, options); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.FuzzyRewrite is not null) - { - writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.FuzzyTranspositions.HasValue) - { - writer.WritePropertyName("fuzzy_transpositions"); - writer.WriteBooleanValue(value.FuzzyTranspositions.Value); - } + if (!string.IsNullOrEmpty(value.FuzzyRewrite)) + { + writer.WritePropertyName("fuzzy_rewrite"); + writer.WriteStringValue(value.FuzzyRewrite); + } - if (value.Lenient.HasValue) - { - writer.WritePropertyName("lenient"); - writer.WriteBooleanValue(value.Lenient.Value); - } + 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.Lenient.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(value.Lenient.Value); + } - if (value.MinimumShouldMatch is not null) - { - writer.WritePropertyName("minimum_should_match"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Operator is not null) - { - writer.WritePropertyName("operator"); - JsonSerializer.Serialize(writer, value.Operator, options); - } + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } - writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, value.Query, options); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchQueryConverter))] -public sealed partial class MatchQuery : SearchQuery +public sealed partial class MatchQuery { - public MatchQuery(Field field) + public MatchQuery(Elastic.Clients.Elasticsearch.Serverless.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. /// @@ -251,7 +245,12 @@ public MatchQuery(Field field) /// If `true`, match phrase queries are automatically created for multi-term synonyms. /// public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Maximum edit distance allowed for matching. @@ -296,39 +295,23 @@ public MatchQuery(Field field) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public string Query { get; set; } + public object Query { get; set; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MatchQuery matchQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Match(matchQuery); } public sealed partial class MatchQueryDescriptor : SerializableDescriptor> { internal MatchQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchQueryDescriptor() : base() - { - } - - public MatchQueryDescriptor(Field field) + public MatchQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -343,7 +326,7 @@ public MatchQueryDescriptor(Expression> field) 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 object QueryValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } @@ -365,6 +348,9 @@ public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? aut return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -383,6 +369,12 @@ public MatchQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum edit distance allowed for matching. /// @@ -440,9 +432,9 @@ public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasti /// /// Boolean logic used to interpret text in the query value. /// - public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -458,7 +450,7 @@ public MatchQueryDescriptor PrefixLength(int? prefixLength) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public MatchQueryDescriptor Query(string query) + public MatchQueryDescriptor Query(object query) { QueryValue = query; return Self; @@ -510,10 +502,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -575,17 +567,10 @@ public sealed partial class MatchQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal MatchQueryDescriptor() : base() + public MatchQueryDescriptor() : base() { } - public MatchQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } @@ -598,7 +583,7 @@ public MatchQueryDescriptor(Field field) 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 object QueryValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } @@ -620,6 +605,9 @@ public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSy return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -701,9 +689,9 @@ public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Ser /// /// Boolean logic used to interpret text in the query value. /// - public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -719,7 +707,7 @@ public MatchQueryDescriptor PrefixLength(int? prefixLength) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public MatchQueryDescriptor Query(string query) + public MatchQueryDescriptor Query(object query) { QueryValue = query; return Self; @@ -771,10 +759,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) 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 index a84a8883d6b..6b40066fa50 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class MoreLikeThisQuery : SearchQuery +public sealed partial class MoreLikeThisQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -56,7 +57,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery /// 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; } + public ICollection? Fields { get; set; } /// /// Specifies whether the input documents should also be included in the search results returned. @@ -95,6 +96,12 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [JsonInclude, JsonPropertyName("min_doc_freq")] public int? MinDocFreq { 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; } + /// /// The minimum term frequency below which the terms are ignored from the input document. /// @@ -107,17 +114,13 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [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("_name")] + public string? QueryName { get; set; } [JsonInclude, JsonPropertyName("routing")] public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get; set; } @@ -125,7 +128,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery /// An array of stop words.
Any word in this set is ignored.
///
[JsonInclude, JsonPropertyName("stop_words")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? StopWords { get; set; } /// @@ -139,9 +142,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MoreLikeThisQuery moreLikeThisQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MoreLikeThis(moreLikeThisQuery); } public sealed partial class MoreLikeThisQueryDescriptor : SerializableDescriptor> @@ -156,7 +157,7 @@ public MoreLikeThisQueryDescriptor() : base() private float? BoostValue { get; set; } private double? BoostTermsValue { get; set; } private bool? FailOnUnsupportedFieldValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private bool? IncludeValue { get; set; } private ICollection LikeValue { get; set; } private int? MaxDocFreqValue { get; set; } @@ -183,6 +184,9 @@ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MoreLikeThisQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -210,7 +214,7 @@ public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failO /// /// 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) + public MoreLikeThisQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -461,10 +465,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -489,7 +493,7 @@ public MoreLikeThisQueryDescriptor() : base() private float? BoostValue { get; set; } private double? BoostTermsValue { get; set; } private bool? FailOnUnsupportedFieldValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private bool? IncludeValue { get; set; } private ICollection LikeValue { get; set; } private int? MaxDocFreqValue { get; set; } @@ -516,6 +520,9 @@ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MoreLikeThisQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -543,7 +550,7 @@ public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failOnUnsupporte /// /// 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) + public MoreLikeThisQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -794,10 +801,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) 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 index a13f976cf71..f196efdf9bf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs @@ -27,11 +27,8 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class MultiMatchQuery : SearchQuery +public sealed partial class MultiMatchQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } - /// /// Analyzer used to convert the text in the query value into tokens. /// @@ -43,6 +40,10 @@ public sealed partial class MultiMatchQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -105,6 +106,8 @@ public sealed partial class MultiMatchQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -130,9 +133,7 @@ public sealed partial class MultiMatchQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(MultiMatchQuery multiMatchQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.MultiMatch(multiMatchQuery); } public sealed partial class MultiMatchQueryDescriptor : SerializableDescriptor> @@ -180,6 +181,9 @@ public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MultiMatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -252,9 +256,9 @@ public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.E /// /// Boolean logic used to interpret text in the query value. /// - public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -351,10 +355,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -474,6 +478,9 @@ public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGener return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MultiMatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -546,9 +553,9 @@ public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearc /// /// Boolean logic used to interpret text in the query value. /// - public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? op) + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -645,10 +652,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) 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 index d3854f14b57..c707efc067d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NestedQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class NestedQuery : SearchQuery +public sealed partial class NestedQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -57,6 +58,8 @@ public sealed partial class NestedQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// How scores for matching child objects affect the root parent document’s relevance score. @@ -64,9 +67,7 @@ public sealed partial class NestedQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(NestedQuery nestedQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Nested(nestedQuery); } public sealed partial class NestedQueryDescriptor : SerializableDescriptor> @@ -80,15 +81,18 @@ public NestedQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NestedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -115,7 +119,7 @@ public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch. return Self; } - public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -123,7 +127,7 @@ public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescripto return Self; } - public NestedQueryDescriptor InnerHits(Action> configure) + public NestedQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -149,6 +153,15 @@ public NestedQueryDescriptor Path(Expression + /// Path to the nested object you wish to search. + ///
+ public NestedQueryDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + /// /// Query you wish to run on nested objects in the path. /// @@ -160,7 +173,7 @@ public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serv return Self; } - public NestedQueryDescriptor Query(QueryDescriptor descriptor) + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -168,7 +181,7 @@ public NestedQueryDescriptor Query(QueryDescriptor descrip return Self; } - public NestedQueryDescriptor Query(Action> configure) + public NestedQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -214,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -232,7 +245,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -267,15 +280,18 @@ public NestedQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field PathValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NestedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -302,7 +318,7 @@ public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless. return Self; } - public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -310,7 +326,7 @@ public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descripto return Self; } - public NestedQueryDescriptor InnerHits(Action configure) + public NestedQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -356,7 +372,7 @@ public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.Quer return Self; } - public NestedQueryDescriptor Query(QueryDescriptor descriptor) + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -364,7 +380,7 @@ public NestedQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public NestedQueryDescriptor Query(Action configure) + public NestedQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -410,7 +426,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -428,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { 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 index aad9c272ab4..96ae49d4941 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -106,86 +106,85 @@ public override void Write(Utf8JsonWriter writer, NumberRangeQuery value, JsonSe { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.From.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(value.From.Value); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.Gt.HasValue) - { - writer.WritePropertyName("gt"); - writer.WriteNumberValue(value.Gt.Value); - } + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } - if (value.Gte.HasValue) - { - writer.WritePropertyName("gte"); - writer.WriteNumberValue(value.Gte.Value); - } + if (value.Gt.HasValue) + { + writer.WritePropertyName("gt"); + writer.WriteNumberValue(value.Gt.Value); + } - if (value.Lt.HasValue) - { - writer.WritePropertyName("lt"); - writer.WriteNumberValue(value.Lt.Value); - } + if (value.Gte.HasValue) + { + writer.WritePropertyName("gte"); + writer.WriteNumberValue(value.Gte.Value); + } - if (value.Lte.HasValue) - { - writer.WritePropertyName("lte"); - writer.WriteNumberValue(value.Lte.Value); - } + if (value.Lt.HasValue) + { + writer.WritePropertyName("lt"); + writer.WriteNumberValue(value.Lt.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.To.HasValue) - { - writer.WritePropertyName("to"); - writer.WriteNumberValue(value.To.Value); - } + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.To.HasValue) + { + writer.WritePropertyName("to"); + writer.WriteNumberValue(value.To.Value); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(NumberRangeQueryConverter))] -public sealed partial class NumberRangeQuery : RangeQuery +public sealed partial class NumberRangeQuery { - public NumberRangeQuery(Field field) + public NumberRangeQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } public double? From { get; set; } /// @@ -207,37 +206,23 @@ public NumberRangeQuery(Field field) /// Less than or equal to. /// public double? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// 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() : 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 float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private double? FromValue { get; set; } @@ -249,6 +234,9 @@ public NumberRangeQueryDescriptor(Expression> field) private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } private double? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NumberRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -267,6 +255,12 @@ public NumberRangeQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public NumberRangeQueryDescriptor From(double? from) { FromValue = from; @@ -315,6 +309,9 @@ public NumberRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -397,17 +394,10 @@ public sealed partial class NumberRangeQueryDescriptor : SerializableDescriptor< { internal NumberRangeQueryDescriptor(Action configure) => configure.Invoke(this); - internal NumberRangeQueryDescriptor() : base() + public NumberRangeQueryDescriptor() : base() { } - public NumberRangeQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private double? FromValue { get; set; } @@ -419,6 +409,9 @@ public NumberRangeQueryDescriptor(Field field) private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? RelationValue { get; set; } private double? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NumberRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -491,6 +484,9 @@ public NumberRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeRelation? relation) { RelationValue = relation; 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 index c1db6201046..a3df1e1c0f2 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ParentIdQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class ParentIdQuery : SearchQuery +public sealed partial class ParentIdQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class ParentIdQuery : SearchQuery /// [JsonInclude, JsonPropertyName("ignore_unmapped")] public bool? IgnoreUnmapped { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Name of the child relationship mapped for the `join` field. @@ -52,9 +55,7 @@ public sealed partial class ParentIdQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(ParentIdQuery parentIdQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.ParentId(parentIdQuery); } public sealed partial class ParentIdQueryDescriptor : SerializableDescriptor @@ -71,6 +72,9 @@ public ParentIdQueryDescriptor() : base() private string? QueryNameValue { get; set; } private string? TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ParentIdQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -137,10 +141,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (TypeValue is not null) + if (!string.IsNullOrEmpty(TypeValue)) { writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); 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 index df3aa5ecbb1..bc43533a9cf 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PercolateQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class PercolateQuery : SearchQuery +public sealed partial class PercolateQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -75,6 +76,8 @@ public sealed partial class PercolateQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("preference")] public string? Preference { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Routing used to fetch document to percolate. @@ -88,9 +91,7 @@ public sealed partial class PercolateQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(PercolateQuery percolateQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Percolate(percolateQuery); } public sealed partial class PercolateQueryDescriptor : SerializableDescriptor> @@ -113,6 +114,9 @@ public PercolateQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } private long? VersionValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PercolateQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -155,6 +159,15 @@ public PercolateQueryDescriptor Field(Expression + /// 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. /// @@ -274,10 +287,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -304,6 +317,9 @@ public PercolateQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.Routing? RoutingValue { get; set; } private long? VersionValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PercolateQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -474,10 +490,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); 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 index efa56f76f31..d581aed53aa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PinnedQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -28,7 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; [JsonConverter(typeof(PinnedQueryConverter))] -public sealed partial class PinnedQuery : SearchQuery +public sealed partial class PinnedQuery { internal PinnedQuery(string variantName, object variant) { @@ -45,11 +46,12 @@ internal PinnedQuery(string variantName, object 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); + public static PinnedQuery Docs(IReadOnlyCollection pinnedDoc) => new PinnedQuery("docs", pinnedDoc); + public static PinnedQuery Ids(IReadOnlyCollection id) => new PinnedQuery("ids", id); - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -58,10 +60,20 @@ internal PinnedQuery(string variantName, object variant) /// [JsonInclude, JsonPropertyName("organic")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Organic { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(PinnedQuery pinnedQuery) => QueryDsl.Query.Pinned(pinnedQuery); + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("pinned", this); + return false; + } } internal sealed partial class PinnedQueryConverter : JsonConverter @@ -75,9 +87,9 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, object? variantValue = default; string? variantNameValue = default; - string? nameValue = default; float? boostValue = default; Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query organicValue = default; + string? queryNameValue = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -92,12 +104,6 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, 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); @@ -110,6 +116,12 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, continue; } + if (propertyName == "_name") + { + queryNameValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + if (propertyName == "docs") { variantValue = JsonSerializer.Deserialize?>(ref reader, options); @@ -129,39 +141,43 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, reader.Read(); var result = new PinnedQuery(variantNameValue, variantValue); - result.QueryName = nameValue; result.Boost = boostValue; result.Organic = organicValue; + result.QueryName = queryNameValue; 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) + if (value.Organic is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, value.Organic, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + 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); + JsonSerializer.Serialize>(writer, (IReadOnlyCollection)value.Variant, options); break; case "ids": - JsonSerializer.Serialize>(writer, (ICollection)value.Variant, options); + JsonSerializer.Serialize>(writer, (IReadOnlyCollection)value.Variant, options); break; } } @@ -203,10 +219,11 @@ private PinnedQueryDescriptor Set(object variant, string variantName) private float? BoostValue { get; set; } 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PinnedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -218,34 +235,20 @@ public PinnedQueryDescriptor Boost(float? boost) /// 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 Docs(IReadOnlyCollection pinnedDoc) => Set(pinnedDoc, "docs"); + public PinnedQueryDescriptor Docs(Action configure) => Set(configure, "docs"); + public PinnedQueryDescriptor Ids(IReadOnlyCollection id) => Set(id, "ids"); + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -255,17 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - 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 + if (OrganicValue is not null) { writer.WritePropertyName("organic"); JsonSerializer.Serialize(writer, OrganicValue, options); @@ -327,10 +320,11 @@ private PinnedQueryDescriptor Set(object variant, string variantName) private float? BoostValue { get; set; } 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; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PinnedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -342,34 +336,20 @@ public PinnedQueryDescriptor Boost(float? boost) /// 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 Docs(IReadOnlyCollection pinnedDoc) => Set(pinnedDoc, "docs"); + public PinnedQueryDescriptor Docs(Action configure) => Set(configure, "docs"); + public PinnedQueryDescriptor Ids(IReadOnlyCollection id) => Set(id, "ids"); + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -379,17 +359,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - 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 + if (OrganicValue is not null) { writer.WritePropertyName("organic"); JsonSerializer.Serialize(writer, OrganicValue, options); 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 index 646e651c482..7f24149aaec 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/PrefixQuery.g.cs @@ -82,63 +82,63 @@ public override void Write(Utf8JsonWriter writer, PrefixQuery value, JsonSeriali { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(PrefixQueryConverter))] -public sealed partial class PrefixQuery : SearchQuery +public sealed partial class PrefixQuery { - public PrefixQuery(Field field) + public PrefixQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -149,33 +149,16 @@ public PrefixQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(PrefixQuery prefixQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Prefix(prefixQuery); } public sealed partial class PrefixQueryDescriptor : SerializableDescriptor> { internal PrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal PrefixQueryDescriptor() : base() - { - } - - public PrefixQueryDescriptor(Field field) + public PrefixQueryDescriptor() : base() { - 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 float? BoostValue { get; set; } @@ -185,6 +168,9 @@ public PrefixQueryDescriptor(Expression> field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -212,6 +198,12 @@ public PrefixQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PrefixQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -261,10 +253,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); @@ -278,15 +270,8 @@ public sealed partial class PrefixQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal PrefixQueryDescriptor() : base() - { - } - - public PrefixQueryDescriptor(Field field) + public PrefixQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -296,6 +281,9 @@ public PrefixQueryDescriptor(Field field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -378,10 +366,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); 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 index 71b90b2d9d1..925971e5308 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/Query.g.cs @@ -21,16 +21,20 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; 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; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(QueryConverter))] public sealed partial class Query { - internal Query(string variantName, SearchQuery variant) + internal Query(string variantName, object variant) { if (variantName is null) throw new ArgumentNullException(nameof(variantName)); @@ -42,14 +46,8 @@ internal Query(string variantName, SearchQuery variant) 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; - } + internal object Variant { get; } + internal string VariantName { get; } 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); @@ -102,8 +100,21 @@ internal void WrapVariant(string variantName, SearchQuery variant) 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 WeightedTokens(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WeightedTokensQuery weightedTokensQuery) => new Query("weighted_tokens", weightedTokensQuery); 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class QueryConverter : JsonConverter @@ -115,398 +126,412 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "bool") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "boosting") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "bool") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "combined_fields") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "boosting") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "constant_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "combined_fields") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dis_max") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "constant_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "exists") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "dis_max") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "field_masking_span") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "exists") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "function_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "field_masking_span") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fuzzy") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "function_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_bounding_box") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "fuzzy") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_distance") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_bounding_box") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_polygon") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_distance") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "has_child") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_polygon") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "has_parent") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "has_child") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "ids") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "has_parent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "intervals") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "ids") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "knn") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "intervals") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "knn") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_all") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_bool_prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_all") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_none") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_bool_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_phrase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_none") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_phrase_prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_phrase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "more_like_this") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_phrase_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "multi_match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "more_like_this") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "nested") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "multi_match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "parent_id") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "percolate") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "parent_id") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "pinned") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "percolate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "pinned") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "query_string") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "range") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "query_string") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rank_feature") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "raw_json") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "rank_feature") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "regexp") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "raw_json") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rule_query") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "regexp") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "script") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "rule_query") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "script_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "simple_query_string") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "script_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_containing") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "simple_query_string") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_first") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_multi") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_first") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_near") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_multi") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_not") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_near") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_or") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_not") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_or") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_within") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_within") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms_set") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "text_expansion") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "terms_set") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wildcard") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wrapper") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); + if (propertyName == "weighted_tokens") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "wildcard") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "wrapper") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Query' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Query(variantNameValue, variantValue); + return result; } 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) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -664,6 +689,9 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "text_expansion": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextExpansionQuery)value.Variant, options); break; + case "weighted_tokens": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WeightedTokensQuery)value.Variant, options); + break; case "wildcard": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WildcardQuery)value.Variant, options); break; @@ -708,136 +736,129 @@ private QueryDescriptor Set(object variant, string variantName) 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 Knn(KnnQuery knnQuery) => Set(knnQuery, "knn"); - public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); - 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 Bool(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action> configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action> configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action> configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action> configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action> configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action> configure) => Set(configure, "intervals"); + public QueryDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQuery knnQuery) => Set(knnQuery, "knn"); + public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); + public QueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action> configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action> configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action> configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action> configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action> configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action> configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action> configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action> configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action> configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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"); + public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action> configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action> configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + public QueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action> configure) => Set(configure, "term"); + public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action> configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action> configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action> configure) => Set(configure, "text_expansion"); + public QueryDescriptor WeightedTokens(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WeightedTokensQuery weightedTokensQuery) => Set(weightedTokensQuery, "weighted_tokens"); + public QueryDescriptor WeightedTokens(Action> configure) => Set(configure, "weighted_tokens"); + public QueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -873,182 +894,129 @@ private QueryDescriptor Set(object variant, string variantName) 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 Knn(KnnQuery knnQuery) => Set(knnQuery, "knn"); - public QueryDescriptor Knn(Action configure) => Set(configure, "knn"); - public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); - 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 Bool(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action configure) => Set(configure, "intervals"); + public QueryDescriptor Knn(Elastic.Clients.Elasticsearch.Serverless.KnnQuery knnQuery) => Set(knnQuery, "knn"); + public QueryDescriptor Knn(Action configure) => Set(configure, "knn"); + public QueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action configure) => Set(configure, "query_string"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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 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"); + public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action configure) => Set(configure, "span_within"); + public QueryDescriptor Term(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action configure) => Set(configure, "term"); + public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public QueryDescriptor WeightedTokens(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WeightedTokensQuery weightedTokensQuery) => Set(weightedTokensQuery, "weighted_tokens"); + public QueryDescriptor WeightedTokens(Action configure) => Set(configure, "weighted_tokens"); + public QueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index c949d269b04..9a986c29b07 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/QueryStringQuery.g.cs @@ -27,34 +27,35 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class QueryStringQuery : SearchQuery +public sealed partial class QueryStringQuery { - [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`, the query attempts to analyze wildcard terms in the query string. + /// + [JsonInclude, JsonPropertyName("analyze_wildcard")] + public bool? AnalyzeWildcard { 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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -82,7 +83,7 @@ public sealed partial class QueryStringQuery : SearchQuery /// Array of fields to search. Supports wildcards (`*`). /// [JsonInclude, JsonPropertyName("fields")] - public Fields? Fields { get; set; } + public ICollection? Fields { get; set; } /// /// Maximum edit distance allowed for fuzzy matching. @@ -143,6 +144,8 @@ public sealed partial class QueryStringQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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.
@@ -180,9 +183,7 @@ public sealed partial class QueryStringQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(QueryStringQuery queryStringQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.QueryString(queryStringQuery); } public sealed partial class QueryStringQueryDescriptor : SerializableDescriptor> @@ -202,7 +203,7 @@ public QueryStringQueryDescriptor() : base() 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 ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } @@ -257,6 +258,9 @@ public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(boo return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public QueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -281,6 +285,15 @@ public QueryStringQueryDescriptor DefaultField(Expression + /// 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. /// @@ -308,7 +321,7 @@ public QueryStringQueryDescriptor Escape(bool? escape = true) /// /// Array of fields to search. Supports wildcards (`*`). /// - public QueryStringQueryDescriptor Fields(Fields? fields) + public QueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -545,10 +558,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -601,10 +614,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QuoteFieldSuffixValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TieBreakerValue.HasValue) @@ -613,10 +626,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(TieBreakerValue.Value); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (TypeValue is not null) @@ -646,7 +659,7 @@ public QueryStringQueryDescriptor() : base() 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 ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Fuzziness? FuzzinessValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } @@ -701,6 +714,9 @@ public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGene return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public QueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -761,7 +777,7 @@ public QueryStringQueryDescriptor Escape(bool? escape = true) /// /// Array of fields to search. Supports wildcards (`*`). /// - public QueryStringQueryDescriptor Fields(Fields? fields) + public QueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -998,10 +1014,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -1054,10 +1070,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QuoteFieldSuffixValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TieBreakerValue.HasValue) @@ -1066,10 +1082,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(TieBreakerValue.Value); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (TypeValue is not null) 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 index 37f70a91a57..26d23cfaa5f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs @@ -32,9 +32,9 @@ 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 object? Seed { get; set; } - public static implicit operator FunctionScore(RandomScoreFunction randomScoreFunction) => QueryDsl.FunctionScore.RandomScore(randomScoreFunction); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore(RandomScoreFunction randomScoreFunction) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore.RandomScore(randomScoreFunction); } public sealed partial class RandomScoreFunctionDescriptor : SerializableDescriptor> @@ -46,7 +46,7 @@ public RandomScoreFunctionDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } - private Union? SeedValue { get; set; } + private object? SeedValue { get; set; } public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { @@ -60,7 +60,13 @@ public RandomScoreFunctionDescriptor Field(Expression Seed(Union? seed) + public RandomScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Seed(object? seed) { SeedValue = seed; return Self; @@ -94,7 +100,7 @@ public RandomScoreFunctionDescriptor() : base() } private Elastic.Clients.Elasticsearch.Serverless.Field? FieldValue { get; set; } - private Union? SeedValue { get; set; } + private object? SeedValue { get; set; } public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field? field) { @@ -114,7 +120,7 @@ public RandomScoreFunctionDescriptor Field(Expression? seed) + public RandomScoreFunctionDescriptor Seed(object? seed) { SeedValue = seed; return Self; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.g.cs new file mode 100644 index 00000000000..7efbdcec56c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RangeQuery.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 RangeQuery : Union +{ + public RangeQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.DateRangeQuery Date) : base(Date) + { + } + + public RangeQuery(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.NumberRangeQuery Number) : base(Number) + { + } +} \ 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 index 0c14cdc2ef0..7d68b4606af 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs @@ -41,5 +41,7 @@ public RankFeatureFunctionLinearDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + 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 index dcc33313e31..a86263779ac 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class RankFeatureQuery : SearchQuery +public sealed partial class RankFeatureQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -51,6 +52,8 @@ public sealed partial class RankFeatureQuery : SearchQuery /// [JsonInclude, JsonPropertyName("log")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithm? Log { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Saturation function used to boost relevance scores based on the value of the rank feature `field`. @@ -64,9 +67,7 @@ public sealed partial class RankFeatureQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(RankFeatureQuery rankFeatureQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.RankFeature(rankFeatureQuery); } public sealed partial class RankFeatureQueryDescriptor : SerializableDescriptor> @@ -80,19 +81,22 @@ public RankFeatureQueryDescriptor() : base() 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.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.RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } private string? QueryNameValue { 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.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; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RankFeatureQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -117,6 +121,15 @@ public RankFeatureQueryDescriptor Field(Expression + /// `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`. /// @@ -128,7 +141,7 @@ public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearc return Self; } - public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinearDescriptor descriptor) { LinearValue = null; LinearDescriptorAction = null; @@ -136,7 +149,7 @@ public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDes return Self; } - public RankFeatureQueryDescriptor Linear(Action configure) + public RankFeatureQueryDescriptor Linear(Action configure) { LinearValue = null; LinearDescriptor = null; @@ -155,7 +168,7 @@ public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.S return Self; } - public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithmDescriptor descriptor) { LogValue = null; LogDescriptorAction = null; @@ -163,7 +176,7 @@ public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDes return Self; } - public RankFeatureQueryDescriptor Log(Action configure) + public RankFeatureQueryDescriptor Log(Action configure) { LogValue = null; LogDescriptor = null; @@ -188,7 +201,7 @@ public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elastics return Self; } - public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturationDescriptor descriptor) { SaturationValue = null; SaturationDescriptorAction = null; @@ -196,7 +209,7 @@ public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSatur return Self; } - public RankFeatureQueryDescriptor Saturation(Action configure) + public RankFeatureQueryDescriptor Saturation(Action configure) { SaturationValue = null; SaturationDescriptor = null; @@ -215,7 +228,7 @@ public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsear return Self; } - public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor descriptor) { SigmoidValue = null; SigmoidDescriptorAction = null; @@ -223,7 +236,7 @@ public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidD return Self; } - public RankFeatureQueryDescriptor Sigmoid(Action configure) + public RankFeatureQueryDescriptor Sigmoid(Action configure) { SigmoidValue = null; SigmoidDescriptor = null; @@ -250,7 +263,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LinearDescriptorAction is not null) { writer.WritePropertyName("linear"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); } else if (LinearValue is not null) { @@ -266,7 +279,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LogDescriptorAction is not null) { writer.WritePropertyName("log"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); } else if (LogValue is not null) { @@ -288,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SaturationDescriptorAction is not null) { writer.WritePropertyName("saturation"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); } else if (SaturationValue is not null) { @@ -304,7 +317,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SigmoidDescriptorAction is not null) { writer.WritePropertyName("sigmoid"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); } else if (SigmoidValue is not null) { @@ -327,19 +340,22 @@ public RankFeatureQueryDescriptor() : base() 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.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.RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } private string? QueryNameValue { 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.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; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RankFeatureQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -384,7 +400,7 @@ public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.Serverles return Self; } - public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinearDescriptor descriptor) { LinearValue = null; LinearDescriptorAction = null; @@ -392,7 +408,7 @@ public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor des return Self; } - public RankFeatureQueryDescriptor Linear(Action configure) + public RankFeatureQueryDescriptor Linear(Action configure) { LinearValue = null; LinearDescriptor = null; @@ -411,7 +427,7 @@ public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithmDescriptor descriptor) { LogValue = null; LogDescriptorAction = null; @@ -419,7 +435,7 @@ public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor des return Self; } - public RankFeatureQueryDescriptor Log(Action configure) + public RankFeatureQueryDescriptor Log(Action configure) { LogValue = null; LogDescriptor = null; @@ -444,7 +460,7 @@ public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Serve return Self; } - public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturationDescriptor descriptor) { SaturationValue = null; SaturationDescriptorAction = null; @@ -452,7 +468,7 @@ public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescri return Self; } - public RankFeatureQueryDescriptor Saturation(Action configure) + public RankFeatureQueryDescriptor Saturation(Action configure) { SaturationValue = null; SaturationDescriptor = null; @@ -471,7 +487,7 @@ public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.Serverle return Self; } - public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor descriptor) { SigmoidValue = null; SigmoidDescriptorAction = null; @@ -479,7 +495,7 @@ public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor d return Self; } - public RankFeatureQueryDescriptor Sigmoid(Action configure) + public RankFeatureQueryDescriptor Sigmoid(Action configure) { SigmoidValue = null; SigmoidDescriptor = null; @@ -506,7 +522,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LinearDescriptorAction is not null) { writer.WritePropertyName("linear"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); } else if (LinearValue is not null) { @@ -522,7 +538,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LogDescriptorAction is not null) { writer.WritePropertyName("log"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); } else if (LogValue is not null) { @@ -544,7 +560,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SaturationDescriptorAction is not null) { writer.WritePropertyName("saturation"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); } else if (SaturationValue is not null) { @@ -560,7 +576,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SigmoidDescriptorAction is not null) { writer.WritePropertyName("sigmoid"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); } else if (SigmoidValue is not null) { 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 index 740da58705c..15b69597070 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RegexpQuery.g.cs @@ -94,75 +94,74 @@ public override void Write(Utf8JsonWriter writer, RegexpQuery value, JsonSeriali { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.Flags)) - { - writer.WritePropertyName("flags"); - writer.WriteStringValue(value.Flags); - } + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } - if (value.MaxDeterminizedStates.HasValue) - { - writer.WritePropertyName("max_determinized_states"); - writer.WriteNumberValue(value.MaxDeterminizedStates.Value); - } + if (!string.IsNullOrEmpty(value.Flags)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(value.Flags); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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); - } + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(RegexpQueryConverter))] -public sealed partial class RegexpQuery : SearchQuery +public sealed partial class RegexpQuery { - public RegexpQuery(Field field) + public RegexpQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Enables optional operators for the regular expression. @@ -173,6 +172,7 @@ public RegexpQuery(Field field) /// Maximum number of automaton states required for the query. /// public int? MaxDeterminizedStates { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -183,35 +183,18 @@ public RegexpQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(RegexpQuery regexpQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Regexp(regexpQuery); } public sealed partial class RegexpQueryDescriptor : SerializableDescriptor> { internal RegexpQueryDescriptor(Action> configure) => configure.Invoke(this); - internal RegexpQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -221,6 +204,9 @@ public RegexpQueryDescriptor(Expression> field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RegexpQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -248,6 +234,12 @@ public RegexpQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Enables optional operators for the regular expression. /// @@ -327,10 +319,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); @@ -344,17 +336,10 @@ public sealed partial class RegexpQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal RegexpQueryDescriptor() : base() + public RegexpQueryDescriptor() : base() { } - public RegexpQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -364,6 +349,9 @@ public RegexpQueryDescriptor(Field field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RegexpQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -476,10 +464,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); 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 index 55545a28fe7..79108b7ff56 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -27,22 +27,23 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class RuleQuery : SearchQuery +public sealed partial class RuleQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[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("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.RuleQuery(ruleQuery); } public sealed partial class RuleQueryDescriptor : SerializableDescriptor> @@ -56,11 +57,14 @@ public RuleQueryDescriptor() : base() private float? BoostValue { get; set; } private object MatchCriteriaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action> OrganicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } + private Action> OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RuleQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -81,7 +85,7 @@ public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serv return Self; } - public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { OrganicValue = null; OrganicDescriptorAction = null; @@ -89,7 +93,7 @@ public RuleQueryDescriptor Organic(QueryDescriptor descrip return Self; } - public RuleQueryDescriptor Organic(Action> configure) + public RuleQueryDescriptor Organic(Action> configure) { OrganicValue = null; OrganicDescriptor = null; @@ -128,7 +132,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (OrganicDescriptorAction is not null) { writer.WritePropertyName("organic"); - JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(OrganicDescriptorAction), options); } else { @@ -159,11 +163,14 @@ public RuleQueryDescriptor() : base() private float? BoostValue { get; set; } private object MatchCriteriaValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action OrganicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } + private Action OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Id RulesetIdValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RuleQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -184,7 +191,7 @@ public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.Quer return Self; } - public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { OrganicValue = null; OrganicDescriptorAction = null; @@ -192,7 +199,7 @@ public RuleQueryDescriptor Organic(QueryDescriptor descriptor) return Self; } - public RuleQueryDescriptor Organic(Action configure) + public RuleQueryDescriptor Organic(Action configure) { OrganicValue = null; OrganicDescriptor = null; @@ -231,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (OrganicDescriptorAction is not null) { writer.WritePropertyName("organic"); - JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(OrganicDescriptorAction), options); } else { 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 index 1d7ee1ccb93..e83c0d2be7e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptQuery.g.cs @@ -27,12 +27,15 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class ScriptQuery : SearchQuery +public sealed partial class ScriptQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Contains a script to run as a query.
This script must return a boolean value, `true` or `false`.
@@ -40,9 +43,7 @@ public sealed partial class ScriptQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(ScriptQuery scriptQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Script(scriptQuery); } public sealed partial class ScriptQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public ScriptQueryDescriptor() : base() private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index e556e94fb84..f1c18e81446 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs @@ -35,7 +35,7 @@ public sealed partial class ScriptScoreFunction [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Serverless.Script Script { get; set; } - public static implicit operator FunctionScore(ScriptScoreFunction scriptScoreFunction) => QueryDsl.FunctionScore.ScriptScore(scriptScoreFunction); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore(ScriptScoreFunction scriptScoreFunction) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.FunctionScore.ScriptScore(scriptScoreFunction); } public sealed partial class ScriptScoreFunctionDescriptor : SerializableDescriptor 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 index 439a8f8f747..d772e7320a1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class ScriptScoreQuery : SearchQuery +public sealed partial class ScriptScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class ScriptScoreQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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.
@@ -52,9 +55,7 @@ public sealed partial class ScriptScoreQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(ScriptScoreQuery scriptScoreQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.ScriptScore(scriptScoreQuery); } public sealed partial class ScriptScoreQueryDescriptor : SerializableDescriptor> @@ -68,11 +69,14 @@ public ScriptScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private float? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -99,7 +103,7 @@ public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch return Self; } - public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -107,7 +111,7 @@ public ScriptScoreQueryDescriptor Query(QueryDescriptor de return Self; } - public ScriptScoreQueryDescriptor Query(Action> configure) + public ScriptScoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -153,7 +157,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -184,11 +188,14 @@ public ScriptScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private float? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -215,7 +222,7 @@ public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless return Self; } - public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -223,7 +230,7 @@ public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public ScriptScoreQueryDescriptor Query(Action configure) + public ScriptScoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -269,7 +276,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { 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 index 83583f39479..1077d028c3a 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs @@ -27,10 +27,13 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SimpleQueryStringQuery : SearchQuery +public sealed partial class SimpleQueryStringQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Analyzer used to convert text in the query string into tokens. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } /// /// If `true`, the query attempts to analyze wildcard terms in the query string. @@ -38,17 +41,15 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -62,13 +63,13 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery /// 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; } + public ICollection? 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; } + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlag? Flags { get; set; } /// /// Maximum number of terms to which the query expands for fuzzy matching. @@ -105,6 +106,8 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Suffix appended to quoted text in the query string. @@ -112,9 +115,7 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SimpleQueryStringQuery simpleQueryStringQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SimpleQueryString(simpleQueryStringQuery); } public sealed partial class SimpleQueryStringQueryDescriptor : SerializableDescriptor> @@ -130,8 +131,8 @@ public SimpleQueryStringQueryDescriptor() : base() 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 ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlag? FlagsValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } private bool? FuzzyTranspositionsValue { get; set; } @@ -168,6 +169,9 @@ public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQue return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SimpleQueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -186,7 +190,7 @@ public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clien /// /// 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) + public SimpleQueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -195,7 +199,7 @@ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) /// /// List of enabled operators for the simple query string syntax. /// - public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? flags) + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlag? flags) { FlagsValue = flags; return Self; @@ -376,8 +380,8 @@ public SimpleQueryStringQueryDescriptor() : base() 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 ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlag? FlagsValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } private bool? FuzzyTranspositionsValue { get; set; } @@ -414,6 +418,9 @@ public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? au return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SimpleQueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -432,7 +439,7 @@ public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elastics /// /// 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) + public SimpleQueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -441,7 +448,7 @@ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) /// /// List of enabled operators for the simple query string syntax. /// - public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlags? flags) + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SimpleQueryStringFlag? flags) { FlagsValue = flags; return Self; 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 index a83181f212f..f3c779ff99c 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanContainingQuery : SearchQuery +public sealed partial class SpanContainingQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanContainingQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("little")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Little { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_containing", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanContainingQuery spanContainingQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanContaining(spanContainingQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanContainingQuery spanContainingQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanContaining(spanContainingQuery); } public sealed partial class SpanContainingQueryDescriptor : SerializableDescriptor> @@ -58,12 +62,12 @@ 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.SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action> LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -77,7 +81,7 @@ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearc return Self; } - public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -85,7 +89,7 @@ public SpanContainingQueryDescriptor Big(SpanQueryDescriptor Big(Action> configure) + public SpanContainingQueryDescriptor Big(Action> configure) { BigValue = null; BigDescriptor = null; @@ -93,6 +97,9 @@ public SpanContainingQueryDescriptor Big(Action + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanContainingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +117,7 @@ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticse return Self; } - public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -118,7 +125,7 @@ public SpanContainingQueryDescriptor Little(SpanQueryDescriptor Little(Action> configure) + public SpanContainingQueryDescriptor Little(Action> configure) { LittleValue = null; LittleDescriptor = null; @@ -143,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -165,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { @@ -192,12 +199,12 @@ 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.SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -211,7 +218,7 @@ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverles return Self; } - public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -219,7 +226,7 @@ public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) return Self; } - public SpanContainingQueryDescriptor Big(Action configure) + public SpanContainingQueryDescriptor Big(Action configure) { BigValue = null; BigDescriptor = null; @@ -227,6 +234,9 @@ public SpanContainingQueryDescriptor Big(Action configure) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanContainingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -244,7 +254,7 @@ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.Server return Self; } - public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -252,7 +262,7 @@ public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) return Self; } - public SpanContainingQueryDescriptor Little(Action configure) + public SpanContainingQueryDescriptor Little(Action configure) { LittleValue = null; LittleDescriptor = null; @@ -277,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -299,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { 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 index c452361bdbb..67c42cbda13 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs @@ -27,18 +27,22 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanFieldMaskingQuery : SearchQuery +public sealed partial class SpanFieldMaskingQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[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; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("field_masking_span", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanFieldMaskingQuery spanFieldMaskingQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.FieldMaskingSpan(spanFieldMaskingQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanFieldMaskingQuery spanFieldMaskingQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.FieldMaskingSpan(spanFieldMaskingQuery); } public sealed partial class SpanFieldMaskingQueryDescriptor : SerializableDescriptor> @@ -52,10 +56,13 @@ public SpanFieldMaskingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery QueryValue { get; set; } - private SpanQueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFieldMaskingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -74,6 +81,12 @@ public SpanFieldMaskingQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery query) { QueryDescriptor = null; @@ -82,7 +95,7 @@ public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elastics return Self; } - public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -90,7 +103,7 @@ public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor Query(Action> configure) + public SpanFieldMaskingQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -123,7 +136,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(QueryDescriptorAction), options); } else { @@ -152,10 +165,13 @@ public SpanFieldMaskingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery QueryValue { get; set; } - private SpanQueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFieldMaskingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -188,7 +204,7 @@ public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serve return Self; } - public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -196,7 +212,7 @@ public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) return Self; } - public SpanFieldMaskingQueryDescriptor Query(Action configure) + public SpanFieldMaskingQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -229,7 +245,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(QueryDescriptorAction), options); } else { 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 index 03a39e5e31a..93e0a22a791 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanFirstQuery : SearchQuery +public sealed partial class SpanFirstQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanFirstQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("match")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Match { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_first", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanFirstQuery spanFirstQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanFirst(spanFirstQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanFirstQuery spanFirstQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanFirst(spanFirstQuery); } public sealed partial class SpanFirstQueryDescriptor : SerializableDescriptor> @@ -60,10 +64,13 @@ public SpanFirstQueryDescriptor() : base() private float? BoostValue { get; set; } private int EndValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery MatchValue { get; set; } - private SpanQueryDescriptor MatchDescriptor { get; set; } - private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFirstQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -90,7 +97,7 @@ public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.S return Self; } - public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -98,7 +105,7 @@ public SpanFirstQueryDescriptor Match(SpanQueryDescriptor return Self; } - public SpanFirstQueryDescriptor Match(Action> configure) + public SpanFirstQueryDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -131,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(MatchDescriptorAction), options); } else { @@ -160,10 +167,13 @@ public SpanFirstQueryDescriptor() : base() private float? BoostValue { get; set; } private int EndValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery MatchValue { get; set; } - private SpanQueryDescriptor MatchDescriptor { get; set; } - private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFirstQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -190,7 +200,7 @@ public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -198,7 +208,7 @@ public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) return Self; } - public SpanFirstQueryDescriptor Match(Action configure) + public SpanFirstQueryDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -231,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(MatchDescriptorAction), options); } else { 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 index 3085a3a6a63..56e3ed48543 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanMultiTermQuery : SearchQuery +public sealed partial class SpanMultiTermQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,8 +40,11 @@ public sealed partial class SpanMultiTermQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("match")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query Match { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_multi", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanMultiTermQuery spanMultiTermQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanMulti(spanMultiTermQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanMultiTermQuery spanMultiTermQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanMulti(spanMultiTermQuery); } public sealed partial class SpanMultiTermQueryDescriptor : SerializableDescriptor> @@ -53,10 +57,13 @@ public SpanMultiTermQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query MatchValue { get; set; } - private QueryDescriptor MatchDescriptor { get; set; } - private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanMultiTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -74,7 +81,7 @@ public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsear return Self; } - public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -82,7 +89,7 @@ public SpanMultiTermQueryDescriptor Match(QueryDescriptor return Self; } - public SpanMultiTermQueryDescriptor Match(Action> configure) + public SpanMultiTermQueryDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -113,7 +120,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MatchDescriptorAction), options); } else { @@ -141,10 +148,13 @@ public SpanMultiTermQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query MatchValue { get; set; } - private QueryDescriptor MatchDescriptor { get; set; } - private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanMultiTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -162,7 +172,7 @@ public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverle return Self; } - public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -170,7 +180,7 @@ public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) return Self; } - public SpanMultiTermQueryDescriptor Match(Action configure) + public SpanMultiTermQueryDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -201,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(MatchDescriptorAction), options); } else { 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 index 1b91f595d61..488626cf62d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNearQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanNearQuery : SearchQuery +public sealed partial class SpanNearQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class SpanNearQuery : SearchQuery /// [JsonInclude, JsonPropertyName("in_order")] public bool? InOrder { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Controls the maximum number of intervening unmatched positions permitted. @@ -52,7 +55,8 @@ public sealed partial class SpanNearQuery : SearchQuery [JsonInclude, JsonPropertyName("slop")] public int? Slop { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_near", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanNearQuery spanNearQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanNear(spanNearQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanNearQuery spanNearQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanNear(spanNearQuery); } public sealed partial class SpanNearQueryDescriptor : SerializableDescriptor> @@ -65,13 +69,16 @@ public SpanNearQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action> ClausesDescriptorAction { get; set; } - private Action>[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } private bool? InOrderValue { get; set; } private string? QueryNameValue { get; set; } private int? SlopValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNearQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -90,7 +97,7 @@ public SpanNearQueryDescriptor Clauses(ICollection Clauses(SpanQueryDescriptor descriptor) + public SpanNearQueryDescriptor Clauses(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { ClausesValue = null; ClausesDescriptorAction = null; @@ -99,7 +106,7 @@ public SpanNearQueryDescriptor Clauses(SpanQueryDescriptor return Self; } - public SpanNearQueryDescriptor Clauses(Action> configure) + public SpanNearQueryDescriptor Clauses(Action> configure) { ClausesValue = null; ClausesDescriptor = null; @@ -108,7 +115,7 @@ public SpanNearQueryDescriptor Clauses(Action Clauses(params Action>[] configure) + public SpanNearQueryDescriptor Clauses(params Action>[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -161,7 +168,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -170,7 +177,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); @@ -213,13 +220,16 @@ public SpanNearQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action ClausesDescriptorAction { get; set; } - private Action[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } private bool? InOrderValue { get; set; } private string? QueryNameValue { get; set; } private int? SlopValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNearQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -238,7 +248,7 @@ public SpanNearQueryDescriptor Clauses(ICollection configure) + public SpanNearQueryDescriptor Clauses(Action configure) { ClausesValue = null; ClausesDescriptor = null; @@ -256,7 +266,7 @@ public SpanNearQueryDescriptor Clauses(Action configure) return Self; } - public SpanNearQueryDescriptor Clauses(params Action[] configure) + public SpanNearQueryDescriptor Clauses(params Action[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -309,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -318,7 +328,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); 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 index ce2cb4b00bf..44ca1b65ac1 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanNotQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanNotQuery : SearchQuery +public sealed partial class SpanNotQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,8 +64,11 @@ public sealed partial class SpanNotQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("pre")] public int? Pre { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_not", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanNotQuery spanNotQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanNot(spanNotQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanNotQuery spanNotQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanNot(spanNotQuery); } public sealed partial class SpanNotQueryDescriptor : SerializableDescriptor> @@ -78,15 +82,18 @@ public SpanNotQueryDescriptor() : base() private float? BoostValue { get; set; } private int? DistValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action> IncludeDescriptorAction { get; set; } private int? PostValue { get; set; } private int? PreValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNotQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -113,7 +120,7 @@ public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.S return Self; } - public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { ExcludeValue = null; ExcludeDescriptorAction = null; @@ -121,7 +128,7 @@ public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor return Self; } - public SpanNotQueryDescriptor Exclude(Action> configure) + public SpanNotQueryDescriptor Exclude(Action> configure) { ExcludeValue = null; ExcludeDescriptor = null; @@ -140,7 +147,7 @@ public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.S return Self; } - public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -148,7 +155,7 @@ public SpanNotQueryDescriptor Include(SpanQueryDescriptor return Self; } - public SpanNotQueryDescriptor Include(Action> configure) + public SpanNotQueryDescriptor Include(Action> configure) { IncludeValue = null; IncludeDescriptor = null; @@ -203,7 +210,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExcludeDescriptorAction is not null) { writer.WritePropertyName("exclude"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ExcludeDescriptorAction), options); } else { @@ -219,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(IncludeDescriptorAction), options); } else { @@ -260,15 +267,18 @@ public SpanNotQueryDescriptor() : base() private float? BoostValue { get; set; } private int? DistValue { get; set; } 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.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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } private int? PostValue { get; set; } private int? PreValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNotQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -295,7 +305,7 @@ public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { ExcludeValue = null; ExcludeDescriptorAction = null; @@ -303,7 +313,7 @@ public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) return Self; } - public SpanNotQueryDescriptor Exclude(Action configure) + public SpanNotQueryDescriptor Exclude(Action configure) { ExcludeValue = null; ExcludeDescriptor = null; @@ -322,7 +332,7 @@ public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.Q return Self; } - public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -330,7 +340,7 @@ public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) return Self; } - public SpanNotQueryDescriptor Include(Action configure) + public SpanNotQueryDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -385,7 +395,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExcludeDescriptorAction is not null) { writer.WritePropertyName("exclude"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ExcludeDescriptorAction), options); } else { @@ -401,7 +411,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(IncludeDescriptorAction), options); } else { 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 index f4603d9591d..f474918ecbb 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanOrQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanOrQuery : SearchQuery +public sealed partial class SpanOrQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,8 +40,11 @@ public sealed partial class SpanOrQuery : SearchQuery /// [JsonInclude, JsonPropertyName("clauses")] public ICollection Clauses { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_or", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanOrQuery spanOrQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanOr(spanOrQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanOrQuery spanOrQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanOr(spanOrQuery); } public sealed partial class SpanOrQueryDescriptor : SerializableDescriptor> @@ -53,11 +57,14 @@ public SpanOrQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action> ClausesDescriptorAction { get; set; } - private Action>[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanOrQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -76,7 +83,7 @@ public SpanOrQueryDescriptor Clauses(ICollection Clauses(SpanQueryDescriptor descriptor) + public SpanOrQueryDescriptor Clauses(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { ClausesValue = null; ClausesDescriptorAction = null; @@ -85,7 +92,7 @@ public SpanOrQueryDescriptor Clauses(SpanQueryDescriptor d return Self; } - public SpanOrQueryDescriptor Clauses(Action> configure) + public SpanOrQueryDescriptor Clauses(Action> configure) { ClausesValue = null; ClausesDescriptor = null; @@ -94,7 +101,7 @@ public SpanOrQueryDescriptor Clauses(Action Clauses(params Action>[] configure) + public SpanOrQueryDescriptor Clauses(params Action>[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -129,7 +136,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -138,7 +145,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); @@ -169,11 +176,14 @@ public SpanOrQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action ClausesDescriptorAction { get; set; } - private Action[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanOrQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -192,7 +202,7 @@ public SpanOrQueryDescriptor Clauses(ICollection configure) + public SpanOrQueryDescriptor Clauses(Action configure) { ClausesValue = null; ClausesDescriptor = null; @@ -210,7 +220,7 @@ public SpanOrQueryDescriptor Clauses(Action configure) return Self; } - public SpanOrQueryDescriptor Clauses(params Action[] configure) + public SpanOrQueryDescriptor Clauses(params Action[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -245,7 +255,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -254,7 +264,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); 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 index 1b6638e5d8f..707dd1a9ba8 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -48,12 +49,25 @@ internal SpanQuery(string variantName, object variant) 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 SpanGap(IReadOnlyDictionary integer) => new SpanQuery("span_gap", integer); 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class SpanQueryConverter : JsonConverter @@ -65,84 +79,104 @@ public override SpanQuery Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "span_containing") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "field_masking_span") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_first") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_multi") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_first") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_near") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_gap") + { + variantValue = JsonSerializer.Deserialize?>(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_not") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_multi") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_or") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_near") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_not") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_within") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); + if (propertyName == "span_or") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "span_term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "span_within") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'SpanQuery' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new SpanQuery(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, SpanQuery value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -156,6 +190,9 @@ public override void Write(Utf8JsonWriter writer, SpanQuery value, JsonSerialize case "span_first": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery)value.Variant, options); break; + case "span_gap": + JsonSerializer.Serialize>(writer, (IReadOnlyDictionary)value.Variant, options); + break; case "span_multi": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery)value.Variant, options); break; @@ -212,43 +249,42 @@ private SpanQueryDescriptor Set(object variant, string variantName) 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"); + public SpanQueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanGap(IReadOnlyDictionary integer) => Set(integer, "span_gap"); + public SpanQueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -284,52 +320,42 @@ private SpanQueryDescriptor Set(object variant, string variantName) 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"); + public SpanQueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanGap(IReadOnlyDictionary integer) => Set(integer, "span_gap"); + public SpanQueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index 4859ffcc5e7..8356e34ff12 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanTermQuery.g.cs @@ -70,79 +70,68 @@ public override void Write(Utf8JsonWriter writer, SpanTermQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(SpanTermQueryConverter))] -public sealed partial class SpanTermQuery : SearchQuery +public sealed partial class SpanTermQuery { - public SpanTermQuery(Field field) + public SpanTermQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } - public string Value { get; set; } public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? QueryName { get; set; } + public string Value { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_term", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanTermQuery spanTermQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanTerm(spanTermQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanTermQuery spanTermQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanTerm(spanTermQuery); } public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor> { internal SpanTermQueryDescriptor(Action> configure) => configure.Invoke(this); - internal SpanTermQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -161,6 +150,12 @@ public SpanTermQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SpanTermQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -203,15 +198,8 @@ public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal SpanTermQueryDescriptor() : base() - { - } - - public SpanTermQueryDescriptor(Field field) + public SpanTermQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -219,6 +207,9 @@ public SpanTermQueryDescriptor(Field field) private string? QueryNameValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanTermQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index 41e3f1c04a3..23cedc4a973 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class SpanWithinQuery : SearchQuery +public sealed partial class SpanWithinQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanWithinQuery : SearchQuery /// [JsonInclude, JsonPropertyName("little")] public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery Little { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_within", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(SpanWithinQuery spanWithinQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.SpanWithin(spanWithinQuery); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery(SpanWithinQuery spanWithinQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery.SpanWithin(spanWithinQuery); } public sealed partial class SpanWithinQueryDescriptor : SerializableDescriptor> @@ -58,12 +62,12 @@ 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.SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action> LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -77,7 +81,7 @@ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Se return Self; } - public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -85,7 +89,7 @@ public SpanWithinQueryDescriptor Big(SpanQueryDescriptor d return Self; } - public SpanWithinQueryDescriptor Big(Action> configure) + public SpanWithinQueryDescriptor Big(Action> configure) { BigValue = null; BigDescriptor = null; @@ -93,6 +97,9 @@ public SpanWithinQueryDescriptor Big(Action + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanWithinQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +117,7 @@ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch return Self; } - public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -118,7 +125,7 @@ public SpanWithinQueryDescriptor Little(SpanQueryDescriptor Little(Action> configure) + public SpanWithinQueryDescriptor Little(Action> configure) { LittleValue = null; LittleDescriptor = null; @@ -143,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -165,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { @@ -192,12 +199,12 @@ 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.SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -211,7 +218,7 @@ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.Qu return Self; } - public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -219,7 +226,7 @@ public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) return Self; } - public SpanWithinQueryDescriptor Big(Action configure) + public SpanWithinQueryDescriptor Big(Action configure) { BigValue = null; BigDescriptor = null; @@ -227,6 +234,9 @@ public SpanWithinQueryDescriptor Big(Action configure) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanWithinQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -244,7 +254,7 @@ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless return Self; } - public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -252,7 +262,7 @@ public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) return Self; } - public SpanWithinQueryDescriptor Little(Action configure) + public SpanWithinQueryDescriptor Little(Action configure) { LittleValue = null; LittleDescriptor = null; @@ -277,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -299,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { 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 index c2d383c9bbd..71168c005df 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermQuery.g.cs @@ -76,97 +76,83 @@ public override void Write(Utf8JsonWriter writer, TermQuery value, JsonSerialize { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TermQueryConverter))] -public sealed partial class TermQuery : SearchQuery +public sealed partial class TermQuery { - public TermQuery(Field field) + public TermQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(TermQuery termQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Term(termQuery); } public sealed partial class TermQueryDescriptor : SerializableDescriptor> { internal TermQueryDescriptor(Action> configure) => configure.Invoke(this); - internal TermQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.FieldValue ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -194,6 +180,12 @@ public TermQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -245,23 +237,19 @@ public sealed partial class TermQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal TermQueryDescriptor() : base() + public TermQueryDescriptor() : base() { } - public TermQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.FieldValue ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index 39238258a2e..4af488b296e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsLookup.g.cs @@ -76,6 +76,12 @@ public TermsLookupDescriptor Path(Expression Path(Expression> path) + { + PathValue = path; + return Self; + } + public TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) { RoutingValue = routing; 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 index 95a4e51473a..7367075ee5d 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -92,16 +92,17 @@ public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializ } [JsonConverter(typeof(TermsQueryConverter))] -public sealed partial class TermsQuery : SearchQuery +public sealed partial class TermsQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(TermsQuery termsQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Terms(termsQuery); } public sealed partial class TermsQueryDescriptor : SerializableDescriptor> @@ -113,37 +114,46 @@ public TermsQueryDescriptor() : base() } private float? BoostValue { get; set; } - private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public TermsQueryDescriptor QueryName(string? queryName) + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Field(Expression> field) { - TermsValue = terms; + FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public TermsQueryDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + return Self; + } + + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + { + TermsValue = terms; return Self; } @@ -182,43 +192,46 @@ public TermsQueryDescriptor() : base() } private float? BoostValue { get; set; } - private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public TermsQueryDescriptor QueryName(string? queryName) + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Field(Expression> field) { - TermsValue = terms; + FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + public TermsQueryDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsQueryField terms) { - FieldValue = field; + TermsValue = terms; return Self; } 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 index f26f8a8b013..2acdddd8b8b 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsQueryField.g.cs @@ -32,11 +32,11 @@ 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(IReadOnlyCollection Value) : base(Value) { } - public TermsQueryField(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TermsLookup lookup) : base(lookup) + 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 index b796f1fbd37..a3a130e59e6 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TermsSetQuery.g.cs @@ -82,58 +82,57 @@ public override void Write(Utf8JsonWriter writer, TermsSetQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.MinimumShouldMatchScript is not null) - { - writer.WritePropertyName("minimum_should_match_script"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatchScript, options); - } + if (value.MinimumShouldMatchField is not null) + { + writer.WritePropertyName("minimum_should_match_field"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatchField, options); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, value.Terms, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TermsSetQueryConverter))] -public sealed partial class TermsSetQuery : SearchQuery +public sealed partial class TermsSetQuery { - public TermsSetQuery(Field field) + public TermsSetQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// Numeric field containing the number of matching terms required to return a document. @@ -144,38 +143,22 @@ public TermsSetQuery(Field field) /// Custom script containing the number of matching terms required to return a document. /// public Elastic.Clients.Elasticsearch.Serverless.Script? MinimumShouldMatchScript { get; set; } + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(TermsSetQuery termsSetQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.TermsSet(termsSetQuery); } public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor> { internal TermsSetQueryDescriptor(Action> configure) => configure.Invoke(this); - internal TermsSetQueryDescriptor() : base() - { - } - - public TermsSetQueryDescriptor(Field field) + public TermsSetQueryDescriptor() : base() { - 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 float? BoostValue { get; set; } @@ -185,6 +168,9 @@ public TermsSetQueryDescriptor(Expression> field) private string? QueryNameValue { get; set; } private ICollection TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsSetQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -203,6 +189,12 @@ public TermsSetQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Numeric field containing the number of matching terms required to return a document. /// @@ -221,6 +213,15 @@ public TermsSetQueryDescriptor MinimumShouldMatchField(Expres 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. /// @@ -287,17 +288,10 @@ public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal TermsSetQueryDescriptor() : base() + public TermsSetQueryDescriptor() : base() { } - public TermsSetQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field? MinimumShouldMatchFieldValue { get; set; } @@ -305,6 +299,9 @@ public TermsSetQueryDescriptor(Field field) private string? QueryNameValue { get; set; } private ICollection TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsSetQueryDescriptor Boost(float? boost) { BoostValue = boost; 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 index c3e806ce2ad..ecef6f11cd4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs @@ -76,48 +76,47 @@ public override void Write(Utf8JsonWriter writer, TextExpansionQuery value, Json { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + writer.WritePropertyName("model_id"); + writer.WriteStringValue(value.ModelId); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(value.ModelText); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TextExpansionQueryConverter))] -public sealed partial class TextExpansionQuery : SearchQuery +public sealed partial class TextExpansionQuery { - public TextExpansionQuery(Field field) + public TextExpansionQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } /// /// The text expansion NLP model to use @@ -128,41 +127,28 @@ public TextExpansionQuery(Field field) /// 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); + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("text_expansion", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(TextExpansionQuery textExpansionQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.TextExpansion(textExpansionQuery); } public sealed partial class TextExpansionQueryDescriptor : SerializableDescriptor> { internal TextExpansionQueryDescriptor(Action> configure) => configure.Invoke(this); - internal TextExpansionQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } private string ModelIdValue { get; set; } private string ModelTextValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TextExpansionQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -181,6 +167,12 @@ public TextExpansionQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The text expansion NLP model to use /// @@ -237,15 +229,8 @@ public sealed partial class TextExpansionQueryDescriptor : SerializableDescripto { internal TextExpansionQueryDescriptor(Action configure) => configure.Invoke(this); - internal TextExpansionQueryDescriptor() : base() - { - } - - public TextExpansionQueryDescriptor(Field field) + public TextExpansionQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -254,6 +239,9 @@ public TextExpansionQueryDescriptor(Field field) private string ModelTextValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TextExpansionQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs new file mode 100644 index 00000000000..b9a84244ac3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/TokenPruningConfig.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.QueryDsl; + +public sealed partial class TokenPruningConfig +{ + /// + /// Whether to only score pruned tokens, vs only scoring kept tokens. + /// + [JsonInclude, JsonPropertyName("only_score_pruned_tokens")] + public bool? OnlyScorePrunedTokens { get; set; } + + /// + /// Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned. + /// + [JsonInclude, JsonPropertyName("tokens_freq_ratio_threshold")] + public int? TokensFreqRatioThreshold { get; set; } + + /// + /// Tokens whose weight is less than this threshold are considered nonsignificant and pruned. + /// + [JsonInclude, JsonPropertyName("tokens_weight_threshold")] + public float? TokensWeightThreshold { get; set; } +} + +public sealed partial class TokenPruningConfigDescriptor : SerializableDescriptor +{ + internal TokenPruningConfigDescriptor(Action configure) => configure.Invoke(this); + + public TokenPruningConfigDescriptor() : base() + { + } + + private bool? OnlyScorePrunedTokensValue { get; set; } + private int? TokensFreqRatioThresholdValue { get; set; } + private float? TokensWeightThresholdValue { get; set; } + + /// + /// Whether to only score pruned tokens, vs only scoring kept tokens. + /// + public TokenPruningConfigDescriptor OnlyScorePrunedTokens(bool? onlyScorePrunedTokens = true) + { + OnlyScorePrunedTokensValue = onlyScorePrunedTokens; + return Self; + } + + /// + /// Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned. + /// + public TokenPruningConfigDescriptor TokensFreqRatioThreshold(int? tokensFreqRatioThreshold) + { + TokensFreqRatioThresholdValue = tokensFreqRatioThreshold; + return Self; + } + + /// + /// Tokens whose weight is less than this threshold are considered nonsignificant and pruned. + /// + public TokenPruningConfigDescriptor TokensWeightThreshold(float? tokensWeightThreshold) + { + TokensWeightThresholdValue = tokensWeightThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnlyScorePrunedTokensValue.HasValue) + { + writer.WritePropertyName("only_score_pruned_tokens"); + writer.WriteBooleanValue(OnlyScorePrunedTokensValue.Value); + } + + if (TokensFreqRatioThresholdValue.HasValue) + { + writer.WritePropertyName("tokens_freq_ratio_threshold"); + writer.WriteNumberValue(TokensFreqRatioThresholdValue.Value); + } + + if (TokensWeightThresholdValue.HasValue) + { + writer.WritePropertyName("tokens_weight_threshold"); + writer.WriteNumberValue(TokensWeightThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs new file mode 100644 index 00000000000..4d62b66c785 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WeightedTokensQuery.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; + +internal sealed partial class WeightedTokensQueryConverter : JsonConverter +{ + public override WeightedTokensQuery 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 WeightedTokensQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pruning_config") + { + variant.PruningConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "tokens") + { + variant.Tokens = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, WeightedTokensQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize WeightedTokensQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.PruningConfig is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, value.PruningConfig, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, value.Tokens, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(WeightedTokensQueryConverter))] +public sealed partial class WeightedTokensQuery +{ + public WeightedTokensQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Token pruning configurations + /// + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfig? PruningConfig { get; set; } + public string? QueryName { get; set; } + + /// + /// The tokens representing this query + /// + public IDictionary Tokens { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(WeightedTokensQuery weightedTokensQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.WeightedTokens(weightedTokensQuery); +} + +public sealed partial class WeightedTokensQueryDescriptor : SerializableDescriptor> +{ + internal WeightedTokensQueryDescriptor(Action> configure) => configure.Invoke(this); + + public WeightedTokensQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private IDictionary TokensValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public WeightedTokensQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Token pruning configurations + /// + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + + public WeightedTokensQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The tokens representing this query + /// + public WeightedTokensQueryDescriptor Tokens(Func, FluentDictionary> selector) + { + TokensValue = selector?.Invoke(new FluentDictionary()); + 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 (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, TokensValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class WeightedTokensQueryDescriptor : SerializableDescriptor +{ + internal WeightedTokensQueryDescriptor(Action configure) => configure.Invoke(this); + + public WeightedTokensQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private IDictionary TokensValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public WeightedTokensQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Token pruning configurations + /// + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + + public WeightedTokensQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The tokens representing this query + /// + public WeightedTokensQueryDescriptor Tokens(Func, FluentDictionary> selector) + { + TokensValue = selector?.Invoke(new FluentDictionary()); + 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 (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, TokensValue, options); + 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 index 23098f344c5..af13fd89780 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WildcardQuery.g.cs @@ -88,73 +88,73 @@ public override void Write(Utf8JsonWriter writer, WildcardQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (!string.IsNullOrEmpty(value.Value)) - { - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - } + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); + } - if (!string.IsNullOrEmpty(value.Wildcard)) - { - writer.WritePropertyName("wildcard"); - writer.WriteStringValue(value.Wildcard); - } + if (!string.IsNullOrEmpty(value.Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Wildcard)) + { + writer.WritePropertyName("wildcard"); + writer.WriteStringValue(value.Wildcard); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(WildcardQueryConverter))] -public sealed partial class WildcardQuery : SearchQuery +public sealed partial class WildcardQuery { - public WildcardQuery(Field field) + public WildcardQuery(Elastic.Clients.Elasticsearch.Serverless.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -170,35 +170,18 @@ public WildcardQuery(Field field) /// 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 static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(WildcardQuery wildcardQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Wildcard(wildcardQuery); } public sealed partial class WildcardQueryDescriptor : SerializableDescriptor> { internal WildcardQueryDescriptor(Action> configure) => configure.Invoke(this); - internal WildcardQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -207,6 +190,9 @@ public WildcardQueryDescriptor(Expression> field) private string? ValueValue { get; set; } private string? WildcardValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WildcardQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -234,6 +220,12 @@ public WildcardQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public WildcardQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -292,10 +284,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (!string.IsNullOrEmpty(ValueValue)) @@ -319,17 +311,10 @@ public sealed partial class WildcardQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal WildcardQueryDescriptor() : base() + public WildcardQueryDescriptor() : base() { } - public WildcardQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } @@ -338,6 +323,9 @@ public WildcardQueryDescriptor(Field field) private string? ValueValue { get; set; } private string? WildcardValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WildcardQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -429,10 +417,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (!string.IsNullOrEmpty(ValueValue)) 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 index 336483cb0c0..d6a38662a71 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryDsl/WrapperQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -public sealed partial class WrapperQuery : SearchQuery +public sealed partial class WrapperQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class WrapperQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(WrapperQuery wrapperQuery) => QueryDsl.Query.Wrapper(wrapperQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("wrapper", this); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query(WrapperQuery wrapperQuery) => Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query.Wrapper(wrapperQuery); } public sealed partial class WrapperQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public WrapperQueryDescriptor() : base() private string QueryValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WrapperQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs index 6975be907fc..eb8988343b4 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/QueryVectorBuilder.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -46,6 +47,18 @@ internal QueryVectorBuilder(string variantName, object variant) internal string VariantName { get; } public static QueryVectorBuilder TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.TextEmbedding textEmbedding) => new QueryVectorBuilder("text_embedding", textEmbedding); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class QueryVectorBuilderConverter : JsonConverter @@ -57,28 +70,41 @@ public override QueryVectorBuilder Read(ref Utf8JsonReader reader, Type typeToCo throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "text_embedding") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + 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(); - return new QueryVectorBuilder(propertyName, variant); + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'QueryVectorBuilder' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new QueryVectorBuilder(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, QueryVectorBuilder value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -124,27 +150,25 @@ private QueryVectorBuilderDescriptor Set(object variant, string varia return Self; } - public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); - public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -180,27 +204,25 @@ private QueryVectorBuilderDescriptor Set(object variant, string variantName) return Self; } - public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); - public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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 index fedfcf9ab36..efee9c84574 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Rank.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -46,6 +47,18 @@ internal Rank(string variantName, object variant) internal string VariantName { get; } public static Rank Rrf(Elastic.Clients.Elasticsearch.Serverless.RrfRank rrfRank) => new Rank("rrf", rrfRank); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class RankConverter : JsonConverter @@ -57,28 +70,41 @@ public override Rank Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "rrf") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + 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(); - return new Rank(propertyName, variant); + if (propertyName == "rrf") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Rank' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Rank(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Rank value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -124,27 +150,25 @@ private RankDescriptor Set(object variant, string variantName) return Self; } - public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); - public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + public RankDescriptor Rrf(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -180,27 +204,25 @@ private RankDescriptor Set(object variant, string variantName) return Self; } - public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); - public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + public RankDescriptor Rrf(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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/RrfRank.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs index a5a3e2dfc58..be630e319aa 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/RrfRank.g.cs @@ -41,7 +41,7 @@ public sealed partial class RrfRank [JsonInclude, JsonPropertyName("window_size")] public long? WindowSize { get; set; } - public static implicit operator Rank(RrfRank rrfRank) => Rank.Rrf(rrfRank); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.Rank(RrfRank rrfRank) => Elastic.Clients.Elasticsearch.Serverless.Rank.Rrf(rrfRank); } public sealed partial class RrfRankDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs index 13c5f685566..e23c9fb8c98 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Script.g.cs @@ -32,11 +32,11 @@ 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.InlineScript Inline) : base(Inline) { } - public Script(Elastic.Clients.Elasticsearch.Serverless.StoredScriptId stored) : base(stored) + 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/ScriptSort.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs index e8efa5f9900..b1cade3a24f 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/ScriptSort.g.cs @@ -40,7 +40,7 @@ public sealed partial class ScriptSort [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.Serverless.ScriptSortType? Type { get; set; } - public static implicit operator SortOptions(ScriptSort scriptSort) => SortOptions.Script(scriptSort); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.SortOptions(ScriptSort scriptSort) => Elastic.Clients.Elasticsearch.Serverless.SortOptions.Script(scriptSort); } public sealed partial class ScriptSortDescriptor : SerializableDescriptor> @@ -53,8 +53,8 @@ public ScriptSortDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { 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; } @@ -73,7 +73,7 @@ public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serv return Self; } - public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -81,7 +81,7 @@ public ScriptSortDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public ScriptSortDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -124,7 +124,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -160,8 +160,8 @@ public ScriptSortDescriptor() : base() private Elastic.Clients.Elasticsearch.Serverless.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Serverless.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { 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; } @@ -180,7 +180,7 @@ public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.Nest return Self; } - public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -188,7 +188,7 @@ public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public ScriptSortDescriptor Nested(Action configure) + public ScriptSortDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -231,7 +231,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Serverless.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs index a84e56411b0..90371ca1a90 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SegmentsStats.g.cs @@ -129,18 +129,6 @@ public sealed partial class SegmentsStats [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. /// @@ -153,6 +141,18 @@ public sealed partial class SegmentsStats [JsonInclude, JsonPropertyName("terms_memory_in_bytes")] public long TermsMemoryInBytes { 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 by all version maps across all shards assigned to selected nodes. /// diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs index 3511c28334f..18c2dad5b5e 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SlicedScroll.g.cs @@ -61,6 +61,12 @@ public SlicedScrollDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SlicedScrollDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id) { IdValue = id; diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs index faac2f0f666..66c9cdb0e49 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Slices.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Serverless; +/// +/// Slices configuration used to parallelize a process. +/// public sealed partial class Slices : Union { - public Slices(int value) : base(value) + public Slices(int Value) : base(Value) { } - public Slices(Elastic.Clients.Elasticsearch.Serverless.SlicesCalculation computed) : base(computed) + 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/Snapshot/AzureRepository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepository.g.cs new file mode 100644 index 00000000000..4fa4a5d53c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class AzureRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "azure"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class AzureRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal AzureRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public AzureRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public AzureRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public AzureRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public AzureRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public AzureRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("azure"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + AzureRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs new file mode 100644 index 00000000000..1810933fb85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/AzureRepositorySettings.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.Snapshot; + +public sealed partial class AzureRepositorySettings +{ + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("container")] + public string? Container { get; set; } + [JsonInclude, JsonPropertyName("location_mode")] + public string? LocationMode { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class AzureRepositorySettingsDescriptor : SerializableDescriptor +{ + internal AzureRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public AzureRepositorySettingsDescriptor() : base() + { + } + + private string? BasePathValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private string? ContainerValue { get; set; } + private string? LocationModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public AzureRepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public AzureRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public AzureRepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public AzureRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public AzureRepositorySettingsDescriptor Container(string? container) + { + ContainerValue = container; + return Self; + } + + public AzureRepositorySettingsDescriptor LocationMode(string? locationMode) + { + LocationModeValue = locationMode; + return Self; + } + + public AzureRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public AzureRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public AzureRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (!string.IsNullOrEmpty(ContainerValue)) + { + writer.WritePropertyName("container"); + writer.WriteStringValue(ContainerValue); + } + + if (!string.IsNullOrEmpty(LocationModeValue)) + { + writer.WritePropertyName("location_mode"); + writer.WriteStringValue(LocationModeValue); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs new file mode 100644 index 00000000000..ef47ed457bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CleanupRepositoryResults.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.Snapshot; + +public sealed partial class CleanupRepositoryResults +{ + /// + /// Number of binary large objects (blobs) removed during cleanup. + /// + [JsonInclude, JsonPropertyName("deleted_blobs")] + public long DeletedBlobs { get; init; } + + /// + /// Number of bytes freed by cleanup operations. + /// + [JsonInclude, JsonPropertyName("deleted_bytes")] + public long DeletedBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CompactNodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CompactNodeInfo.g.cs new file mode 100644 index 00000000000..97858134697 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/CompactNodeInfo.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.Snapshot; + +public sealed partial class CompactNodeInfo +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs new file mode 100644 index 00000000000..f95ec40b41d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/FileCountSnapshotStats.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.Snapshot; + +public sealed partial class FileCountSnapshotStats +{ + [JsonInclude, JsonPropertyName("file_count")] + public int FileCount { 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/Snapshot/GcsRepository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepository.g.cs new file mode 100644 index 00000000000..e0700adbd5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class GcsRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "gcs"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class GcsRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal GcsRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public GcsRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public GcsRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public GcsRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public GcsRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public GcsRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("gcs"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + GcsRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs new file mode 100644 index 00000000000..f8129208016 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class GcsRepositorySettings +{ + [JsonInclude, JsonPropertyName("application_name")] + public string? ApplicationName { get; set; } + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("bucket")] + public string Bucket { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class GcsRepositorySettingsDescriptor : SerializableDescriptor +{ + internal GcsRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public GcsRepositorySettingsDescriptor() : base() + { + } + + private string? ApplicationNameValue { get; set; } + private string? BasePathValue { get; set; } + private string BucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public GcsRepositorySettingsDescriptor ApplicationName(string? applicationName) + { + ApplicationNameValue = applicationName; + return Self; + } + + public GcsRepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public GcsRepositorySettingsDescriptor Bucket(string bucket) + { + BucketValue = bucket; + return Self; + } + + public GcsRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public GcsRepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public GcsRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public GcsRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public GcsRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public GcsRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ApplicationNameValue)) + { + writer.WritePropertyName("application_name"); + writer.WriteStringValue(ApplicationNameValue); + } + + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + writer.WritePropertyName("bucket"); + writer.WriteStringValue(BucketValue); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/IndexDetails.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/IndexDetails.g.cs new file mode 100644 index 00000000000..ecd38d300fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/IndexDetails.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.Snapshot; + +public sealed partial class IndexDetails +{ + [JsonInclude, JsonPropertyName("max_segments_per_shard")] + public long MaxSegmentsPerShard { get; init; } + [JsonInclude, JsonPropertyName("shard_count")] + public int ShardCount { get; init; } + [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/Snapshot/InfoFeatureState.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/InfoFeatureState.g.cs new file mode 100644 index 00000000000..c7a92a7f6e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/InfoFeatureState.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.Snapshot; + +public sealed partial class InfoFeatureState +{ + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs new file mode 100644 index 00000000000..af28380959d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class ReadOnlyUrlRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "url"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class ReadOnlyUrlRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ReadOnlyUrlRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public ReadOnlyUrlRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public ReadOnlyUrlRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("url"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + ReadOnlyUrlRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs new file mode 100644 index 00000000000..3335b4442f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs @@ -0,0 +1,164 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class ReadOnlyUrlRepositorySettings +{ + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("http_max_retries")] + public int? HttpMaxRetries { get; set; } + [JsonInclude, JsonPropertyName("http_socket_timeout")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? HttpSocketTimeout { get; set; } + [JsonInclude, JsonPropertyName("max_number_of_snapshots")] + public int? MaxNumberOfSnapshots { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("url")] + public string Url { get; set; } +} + +public sealed partial class ReadOnlyUrlRepositorySettingsDescriptor : SerializableDescriptor +{ + internal ReadOnlyUrlRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public ReadOnlyUrlRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private int? HttpMaxRetriesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration? HttpSocketTimeoutValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private string UrlValue { get; set; } + + public ReadOnlyUrlRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor HttpMaxRetries(int? httpMaxRetries) + { + HttpMaxRetriesValue = httpMaxRetries; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor HttpSocketTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? httpSocketTimeout) + { + HttpSocketTimeoutValue = httpSocketTimeout; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor Url(string url) + { + UrlValue = url; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (HttpMaxRetriesValue.HasValue) + { + writer.WritePropertyName("http_max_retries"); + writer.WriteNumberValue(HttpMaxRetriesValue.Value); + } + + if (HttpSocketTimeoutValue is not null) + { + writer.WritePropertyName("http_socket_timeout"); + JsonSerializer.Serialize(writer, HttpSocketTimeoutValue, options); + } + + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + writer.WritePropertyName("url"); + writer.WriteStringValue(UrlValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Repositories.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Repositories.g.cs new file mode 100644 index 00000000000..a8395962378 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Repositories.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the 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.Snapshot; + +public partial class Repositories : IsADictionary +{ + public Repositories() + { + } + + public Repositories(IDictionary container) : base(container) + { + } + + public void Add(string name, IRepository repository) => BackingDictionary.Add(Sanitize(name), repository); + public bool TryGetRepository(string name, [NotNullWhen(returnValue: true)] out IRepository repository) => BackingDictionary.TryGetValue(Sanitize(name), out repository); + + public bool TryGetRepository(string name, [NotNullWhen(returnValue: true)] out T? repository) where T : class, IRepository + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + repository = finalValue; + return true; + } + + repository = null; + return false; + } +} + +public sealed partial class RepositoriesDescriptor : IsADictionaryDescriptor +{ + public RepositoriesDescriptor() : base(new Repositories()) + { + } + + public RepositoriesDescriptor(Repositories repositories) : base(repositories ?? new Repositories()) + { + } + + public RepositoriesDescriptor Azure(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor Azure(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor Azure(string repositoryName, AzureRepository azureRepository) => AssignVariant(repositoryName, azureRepository); + public RepositoriesDescriptor Gcs(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor Gcs(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor Gcs(string repositoryName, GcsRepository gcsRepository) => AssignVariant(repositoryName, gcsRepository); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName, ReadOnlyUrlRepository readOnlyUrlRepository) => AssignVariant(repositoryName, readOnlyUrlRepository); + public RepositoriesDescriptor S3(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor S3(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor S3(string repositoryName, S3Repository s3Repository) => AssignVariant(repositoryName, s3Repository); + public RepositoriesDescriptor SharedFileSystem(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor SharedFileSystem(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor SharedFileSystem(string repositoryName, SharedFileSystemRepository sharedFileSystemRepository) => AssignVariant(repositoryName, sharedFileSystemRepository); + public RepositoriesDescriptor SourceOnly(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor SourceOnly(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor SourceOnly(string repositoryName, SourceOnlyRepository sourceOnlyRepository) => AssignVariant(repositoryName, sourceOnlyRepository); +} + +internal sealed partial class RepositoryInterfaceConverter : JsonConverter +{ + public override IRepository 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 "azure": + return JsonSerializer.Deserialize(ref reader, options); + case "gcs": + return JsonSerializer.Deserialize(ref reader, options); + case "url": + return JsonSerializer.Deserialize(ref reader, options); + case "s3": + return JsonSerializer.Deserialize(ref reader, options); + case "fs": + return JsonSerializer.Deserialize(ref reader, options); + case "source": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IRepository)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, IRepository value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "azure": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.AzureRepository), options); + return; + case "gcs": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.GcsRepository), options); + return; + case "url": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.ReadOnlyUrlRepository), options); + return; + case "s3": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3Repository), options); + return; + case "fs": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepository), options); + return; + case "source": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepository), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(RepositoryInterfaceConverter))] +public partial interface IRepository +{ + public string? Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3Repository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3Repository.g.cs new file mode 100644 index 00000000000..5082b90ec15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3Repository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class S3Repository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "s3"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class S3RepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal S3RepositoryDescriptor(Action configure) => configure.Invoke(this); + + public S3RepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public S3RepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public S3RepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public S3RepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public S3RepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("s3"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.S3RepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + S3Repository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3RepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3RepositorySettings.g.cs new file mode 100644 index 00000000000..9a22a6fa90c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/S3RepositorySettings.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class S3RepositorySettings +{ + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("bucket")] + public string Bucket { get; set; } + [JsonInclude, JsonPropertyName("buffer_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? BufferSize { get; set; } + [JsonInclude, JsonPropertyName("canned_acl")] + public string? CannedAcl { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } + [JsonInclude, JsonPropertyName("server_side_encryption")] + public bool? ServerSideEncryption { get; set; } + [JsonInclude, JsonPropertyName("storage_class")] + public string? StorageClass { get; set; } +} + +public sealed partial class S3RepositorySettingsDescriptor : SerializableDescriptor +{ + internal S3RepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public S3RepositorySettingsDescriptor() : base() + { + } + + private string? BasePathValue { get; set; } + private string BucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? BufferSizeValue { get; set; } + private string? CannedAclValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + private bool? ServerSideEncryptionValue { get; set; } + private string? StorageClassValue { get; set; } + + public S3RepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public S3RepositorySettingsDescriptor Bucket(string bucket) + { + BucketValue = bucket; + return Self; + } + + public S3RepositorySettingsDescriptor BufferSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? bufferSize) + { + BufferSizeValue = bufferSize; + return Self; + } + + public S3RepositorySettingsDescriptor CannedAcl(string? cannedAcl) + { + CannedAclValue = cannedAcl; + return Self; + } + + public S3RepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public S3RepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public S3RepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public S3RepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public S3RepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public S3RepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + public S3RepositorySettingsDescriptor ServerSideEncryption(bool? serverSideEncryption = true) + { + ServerSideEncryptionValue = serverSideEncryption; + return Self; + } + + public S3RepositorySettingsDescriptor StorageClass(string? storageClass) + { + StorageClassValue = storageClass; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + writer.WritePropertyName("bucket"); + writer.WriteStringValue(BucketValue); + if (BufferSizeValue is not null) + { + writer.WritePropertyName("buffer_size"); + JsonSerializer.Serialize(writer, BufferSizeValue, options); + } + + if (!string.IsNullOrEmpty(CannedAclValue)) + { + writer.WritePropertyName("canned_acl"); + writer.WriteStringValue(CannedAclValue); + } + + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + if (ServerSideEncryptionValue.HasValue) + { + writer.WritePropertyName("server_side_encryption"); + writer.WriteBooleanValue(ServerSideEncryptionValue.Value); + } + + if (!string.IsNullOrEmpty(StorageClassValue)) + { + writer.WritePropertyName("storage_class"); + writer.WriteStringValue(StorageClassValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStats.g.cs new file mode 100644 index 00000000000..cacaaed5705 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStats.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.Snapshot; + +public sealed partial class ShardsStats +{ + [JsonInclude, JsonPropertyName("done")] + public long Done { get; init; } + [JsonInclude, JsonPropertyName("failed")] + public long Failed { get; init; } + [JsonInclude, JsonPropertyName("finalizing")] + public long Finalizing { get; init; } + [JsonInclude, JsonPropertyName("initializing")] + public long Initializing { get; init; } + [JsonInclude, JsonPropertyName("started")] + public long Started { 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/Snapshot/ShardsStatsSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs new file mode 100644 index 00000000000..0a0a53d921d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummary.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.Snapshot; + +public sealed partial class ShardsStatsSummary +{ + [JsonInclude, JsonPropertyName("incremental")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStatsSummaryItem Incremental { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStatsSummaryItem Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs new file mode 100644 index 00000000000..659caee8f26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/ShardsStatsSummaryItem.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.Snapshot; + +public sealed partial class ShardsStatsSummaryItem +{ + [JsonInclude, JsonPropertyName("file_count")] + public long FileCount { 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/Snapshot/SharedFileSystemRepository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs new file mode 100644 index 00000000000..ce70a279ec7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class SharedFileSystemRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "fs"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class SharedFileSystemRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SharedFileSystemRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public SharedFileSystemRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public SharedFileSystemRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("fs"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.SharedFileSystemRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + SharedFileSystemRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs new file mode 100644 index 00000000000..ca0a1dcea34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.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.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class SharedFileSystemRepositorySettings +{ + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("location")] + public string Location { get; set; } + [JsonInclude, JsonPropertyName("max_number_of_snapshots")] + public int? MaxNumberOfSnapshots { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class SharedFileSystemRepositorySettingsDescriptor : SerializableDescriptor +{ + internal SharedFileSystemRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public SharedFileSystemRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private string LocationValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public SharedFileSystemRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Location(string location) + { + LocationValue = location; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + writer.WritePropertyName("location"); + writer.WriteStringValue(LocationValue); + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs new file mode 100644 index 00000000000..6eba7b4b26e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotIndexStats.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.Snapshot; + +public sealed partial class SnapshotIndexStats +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary Shards { get; init; } + [JsonInclude, JsonPropertyName("shards_stats")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStats ShardsStats { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotStats Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotInfo.g.cs new file mode 100644 index 00000000000..56b8fa219e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotInfo.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.Snapshot; + +public sealed partial class SnapshotInfo +{ + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } + [JsonInclude, JsonPropertyName("duration")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Duration { get; init; } + [JsonInclude, JsonPropertyName("duration_in_millis")] + public long? DurationInMillis { get; init; } + [JsonInclude, JsonPropertyName("end_time")] + public DateTimeOffset? EndTime { get; init; } + [JsonInclude, JsonPropertyName("end_time_in_millis")] + public long? EndTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("feature_states")] + public IReadOnlyCollection? FeatureStates { get; init; } + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; init; } + [JsonInclude, JsonPropertyName("index_details")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Snapshot.IndexDetails))] + public IReadOnlyDictionary? IndexDetails { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection? Indices { get; init; } + [JsonInclude, JsonPropertyName("metadata")] + public IReadOnlyDictionary? Metadata { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long? StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string? State { get; init; } + [JsonInclude, JsonPropertyName("uuid")] + public string Uuid { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } + [JsonInclude, JsonPropertyName("version_id")] + public long? VersionId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs new file mode 100644 index 00000000000..773e673d3f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotResponseItem.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.Snapshot; + +public sealed partial class SnapshotResponseItem +{ + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.Serverless.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection? Snapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotRestore.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotRestore.g.cs new file mode 100644 index 00000000000..66f4eafe57b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotRestore.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.Snapshot; + +public sealed partial class SnapshotRestore +{ + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs new file mode 100644 index 00000000000..0071b40bb4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardFailure.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.Snapshot; + +public sealed partial class SnapshotShardFailure +{ + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string? NodeId { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + [JsonInclude, JsonPropertyName("shard_id")] + public string ShardId { 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/Snapshot/SnapshotShardsStatus.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs new file mode 100644 index 00000000000..6f840e7deb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotShardsStatus.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.Snapshot; + +public sealed partial class SnapshotShardsStatus +{ + [JsonInclude, JsonPropertyName("stage")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStatsStage Stage { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStatsSummary Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotStats.g.cs new file mode 100644 index 00000000000..f6089c6b216 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SnapshotStats.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.Snapshot; + +public sealed partial class SnapshotStats +{ + [JsonInclude, JsonPropertyName("incremental")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.FileCountSnapshotStats Incremental { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.FileCountSnapshotStats Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs new file mode 100644 index 00000000000..559095c9279 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.Snapshot; + +public sealed partial class SourceOnlyRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "source"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class SourceOnlyRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SourceOnlyRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public SourceOnlyRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public SourceOnlyRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public SourceOnlyRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public SourceOnlyRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public SourceOnlyRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("source"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Serverless.Snapshot.SourceOnlyRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + SourceOnlyRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs new file mode 100644 index 00000000000..b039cdb0a45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.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.Snapshot; + +internal sealed partial class SourceOnlyRepositorySettingsConverter : JsonConverter +{ + public override SourceOnlyRepositorySettings Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new SourceOnlyRepositorySettings(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "chunk_size") + { + variant.ChunkSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "compress") + { + variant.Compress = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delegate_type") + { + variant.DelegateType = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_number_of_snapshots") + { + variant.MaxNumberOfSnapshots = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_restore_bytes_per_sec") + { + variant.MaxRestoreBytesPerSec = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_snapshot_bytes_per_sec") + { + variant.MaxSnapshotBytesPerSec = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "read_only" || property == "readonly") + { + variant.ReadOnly = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, SourceOnlyRepositorySettings value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.ChunkSize is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, value.ChunkSize, options); + } + + if (value.Compress.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(value.Compress.Value); + } + + if (!string.IsNullOrEmpty(value.DelegateType)) + { + writer.WritePropertyName("delegate_type"); + writer.WriteStringValue(value.DelegateType); + } + + if (value.MaxNumberOfSnapshots.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(value.MaxNumberOfSnapshots.Value); + } + + if (value.MaxRestoreBytesPerSec is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, value.MaxRestoreBytesPerSec, options); + } + + if (value.MaxSnapshotBytesPerSec is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, value.MaxSnapshotBytesPerSec, options); + } + + if (value.ReadOnly.HasValue) + { + writer.WritePropertyName("read_only"); + writer.WriteBooleanValue(value.ReadOnly.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SourceOnlyRepositorySettingsConverter))] +public sealed partial class SourceOnlyRepositorySettings +{ + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSize { get; set; } + public bool? Compress { get; set; } + public string? DelegateType { get; set; } + public int? MaxNumberOfSnapshots { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSec { get; set; } + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSec { get; set; } + public bool? ReadOnly { get; set; } +} + +public sealed partial class SourceOnlyRepositorySettingsDescriptor : SerializableDescriptor +{ + internal SourceOnlyRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public SourceOnlyRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private string? DelegateTypeValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadOnlyValue { get; set; } + + public SourceOnlyRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.Serverless.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor DelegateType(string? delegateType) + { + DelegateTypeValue = delegateType; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.Serverless.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor ReadOnly(bool? readOnly = true) + { + ReadOnlyValue = readOnly; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (!string.IsNullOrEmpty(DelegateTypeValue)) + { + writer.WritePropertyName("delegate_type"); + writer.WriteStringValue(DelegateTypeValue); + } + + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadOnlyValue.HasValue) + { + writer.WritePropertyName("read_only"); + writer.WriteBooleanValue(ReadOnlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Status.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Status.g.cs new file mode 100644 index 00000000000..e8d92e580c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Snapshot/Status.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.Snapshot; + +public sealed partial class Status +{ + [JsonInclude, JsonPropertyName("include_global_state")] + public bool IncludeGlobalState { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyDictionary Indices { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("shards_stats")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.ShardsStats ShardsStats { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Snapshot.SnapshotStats Stats { 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/SnapshotLifecycleManagement/InProgress.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs new file mode 100644 index 00000000000..6cbb520abf2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/InProgress.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.SnapshotLifecycleManagement; + +public sealed partial class InProgress +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("start_time_millis")] + public long StartTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { 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/SnapshotLifecycleManagement/Invocation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs new file mode 100644 index 00000000000..2e140785f84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Invocation.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.SnapshotLifecycleManagement; + +public sealed partial class Invocation +{ + [JsonInclude, JsonPropertyName("snapshot_name")] + public string SnapshotName { get; init; } + [JsonInclude, JsonPropertyName("time")] + public DateTimeOffset Time { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs new file mode 100644 index 00000000000..2f4108cc56b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Retention.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.SnapshotLifecycleManagement; + +public sealed partial class Retention +{ + /// + /// Time period after which a snapshot is considered expired and eligible for deletion. SLM deletes expired snapshots based on the slm.retention_schedule. + /// + [JsonInclude, JsonPropertyName("expire_after")] + public Elastic.Clients.Elasticsearch.Serverless.Duration ExpireAfter { get; set; } + + /// + /// Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots. + /// + [JsonInclude, JsonPropertyName("max_count")] + public int MaxCount { get; set; } + + /// + /// Minimum number of snapshots to retain, even if the snapshots have expired. + /// + [JsonInclude, JsonPropertyName("min_count")] + public int MinCount { get; set; } +} + +public sealed partial class RetentionDescriptor : SerializableDescriptor +{ + internal RetentionDescriptor(Action configure) => configure.Invoke(this); + + public RetentionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration ExpireAfterValue { get; set; } + private int MaxCountValue { get; set; } + private int MinCountValue { get; set; } + + /// + /// Time period after which a snapshot is considered expired and eligible for deletion. SLM deletes expired snapshots based on the slm.retention_schedule. + /// + public RetentionDescriptor ExpireAfter(Elastic.Clients.Elasticsearch.Serverless.Duration expireAfter) + { + ExpireAfterValue = expireAfter; + return Self; + } + + /// + /// Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots. + /// + public RetentionDescriptor MaxCount(int maxCount) + { + MaxCountValue = maxCount; + return Self; + } + + /// + /// Minimum number of snapshots to retain, even if the snapshots have expired. + /// + public RetentionDescriptor MinCount(int minCount) + { + MinCountValue = minCount; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("expire_after"); + JsonSerializer.Serialize(writer, ExpireAfterValue, options); + writer.WritePropertyName("max_count"); + writer.WriteNumberValue(MaxCountValue); + writer.WritePropertyName("min_count"); + writer.WriteNumberValue(MinCountValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs new file mode 100644 index 00000000000..a566a055e3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement; + +public sealed partial class SlmConfiguration +{ + /// + /// A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.
Each feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.
+ ///
+ [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + + /// + /// If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + + /// + /// If true, the current global state is included in the snapshot. + /// + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + + /// + /// A comma-separated list of data streams and indices to include in the snapshot. Multi-index syntax is supported.
By default, a snapshot includes all data streams and indices in the cluster. If this argument is provided, the snapshot only includes the specified data streams and clusters.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Serverless.Indices? Indices { get; set; } + + /// + /// Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes. + /// + [JsonInclude, JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + + /// + /// If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } +} + +public sealed partial class SlmConfigurationDescriptor : SerializableDescriptor +{ + internal SlmConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public SlmConfigurationDescriptor() : base() + { + } + + private ICollection? FeatureStatesValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Indices? IndicesValue { get; set; } + private IDictionary? MetadataValue { get; set; } + private bool? PartialValue { get; set; } + + /// + /// A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.
Each feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.
+ ///
+ public SlmConfigurationDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + /// + /// If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices. + /// + public SlmConfigurationDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + /// + /// If true, the current global state is included in the snapshot. + /// + public SlmConfigurationDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + /// + /// A comma-separated list of data streams and indices to include in the snapshot. Multi-index syntax is supported.
By default, a snapshot includes all data streams and indices in the cluster. If this argument is provided, the snapshot only includes the specified data streams and clusters.
+ ///
+ public SlmConfigurationDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes. + /// + public SlmConfigurationDescriptor Metadata(Func, FluentDictionary> selector) + { + MetadataValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + public SlmConfigurationDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs new file mode 100644 index 00000000000..d95d7365b69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.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.SnapshotLifecycleManagement; + +public sealed partial class SlmPolicy +{ + [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmConfiguration? Config { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("retention")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Retention? Retention { get; init; } + [JsonInclude, JsonPropertyName("schedule")] + public string Schedule { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs new file mode 100644 index 00000000000..e9e918b2431 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.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.SnapshotLifecycleManagement; + +public sealed partial class SnapshotLifecycle +{ + [JsonInclude, JsonPropertyName("in_progress")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.InProgress? InProgress { get; init; } + [JsonInclude, JsonPropertyName("last_failure")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Invocation? LastFailure { get; init; } + [JsonInclude, JsonPropertyName("last_success")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Invocation? LastSuccess { get; init; } + [JsonInclude, JsonPropertyName("modified_date")] + public DateTimeOffset? ModifiedDate { get; init; } + [JsonInclude, JsonPropertyName("modified_date_millis")] + public long ModifiedDateMillis { get; init; } + [JsonInclude, JsonPropertyName("next_execution")] + public DateTimeOffset? NextExecution { get; init; } + [JsonInclude, JsonPropertyName("next_execution_millis")] + public long NextExecutionMillis { get; init; } + [JsonInclude, JsonPropertyName("policy")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.SlmPolicy Policy { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Statistics Stats { 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/SnapshotLifecycleManagement/Statistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs new file mode 100644 index 00000000000..d55ab71cb05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SnapshotLifecycleManagement/Statistics.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.SnapshotLifecycleManagement; + +internal sealed partial class StatisticsConverter : JsonConverter +{ + public override Statistics Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + string? policy = default; + Elastic.Clients.Elasticsearch.Serverless.Duration? retentionDeletionTime = default; + long? retentionDeletionTimeMillis = default; + long? retentionFailed = default; + long? retentionRuns = default; + long? retentionTimedOut = default; + long? totalSnapshotDeletionFailures = default; + long? totalSnapshotsDeleted = default; + long? totalSnapshotsFailed = default; + long? totalSnapshotsTaken = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "policy") + { + policy = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_deletion_time") + { + retentionDeletionTime = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_deletion_time_millis") + { + retentionDeletionTimeMillis = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_failed") + { + retentionFailed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_runs") + { + retentionRuns = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_timed_out") + { + retentionTimedOut = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshot_deletion_failures" || property == "snapshot_deletion_failures") + { + totalSnapshotDeletionFailures = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_deleted" || property == "snapshots_deleted") + { + totalSnapshotsDeleted = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_failed" || property == "snapshots_failed") + { + totalSnapshotsFailed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_taken" || property == "snapshots_taken") + { + totalSnapshotsTaken = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new Statistics { Policy = policy, RetentionDeletionTime = retentionDeletionTime, RetentionDeletionTimeMillis = retentionDeletionTimeMillis, RetentionFailed = retentionFailed, RetentionRuns = retentionRuns, RetentionTimedOut = retentionTimedOut, TotalSnapshotDeletionFailures = totalSnapshotDeletionFailures, TotalSnapshotsDeleted = totalSnapshotsDeleted, TotalSnapshotsFailed = totalSnapshotsFailed, TotalSnapshotsTaken = totalSnapshotsTaken }; + } + + public override void Write(Utf8JsonWriter writer, Statistics value, JsonSerializerOptions options) + { + throw new NotImplementedException("'Statistics' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StatisticsConverter))] +public sealed partial class Statistics +{ + public string? Policy { get; init; } + public Elastic.Clients.Elasticsearch.Serverless.Duration? RetentionDeletionTime { get; init; } + public long? RetentionDeletionTimeMillis { get; init; } + public long? RetentionFailed { get; init; } + public long? RetentionRuns { get; init; } + public long? RetentionTimedOut { get; init; } + public long? TotalSnapshotDeletionFailures { get; init; } + public long? TotalSnapshotsDeleted { get; init; } + public long? TotalSnapshotsFailed { get; init; } + public long? TotalSnapshotsTaken { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SpecUtils/OverloadOf.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SpecUtils/OverloadOf.g.cs new file mode 100644 index 00000000000..3ee612330b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/SpecUtils/OverloadOf.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 System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.SpecUtils; + +/// +/// A class that implements `OverloadOf` should have the exact same properties with the same types.
It can change if a property is required or not. There is no need to port the descriptions
and js doc tags, the compiler will do that for you.
+///
+public sealed partial class OverloadOf +{ +} \ 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 index e04d8fb2f18..80b95412999 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/StoredScriptId.g.cs @@ -34,6 +34,10 @@ public sealed partial class StoredScriptId /// [JsonInclude, JsonPropertyName("id")] public Elastic.Clients.Elasticsearch.Serverless.Id Id { get; set; } + + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
[JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } } @@ -58,6 +62,9 @@ public StoredScriptIdDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id i return Self; } + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
public StoredScriptIdDescriptor Params(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRule.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRule.g.cs new file mode 100644 index 00000000000..e6795fb388d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRule.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.Synonyms; + +public sealed partial class SynonymRule +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Serverless.Id? Id { get; set; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; set; } +} + +public sealed partial class SynonymRuleDescriptor : SerializableDescriptor +{ + internal SynonymRuleDescriptor(Action configure) => configure.Invoke(this); + + public SynonymRuleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Id? IdValue { get; set; } + private string SynonymsValue { get; set; } + + /// + /// Synonym Rule identifier + /// + public SynonymRuleDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + public SynonymRuleDescriptor Synonyms(string synonyms) + { + SynonymsValue = synonyms; + 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.WritePropertyName("synonyms"); + writer.WriteStringValue(SynonymsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRuleRead.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRuleRead.g.cs new file mode 100644 index 00000000000..eb2ee5a512a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymRuleRead.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.Synonyms; + +public sealed partial class SynonymRuleRead +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymsSetItem.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymsSetItem.g.cs new file mode 100644 index 00000000000..4c2ad7cb749 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Synonyms/SynonymsSetItem.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.Synonyms; + +public sealed partial class SynonymsSetItem +{ + /// + /// Number of synonym rules that the synonym set contains + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Synonyms set identifier + /// + [JsonInclude, JsonPropertyName("synonyms_set")] + public string SynonymsSet { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/ParentTaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/ParentTaskInfo.g.cs index 4a0dacf03d0..01021437267 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/ParentTaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/ParentTaskInfo.g.cs @@ -53,6 +53,10 @@ public sealed partial class ParentTaskInfo 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")] diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfos.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfos.g.cs index 8be7e3c7cff..5e951907a42 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfos.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Tasks/TaskInfos.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Tasks; public sealed partial class TaskInfos : Union, IReadOnlyDictionary> { - public TaskInfos(IReadOnlyCollection flat) : base(flat) + public TaskInfos(IReadOnlyCollection Flat) : base(Flat) { } - public TaskInfos(IReadOnlyDictionary grouped) : base(grouped) + public TaskInfos(IReadOnlyDictionary Grouped) : base(Grouped) { } } \ 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 index 46db556692a..e98b1858db7 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextEmbedding.g.cs @@ -34,7 +34,7 @@ public sealed partial class TextEmbedding [JsonInclude, JsonPropertyName("model_text")] public string ModelText { get; set; } - public static implicit operator QueryVectorBuilder(TextEmbedding textEmbedding) => QueryVectorBuilder.TextEmbedding(textEmbedding); + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder(TextEmbedding textEmbedding) => Elastic.Clients.Elasticsearch.Serverless.QueryVectorBuilder.TextEmbedding(textEmbedding); } public sealed partial class TextEmbeddingDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedField.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedField.g.cs new file mode 100644 index 00000000000..e00168eadf6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedField.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.TextStructure; + +public sealed partial class MatchedField +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("match")] + public string Match { 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/TextStructure/MatchedText.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedText.g.cs new file mode 100644 index 00000000000..1a552192c91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TextStructure/MatchedText.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.TextStructure; + +public sealed partial class MatchedText +{ + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary>? Fields { get; init; } + [JsonInclude, JsonPropertyName("matched")] + public bool Matched { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/CheckpointStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/CheckpointStats.g.cs new file mode 100644 index 00000000000..a01385c2f71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/CheckpointStats.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.TransformManagement; + +public sealed partial class CheckpointStats +{ + [JsonInclude, JsonPropertyName("checkpoint")] + public long Checkpoint { get; init; } + [JsonInclude, JsonPropertyName("checkpoint_progress")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TransformProgress? CheckpointProgress { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public DateTimeOffset? Timestamp { get; init; } + [JsonInclude, JsonPropertyName("timestamp_millis")] + public long? TimestampMillis { get; init; } + [JsonInclude, JsonPropertyName("time_upper_bound")] + public DateTimeOffset? TimeUpperBound { get; init; } + [JsonInclude, JsonPropertyName("time_upper_bound_millis")] + public long? TimeUpperBoundMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Checkpointing.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Checkpointing.g.cs new file mode 100644 index 00000000000..fa1925fb923 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Checkpointing.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.TransformManagement; + +public sealed partial class Checkpointing +{ + [JsonInclude, JsonPropertyName("changes_last_detected_at")] + public long? ChangesLastDetectedAt { get; init; } + [JsonInclude, JsonPropertyName("changes_last_detected_at_date_time")] + public DateTimeOffset? ChangesLastDetectedAtDateTime { get; init; } + [JsonInclude, JsonPropertyName("last")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.CheckpointStats Last { get; init; } + [JsonInclude, JsonPropertyName("last_search_time")] + public long? LastSearchTime { get; init; } + [JsonInclude, JsonPropertyName("next")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.CheckpointStats? Next { get; init; } + [JsonInclude, JsonPropertyName("operations_behind")] + public long? OperationsBehind { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Destination.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Destination.g.cs new file mode 100644 index 00000000000..d50962e671b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Destination.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.TransformManagement; + +public sealed partial class Destination +{ + /// + /// The destination index for the transform. The mappings of the destination index are deduced based on the source
fields when possible. If alternate mappings are required, use the create index API prior to starting the
transform.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.IndexName? Index { get; set; } + + /// + /// The unique identifier for an ingest pipeline. + /// + [JsonInclude, JsonPropertyName("pipeline")] + public string? Pipeline { get; set; } +} + +public sealed partial class DestinationDescriptor : SerializableDescriptor +{ + internal DestinationDescriptor(Action configure) => configure.Invoke(this); + + public DestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.IndexName? IndexValue { get; set; } + private string? PipelineValue { get; set; } + + /// + /// The destination index for the transform. The mappings of the destination index are deduced based on the source
fields when possible. If alternate mappings are required, use the create index API prior to starting the
transform.
+ ///
+ public DestinationDescriptor Index(Elastic.Clients.Elasticsearch.Serverless.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// The unique identifier for an ingest pipeline. + /// + public DestinationDescriptor Pipeline(string? pipeline) + { + PipelineValue = pipeline; + 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 (!string.IsNullOrEmpty(PipelineValue)) + { + writer.WritePropertyName("pipeline"); + writer.WriteStringValue(PipelineValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Latest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Latest.g.cs new file mode 100644 index 00000000000..bbda8604b21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Latest.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.TransformManagement; + +public sealed partial class Latest +{ + /// + /// Specifies the date field that is used to identify the latest documents. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Serverless.Field Sort { get; set; } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + [JsonInclude, JsonPropertyName("unique_key")] + public ICollection UniqueKey { get; set; } +} + +public sealed partial class LatestDescriptor : SerializableDescriptor> +{ + internal LatestDescriptor(Action> configure) => configure.Invoke(this); + + public LatestDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field SortValue { get; set; } + private ICollection UniqueKeyValue { get; set; } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + public LatestDescriptor UniqueKey(ICollection uniqueKey) + { + UniqueKeyValue = uniqueKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + writer.WritePropertyName("unique_key"); + JsonSerializer.Serialize(writer, UniqueKeyValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class LatestDescriptor : SerializableDescriptor +{ + internal LatestDescriptor(Action configure) => configure.Invoke(this); + + public LatestDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field SortValue { get; set; } + private ICollection UniqueKeyValue { get; set; } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Elastic.Clients.Elasticsearch.Serverless.Field sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + public LatestDescriptor UniqueKey(ICollection uniqueKey) + { + UniqueKeyValue = uniqueKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + writer.WritePropertyName("unique_key"); + JsonSerializer.Serialize(writer, UniqueKeyValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Pivot.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Pivot.g.cs new file mode 100644 index 00000000000..0f01241ca8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Pivot.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.TransformManagement; + +internal sealed partial class PivotConverter : JsonConverter +{ + public override Pivot Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new Pivot(); + 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 == "group_by") + { + variant.GroupBy = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, Pivot value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.GroupBy is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, value.GroupBy, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(PivotConverter))] +public sealed partial class Pivot +{ + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public IDictionary? Aggregations { get; set; } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public IDictionary? GroupBy { get; set; } +} + +public sealed partial class PivotDescriptor : SerializableDescriptor> +{ + internal PivotDescriptor(Action> configure) => configure.Invoke(this); + + public PivotDescriptor() : base() + { + } + + private IDictionary> AggregationsValue { get; set; } + private IDictionary> GroupByValue { get; set; } + + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public PivotDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public PivotDescriptor GroupBy(Func>, FluentDescriptorDictionary>> selector) + { + GroupByValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (GroupByValue is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, GroupByValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PivotDescriptor : SerializableDescriptor +{ + internal PivotDescriptor(Action configure) => configure.Invoke(this); + + public PivotDescriptor() : base() + { + } + + private IDictionary AggregationsValue { get; set; } + private IDictionary GroupByValue { get; set; } + + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public PivotDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public PivotDescriptor GroupBy(Func, FluentDescriptorDictionary> selector) + { + GroupByValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (GroupByValue is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, GroupByValue, 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 index aa28c12c2b1..c4157712674 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/PivotGroupBy.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serverless.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -49,6 +50,18 @@ internal PivotGroupBy(string variantName, object variant) 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); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class PivotGroupByConverter : JsonConverter @@ -60,49 +73,62 @@ public override PivotGroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "geotile_grid") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new PivotGroupBy(propertyName, variant); - } + if (propertyName == "date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "histogram") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new PivotGroupBy(propertyName, variant); - } + if (propertyName == "geotile_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new PivotGroupBy(propertyName, variant); + if (propertyName == "histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'PivotGroupBy' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new PivotGroupBy(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, PivotGroupBy value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -157,33 +183,31 @@ private PivotGroupByDescriptor Set(object variant, string variantName 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"); + public PivotGroupByDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -219,37 +243,31 @@ private PivotGroupByDescriptor Set(object variant, string variantName) 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"); + public PivotGroupByDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Serverless.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Elastic.Clients.Elasticsearch.Serverless.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Elastic.Clients.Elasticsearch.Serverless.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - 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/TransformManagement/RetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/RetentionPolicy.g.cs new file mode 100644 index 00000000000..6d7d53acbda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/RetentionPolicy.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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.TransformManagement; + +[JsonConverter(typeof(RetentionPolicyConverter))] +public sealed partial class RetentionPolicy +{ + internal RetentionPolicy(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 RetentionPolicy Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeRetentionPolicy retentionPolicy) => new RetentionPolicy("time", retentionPolicy); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class RetentionPolicyConverter : JsonConverter +{ + public override RetentionPolicy 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; + 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 == "time") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'RetentionPolicy' from the response."); + } + + reader.Read(); + var result = new RetentionPolicy(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, RetentionPolicy value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "time": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeRetentionPolicy)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RetentionPolicyDescriptor : SerializableDescriptor> +{ + internal RetentionPolicyDescriptor(Action> configure) => configure.Invoke(this); + + public RetentionPolicyDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RetentionPolicyDescriptor 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 RetentionPolicyDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RetentionPolicyDescriptor Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeRetentionPolicy retentionPolicy) => Set(retentionPolicy, "time"); + public RetentionPolicyDescriptor Time(Action> configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 RetentionPolicyDescriptor : SerializableDescriptor +{ + internal RetentionPolicyDescriptor(Action configure) => configure.Invoke(this); + + public RetentionPolicyDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RetentionPolicyDescriptor 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 RetentionPolicyDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RetentionPolicyDescriptor Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeRetentionPolicy retentionPolicy) => Set(retentionPolicy, "time"); + public RetentionPolicyDescriptor Time(Action configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/TransformManagement/Settings.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Settings.g.cs new file mode 100644 index 00000000000..d0838ea69ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Settings.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.TransformManagement; + +/// +/// The source of the data for the transform. +/// +public sealed partial class Settings +{ + /// + /// Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align
checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the
transform config. As a result, less document updates in the destination index will be performed thus improving
overall performance.
+ ///
+ [JsonInclude, JsonPropertyName("align_checkpoints")] + public bool? AlignCheckpoints { get; set; } + + /// + /// Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was
the default for transforms created before version 7.11. For compatible output set this value to `true`.
+ ///
+ [JsonInclude, JsonPropertyName("dates_as_epoch_millis")] + public bool? DatesAsEpochMillis { get; set; } + + /// + /// Specifies whether the transform should deduce the destination index mappings from the transform configuration. + /// + [JsonInclude, JsonPropertyName("deduce_mappings")] + public bool? DeduceMappings { get; set; } + + /// + /// Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a
wait time between search requests. The default value is null, which disables throttling.
+ ///
+ [JsonInclude, JsonPropertyName("docs_per_second")] + public float? DocsPerSecond { get; set; } + + /// + /// Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker
exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the
maximum is `65,536`.
+ ///
+ [JsonInclude, JsonPropertyName("max_page_search_size")] + public int? MaxPageSearchSize { get; set; } + + /// + /// If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case
of an error which means the transform never fails. Setting the number of retries other than infinite fails in
validation.
+ ///
+ [JsonInclude, JsonPropertyName("unattended")] + public bool? Unattended { get; set; } +} + +/// +/// The source of the data for the transform. +/// +public sealed partial class SettingsDescriptor : SerializableDescriptor +{ + internal SettingsDescriptor(Action configure) => configure.Invoke(this); + + public SettingsDescriptor() : base() + { + } + + private bool? AlignCheckpointsValue { get; set; } + private bool? DatesAsEpochMillisValue { get; set; } + private bool? DeduceMappingsValue { get; set; } + private float? DocsPerSecondValue { get; set; } + private int? MaxPageSearchSizeValue { get; set; } + private bool? UnattendedValue { get; set; } + + /// + /// Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align
checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the
transform config. As a result, less document updates in the destination index will be performed thus improving
overall performance.
+ ///
+ public SettingsDescriptor AlignCheckpoints(bool? alignCheckpoints = true) + { + AlignCheckpointsValue = alignCheckpoints; + return Self; + } + + /// + /// Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was
the default for transforms created before version 7.11. For compatible output set this value to `true`.
+ ///
+ public SettingsDescriptor DatesAsEpochMillis(bool? datesAsEpochMillis = true) + { + DatesAsEpochMillisValue = datesAsEpochMillis; + return Self; + } + + /// + /// Specifies whether the transform should deduce the destination index mappings from the transform configuration. + /// + public SettingsDescriptor DeduceMappings(bool? deduceMappings = true) + { + DeduceMappingsValue = deduceMappings; + return Self; + } + + /// + /// Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a
wait time between search requests. The default value is null, which disables throttling.
+ ///
+ public SettingsDescriptor DocsPerSecond(float? docsPerSecond) + { + DocsPerSecondValue = docsPerSecond; + return Self; + } + + /// + /// Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker
exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the
maximum is `65,536`.
+ ///
+ public SettingsDescriptor MaxPageSearchSize(int? maxPageSearchSize) + { + MaxPageSearchSizeValue = maxPageSearchSize; + return Self; + } + + /// + /// If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case
of an error which means the transform never fails. Setting the number of retries other than infinite fails in
validation.
+ ///
+ public SettingsDescriptor Unattended(bool? unattended = true) + { + UnattendedValue = unattended; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlignCheckpointsValue.HasValue) + { + writer.WritePropertyName("align_checkpoints"); + writer.WriteBooleanValue(AlignCheckpointsValue.Value); + } + + if (DatesAsEpochMillisValue.HasValue) + { + writer.WritePropertyName("dates_as_epoch_millis"); + writer.WriteBooleanValue(DatesAsEpochMillisValue.Value); + } + + if (DeduceMappingsValue.HasValue) + { + writer.WritePropertyName("deduce_mappings"); + writer.WriteBooleanValue(DeduceMappingsValue.Value); + } + + if (DocsPerSecondValue.HasValue) + { + writer.WritePropertyName("docs_per_second"); + writer.WriteNumberValue(DocsPerSecondValue.Value); + } + + if (MaxPageSearchSizeValue.HasValue) + { + writer.WritePropertyName("max_page_search_size"); + writer.WriteNumberValue(MaxPageSearchSizeValue.Value); + } + + if (UnattendedValue.HasValue) + { + writer.WritePropertyName("unattended"); + writer.WriteBooleanValue(UnattendedValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Source.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Source.g.cs new file mode 100644 index 00000000000..686bab473e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Source.g.cs @@ -0,0 +1,229 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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; + +public sealed partial class Source +{ + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Serverless.Indices Indices { get; set; } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } +} + +public sealed partial class SourceDescriptor : SerializableDescriptor> +{ + internal SourceDescriptor(Action> configure) => configure.Invoke(this); + + public SourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SourceDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ public SourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SourceDescriptor : SerializableDescriptor +{ + internal SourceDescriptor(Action configure) => configure.Invoke(this); + + public SourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SourceDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ public SourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.Serverless.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, 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/Types/TransformManagement/Sync.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Sync.g.cs new file mode 100644 index 00000000000..bb5abd2b0b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/Sync.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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.TransformManagement; + +[JsonConverter(typeof(SyncConverter))] +public sealed partial class Sync +{ + internal Sync(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 Sync Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeSync timeSync) => new Sync("time", timeSync); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class SyncConverter : JsonConverter +{ + public override Sync 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; + 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 == "time") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Sync' from the response."); + } + + reader.Read(); + var result = new Sync(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, Sync value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "time": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeSync)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SyncDescriptor : SerializableDescriptor> +{ + internal SyncDescriptor(Action> configure) => configure.Invoke(this); + + public SyncDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SyncDescriptor 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 SyncDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SyncDescriptor Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeSync timeSync) => Set(timeSync, "time"); + public SyncDescriptor Time(Action> configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 SyncDescriptor : SerializableDescriptor +{ + internal SyncDescriptor(Action configure) => configure.Invoke(this); + + public SyncDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SyncDescriptor 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 SyncDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SyncDescriptor Time(Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TimeSync timeSync) => Set(timeSync, "time"); + public SyncDescriptor Time(Action configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/TransformManagement/TimeRetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs new file mode 100644 index 00000000000..9f578f277eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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; + +public sealed partial class TimeRetentionPolicy +{ + /// + /// The date field that is used to calculate the age of the document. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("max_age")] + public Elastic.Clients.Elasticsearch.Serverless.Duration MaxAge { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy(TimeRetentionPolicy timeRetentionPolicy) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy.Time(timeRetentionPolicy); +} + +public sealed partial class TimeRetentionPolicyDescriptor : SerializableDescriptor> +{ + internal TimeRetentionPolicyDescriptor(Action> configure) => configure.Invoke(this); + + public TimeRetentionPolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration MaxAgeValue { get; set; } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ public TimeRetentionPolicyDescriptor MaxAge(Elastic.Clients.Elasticsearch.Serverless.Duration maxAge) + { + MaxAgeValue = maxAge; + 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_age"); + JsonSerializer.Serialize(writer, MaxAgeValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TimeRetentionPolicyDescriptor : SerializableDescriptor +{ + internal TimeRetentionPolicyDescriptor(Action configure) => configure.Invoke(this); + + public TimeRetentionPolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Duration MaxAgeValue { get; set; } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ public TimeRetentionPolicyDescriptor MaxAge(Elastic.Clients.Elasticsearch.Serverless.Duration maxAge) + { + MaxAgeValue = maxAge; + 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_age"); + JsonSerializer.Serialize(writer, MaxAgeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeSync.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeSync.g.cs new file mode 100644 index 00000000000..7e725a89771 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TimeSync.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Serverless.Fluent; +using Elastic.Clients.Elasticsearch.Serverless.Serialization; +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; + +public sealed partial class TimeSync +{ + /// + /// The time delay between the current time and the latest input data time. + /// + [JsonInclude, JsonPropertyName("delay")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Delay { get; set; } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Serverless.Field Field { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync(TimeSync timeSync) => Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync.Time(timeSync); +} + +public sealed partial class TimeSyncDescriptor : SerializableDescriptor> +{ + internal TimeSyncDescriptor(Action> configure) => configure.Invoke(this); + + public TimeSyncDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The time delay between the current time and the latest input data time. + /// + public TimeSyncDescriptor Delay(Elastic.Clients.Elasticsearch.Serverless.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TimeSyncDescriptor : SerializableDescriptor +{ + internal TimeSyncDescriptor(Action configure) => configure.Invoke(this); + + public TimeSyncDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Serverless.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Serverless.Field FieldValue { get; set; } + + /// + /// The time delay between the current time and the latest input data time. + /// + public TimeSyncDescriptor Delay(Elastic.Clients.Elasticsearch.Serverless.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Elastic.Clients.Elasticsearch.Serverless.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + 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/TransformManagement/TransformIndexerStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs new file mode 100644 index 00000000000..5598a12e818 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformIndexerStats.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 System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement; + +public sealed partial class TransformIndexerStats +{ + [JsonInclude, JsonPropertyName("delete_time_in_ms")] + public long? DeleteTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("documents_deleted")] + public long? DocumentsDeleted { get; init; } + [JsonInclude, JsonPropertyName("documents_indexed")] + public long DocumentsIndexed { get; init; } + [JsonInclude, JsonPropertyName("documents_processed")] + public long DocumentsProcessed { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_checkpoint_duration_ms")] + public double ExponentialAvgCheckpointDurationMs { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_documents_indexed")] + public double ExponentialAvgDocumentsIndexed { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_documents_processed")] + public double ExponentialAvgDocumentsProcessed { get; init; } + [JsonInclude, JsonPropertyName("index_failures")] + public long IndexFailures { get; init; } + [JsonInclude, JsonPropertyName("index_time_in_ms")] + public long IndexTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("index_total")] + public long IndexTotal { get; init; } + [JsonInclude, JsonPropertyName("pages_processed")] + public long PagesProcessed { get; init; } + [JsonInclude, JsonPropertyName("processing_time_in_ms")] + public long ProcessingTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("processing_total")] + public long ProcessingTotal { get; init; } + [JsonInclude, JsonPropertyName("search_failures")] + public long SearchFailures { get; init; } + [JsonInclude, JsonPropertyName("search_time_in_ms")] + public long SearchTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("search_total")] + public long SearchTotal { get; init; } + [JsonInclude, JsonPropertyName("trigger_count")] + public long TriggerCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformProgress.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformProgress.g.cs new file mode 100644 index 00000000000..096b4c77899 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformProgress.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.TransformManagement; + +public sealed partial class TransformProgress +{ + [JsonInclude, JsonPropertyName("docs_indexed")] + public long DocsIndexed { get; init; } + [JsonInclude, JsonPropertyName("docs_processed")] + public long DocsProcessed { get; init; } + [JsonInclude, JsonPropertyName("docs_remaining")] + public long DocsRemaining { get; init; } + [JsonInclude, JsonPropertyName("percent_complete")] + public double PercentComplete { get; init; } + [JsonInclude, JsonPropertyName("total_docs")] + public long TotalDocs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStats.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStats.g.cs new file mode 100644 index 00000000000..9ef4feeee09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStats.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.TransformManagement; + +public sealed partial class TransformStats +{ + [JsonInclude, JsonPropertyName("checkpointing")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Checkpointing Checkpointing { get; init; } + [JsonInclude, JsonPropertyName("health")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TransformStatsHealth? Health { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.TransformIndexerStats Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs new file mode 100644 index 00000000000..0f9e040603e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformStatsHealth.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.TransformManagement; + +public sealed partial class TransformStatsHealth +{ + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformSummary.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformSummary.g.cs new file mode 100644 index 00000000000..33b598cec6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/TransformManagement/TransformSummary.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.TransformManagement; + +public sealed partial class TransformSummary +{ + /// + /// The security privileges that the transform uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the transform, this property is omitted. + /// + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.TransformAuthorization? Authorization { get; init; } + + /// + /// The time the transform was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public long? CreateTime { get; init; } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Serverless.Core.Reindex.Destination Dest { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Serverless.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Latest? Latest { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The pivot method transforms the data by aggregating and grouping it. + /// + [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Pivot? Pivot { get; init; } + [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.RetentionPolicy? RetentionPolicy { get; init; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Settings? Settings { get; init; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Source Source { get; init; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.Serverless.TransformManagement.Sync? Sync { get; init; } + + /// + /// The version of Elasticsearch that existed on the node when the transform was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Analytics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Analytics.g.cs new file mode 100644 index 00000000000..e8ae431eabe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Analytics.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.Xpack; + +public sealed partial class Analytics +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.AnalyticsStatistics Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/AnalyticsStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/AnalyticsStatistics.g.cs new file mode 100644 index 00000000000..e4b357a6fb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/AnalyticsStatistics.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.Xpack; + +public sealed partial class AnalyticsStatistics +{ + [JsonInclude, JsonPropertyName("boxplot_usage")] + public long BoxplotUsage { get; init; } + [JsonInclude, JsonPropertyName("cumulative_cardinality_usage")] + public long CumulativeCardinalityUsage { get; init; } + [JsonInclude, JsonPropertyName("moving_percentiles_usage")] + public long MovingPercentilesUsage { get; init; } + [JsonInclude, JsonPropertyName("multi_terms_usage")] + public long? MultiTermsUsage { get; init; } + [JsonInclude, JsonPropertyName("normalize_usage")] + public long NormalizeUsage { get; init; } + [JsonInclude, JsonPropertyName("rate_usage")] + public long RateUsage { get; init; } + [JsonInclude, JsonPropertyName("string_stats_usage")] + public long StringStatsUsage { get; init; } + [JsonInclude, JsonPropertyName("top_metrics_usage")] + public long TopMetricsUsage { get; init; } + [JsonInclude, JsonPropertyName("t_test_usage")] + public long TTestUsage { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Archive.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Archive.g.cs new file mode 100644 index 00000000000..c546b7f76ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Archive.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.Xpack; + +public sealed partial class Archive +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Audit.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Audit.g.cs new file mode 100644 index 00000000000..8a83da0392d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Audit.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.Xpack; + +public sealed partial class Audit +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("outputs")] + public IReadOnlyCollection? Outputs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Base.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Base.g.cs new file mode 100644 index 00000000000..300d124aef9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Base.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.Xpack; + +public sealed partial class Base +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/BuildInformation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/BuildInformation.g.cs new file mode 100644 index 00000000000..3a0fe0808f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/BuildInformation.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.Xpack; + +public sealed partial class BuildInformation +{ + [JsonInclude, JsonPropertyName("date")] + public DateTimeOffset Date { get; init; } + [JsonInclude, JsonPropertyName("hash")] + public string Hash { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ccr.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ccr.g.cs new file mode 100644 index 00000000000..a620f573c2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ccr.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.Xpack; + +public sealed partial class Ccr +{ + [JsonInclude, JsonPropertyName("auto_follow_patterns_count")] + public int AutoFollowPatternsCount { get; init; } + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("follower_indices_count")] + public int FollowerIndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Counter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Counter.g.cs new file mode 100644 index 00000000000..1039ec2e67c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Counter.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.Xpack; + +public sealed partial class Counter +{ + [JsonInclude, JsonPropertyName("active")] + public long Active { 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/Xpack/DataStreams.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataStreams.g.cs new file mode 100644 index 00000000000..ab13e3404f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataStreams.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.Xpack; + +public sealed partial class DataStreams +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public long DataStreams2 { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs new file mode 100644 index 00000000000..925b688cdd4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTierPhaseStatistics.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.Xpack; + +public sealed partial class DataTierPhaseStatistics +{ + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("index_count")] + public long IndexCount { get; init; } + [JsonInclude, JsonPropertyName("node_count")] + public long NodeCount { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_count")] + public long PrimaryShardCount { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_avg_bytes")] + public long PrimaryShardSizeAvgBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_mad_bytes")] + public long PrimaryShardSizeMadBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_median_bytes")] + public long PrimaryShardSizeMedianBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_size_bytes")] + public long PrimarySizeBytes { get; init; } + [JsonInclude, JsonPropertyName("total_shard_count")] + public long TotalShardCount { get; init; } + [JsonInclude, JsonPropertyName("total_size_bytes")] + public long TotalSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTiers.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTiers.g.cs new file mode 100644 index 00000000000..5ab69df2f3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/DataTiers.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.Xpack; + +public sealed partial class DataTiers +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("data_cold")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTierPhaseStatistics DataCold { get; init; } + [JsonInclude, JsonPropertyName("data_content")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTierPhaseStatistics DataContent { get; init; } + [JsonInclude, JsonPropertyName("data_frozen")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTierPhaseStatistics? DataFrozen { get; init; } + [JsonInclude, JsonPropertyName("data_hot")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTierPhaseStatistics DataHot { get; init; } + [JsonInclude, JsonPropertyName("data_warm")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.DataTierPhaseStatistics DataWarm { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Datafeed.g.cs new file mode 100644 index 00000000000..daefcc8c031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Datafeed.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.Xpack; + +public sealed partial class Datafeed +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Eql.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Eql.g.cs new file mode 100644 index 00000000000..99115845263 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Eql.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.Xpack; + +public sealed partial class Eql +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.EqlFeatures Features { get; init; } + [JsonInclude, JsonPropertyName("queries")] + public IReadOnlyDictionary Queries { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeatures.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeatures.g.cs new file mode 100644 index 00000000000..df7fb215a94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeatures.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.Xpack; + +public sealed partial class EqlFeatures +{ + [JsonInclude, JsonPropertyName("event")] + public int Event { get; init; } + [JsonInclude, JsonPropertyName("join")] + public int Join { get; init; } + [JsonInclude, JsonPropertyName("joins")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.EqlFeaturesJoin Joins { get; init; } + [JsonInclude, JsonPropertyName("keys")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.EqlFeaturesKeys Keys { get; init; } + [JsonInclude, JsonPropertyName("pipes")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.EqlFeaturesPipes Pipes { get; init; } + [JsonInclude, JsonPropertyName("sequence")] + public int Sequence { get; init; } + [JsonInclude, JsonPropertyName("sequences")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.EqlFeaturesSequences Sequences { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs new file mode 100644 index 00000000000..f5c38fc1912 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesJoin.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.Xpack; + +public sealed partial class EqlFeaturesJoin +{ + [JsonInclude, JsonPropertyName("join_queries_five_or_more")] + public int JoinQueriesFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("join_queries_four")] + public int JoinQueriesFour { get; init; } + [JsonInclude, JsonPropertyName("join_queries_three")] + public int JoinQueriesThree { get; init; } + [JsonInclude, JsonPropertyName("join_queries_two")] + public int JoinQueriesTwo { get; init; } + [JsonInclude, JsonPropertyName("join_until")] + public int JoinUntil { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs new file mode 100644 index 00000000000..0c07c70c350 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesKeys.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.Xpack; + +public sealed partial class EqlFeaturesKeys +{ + [JsonInclude, JsonPropertyName("join_keys_five_or_more")] + public int JoinKeysFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("join_keys_four")] + public int JoinKeysFour { get; init; } + [JsonInclude, JsonPropertyName("join_keys_one")] + public int JoinKeysOne { get; init; } + [JsonInclude, JsonPropertyName("join_keys_three")] + public int JoinKeysThree { get; init; } + [JsonInclude, JsonPropertyName("join_keys_two")] + public int JoinKeysTwo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs new file mode 100644 index 00000000000..7854cf5e341 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesPipes.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.Xpack; + +public sealed partial class EqlFeaturesPipes +{ + [JsonInclude, JsonPropertyName("pipe_head")] + public int PipeHead { get; init; } + [JsonInclude, JsonPropertyName("pipe_tail")] + public int PipeTail { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs new file mode 100644 index 00000000000..490ea023d6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/EqlFeaturesSequences.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.Xpack; + +public sealed partial class EqlFeaturesSequences +{ + [JsonInclude, JsonPropertyName("sequence_maxspan")] + public int SequenceMaxspan { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_five_or_more")] + public int SequenceQueriesFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_four")] + public int SequenceQueriesFour { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_three")] + public int SequenceQueriesThree { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_two")] + public int SequenceQueriesTwo { get; init; } + [JsonInclude, JsonPropertyName("sequence_until")] + public int SequenceUntil { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Feature.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Feature.g.cs new file mode 100644 index 00000000000..61fe59b8353 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Feature.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.Xpack; + +public sealed partial class Feature +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("native_code_info")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.NativeCodeInformation? NativeCodeInfo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FeatureToggle.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FeatureToggle.g.cs new file mode 100644 index 00000000000..859c9a92856 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FeatureToggle.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.Xpack; + +public sealed partial class FeatureToggle +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.g.cs new file mode 100644 index 00000000000..3fc5b6e9a01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Features.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.Xpack; + +public sealed partial class Features +{ + [JsonInclude, JsonPropertyName("aggregate_metric")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature AggregateMetric { get; init; } + [JsonInclude, JsonPropertyName("analytics")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Analytics { get; init; } + [JsonInclude, JsonPropertyName("archive")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Archive { get; init; } + [JsonInclude, JsonPropertyName("ccr")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Ccr { get; init; } + [JsonInclude, JsonPropertyName("data_frame")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? DataFrame { get; init; } + [JsonInclude, JsonPropertyName("data_science")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? DataScience { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature DataStreams { get; init; } + [JsonInclude, JsonPropertyName("data_tiers")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature DataTiers { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Enrich { get; init; } + [JsonInclude, JsonPropertyName("eql")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Eql { get; init; } + [JsonInclude, JsonPropertyName("flattened")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? Flattened { get; init; } + [JsonInclude, JsonPropertyName("frozen_indices")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature FrozenIndices { get; init; } + [JsonInclude, JsonPropertyName("graph")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Graph { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Ilm { get; init; } + [JsonInclude, JsonPropertyName("logstash")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Logstash { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Ml { get; init; } + [JsonInclude, JsonPropertyName("monitoring")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Monitoring { get; init; } + [JsonInclude, JsonPropertyName("rollup")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Rollup { get; init; } + [JsonInclude, JsonPropertyName("runtime_fields")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? RuntimeFields { get; init; } + [JsonInclude, JsonPropertyName("searchable_snapshots")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature SearchableSnapshots { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Security { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Slm { get; init; } + [JsonInclude, JsonPropertyName("spatial")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Spatial { get; init; } + [JsonInclude, JsonPropertyName("sql")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Sql { get; init; } + [JsonInclude, JsonPropertyName("transform")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Transform { get; init; } + [JsonInclude, JsonPropertyName("vectors")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature? Vectors { get; init; } + [JsonInclude, JsonPropertyName("voting_only")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature VotingOnly { get; init; } + [JsonInclude, JsonPropertyName("watcher")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Feature Watcher { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Flattened.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Flattened.g.cs new file mode 100644 index 00000000000..cab37e171d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Flattened.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.Xpack; + +public sealed partial class Flattened +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("field_count")] + public int FieldCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FrozenIndices.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FrozenIndices.g.cs new file mode 100644 index 00000000000..e44ef006237 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/FrozenIndices.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.Xpack; + +public sealed partial class FrozenIndices +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/HealthStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/HealthStatistics.g.cs new file mode 100644 index 00000000000..2f944f32b16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/HealthStatistics.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.Xpack; + +public sealed partial class HealthStatistics +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("invocations")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Invocations Invocations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ilm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ilm.g.cs new file mode 100644 index 00000000000..4798e3b942d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ilm.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.Xpack; + +public sealed partial class Ilm +{ + [JsonInclude, JsonPropertyName("policy_count")] + public int PolicyCount { get; init; } + [JsonInclude, JsonPropertyName("policy_stats")] + public IReadOnlyCollection PolicyStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs new file mode 100644 index 00000000000..cafdbb0915e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IlmPolicyStatistics.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.Xpack; + +public sealed partial class IlmPolicyStatistics +{ + [JsonInclude, JsonPropertyName("indices_managed")] + public int IndicesManaged { get; init; } + [JsonInclude, JsonPropertyName("phases")] + public Elastic.Clients.Elasticsearch.Serverless.IndexLifecycleManagement.Phases Phases { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Invocations.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Invocations.g.cs new file mode 100644 index 00000000000..7c9ef68c9b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Invocations.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.Xpack; + +public sealed partial class Invocations +{ + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IpFilter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IpFilter.g.cs new file mode 100644 index 00000000000..2ffbebba860 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/IpFilter.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.Xpack; + +public sealed partial class IpFilter +{ + [JsonInclude, JsonPropertyName("http")] + public bool Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public bool Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/JobUsage.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/JobUsage.g.cs new file mode 100644 index 00000000000..db5b13551ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/JobUsage.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.Xpack; + +public sealed partial class JobUsage +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("created_by")] + public IReadOnlyDictionary CreatedBy { get; init; } + [JsonInclude, JsonPropertyName("detectors")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics Detectors { get; init; } + [JsonInclude, JsonPropertyName("forecasts")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlJobForecasts Forecasts { get; init; } + [JsonInclude, JsonPropertyName("model_size")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics ModelSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MachineLearning.g.cs new file mode 100644 index 00000000000..4e271abda41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MachineLearning.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.Xpack; + +public sealed partial class MachineLearning +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyDictionary Datafeeds { get; init; } + [JsonInclude, JsonPropertyName("data_frame_analytics_jobs")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlDataFrameAnalyticsJobs DataFrameAnalyticsJobs { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("inference")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInference Inference { get; init; } + + /// + /// Job usage statistics. The `_all` entry is always present and gathers statistics for all jobs. + /// + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyDictionary Jobs { get; init; } + [JsonInclude, JsonPropertyName("node_count")] + public int NodeCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs new file mode 100644 index 00000000000..a502ed120da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MinimalLicenseInformation.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.Xpack; + +public sealed partial class MinimalLicenseInformation +{ + [JsonInclude, JsonPropertyName("expiry_date_in_millis")] + public long ExpiryDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseType Mode { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseStatus Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Serverless.LicenseManagement.LicenseType Type { get; init; } + [JsonInclude, JsonPropertyName("uid")] + public string Uid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlCounter.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlCounter.g.cs new file mode 100644 index 00000000000..da55acf45e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlCounter.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.Xpack; + +public sealed partial class MlCounter +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs new file mode 100644 index 00000000000..ebef5e3011e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.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.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobs +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlDataFrameAnalyticsJobsCount All { get; init; } + [JsonInclude, JsonPropertyName("analysis_counts")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlDataFrameAnalyticsJobsAnalysis? AnalysisCounts { get; init; } + [JsonInclude, JsonPropertyName("memory_usage")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlDataFrameAnalyticsJobsMemory? MemoryUsage { get; init; } + [JsonInclude, JsonPropertyName("stopped")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlDataFrameAnalyticsJobsCount? Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs new file mode 100644 index 00000000000..afa9d637b0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.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.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsAnalysis +{ + [JsonInclude, JsonPropertyName("classification")] + public int? Classification { get; init; } + [JsonInclude, JsonPropertyName("outlier_detection")] + public int? OutlierDetection { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public int? Regression { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs new file mode 100644 index 00000000000..faf8f65809f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.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.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsCount +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs new file mode 100644 index 00000000000..a1b8243319b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.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.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsMemory +{ + [JsonInclude, JsonPropertyName("peak_usage_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics PeakUsageBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInference.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInference.g.cs new file mode 100644 index 00000000000..4f2d5a6527e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInference.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.Xpack; + +public sealed partial class MlInference +{ + [JsonInclude, JsonPropertyName("deployments")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceDeployments? Deployments { get; init; } + [JsonInclude, JsonPropertyName("ingest_processors")] + public IReadOnlyDictionary IngestProcessors { get; init; } + [JsonInclude, JsonPropertyName("trained_models")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceTrainedModels TrainedModels { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeployments.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeployments.g.cs new file mode 100644 index 00000000000..7f0f17f580c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeployments.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.Xpack; + +public sealed partial class MlInferenceDeployments +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("inference_counts")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics InferenceCounts { get; init; } + [JsonInclude, JsonPropertyName("model_sizes_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics ModelSizesBytes { get; init; } + [JsonInclude, JsonPropertyName("time_ms")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceDeploymentsTimeMs TimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs new file mode 100644 index 00000000000..f7051c056c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.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.Xpack; + +public sealed partial class MlInferenceDeploymentsTimeMs +{ + [JsonInclude, JsonPropertyName("avg")] + public double Avg { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs new file mode 100644 index 00000000000..c063c037e0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessor.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.Xpack; + +public sealed partial class MlInferenceIngestProcessor +{ + [JsonInclude, JsonPropertyName("num_docs_processed")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceIngestProcessorCount NumDocsProcessed { get; init; } + [JsonInclude, JsonPropertyName("num_failures")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceIngestProcessorCount NumFailures { get; init; } + [JsonInclude, JsonPropertyName("pipelines")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlCounter Pipelines { get; init; } + [JsonInclude, JsonPropertyName("time_ms")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceIngestProcessorCount TimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs new file mode 100644 index 00000000000..b3de2f545ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.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.Xpack; + +public sealed partial class MlInferenceIngestProcessorCount +{ + [JsonInclude, JsonPropertyName("max")] + public long Max { get; init; } + [JsonInclude, JsonPropertyName("min")] + public long Min { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public long Sum { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs new file mode 100644 index 00000000000..fe319ef07af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModels.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.Xpack; + +public sealed partial class MlInferenceTrainedModels +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlCounter All { get; init; } + [JsonInclude, JsonPropertyName("count")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.MlInferenceTrainedModelsCount? Count { get; init; } + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? EstimatedHeapMemoryUsageBytes { get; init; } + [JsonInclude, JsonPropertyName("estimated_operations")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? EstimatedOperations { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.JobStatistics? ModelSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs new file mode 100644 index 00000000000..ad74c6694f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.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.Xpack; + +public sealed partial class MlInferenceTrainedModelsCount +{ + [JsonInclude, JsonPropertyName("classification")] + public long? Classification { get; init; } + [JsonInclude, JsonPropertyName("ner")] + public long? Ner { get; init; } + [JsonInclude, JsonPropertyName("other")] + public long Other { get; init; } + [JsonInclude, JsonPropertyName("pass_through")] + public long? PassThrough { get; init; } + [JsonInclude, JsonPropertyName("prepackaged")] + public long Prepackaged { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public long? Regression { get; init; } + [JsonInclude, JsonPropertyName("text_embedding")] + public long? TextEmbedding { 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/Xpack/MlJobForecasts.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlJobForecasts.g.cs new file mode 100644 index 00000000000..cc1d5719be0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/MlJobForecasts.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.Xpack; + +public sealed partial class MlJobForecasts +{ + [JsonInclude, JsonPropertyName("forecasted_jobs")] + public long ForecastedJobs { 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/Xpack/Monitoring.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Monitoring.g.cs new file mode 100644 index 00000000000..e205c28a569 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Monitoring.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.Xpack; + +public sealed partial class Monitoring +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("collection_enabled")] + public bool CollectionEnabled { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("enabled_exporters")] + public IReadOnlyDictionary EnabledExporters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/NativeCodeInformation.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/NativeCodeInformation.g.cs new file mode 100644 index 00000000000..6f08c7cd376 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/NativeCodeInformation.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.Xpack; + +public sealed partial class NativeCodeInformation +{ + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { 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/Xpack/Realm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Realm.g.cs new file mode 100644 index 00000000000..10f1b193815 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Realm.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.Xpack; + +public sealed partial class Realm +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("cache")] + public IReadOnlyCollection? Cache { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("has_authorization_realms")] + public IReadOnlyCollection? HasAuthorizationRealms { get; init; } + [JsonInclude, JsonPropertyName("has_default_username_pattern")] + public IReadOnlyCollection? HasDefaultUsernamePattern { get; init; } + [JsonInclude, JsonPropertyName("has_truststore")] + public IReadOnlyCollection? HasTruststore { get; init; } + [JsonInclude, JsonPropertyName("is_authentication_delegated")] + public IReadOnlyCollection? IsAuthenticationDelegated { get; init; } + [JsonInclude, JsonPropertyName("name")] + public IReadOnlyCollection? Name { get; init; } + [JsonInclude, JsonPropertyName("order")] + public IReadOnlyCollection? Order { get; init; } + [JsonInclude, JsonPropertyName("size")] + public IReadOnlyCollection? Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RealmCache.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RealmCache.g.cs new file mode 100644 index 00000000000..1acc373ee33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RealmCache.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.Xpack; + +public sealed partial class RealmCache +{ + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RoleMapping.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RoleMapping.g.cs new file mode 100644 index 00000000000..30715f8461e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RoleMapping.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.Xpack; + +public sealed partial class RoleMapping +{ + [JsonInclude, JsonPropertyName("enabled")] + public int Enabled { get; init; } + [JsonInclude, JsonPropertyName("size")] + public int Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs new file mode 100644 index 00000000000..29d1c98ebe2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldTypes.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.Xpack; + +public sealed partial class RuntimeFieldTypes +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("field_types")] + public IReadOnlyCollection FieldTypes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldsType.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldsType.g.cs new file mode 100644 index 00000000000..979efc96503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/RuntimeFieldsType.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.Xpack; + +public sealed partial class RuntimeFieldsType +{ + [JsonInclude, JsonPropertyName("chars_max")] + public long CharsMax { get; init; } + [JsonInclude, JsonPropertyName("chars_total")] + public long CharsTotal { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("doc_max")] + public long DocMax { get; init; } + [JsonInclude, JsonPropertyName("doc_total")] + public long DocTotal { get; init; } + [JsonInclude, JsonPropertyName("index_count")] + public long IndexCount { get; init; } + [JsonInclude, JsonPropertyName("lang")] + public IReadOnlyCollection Lang { get; init; } + [JsonInclude, JsonPropertyName("lines_max")] + public long LinesMax { get; init; } + [JsonInclude, JsonPropertyName("lines_total")] + public long LinesTotal { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("scriptless_count")] + public long ScriptlessCount { get; init; } + [JsonInclude, JsonPropertyName("shadowed_count")] + public long ShadowedCount { get; init; } + [JsonInclude, JsonPropertyName("source_max")] + public long SourceMax { get; init; } + [JsonInclude, JsonPropertyName("source_total")] + public long SourceTotal { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SearchableSnapshots.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SearchableSnapshots.g.cs new file mode 100644 index 00000000000..2ce854bdd8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SearchableSnapshots.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.Xpack; + +public sealed partial class SearchableSnapshots +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("full_copy_indices_count")] + public int? FullCopyIndicesCount { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public int IndicesCount { get; init; } + [JsonInclude, JsonPropertyName("shared_cache_indices_count")] + public int? SharedCacheIndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Security.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Security.g.cs new file mode 100644 index 00000000000..f987fa4f3cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Security.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.Xpack; + +public sealed partial class Security +{ + [JsonInclude, JsonPropertyName("anonymous")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle Anonymous { get; init; } + [JsonInclude, JsonPropertyName("api_key_service")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle ApiKeyService { get; init; } + [JsonInclude, JsonPropertyName("audit")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Audit Audit { get; init; } + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("fips_140")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle Fips140 { get; init; } + [JsonInclude, JsonPropertyName("ipfilter")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.IpFilter Ipfilter { get; init; } + [JsonInclude, JsonPropertyName("operator_privileges")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Base OperatorPrivileges { get; init; } + [JsonInclude, JsonPropertyName("realms")] + public IReadOnlyDictionary Realms { get; init; } + [JsonInclude, JsonPropertyName("role_mapping")] + public IReadOnlyDictionary RoleMapping { get; init; } + [JsonInclude, JsonPropertyName("roles")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SecurityRoles Roles { get; init; } + [JsonInclude, JsonPropertyName("ssl")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Ssl Ssl { get; init; } + [JsonInclude, JsonPropertyName("system_key")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle? SystemKey { get; init; } + [JsonInclude, JsonPropertyName("token_service")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle TokenService { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRoles.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRoles.g.cs new file mode 100644 index 00000000000..9f74bbedff7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRoles.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.Xpack; + +public sealed partial class SecurityRoles +{ + [JsonInclude, JsonPropertyName("dls")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SecurityRolesDls Dls { get; init; } + [JsonInclude, JsonPropertyName("file")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SecurityRolesFile File { get; init; } + [JsonInclude, JsonPropertyName("native")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SecurityRolesNative Native { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDls.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDls.g.cs new file mode 100644 index 00000000000..e6de2cb08d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDls.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.Xpack; + +public sealed partial class SecurityRolesDls +{ + [JsonInclude, JsonPropertyName("bit_set_cache")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.SecurityRolesDlsBitSetCache BitSetCache { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs new file mode 100644 index 00000000000..92e8dbdd33e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.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.Xpack; + +public sealed partial class SecurityRolesDlsBitSetCache +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Serverless.ByteSize? Memory { get; init; } + [JsonInclude, JsonPropertyName("memory_in_bytes")] + public long MemoryInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesFile.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesFile.g.cs new file mode 100644 index 00000000000..626eb3dc92d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesFile.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.Xpack; + +public sealed partial class SecurityRolesFile +{ + [JsonInclude, JsonPropertyName("dls")] + public bool Dls { get; init; } + [JsonInclude, JsonPropertyName("fls")] + public bool Fls { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesNative.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesNative.g.cs new file mode 100644 index 00000000000..5b94639eb10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/SecurityRolesNative.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.Xpack; + +public sealed partial class SecurityRolesNative +{ + [JsonInclude, JsonPropertyName("dls")] + public bool Dls { get; init; } + [JsonInclude, JsonPropertyName("fls")] + public bool Fls { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Slm.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Slm.g.cs new file mode 100644 index 00000000000..e27ee18bb9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Slm.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.Xpack; + +public sealed partial class Slm +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("policy_count")] + public int? PolicyCount { get; init; } + [JsonInclude, JsonPropertyName("policy_stats")] + public Elastic.Clients.Elasticsearch.Serverless.SnapshotLifecycleManagement.Statistics? PolicyStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Sql.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Sql.g.cs new file mode 100644 index 00000000000..8811ad78e0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Sql.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.Xpack; + +public sealed partial class Sql +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("features")] + public IReadOnlyDictionary Features { get; init; } + [JsonInclude, JsonPropertyName("queries")] + public IReadOnlyDictionary Queries { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ssl.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ssl.g.cs new file mode 100644 index 00000000000..2fe1cb85582 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Ssl.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.Xpack; + +public sealed partial class Ssl +{ + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.FeatureToggle Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Vector.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Vector.g.cs new file mode 100644 index 00000000000..a69bbe0ee39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Vector.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.Xpack; + +public sealed partial class Vector +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("dense_vector_dims_avg_count")] + public int DenseVectorDimsAvgCount { get; init; } + [JsonInclude, JsonPropertyName("dense_vector_fields_count")] + public int DenseVectorFieldsCount { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("sparse_vector_fields_count")] + public int? SparseVectorFieldsCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Watcher.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Watcher.g.cs new file mode 100644 index 00000000000..dc49f61282e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/Watcher.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.Xpack; + +public sealed partial class Watcher +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("count")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Counter Count { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("execution")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.WatcherActions Execution { get; init; } + [JsonInclude, JsonPropertyName("watch")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.WatcherWatch Watch { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActionTotals.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActionTotals.g.cs new file mode 100644 index 00000000000..ac37c4573d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActionTotals.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.Xpack; + +public sealed partial class WatcherActionTotals +{ + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Serverless.Duration Total { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_ms")] + public long TotalTimeInMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActions.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActions.g.cs new file mode 100644 index 00000000000..7b71ef3d484 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherActions.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.Xpack; + +public sealed partial class WatcherActions +{ + [JsonInclude, JsonPropertyName("actions")] + public IReadOnlyDictionary Actions { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatch.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatch.g.cs new file mode 100644 index 00000000000..490c7e5eb21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatch.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.Xpack; + +public sealed partial class WatcherWatch +{ + [JsonInclude, JsonPropertyName("action")] + public IReadOnlyDictionary? Action { get; init; } + [JsonInclude, JsonPropertyName("condition")] + public IReadOnlyDictionary? Condition { get; init; } + [JsonInclude, JsonPropertyName("input")] + public IReadOnlyDictionary Input { get; init; } + [JsonInclude, JsonPropertyName("trigger")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.WatcherWatchTrigger Trigger { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs new file mode 100644 index 00000000000..c05af2cc6b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTrigger.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.Xpack; + +public sealed partial class WatcherWatchTrigger +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Counter All { get; init; } + [JsonInclude, JsonPropertyName("schedule")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.WatcherWatchTriggerSchedule? Schedule { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs new file mode 100644 index 00000000000..42ce175d791 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.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.Xpack; + +public sealed partial class WatcherWatchTriggerSchedule +{ + [JsonInclude, JsonPropertyName("active")] + public long Active { get; init; } + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Counter All { get; init; } + [JsonInclude, JsonPropertyName("cron")] + public Elastic.Clients.Elasticsearch.Serverless.Xpack.Counter Cron { 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/Xpack/XpackUsageQuery.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/XpackUsageQuery.g.cs new file mode 100644 index 00000000000..997b65d42db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Xpack/XpackUsageQuery.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.Xpack; + +public sealed partial class XpackUsageQuery +{ + [JsonInclude, JsonPropertyName("count")] + public int? Count { get; init; } + [JsonInclude, JsonPropertyName("failed")] + public int? Failed { get; init; } + [JsonInclude, JsonPropertyName("paging")] + public int? Paging { get; init; } + [JsonInclude, JsonPropertyName("total")] + public int? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs index 01292530f14..a28d9a55e58 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs @@ -23,7 +23,7 @@ public partial class SubmitAsyncSearchRequest public sealed partial class SubmitAsyncSearchRequestDescriptor { - public SubmitAsyncSearchRequestDescriptor MatchAll(Action? selector = null) => selector is null ? Query(q => q.MatchAll()) : Query(q => q.MatchAll(selector)); + public SubmitAsyncSearchRequestDescriptor MatchAll(Action? selector = null) => selector is null ? Query(q => q.MatchAll(new MatchAllQuery())) : Query(q => q.MatchAll(selector)); internal override void BeforeRequest() => TypedKeys(true); } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs index 867ec3653bb..90d5d8ae558 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs @@ -44,12 +44,6 @@ internal static HttpMethod GetHttpMethod(IndexRequest request) => public sealed partial class IndexRequestDescriptor : ICustomJsonWriter { - public IndexRequestDescriptor Document(TDocument document) - { - DocumentValue = document; - return Self; - } - internal Id _id; public void WriteJson(Utf8JsonWriter writer, Serializer sourceSerializer) => SourceSerialization.Serialize(DocumentValue, writer, sourceSerializer); diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs deleted file mode 100644 index 867e1374031..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs +++ /dev/null @@ -1,30 +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.Diagnostics.CodeAnalysis; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.Ingest; -#else -namespace Elastic.Clients.Elasticsearch.Ingest; -#endif - -public partial class Processor -{ - // TODO - We should generate this. - // TODO - We should include a marker interface on the variants to support constraining the generic T here to IProcessor - - public bool TryGet([NotNullWhen(true)] out T? processor) where T : class - { - processor = null; - - if (Variant is T variant) - { - processor = variant; - return true; - } - - return false; - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs index 4095b35931e..b9052314227 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs @@ -21,5 +21,5 @@ public partial class ScrollResponse public IReadOnlyCollection Documents => HitsMetadata.Hits.Select(s => s.Source).ToReadOnlyCollection(); [JsonIgnore] - public long Total => HitsMetadata?.Total?.Value ?? -1; + public long Total => HitsMetadata?.Total?.Item2 ?? HitsMetadata?.Total?.Item1.Value ?? -1; } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs index 8d3694f7209..844ad157bc2 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs @@ -37,11 +37,15 @@ protected override (string ResolvedUrl, string UrlTemplate, Dictionary +public partial class SearchRequest : SearchRequest { public SearchRequest(Indices? indices) : base(indices) { } + + public SearchRequest() : base(typeof(TInferDocument)) + { + } } public sealed partial class SearchRequestDescriptor @@ -63,7 +67,7 @@ public SearchRequestDescriptor Pit(string id, Action public IReadOnlyCollection Documents => HitsMetadata.Hits.Select(s => s.Source).ToReadOnlyCollection(); [JsonIgnore] - public long Total => HitsMetadata?.Total?.Value ?? -1; + public long Total => HitsMetadata?.Total?.Item2 ?? HitsMetadata?.Total?.Item1.Value ?? -1; } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs index 4dbf619cd61..e7b01a6e330 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient-Manual.cs @@ -92,25 +92,16 @@ public virtual Task> UpdateAsync, 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(IndexName index, Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new UpdateRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); - 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 UpdateResponse Update(TDocument document, TPartialDocument partialDocument, IndexName index, Id id) { - var descriptor = new UpdateRequestDescriptor(document, index, id); + var descriptor = new UpdateRequestDescriptor(index, id); descriptor.BeforeRequest(); + descriptor.Upsert(document); + descriptor.Doc(partialDocument); return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); } @@ -120,9 +111,11 @@ public virtual UpdateResponse Update(TDo /// public virtual Task> UpdateAsync(TDocument document, TPartialDocument partialDocument, IndexName index, Id id, CancellationToken cancellationToken = default) { - var descriptor = new UpdateRequestDescriptor(document, index, id); + var descriptor = new UpdateRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor); + descriptor.Upsert(document); + descriptor.Doc(partialDocument); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } /// @@ -134,15 +127,4 @@ public virtual UpdateResponse Update(Ind var descriptor = new UpdateRequestDescriptor(index, id); 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(IndexName index, Id id, Action> configureRequest) - { - var descriptor = new UpdateRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); - return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); - } } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs index ee1917f77ef..b1d7ccf92a6 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/IndicesNamespace.cs @@ -43,7 +43,7 @@ public Task RefreshAsync(Indices indices, CancellationToken can public virtual GetAliasResponse GetAlias(Indices indicies, Action configureRequest) { - var descriptor = new GetAliasRequestDescriptor(indicies); + var descriptor = new GetAliasRequestDescriptor(indicies, null); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -51,7 +51,7 @@ public virtual GetAliasResponse GetAlias(Indices indicies, Action GetAliasAsync(Indices indicies, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(indicies); + var descriptor = new GetAliasRequestDescriptor(indicies, null); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs deleted file mode 100644 index 30499672923..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationCombinator.cs +++ /dev/null @@ -1,44 +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.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. -/// -internal class AggregationCombinator : SearchAggregation -{ - public AggregationCombinator(string name, SearchAggregation left, SearchAggregation right) - { - AddAggregation(left); - AddAggregation(right); - Name = name; - } - - public override string? Name { get; internal set; } - - internal List Aggregations { get; } = new List(); - - private void AddAggregation(SearchAggregation agg) - { - switch (agg) - { - case null: - return; - case AggregationCombinator combinator when combinator.Aggregations.Any(): - Aggregations.AddRange(combinator.Aggregations); - break; - default: - Aggregations.Add(agg); - break; - } - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs deleted file mode 100644 index a047001e7f8..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/AggregationDictionary.cs +++ /dev/null @@ -1,65 +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; - -#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. -/// -public sealed class AggregationDictionary : IsADictionary -{ - public AggregationDictionary() { } - - public AggregationDictionary(IDictionary dictionary) - : base(dictionary.ToDictionary(kv => kv.Key, kv => kv.Value)) { } // Copy the existing dictionary rather then using the existing reference - - public AggregationDictionary(Dictionary dictionary) - : base(dictionary.ToDictionary(kv => kv.Key, kv => kv.Value)) { } // Copy the existing dictionary rather then using the existing reference - - public static implicit operator AggregationDictionary(Dictionary dictionary) => - new(dictionary); - - public static implicit operator AggregationDictionary(SearchAggregation aggregator) - { - SearchAggregation b; - if (aggregator is AggregationCombinator combinator) - { - var dict = new AggregationDictionary(); - foreach (var agg in combinator.Aggregations) - { - b = agg; - if (b.Name.IsNullOrEmpty()) - throw new ArgumentException($"{aggregator.GetType().Name}.Name is not set!"); - - dict.Add(agg); - } - return dict; - } - - b = aggregator; - - if (b.Name.IsNullOrEmpty()) - throw new ArgumentException($"{aggregator.GetType().Name}.Name is not set!"); - - return new AggregationDictionary { { aggregator } }; - } - - public void Add(string key, Aggregation value) => BackingDictionary.Add(ValidateKey(key), value); - - public void Add(Aggregation value) - { - if (value.Variant.Name.IsNullOrEmpty()) - throw new ArgumentException($"{value.GetType().Name}.Name is not set!"); - - BackingDictionary.Add(ValidateKey(value.Variant.Name), value); - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs deleted file mode 100644 index 2145bdec1af..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/IAggregate.cs +++ /dev/null @@ -1,11 +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. - -#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.Shared/Core/Aggregations/SearchAggregation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs deleted file mode 100644 index bcff4eb0522..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Aggregations/SearchAggregation.cs +++ /dev/null @@ -1,34 +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. - -#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 -{ - string? Name { get; } -} - -/// -/// Base class for all aggregations. -/// -public abstract class SearchAggregation : ISearchAggregation -{ - internal SearchAggregation() { } - - public abstract string? Name { get; internal set; } - - //always evaluate to false so that each side of && equation is evaluated - public static bool operator false(SearchAggregation _) => false; - - //always evaluate to false so that each side of && equation is evaluated - public static bool operator true(SearchAggregation _) => false; - - public static SearchAggregation operator &(SearchAggregation left, SearchAggregation right) => - new AggregationCombinator(null, left, right); -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs index 3fc4c17c581..9ab6b0e2982 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Fluent/FluentDictionary.cs @@ -2,6 +2,7 @@ // Elasticsearch 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; #if ELASTICSEARCH_SERVERLESS @@ -46,3 +47,42 @@ public FluentDictionary(IDictionary source) return this; } } + +public class FluentDescriptorDictionary : Dictionary + where TDescriptor : Descriptor, new() +{ + public FluentDescriptorDictionary() { } + + public FluentDescriptorDictionary(IDictionary source) + { + if (source == null) + return; + + foreach (var kv in source) + this[kv.Key] = kv.Value; + } + + /// + public new FluentDescriptorDictionary Add(TKey key, TDescriptor value) + { + base.Add(key, value); + return this; + } + + /// + public FluentDescriptorDictionary Add(TKey key, Action configure) + { + var descriptor = new TDescriptor(); + configure?.Invoke(descriptor); + + base.Add(key, descriptor); + return this; + } + + /// + public new FluentDescriptorDictionary Remove(TKey key) + { + base.Remove(key); + return this; + } +} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs index 86d148c7594..c2b520c8d28 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Core/Request/RouteValues.cs @@ -19,7 +19,7 @@ internal sealed class ResolvedRouteValues : Dictionary public ResolvedRouteValues(int size) : base(size) { } } -public sealed class RouteValues : Dictionary +public sealed class RouteValues : Dictionary { /// /// Used specifically by index requests to determine whether to use PUT or POST. @@ -34,7 +34,7 @@ internal ResolvedRouteValues Resolve(IElasticsearchClientSettings configuration) var resolved = new ResolvedRouteValues(Count); foreach (var kv in this) { - var value = this[kv.Key].GetString(configuration); + var value = UrlFormatter.CreateString(this[kv.Key], configuration); if (value.IsNullOrEmpty()) continue; resolved[kv.Key] = value; @@ -45,7 +45,7 @@ internal ResolvedRouteValues Resolve(IElasticsearchClientSettings configuration) return resolved; } - private RouteValues Route(string name, IUrlParameter? routeValue, bool required = true) + private RouteValues Route(string name, object? routeValue, bool required = true) { switch (routeValue) { @@ -72,9 +72,9 @@ private RouteValues Route(string name, IUrlParameter? routeValue, bool required private static bool IsId(string key) => key.Equals("id", StringComparison.OrdinalIgnoreCase); - internal RouteValues Required(string route, IUrlParameter? value) => Route(route, value); + internal RouteValues Required(string route, object? value) => Route(route, value); - internal RouteValues Optional(string route, IUrlParameter? value) => Route(route, value, false); + internal RouteValues Optional(string route, object? value) => Route(route, value, false); internal TActual Get(string route) { diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs deleted file mode 100644 index 22516b75146..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Experimental/AggregateDictionaryExtensions.cs +++ /dev/null @@ -1,92 +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. - -#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 -{ - /// - /// WARNING: EXPERIMENTAL API - /// This API provides simplified access to terms aggregations. - /// - /// Experimental APIs are subject to changes or removal and should be used with caution. - public static TermsAggregate GetTerms(this AggregateDictionary aggregationDictionary, string key) => aggregationDictionary.GetTerms(key); - - /// - /// WARNING: EXPERIMENTAL API - /// This API provides simplified access to terms aggregations. - /// - /// Experimental APIs are subject to changes or removal and should be used with caution. - public static TermsAggregate GetTerms(this AggregateDictionary aggregationDictionary, string key) - { - if (!aggregationDictionary.TryGetValue(key, out var agg)) - { - return null; - } - - switch (agg) - { - case StringTermsAggregate stringTerms: - var buckets = stringTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.Key.ToString() }).ToReadOnlyCollection(); // ToString is a temp hack here - return new TermsAggregate - { - Buckets = buckets, - Meta = stringTerms.Meta, - DocCountErrorUpperBound = stringTerms.DocCountErrorUpperBound, - SumOtherDocCount = stringTerms.SumOtherDocCount - }; - - case DoubleTermsAggregate doubleTerms: - var doubleTermsBuckets = doubleTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); - return new TermsAggregate - { - Buckets = doubleTermsBuckets, - Meta = doubleTerms.Meta, - DocCountErrorUpperBound = doubleTerms.DocCountErrorUpperBound, - SumOtherDocCount = doubleTerms.SumOtherDocCount - }; - - case LongTermsAggregate longTerms: - var longTermsBuckets = longTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); - return new TermsAggregate - { - Buckets = longTermsBuckets, - Meta = longTerms.Meta, - DocCountErrorUpperBound = longTerms.DocCountErrorUpperBound, - SumOtherDocCount = longTerms.SumOtherDocCount - }; - - // TODO - Multi-terms - } - - return null; - } - - private static TKey GetKeyFromBucketKey(object key) - { - if (typeof(TKey).IsEnum) - { - return (TKey)Enum.Parse(typeof(TKey), key.ToString(), true); - } - - if (key is FieldValue fieldValue) - { - return (TKey)Convert.ChangeType(fieldValue.Value, typeof(TKey)); - } - - return (TKey)Convert.ChangeType(key, typeof(TKey)); - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs deleted file mode 100644 index 3f6e1f856d4..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/AggregationSerializationHelper.cs +++ /dev/null @@ -1,40 +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.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 -{ - public static Aggregation ReadContainer(ref Utf8JsonReader reader, JsonSerializerOptions options) where T : SearchAggregation - { - var variant = JsonSerializer.Deserialize(ref reader, options); - - var container = new Aggregation(variant); - - return container; - } - - public static Aggregation ReadContainer(string variantName, ref Utf8JsonReader reader, JsonSerializerOptions options) where T : SearchAggregation - { - var variant = JsonSerializer.Deserialize(ref reader, options); - - var container = new Aggregation(variant); - - if (container.Variant is SearchAggregation agg) - agg.Name = variantName; - - return container; - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs index b01a68b2060..c3e2e8f14e3 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/UnionConverter.cs @@ -162,13 +162,13 @@ private class UnionConverterInner : JsonConverter)Activator.CreateInstance(typeof(Union), itemOne); } } else if (itemOne is not null) { reader = readerCopy; - return (TItem1)Activator.CreateInstance(typeof(TItem1), itemOne); + return (Union)Activator.CreateInstance(typeof(Union), itemOne); } } catch @@ -182,7 +182,7 @@ private class UnionConverterInner : JsonConverter)Activator.CreateInstance(typeof(Union), itemTwo); } } catch diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs deleted file mode 100644 index b4513b3da27..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregateDictionaryConverter.cs +++ /dev/null @@ -1,463 +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.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 -{ - public override AggregateDictionary? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var dictionary = new Dictionary(); - - if (reader.TokenType != JsonTokenType.StartObject) - return new AggregateDictionary(dictionary); - - while (reader.Read()) - { - if (reader.TokenType == JsonTokenType.EndObject) - break; - - var name = reader.GetString(); // TODO: Future optimisation, get raw bytes span and parse based on those - - reader.Read(); - - ReadAggregate(ref reader, options, dictionary, name); - } - - return new AggregateDictionary(dictionary); - } - - public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary dictionary, string name) - { - var nameParts = name.Split('#'); - - if (nameParts.Length != 2) - throw new JsonException($"Unable to parse typed-key from aggregation name '{name}'"); - - // Bucket-based Aggregates - - var aggregateName = nameParts[0]; - - switch (aggregateName) - { - case "terms": - case "sterms": - case "lterms": - case "dterms": - { - if (TermsAggregateSerializationHelper.TryDeserializeTermsAggregate(aggregateName, ref reader, options, out var agg)) - { - dictionary.Add(nameParts[1], agg); - } - - break; - } - - case "adjacency_matrix": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "auto_date_histogram": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "children": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "composite": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "date_histogram": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "date_range": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "filter": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "filters": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geo_distance": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geohash_grid": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geotile_grid": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "global": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "histogram": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "ip_range": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "ip_prefix": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "missing": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "multi_terms": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "nested": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "parent": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "range": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "reverse_nested": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "sampler": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "sigsterms": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "variable_width_histogram": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "avg": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "boxplot": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "cardinality": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "extended_stats": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geo_bounds": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geo_centroid": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "geo_line": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "srareterms": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "matrix_stats": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "max": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "median_absolute_deviation": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "min": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "tdigest_percentiles": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "tdigest_percentile_ranks": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "rate": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "scripted_metric": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "stats": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "string_stats": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "sum": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "t_test": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "top_hits": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "top_metrics": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "value_count": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "weighted_avg": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "cumulative_cardinality": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - // Used by: - // - cumulative sum aggregation - case "simple_value": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "derivative": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "extended_stats_bucket": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "inference": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - case "percentiles_bucket": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - case "stats_bucket": - { - var agg = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], agg); - break; - } - - default: - throw new Exception($"The aggregate '{aggregateName}' in this response is not currently supported."); - } - } - - public override void Write(Utf8JsonWriter writer, AggregateDictionary value, JsonSerializerOptions options) => throw new NotImplementedException(); -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs deleted file mode 100644 index b7d580e9e15..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/Aggregation.cs +++ /dev/null @@ -1,39 +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.Text.Json; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -#else -namespace Elastic.Clients.Elasticsearch.Aggregations; -#endif - -public partial class Aggregation -{ - internal string ContainedVariantName { get; set; } - - internal Action SerializeFluent { get; private set; } - - private Aggregation(string variant) => ContainedVariantName = variant; - - internal static Aggregation CreateWithAction(string variantName, Action configure) where T : new() - { - var container = new Aggregation(variantName); - container.SetAction(configure); - return container; - } - - private void SetAction(Action configure) where T : new() - => SerializeFluent = (writer, options) => - { - var descriptor = new T(); - configure(descriptor); - JsonSerializer.Serialize(writer, descriptor, options); - }; - - public static implicit operator Aggregation(SearchAggregation aggregator) => - aggregator == null ? null : new Aggregation(aggregator); -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs deleted file mode 100644 index 35a7bc42f89..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/AggregationDescriptor.cs +++ /dev/null @@ -1,45 +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.Text.Json; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -#else -namespace Elastic.Clients.Elasticsearch.Aggregations; -#endif - -public partial class AggregationDescriptor -{ - internal AggregationDictionary Aggregations { get; set; } - - private AggregationDescriptor SetContainer(string key, Aggregation container) - { - if (Self.Aggregations == null) - Self.Aggregations = new AggregationDictionary(); - - Self.Aggregations[key] = container; - - return this; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) => JsonSerializer.Serialize(writer, Aggregations, options); -} - -public partial class AggregationDescriptor -{ - internal AggregationDictionary Aggregations { get; set; } - - private AggregationDescriptor SetContainer(string key, Aggregation container) - { - if (Self.Aggregations == null) - Self.Aggregations = new AggregationDictionary(); - - Self.Aggregations[key] = container; - - return this; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) => JsonSerializer.Serialize(writer, Aggregations, options); -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs deleted file mode 100644 index 9b66388d842..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregate.cs +++ /dev/null @@ -1,31 +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.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 -{ - [JsonInclude] - [JsonPropertyName("doc_count_error_upper_bound")] - public long? DocCountErrorUpperBound { get; init; } - - [JsonInclude] - [JsonPropertyName("sum_other_doc_count")] - public long? SumOtherDocCount { get; init; } - - [JsonInclude] - [JsonPropertyName("buckets")] - public IReadOnlyCollection> Buckets { get; init; } - - [JsonInclude] - [JsonPropertyName("meta")] - public IReadOnlyDictionary? Meta { get; init; } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs deleted file mode 100644 index c467fdadd23..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsAggregationDescriptor.cs +++ /dev/null @@ -1,44 +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.Collections.Generic; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.Aggregations; -#else -namespace Elastic.Clients.Elasticsearch.Aggregations; -#endif - -public partial class TermsAggregationDescriptor -{ - public TermsAggregationDescriptor Include(long partition, long numberOfPartitions) - { - IncludeValue = new TermsInclude(partition, numberOfPartitions); - return Self; - } - - public TermsAggregationDescriptor Include(string includeRegexPattern) - { - IncludeValue = new TermsInclude(includeRegexPattern); - return Self; - } - - public TermsAggregationDescriptor Include(IEnumerable values) - { - IncludeValue = new TermsInclude(values); - return Self; - } - - public TermsAggregationDescriptor Exclude(string excludeRegexPattern) - { - ExcludeValue = new TermsExclude(excludeRegexPattern); - return Self; - } - - public TermsAggregationDescriptor Exclude(IEnumerable values) - { - ExcludeValue = new TermsExclude(values); - return Self; - } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs deleted file mode 100644 index 9ed0679ff3d..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Aggregations/TermsBucket.cs +++ /dev/null @@ -1,31 +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.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 -{ - public TermsBucket(IReadOnlyDictionary backingDictionary) : base(backingDictionary) - { - } - - public TKey Key { get; init; } - - public string? KeyAsString { get; init; } - - [JsonInclude] - [JsonPropertyName("doc_count_error")] - public long? DocCountError { get; init; } - - [JsonInclude] - [JsonPropertyName("doc_count")] - public long DocCount { get; init; } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs index cad838dd26c..649f26da3ae 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/AsyncSearch/AsyncSearch.cs @@ -30,5 +30,5 @@ public partial class AsyncSearch /// The total number of hits returned for this search. /// [JsonIgnore] - public long Total => HitsMetadata?.Total?.Value ?? -1; + public long Total => HitsMetadata?.Total?.Item2 ?? HitsMetadata?.Total?.Item1.Value ?? -1; } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs deleted file mode 100644 index 692e800b9b9..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/Core/Search/SuggestDictionary.cs +++ /dev/null @@ -1,223 +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.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 : - IsAReadOnlyDictionary> -{ - internal SuggestDictionary(IReadOnlyDictionary> backingDictionary) : - base(backingDictionary) - { - } - - public IReadOnlyCollection? GetTerm(string key) => TryGet(key); - - public IReadOnlyCollection? GetPhrase(string key) => TryGet(key); - - public IReadOnlyCollection>? GetCompletion(string key) => TryGet>(key); - - private IReadOnlyCollection? TryGet(string key) where TSuggest : class, ISuggest => - BackingDictionary.TryGetValue(key, out var items) ? items.Cast().ToArray() : null; -} - -internal sealed class SuggestDictionaryConverter : - JsonConverter> -{ - public override SuggestDictionary? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var dictionary = new Dictionary>(); - - if (reader.TokenType != JsonTokenType.StartObject) - return new SuggestDictionary(dictionary); - - while (reader.Read()) - { - if (reader.TokenType == JsonTokenType.EndObject) - break; - - // TODO: Future optimization, get raw bytes span and parse based on those - var name = reader.GetString() ?? throw new JsonException("Key must not be 'null'."); - - reader.Read(); - ReadVariant(ref reader, options, dictionary, name); - } - - return new SuggestDictionary(dictionary); - } - - public static void ReadVariant(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary> dictionary, string name) - { - var nameParts = name.Split('#'); - - if (nameParts.Length != 2) - throw new JsonException($"Unable to parse typed-key from suggestion name '{name}'"); - - var variantName = nameParts[0]; - switch (variantName) - { - case "term": - { - var suggest = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], suggest); - break; - } - - case "phrase": - { - var suggest = JsonSerializer.Deserialize(ref reader, options); - dictionary.Add(nameParts[1], suggest); - break; - } - - case "completion": - { - var suggest = JsonSerializer.Deserialize[]>(ref reader, options); - dictionary.Add(nameParts[1], suggest); - break; - } - - default: - throw new Exception($"The suggest variant '{variantName}' in this response is currently not supported."); - } - } - - public override void Write(Utf8JsonWriter writer, SuggestDictionary value, JsonSerializerOptions options) => throw new NotImplementedException(); -} - -public interface ISuggest -{ -} - -public sealed partial class TermSuggest : - ISuggest -{ - [JsonInclude, JsonPropertyName("length")] - public int Length { get; init; } - - [JsonInclude, JsonPropertyName("offset")] - public int Offset { get; init; } - - [JsonInclude, JsonPropertyName("options"), SingleOrManyCollectionConverter(typeof(TermSuggestOption))] - public IReadOnlyCollection Options { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} - -public sealed partial class TermSuggestOption -{ - [JsonInclude, JsonPropertyName("collate_match")] - public bool? CollateMatch { get; init; } - - [JsonInclude, JsonPropertyName("freq")] - public long Freq { get; init; } - - [JsonInclude, JsonPropertyName("highlighted")] - public string? Highlighted { get; init; } - - [JsonInclude, JsonPropertyName("score")] - public double Score { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} - -public sealed partial class PhraseSuggest : - ISuggest -{ - [JsonInclude, JsonPropertyName("length")] - public int Length { get; init; } - - [JsonInclude, JsonPropertyName("offset")] - public int Offset { get; init; } - - [JsonInclude, JsonPropertyName("options"), SingleOrManyCollectionConverter(typeof(PhraseSuggestOption))] - public IReadOnlyCollection Options { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} - -public sealed partial class PhraseSuggestOption -{ - [JsonInclude, JsonPropertyName("collate_match")] - public bool? CollateMatch { get; init; } - - [JsonInclude, JsonPropertyName("highlighted")] - public string? Highlighted { get; init; } - - [JsonInclude, JsonPropertyName("score")] - public double Score { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} - -public sealed partial class CompletionSuggest : - ISuggest -{ - [JsonInclude, JsonPropertyName("length")] - public int Length { get; init; } - - [JsonInclude, JsonPropertyName("offset")] - public int Offset { get; init; } - - [JsonInclude, JsonPropertyName("options"), GenericConverter(typeof(SingleOrManyCollectionConverter<>), unwrap:true)] - public IReadOnlyCollection> Options { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} - -public sealed partial class CompletionSuggestOption -{ - [JsonInclude, JsonPropertyName("_id")] - public string? Id { get; init; } - - [JsonInclude, JsonPropertyName("_index")] - public string? Index { get; init; } - - [JsonInclude, JsonPropertyName("_routing")] - public string? Routing { get; init; } - - [JsonInclude, JsonPropertyName("_score")] - public double? Score0 { get; init; } - - [JsonInclude, JsonPropertyName("_source")] - [SourceConverter] - public TDocument? Source { get; init; } - - [JsonInclude, JsonPropertyName("collate_match")] - public bool? CollateMatch { get; init; } - - [JsonInclude, JsonPropertyName("contexts")] - public IReadOnlyDictionary>? Contexts { get; init; } - - [JsonInclude, JsonPropertyName("fields")] - public IReadOnlyDictionary? Fields { get; init; } - - [JsonInclude, JsonPropertyName("score")] - public double? Score { get; init; } - - [JsonInclude, JsonPropertyName("text")] - public string Text { get; init; } -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs index a3e2cbd8f0a..0cbec2939c1 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/MultiSearchItem.cs @@ -21,5 +21,5 @@ public partial class MultiSearchItem public IReadOnlyCollection Documents => HitsMetadata.Hits.Select(s => s.Source).ToReadOnlyCollection(); [JsonIgnore] - public long Total => HitsMetadata?.Total?.Value ?? -1; + public long Total => HitsMetadata?.Total?.Item2 ?? HitsMetadata?.Total?.Item1.Value ?? -1; } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs index 4e42adf6eb2..70ff5bfb147 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/BoolQueryAndExtensions.cs @@ -176,13 +176,13 @@ private static Query CreateMustContainer(Query left, Query right) => CreateMustContainer(new List { left, right }); private static Query CreateMustContainer(List mustClauses) => - new(new BoolQuery() { Must = mustClauses.ToListOrNullIfEmpty() }); + Query.Bool(new BoolQuery() { Must = mustClauses.ToListOrNullIfEmpty() }); private static Query CreateMustContainer( List mustClauses, List mustNotClauses, List filters - ) => new(new BoolQuery + ) => Query.Bool(new BoolQuery { Must = mustClauses.ToListOrNullIfEmpty(), MustNot = mustNotClauses.ToListOrNullIfEmpty(), diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs index 70da58ca951..3da5f73d917 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/Query.cs @@ -13,27 +13,6 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; public partial class Query { - internal Query(SearchQuery query) - { - if (query is null) - return; - - query.WrapInContainer(this); - } - - public bool TryGet([NotNullWhen(true)]out T? query) - { - query = default; - - if (Variant is T variant) - { - query = variant; - return true; - } - - return false; - } - internal bool HoldsOnlyShouldMusts { get; set; } public static bool operator false(Query _) => false; @@ -78,9 +57,9 @@ internal static Query Or(Query leftContainer, Query rightContainer) public static Query operator !(Query queryContainer) => queryContainer is null ? null - : new Query(new BoolQuery { MustNot = new[] { queryContainer } }); + : Query.Bool(new BoolQuery { MustNot = new[] { queryContainer } }); public static Query operator +(Query queryContainer) => queryContainer is null ? null - : new Query(new BoolQuery { Filter = new[] { queryContainer } }); + : Query.Bool(new BoolQuery { Filter = new[] { queryContainer } }); } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs deleted file mode 100644 index bd840944a89..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/QueryDescriptor.cs +++ /dev/null @@ -1,50 +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.Linq.Expressions; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -#else -namespace Elastic.Clients.Elasticsearch.QueryDsl; -#endif - -public sealed partial class QueryDescriptor -{ - /// - /// A query defined as a raw JSON string. This can be useful when support for a built-in query is not yet available. - /// - public QueryDescriptor RawJson(string rawJson) => Set(new RawJsonQuery(rawJson), "raw_json"); - - public QueryDescriptor MatchAll() => - Set(_ => { }, "match_all"); - - public QueryDescriptor Term(Expression> field, object value, float? boost = null) => - Term(t => t.Field(field).Value(FieldValue.Composite(value)).Boost(boost)); - - /// - /// Used purely for testing (for now). - /// - internal bool TestHasVariant => ContainsVariant; -} - -public sealed partial class QueryDescriptor -{ - /// - /// A query defined as a raw JSON string. This can be useful when support for a built-in query is not yet available. - /// - public QueryDescriptor RawJson(string rawJson) => Set(new RawJsonQuery(rawJson), "raw_json"); - - public QueryDescriptor MatchAll() => - Set(_ => { }, "match_all"); - - public QueryDescriptor Term(Expression> field, object value, float? boost = null) => - Term(t => t.Field(field).Value(FieldValue.Composite(value)).Boost(boost)); - - /// - /// Used purely for testing (for now). - /// - internal bool TestHasVariant => ContainsVariant; -} diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs deleted file mode 100644 index f6cfc947ce5..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RangeQuery.cs +++ /dev/null @@ -1,234 +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.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 -{ - internal RangeQuery() { } - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("range", this); - - public static implicit operator Query(RangeQuery rangeQuery) => Query.Range(rangeQuery); -} - -internal sealed class RangeQueryConverter : JsonConverter -{ - public override RangeQuery? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var readerCopy = reader; - - if (readerCopy.TokenType != JsonTokenType.StartObject) - ThrowHelper.ThrowJsonException($"Unexpected JSON detected. Expected {JsonTokenType.StartObject} but read {readerCopy.TokenType}."); - - readerCopy.Read(); // Read past the opening token - readerCopy.Read(); // Read past the field name - - using var jsonDoc = JsonDocument.ParseValue(ref readerCopy); - - if (jsonDoc is null) - return null; - - // When either of these properties are present, we know we have a date range query - if (jsonDoc.RootElement.TryGetProperty("format", out _) || jsonDoc.RootElement.TryGetProperty("time_zone", out _)) - { - return JsonSerializer.Deserialize(ref reader, options); - } - - JsonElement? rangeElement = null; - - if (jsonDoc.RootElement.TryGetProperty("gte", out var gte)) - { - rangeElement = gte; - } - else if (jsonDoc.RootElement.TryGetProperty("gt", out var gt)) - { - rangeElement = gt; - } - else if(jsonDoc.RootElement.TryGetProperty("lte", out var lte)) - { - rangeElement = lte; - } - else if(jsonDoc.RootElement.TryGetProperty("lt", out var lt)) - { - rangeElement = lt; - } - - if (!rangeElement.HasValue) - { - ThrowHelper.ThrowJsonException("Unable to determine type of range query."); - } - - switch (rangeElement.Value.ValueKind) - { - case JsonValueKind.String: - return JsonSerializer.Deserialize(ref reader, options); - case JsonValueKind.Number: - return JsonSerializer.Deserialize(ref reader, options); - } - - ThrowHelper.ThrowJsonException("Unable to deserialize range query."); - - // We never reach here. I wish the flow analysis could infer that this isn't needed with the help of the DoesNotReturn attributes. - return null; - } - - public override void Write(Utf8JsonWriter writer, RangeQuery value, JsonSerializerOptions options) => - JsonSerializer.Serialize(writer, value, value.GetType(), options); -} - - -public sealed class RangeQueryDescriptor : SerializableDescriptor> -{ - private NumberRangeQueryDescriptor _numberRangeQueryDescriptor; - private DateRangeQueryDescriptor _dateRangeQueryDescriptor; - - private Action> _numberRangeQueryDescriptorAction; - private Action> _dateRangeQueryDescriptorAction; - - public RangeQueryDescriptor DateRange(Action> configure) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = configure; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - public RangeQueryDescriptor NumberRange(Action> configure) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = configure; - - return Self; - } - - public RangeQueryDescriptor DateRange(DateRangeQueryDescriptor descriptor) - { - _dateRangeQueryDescriptor = descriptor; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - public RangeQueryDescriptor NumberRange(NumberRangeQueryDescriptor descriptor) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = descriptor; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - if (_dateRangeQueryDescriptor is not null) - { - JsonSerializer.Serialize(writer, _dateRangeQueryDescriptor, options); - } - else if (_dateRangeQueryDescriptorAction is not null) - { - JsonSerializer.Serialize(writer, new DateRangeQueryDescriptor(_dateRangeQueryDescriptorAction), options); - } - else if (_numberRangeQueryDescriptor is not null) - { - JsonSerializer.Serialize(writer, _numberRangeQueryDescriptor, options); - } - else if (_numberRangeQueryDescriptorAction is not null) - { - JsonSerializer.Serialize(writer, new NumberRangeQueryDescriptor(_numberRangeQueryDescriptorAction), options); - } - } -} - -public sealed class RangeQueryDescriptor : SerializableDescriptor -{ - private NumberRangeQueryDescriptor _numberRangeQueryDescriptor; - private DateRangeQueryDescriptor _dateRangeQueryDescriptor; - - private Action _numberRangeQueryDescriptorAction; - private Action _dateRangeQueryDescriptorAction; - - public RangeQueryDescriptor DateRange(Action configure) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = configure; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - public RangeQueryDescriptor NumberRange(Action configure) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = configure; - - return Self; - } - - public RangeQueryDescriptor DateRange(DateRangeQueryDescriptor descriptor) - { - _dateRangeQueryDescriptor = descriptor; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = null; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - public RangeQueryDescriptor NumberRange(NumberRangeQueryDescriptor descriptor) - { - _dateRangeQueryDescriptor = null; - _dateRangeQueryDescriptorAction = null; - _numberRangeQueryDescriptor = descriptor; - _numberRangeQueryDescriptorAction = null; - - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - if (_dateRangeQueryDescriptor is not null) - { - JsonSerializer.Serialize(writer, _dateRangeQueryDescriptor, options); - } - else if (_dateRangeQueryDescriptorAction is not null) - { - JsonSerializer.Serialize(writer, new DateRangeQueryDescriptor(_dateRangeQueryDescriptorAction), options); - } - else if (_numberRangeQueryDescriptor is not null) - { - JsonSerializer.Serialize(writer, _numberRangeQueryDescriptor, options); - } - else if (_numberRangeQueryDescriptorAction is not null) - { - JsonSerializer.Serialize(writer, new NumberRangeQueryDescriptor(_numberRangeQueryDescriptorAction), options); - } - } -} - diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs index 26ed57a94db..99057baca2d 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/RawJsonQuery.cs @@ -15,7 +15,8 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; /// /// 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. /// -public sealed class RawJsonQuery : SearchQuery +[JsonConverter(typeof(RawJsonQueryConverter))] +public sealed class RawJsonQuery { public RawJsonQuery(string rawQuery) => Raw = rawQuery; @@ -24,8 +25,6 @@ public sealed class RawJsonQuery : SearchQuery /// public string Raw { get; } - internal override void InternalWrapInContainer(Query container) => new Query("raw_json", this); - public static implicit operator Query(RawJsonQuery rawJsonQuery) => Query.RawJson(rawJsonQuery); } diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs b/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs deleted file mode 100644 index a0f5928ad1e..00000000000 --- a/src/Elastic.Clients.Elasticsearch.Shared/Types/QueryDsl/SearchQuery.cs +++ /dev/null @@ -1,72 +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; - -#if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Serverless.QueryDsl; -#else -namespace Elastic.Clients.Elasticsearch.QueryDsl; -#endif - -/// -/// A base type for all query variants. -/// -public abstract partial class SearchQuery -{ - // Always evaluate to false so that each side of && equation is evaluated - public static bool operator false(SearchQuery _) => false; - - // Always evaluate to false so that each side of && equation is evaluated - public static bool operator true(SearchQuery _) => false; - - public static SearchQuery? operator &(SearchQuery? leftQuery, SearchQuery? rightQuery) => Combine(leftQuery, rightQuery, (l, r) => l && r); - - public static SearchQuery? operator |(SearchQuery? leftQuery, SearchQuery? rightQuery) => Combine(leftQuery, rightQuery, (l, r) => l || r); - - public static SearchQuery? operator !(SearchQuery? query) => query is null - ? null - : new BoolQuery { MustNot = new Query[] { query } }; - - public static SearchQuery? operator +(SearchQuery? query) => query is null - ? null - : new BoolQuery { Filter = new Query[] { query } }; - - private static SearchQuery? Combine(SearchQuery? leftQuery, SearchQuery? rightQuery, Func combine) - { - // If both sides are null, return null - if (leftQuery is null && rightQuery is null) - { - return null; - } - - // If the left side is null, return the right side - if (leftQuery is null) - { - return rightQuery; - } - - // If the right side is null, return the left side - if (rightQuery is null) - { - return leftQuery; - } - - var container = combine(leftQuery, rightQuery); - - if (container.TryGet(out var boolQuery)) - { - return boolQuery; - } - - throw new Exception("Unable to combine queries."); - } - - public static implicit operator Query?(SearchQuery? query) => query is null ? null : new Query(query); - - // We no longer (currently) support verbatim/strict query containers so this may be simplified to a direct abstract method in the future. - internal void WrapInContainer(Query container) => InternalWrapInContainer(container); - - internal abstract void InternalWrapInContainer(Query container); -} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index b5a329e010c..c5dd76e426e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -26,10 +26,30 @@ internal static class ApiUrlLookup internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "_async_search/status/{id}" }); internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "_async_search", "{index}/_async_search" }); internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[] { "_cluster/allocation/explain" }); + internal static ApiUrls ClusterDeleteComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); + internal static ApiUrls ClusterDeleteVotingConfigExclusions = new ApiUrls(new[] { "_cluster/voting_config_exclusions" }); + internal static ApiUrls ClusterExistsComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); + internal static ApiUrls ClusterGetComponentTemplate = new ApiUrls(new[] { "_component_template", "_component_template/{name}" }); internal static ApiUrls ClusterGetSettings = new ApiUrls(new[] { "_cluster/settings" }); internal static ApiUrls ClusterHealth = new ApiUrls(new[] { "_cluster/health", "_cluster/health/{index}" }); + internal static ApiUrls ClusterInfo = new ApiUrls(new[] { "_info/{target}" }); internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[] { "_cluster/pending_tasks" }); + internal static ApiUrls ClusterPostVotingConfigExclusions = new ApiUrls(new[] { "_cluster/voting_config_exclusions" }); + internal static ApiUrls ClusterPutComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); internal static ApiUrls ClusterStats = new ApiUrls(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" }); + internal static ApiUrls CrossClusterReplicationDeleteAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow/{name}" }); + internal static ApiUrls CrossClusterReplicationFollow = new ApiUrls(new[] { "{index}/_ccr/follow" }); + internal static ApiUrls CrossClusterReplicationFollowInfo = new ApiUrls(new[] { "{index}/_ccr/info" }); + internal static ApiUrls CrossClusterReplicationFollowStats = new ApiUrls(new[] { "{index}/_ccr/stats" }); + internal static ApiUrls CrossClusterReplicationForgetFollower = new ApiUrls(new[] { "{index}/_ccr/forget_follower" }); + internal static ApiUrls CrossClusterReplicationGetAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow", "_ccr/auto_follow/{name}" }); + internal static ApiUrls CrossClusterReplicationPauseAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow/{name}/pause" }); + internal static ApiUrls CrossClusterReplicationPauseFollow = new ApiUrls(new[] { "{index}/_ccr/pause_follow" }); + internal static ApiUrls CrossClusterReplicationPutAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow/{name}" }); + internal static ApiUrls CrossClusterReplicationResumeAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow/{name}/resume" }); + internal static ApiUrls CrossClusterReplicationResumeFollow = new ApiUrls(new[] { "{index}/_ccr/resume_follow" }); + internal static ApiUrls CrossClusterReplicationStats = new ApiUrls(new[] { "_ccr/stats" }); + internal static ApiUrls CrossClusterReplicationUnfollow = new ApiUrls(new[] { "{index}/_ccr/unfollow" }); internal static ApiUrls DanglingIndicesListDanglingIndices = new ApiUrls(new[] { "_dangling" }); internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "_enrich/policy/{name}" }); internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "_enrich/policy/{name}/_execute" }); @@ -41,22 +61,40 @@ internal static class ApiUrlLookup internal static ApiUrls EqlGetStatus = new ApiUrls(new[] { "_eql/search/status/{id}" }); internal static ApiUrls EqlSearch = new ApiUrls(new[] { "{index}/_eql/search" }); internal static ApiUrls EsqlQuery = new ApiUrls(new[] { "_query" }); + internal static ApiUrls FeaturesGetFeatures = new ApiUrls(new[] { "_features" }); + internal static ApiUrls FeaturesResetFeatures = new ApiUrls(new[] { "_features/_reset" }); internal static ApiUrls GraphExplore = new ApiUrls(new[] { "{index}/_graph/explore" }); + internal static ApiUrls IndexLifecycleManagementDeleteLifecycle = new ApiUrls(new[] { "_ilm/policy/{policy}" }); + internal static ApiUrls IndexLifecycleManagementGetLifecycle = new ApiUrls(new[] { "_ilm/policy/{policy}", "_ilm/policy" }); + internal static ApiUrls IndexLifecycleManagementGetStatus = new ApiUrls(new[] { "_ilm/status" }); + internal static ApiUrls IndexLifecycleManagementMigrateToDataTiers = new ApiUrls(new[] { "_ilm/migrate_to_data_tiers" }); + internal static ApiUrls IndexLifecycleManagementMoveToStep = new ApiUrls(new[] { "_ilm/move/{index}" }); + internal static ApiUrls IndexLifecycleManagementPutLifecycle = new ApiUrls(new[] { "_ilm/policy/{policy}" }); + internal static ApiUrls IndexLifecycleManagementRemovePolicy = new ApiUrls(new[] { "{index}/_ilm/remove" }); + internal static ApiUrls IndexLifecycleManagementRetry = new ApiUrls(new[] { "{index}/_ilm/retry" }); + internal static ApiUrls IndexLifecycleManagementStart = new ApiUrls(new[] { "_ilm/start" }); + internal static ApiUrls IndexLifecycleManagementStop = new ApiUrls(new[] { "_ilm/stop" }); + internal static ApiUrls IndexManagementAnalyze = new ApiUrls(new[] { "_analyze", "{index}/_analyze" }); + internal static ApiUrls IndexManagementClearCache = new ApiUrls(new[] { "_cache/clear", "{index}/_cache/clear" }); internal static ApiUrls IndexManagementClone = new ApiUrls(new[] { "{index}/_clone/{target}" }); internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "{index}/_close" }); internal static ApiUrls IndexManagementCreate = new ApiUrls(new[] { "{index}" }); internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "_data_stream/{name}" }); + internal static ApiUrls IndexManagementDataStreamsStats = new ApiUrls(new[] { "_data_stream/_stats", "_data_stream/{name}/_stats" }); internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "{index}" }); - internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{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 IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" }); internal static ApiUrls IndexManagementDeleteTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementDiskUsage = new ApiUrls(new[] { "{index}/_disk_usage" }); + internal static ApiUrls IndexManagementDownsample = new ApiUrls(new[] { "{index}/_downsample/{target_index}" }); internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "{index}" }); 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 IndexManagementExistsTemplate = new ApiUrls(new[] { "_template/{name}" }); internal static ApiUrls IndexManagementExplainDataLifecycle = new ApiUrls(new[] { "{index}/_lifecycle/explain" }); + internal static ApiUrls IndexManagementFieldUsageStats = new ApiUrls(new[] { "{index}/_field_usage_stats" }); internal static ApiUrls IndexManagementFlush = new ApiUrls(new[] { "_flush", "{index}/_flush" }); internal static ApiUrls IndexManagementForcemerge = new ApiUrls(new[] { "_forcemerge", "{index}/_forcemerge" }); internal static ApiUrls IndexManagementGet = new ApiUrls(new[] { "{index}" }); @@ -66,28 +104,127 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementGetFieldMapping = new ApiUrls(new[] { "_mapping/field/{fields}", "{index}/_mapping/field/{fields}" }); 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 IndexManagementGetSettings = new ApiUrls(new[] { "_settings", "{index}/_settings", "{index}/_settings/{name}", "_settings/{name}" }); internal static ApiUrls IndexManagementGetTemplate = new ApiUrls(new[] { "_template", "_template/{name}" }); internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "_data_stream/_migrate/{name}" }); + internal static ApiUrls IndexManagementModifyDataStream = new ApiUrls(new[] { "_data_stream/_modify" }); internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "{index}/_open" }); - internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}" }); + internal static ApiUrls IndexManagementPromoteDataStream = new ApiUrls(new[] { "_data_stream/_promote/{name}" }); + internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{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 IndexManagementPutSettings = new ApiUrls(new[] { "_settings", "{index}/_settings" }); internal static ApiUrls IndexManagementPutTemplate = new ApiUrls(new[] { "_template/{name}" }); + internal static ApiUrls IndexManagementRecovery = new ApiUrls(new[] { "_recovery", "{index}/_recovery" }); internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "_refresh", "{index}/_refresh" }); + internal static ApiUrls IndexManagementReloadSearchAnalyzers = new ApiUrls(new[] { "{index}/_reload_search_analyzers" }); + internal static ApiUrls IndexManagementResolveCluster = new ApiUrls(new[] { "_resolve/cluster/{name}" }); + internal static ApiUrls IndexManagementResolveIndex = new ApiUrls(new[] { "_resolve/index/{name}" }); internal static ApiUrls IndexManagementRollover = new ApiUrls(new[] { "{alias}/_rollover", "{alias}/_rollover/{new_index}" }); + internal static ApiUrls IndexManagementSegments = new ApiUrls(new[] { "_segments", "{index}/_segments" }); + internal static ApiUrls IndexManagementShardStores = new ApiUrls(new[] { "_shard_stores", "{index}/_shard_stores" }); internal static ApiUrls IndexManagementShrink = new ApiUrls(new[] { "{index}/_shrink/{target}" }); 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 IndexManagementSplit = new ApiUrls(new[] { "{index}/_split/{target}" }); internal static ApiUrls IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" }); internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" }); + internal static ApiUrls IndexManagementValidateQuery = new ApiUrls(new[] { "_validate/query", "{index}/_validate/query" }); + internal static ApiUrls InferenceDeleteModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls InferenceGetModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls InferenceInference = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); + internal static ApiUrls InferencePutModel = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" }); 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 LicenseManagementDelete = new ApiUrls(new[] { "_license" }); + internal static ApiUrls LicenseManagementGet = new ApiUrls(new[] { "_license" }); + internal static ApiUrls LicenseManagementGetBasicStatus = new ApiUrls(new[] { "_license/basic_status" }); + internal static ApiUrls LicenseManagementGetTrialStatus = new ApiUrls(new[] { "_license/trial_status" }); + internal static ApiUrls LicenseManagementPost = new ApiUrls(new[] { "_license" }); + internal static ApiUrls LicenseManagementPostStartBasic = new ApiUrls(new[] { "_license/start_basic" }); + internal static ApiUrls LicenseManagementPostStartTrial = new ApiUrls(new[] { "_license/start_trial" }); + internal static ApiUrls MachineLearningClearTrainedModelDeploymentCache = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/cache/_clear" }); + internal static ApiUrls MachineLearningCloseJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_close" }); + internal static ApiUrls MachineLearningDeleteCalendar = new ApiUrls(new[] { "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningDeleteCalendarEvent = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events/{event_id}" }); + internal static ApiUrls MachineLearningDeleteCalendarJob = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/jobs/{job_id}" }); + internal static ApiUrls MachineLearningDeleteDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}" }); + internal static ApiUrls MachineLearningDeleteDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}" }); + internal static ApiUrls MachineLearningDeleteExpiredData = new ApiUrls(new[] { "_ml/_delete_expired_data/{job_id}", "_ml/_delete_expired_data" }); + internal static ApiUrls MachineLearningDeleteFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningDeleteForecast = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_forecast", "_ml/anomaly_detectors/{job_id}/_forecast/{forecast_id}" }); + internal static ApiUrls MachineLearningDeleteJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}" }); + internal static ApiUrls MachineLearningDeleteModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}" }); + internal static ApiUrls MachineLearningDeleteTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}" }); + internal static ApiUrls MachineLearningDeleteTrainedModelAlias = new ApiUrls(new[] { "_ml/trained_models/{model_id}/model_aliases/{model_alias}" }); + internal static ApiUrls MachineLearningEstimateModelMemory = new ApiUrls(new[] { "_ml/anomaly_detectors/_estimate_model_memory" }); + internal static ApiUrls MachineLearningEvaluateDataFrame = new ApiUrls(new[] { "_ml/data_frame/_evaluate" }); + internal static ApiUrls MachineLearningExplainDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/_explain", "_ml/data_frame/analytics/{id}/_explain" }); + internal static ApiUrls MachineLearningFlushJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_flush" }); + internal static ApiUrls MachineLearningForecast = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_forecast" }); + internal static ApiUrls MachineLearningGetBuckets = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", "_ml/anomaly_detectors/{job_id}/results/buckets" }); + internal static ApiUrls MachineLearningGetCalendarEvents = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events" }); + internal static ApiUrls MachineLearningGetCalendars = new ApiUrls(new[] { "_ml/calendars", "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningGetCategories = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/categories/{category_id}", "_ml/anomaly_detectors/{job_id}/results/categories" }); + internal static ApiUrls MachineLearningGetDatafeeds = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}", "_ml/datafeeds" }); + internal static ApiUrls MachineLearningGetDatafeedStats = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_stats", "_ml/datafeeds/_stats" }); + internal static ApiUrls MachineLearningGetDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}", "_ml/data_frame/analytics" }); + internal static ApiUrls MachineLearningGetDataFrameAnalyticsStats = new ApiUrls(new[] { "_ml/data_frame/analytics/_stats", "_ml/data_frame/analytics/{id}/_stats" }); + internal static ApiUrls MachineLearningGetFilters = new ApiUrls(new[] { "_ml/filters", "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningGetInfluencers = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/influencers" }); + internal static ApiUrls MachineLearningGetJobs = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}", "_ml/anomaly_detectors" }); + internal static ApiUrls MachineLearningGetJobStats = new ApiUrls(new[] { "_ml/anomaly_detectors/_stats", "_ml/anomaly_detectors/{job_id}/_stats" }); + internal static ApiUrls MachineLearningGetMemoryStats = new ApiUrls(new[] { "_ml/memory/_stats", "_ml/memory/{node_id}/_stats" }); + internal static ApiUrls MachineLearningGetModelSnapshots = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", "_ml/anomaly_detectors/{job_id}/model_snapshots" }); + internal static ApiUrls MachineLearningGetModelSnapshotUpgradeStats = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats" }); + internal static ApiUrls MachineLearningGetOverallBuckets = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/overall_buckets" }); + internal static ApiUrls MachineLearningGetRecords = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/results/records" }); + internal static ApiUrls MachineLearningGetTrainedModels = new ApiUrls(new[] { "_ml/trained_models/{model_id}", "_ml/trained_models" }); + internal static ApiUrls MachineLearningGetTrainedModelsStats = new ApiUrls(new[] { "_ml/trained_models/{model_id}/_stats", "_ml/trained_models/_stats" }); + internal static ApiUrls MachineLearningInferTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}/_infer" }); + internal static ApiUrls MachineLearningInfo = new ApiUrls(new[] { "_ml/info" }); + internal static ApiUrls MachineLearningOpenJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_open" }); + internal static ApiUrls MachineLearningPostCalendarEvents = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/events" }); + internal static ApiUrls MachineLearningPreviewDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/_preview", "_ml/data_frame/analytics/{id}/_preview" }); + internal static ApiUrls MachineLearningPutCalendar = new ApiUrls(new[] { "_ml/calendars/{calendar_id}" }); + internal static ApiUrls MachineLearningPutCalendarJob = new ApiUrls(new[] { "_ml/calendars/{calendar_id}/jobs/{job_id}" }); + internal static ApiUrls MachineLearningPutDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}" }); + internal static ApiUrls MachineLearningPutDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}" }); + internal static ApiUrls MachineLearningPutFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}" }); + internal static ApiUrls MachineLearningPutJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}" }); + internal static ApiUrls MachineLearningPutTrainedModel = new ApiUrls(new[] { "_ml/trained_models/{model_id}" }); + internal static ApiUrls MachineLearningPutTrainedModelAlias = new ApiUrls(new[] { "_ml/trained_models/{model_id}/model_aliases/{model_alias}" }); + internal static ApiUrls MachineLearningPutTrainedModelDefinitionPart = new ApiUrls(new[] { "_ml/trained_models/{model_id}/definition/{part}" }); + internal static ApiUrls MachineLearningPutTrainedModelVocabulary = new ApiUrls(new[] { "_ml/trained_models/{model_id}/vocabulary" }); + internal static ApiUrls MachineLearningResetJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_reset" }); + internal static ApiUrls MachineLearningRevertModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert" }); + internal static ApiUrls MachineLearningSetUpgradeMode = new ApiUrls(new[] { "_ml/set_upgrade_mode" }); + internal static ApiUrls MachineLearningStartDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_start" }); + internal static ApiUrls MachineLearningStartDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_start" }); + internal static ApiUrls MachineLearningStartTrainedModelDeployment = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/_start" }); + internal static ApiUrls MachineLearningStopDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_stop" }); + internal static ApiUrls MachineLearningStopDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_stop" }); + internal static ApiUrls MachineLearningStopTrainedModelDeployment = new ApiUrls(new[] { "_ml/trained_models/{model_id}/deployment/_stop" }); + internal static ApiUrls MachineLearningUpdateDatafeed = new ApiUrls(new[] { "_ml/datafeeds/{datafeed_id}/_update" }); + internal static ApiUrls MachineLearningUpdateDataFrameAnalytics = new ApiUrls(new[] { "_ml/data_frame/analytics/{id}/_update" }); + internal static ApiUrls MachineLearningUpdateFilter = new ApiUrls(new[] { "_ml/filters/{filter_id}/_update" }); + internal static ApiUrls MachineLearningUpdateJob = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/_update" }); + internal static ApiUrls MachineLearningUpdateModelSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update" }); + internal static ApiUrls MachineLearningUpgradeJobSnapshot = new ApiUrls(new[] { "_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade" }); + internal static ApiUrls MachineLearningValidate = new ApiUrls(new[] { "_ml/anomaly_detectors/_validate" }); + internal static ApiUrls MachineLearningValidateDetector = new ApiUrls(new[] { "_ml/anomaly_detectors/_validate/detector" }); + internal static ApiUrls NodesClearRepositoriesMeteringArchive = new ApiUrls(new[] { "_nodes/{node_id}/_repositories_metering/{max_archive_version}" }); + internal static ApiUrls NodesGetRepositoriesMeteringInfo = new ApiUrls(new[] { "_nodes/{node_id}/_repositories_metering" }); + internal static ApiUrls NodesHotThreads = new ApiUrls(new[] { "_nodes/hot_threads", "_nodes/{node_id}/hot_threads" }); + internal static ApiUrls NodesInfo = new ApiUrls(new[] { "_nodes", "_nodes/{node_id}", "_nodes/{metric}", "_nodes/{node_id}/{metric}" }); + internal static ApiUrls NodesReloadSecureSettings = new ApiUrls(new[] { "_nodes/reload_secure_settings", "_nodes/{node_id}/reload_secure_settings" }); + internal static ApiUrls NodesStats = new ApiUrls(new[] { "_nodes/stats", "_nodes/{node_id}/stats", "_nodes/stats/{metric}", "_nodes/{node_id}/stats/{metric}", "_nodes/stats/{metric}/{index_metric}", "_nodes/{node_id}/stats/{metric}/{index_metric}" }); + internal static ApiUrls NodesUsage = new ApiUrls(new[] { "_nodes/usage", "_nodes/{node_id}/usage", "_nodes/usage/{metric}", "_nodes/{node_id}/usage/{metric}" }); 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" }); @@ -106,12 +243,13 @@ internal static class ApiUrlLookup internal static ApiUrls NoNamespaceGetScriptContext = new ApiUrls(new[] { "_script_context" }); internal static ApiUrls NoNamespaceGetScriptLanguages = new ApiUrls(new[] { "_script_language" }); internal static ApiUrls NoNamespaceGetSource = new ApiUrls(new[] { "{index}/_source/{id}" }); + internal static ApiUrls NoNamespaceHealthReport = new ApiUrls(new[] { "_health_report", "_health_report/{feature}" }); internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[] { "{index}/_doc/{id}", "{index}/_doc" }); internal static ApiUrls NoNamespaceInfo = new ApiUrls(new[] { "" }); - 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 NoNamespaceMultiGet = new ApiUrls(new[] { "_mget", "{index}/_mget" }); + internal static ApiUrls NoNamespaceMultiSearch = new ApiUrls(new[] { "_msearch", "{index}/_msearch" }); + internal static ApiUrls NoNamespaceMultiSearchTemplate = new ApiUrls(new[] { "_msearch/template", "{index}/_msearch/template" }); 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}" }); @@ -119,8 +257,10 @@ internal static class ApiUrlLookup internal static ApiUrls NoNamespaceReindex = new ApiUrls(new[] { "_reindex" }); internal static ApiUrls NoNamespaceReindexRethrottle = new ApiUrls(new[] { "_reindex/{task_id}/_rethrottle" }); internal static ApiUrls NoNamespaceRenderSearchTemplate = new ApiUrls(new[] { "_render/template", "_render/template/{id}" }); + internal static ApiUrls NoNamespaceScriptsPainlessExecute = new ApiUrls(new[] { "_scripts/painless/_execute" }); internal static ApiUrls NoNamespaceScroll = new ApiUrls(new[] { "_search/scroll" }); internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[] { "_search", "{index}/_search" }); + internal static ApiUrls NoNamespaceSearchMvt = new ApiUrls(new[] { "{index}/_mvt/{field}/{zoom}/{x}/{y}" }); internal static ApiUrls NoNamespaceSearchShards = new ApiUrls(new[] { "_search_shards", "{index}/_search_shards" }); internal static ApiUrls NoNamespaceSearchTemplate = new ApiUrls(new[] { "_search/template", "{index}/_search/template" }); internal static ApiUrls NoNamespaceTermsEnum = new ApiUrls(new[] { "{index}/_terms_enum" }); @@ -128,12 +268,78 @@ internal static class ApiUrlLookup internal static ApiUrls NoNamespaceUpdate = new ApiUrls(new[] { "{index}/_update/{id}" }); internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "{index}/_update_by_query" }); internal static ApiUrls NoNamespaceUpdateByQueryRethrottle = new ApiUrls(new[] { "_update_by_query/{task_id}/_rethrottle" }); + internal static ApiUrls QueryRulesetDelete = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesetGet = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls QueryRulesetList = new ApiUrls(new[] { "_query_rules" }); + internal static ApiUrls QueryRulesetPut = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); + internal static ApiUrls RollupDeleteJob = new ApiUrls(new[] { "_rollup/job/{id}" }); + internal static ApiUrls RollupGetJobs = new ApiUrls(new[] { "_rollup/job/{id}", "_rollup/job" }); + internal static ApiUrls RollupGetRollupCaps = new ApiUrls(new[] { "_rollup/data/{id}", "_rollup/data" }); + internal static ApiUrls RollupGetRollupIndexCaps = new ApiUrls(new[] { "{index}/_rollup/data" }); + internal static ApiUrls RollupPutJob = new ApiUrls(new[] { "_rollup/job/{id}" }); + internal static ApiUrls RollupRollupSearch = new ApiUrls(new[] { "{index}/_rollup_search" }); + internal static ApiUrls RollupStartJob = new ApiUrls(new[] { "_rollup/job/{id}/_start" }); + internal static ApiUrls RollupStopJob = new ApiUrls(new[] { "_rollup/job/{id}/_stop" }); + internal static ApiUrls SearchableSnapshotsCacheStats = new ApiUrls(new[] { "_searchable_snapshots/cache/stats", "_searchable_snapshots/{node_id}/cache/stats" }); + internal static ApiUrls SearchableSnapshotsClearCache = new ApiUrls(new[] { "_searchable_snapshots/cache/clear", "{index}/_searchable_snapshots/cache/clear" }); + internal static ApiUrls SearchableSnapshotsMount = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_mount" }); + internal static ApiUrls SearchableSnapshotsStats = new ApiUrls(new[] { "_searchable_snapshots/stats", "{index}/_searchable_snapshots/stats" }); + internal static ApiUrls SearchApplicationDelete = new ApiUrls(new[] { "_application/search_application/{name}" }); + internal static ApiUrls SearchApplicationDeleteBehavioralAnalytics = new ApiUrls(new[] { "_application/analytics/{name}" }); + internal static ApiUrls SearchApplicationGet = new ApiUrls(new[] { "_application/search_application/{name}" }); + internal static ApiUrls SearchApplicationGetBehavioralAnalytics = new ApiUrls(new[] { "_application/analytics", "_application/analytics/{name}" }); + internal static ApiUrls SearchApplicationList = new ApiUrls(new[] { "_application/search_application" }); + internal static ApiUrls SearchApplicationPut = new ApiUrls(new[] { "_application/search_application/{name}" }); + internal static ApiUrls SearchApplicationPutBehavioralAnalytics = new ApiUrls(new[] { "_application/analytics/{name}" }); + internal static ApiUrls SearchApplicationSearch = new ApiUrls(new[] { "_application/search_application/{name}/_search" }); + internal static ApiUrls SnapshotCleanupRepository = new ApiUrls(new[] { "_snapshot/{repository}/_cleanup" }); + internal static ApiUrls SnapshotClone = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}" }); + internal static ApiUrls SnapshotCreate = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotCreateRepository = new ApiUrls(new[] { "_snapshot/{repository}" }); + internal static ApiUrls SnapshotDelete = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotDeleteRepository = new ApiUrls(new[] { "_snapshot/{repository}" }); + internal static ApiUrls SnapshotGet = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}" }); + internal static ApiUrls SnapshotGetRepository = new ApiUrls(new[] { "_snapshot", "_snapshot/{repository}" }); + internal static ApiUrls SnapshotLifecycleManagementDeleteLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}" }); + internal static ApiUrls SnapshotLifecycleManagementExecuteLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}/_execute" }); + internal static ApiUrls SnapshotLifecycleManagementExecuteRetention = new ApiUrls(new[] { "_slm/_execute_retention" }); + internal static ApiUrls SnapshotLifecycleManagementGetLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}", "_slm/policy" }); + internal static ApiUrls SnapshotLifecycleManagementGetStats = new ApiUrls(new[] { "_slm/stats" }); + internal static ApiUrls SnapshotLifecycleManagementGetStatus = new ApiUrls(new[] { "_slm/status" }); + internal static ApiUrls SnapshotLifecycleManagementPutLifecycle = new ApiUrls(new[] { "_slm/policy/{policy_id}" }); + internal static ApiUrls SnapshotLifecycleManagementStart = new ApiUrls(new[] { "_slm/start" }); + internal static ApiUrls SnapshotLifecycleManagementStop = new ApiUrls(new[] { "_slm/stop" }); + internal static ApiUrls SnapshotRestore = new ApiUrls(new[] { "_snapshot/{repository}/{snapshot}/_restore" }); + internal static ApiUrls SnapshotStatus = new ApiUrls(new[] { "_snapshot/_status", "_snapshot/{repository}/_status", "_snapshot/{repository}/{snapshot}/_status" }); + internal static ApiUrls SnapshotVerifyRepository = new ApiUrls(new[] { "_snapshot/{repository}/_verify" }); internal static ApiUrls SqlClearCursor = new ApiUrls(new[] { "_sql/close" }); internal static ApiUrls SqlDeleteAsync = new ApiUrls(new[] { "_sql/async/delete/{id}" }); internal static ApiUrls SqlGetAsync = new ApiUrls(new[] { "_sql/async/{id}" }); internal static ApiUrls SqlGetAsyncStatus = new ApiUrls(new[] { "_sql/async/status/{id}" }); internal static ApiUrls SqlQuery = new ApiUrls(new[] { "_sql" }); + internal static ApiUrls SqlTranslate = new ApiUrls(new[] { "_sql/translate" }); + internal static ApiUrls SynonymsDeleteSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsDeleteSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); + internal static ApiUrls SynonymsGetSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsGetSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); + internal static ApiUrls SynonymsGetSynonymsSets = new ApiUrls(new[] { "_synonyms" }); + internal static ApiUrls SynonymsPutSynonym = new ApiUrls(new[] { "_synonyms/{id}" }); + internal static ApiUrls SynonymsPutSynonymRule = new ApiUrls(new[] { "_synonyms/{set_id}/{rule_id}" }); internal static ApiUrls TasksCancel = new ApiUrls(new[] { "_tasks/_cancel", "_tasks/{task_id}/_cancel" }); internal static ApiUrls TasksGet = new ApiUrls(new[] { "_tasks/{task_id}" }); internal static ApiUrls TasksList = new ApiUrls(new[] { "_tasks" }); + internal static ApiUrls TextStructureTestGrokPattern = new ApiUrls(new[] { "_text_structure/test_grok_pattern" }); + internal static ApiUrls TransformManagementDeleteTransform = new ApiUrls(new[] { "_transform/{transform_id}" }); + internal static ApiUrls TransformManagementGetTransform = new ApiUrls(new[] { "_transform/{transform_id}", "_transform" }); + internal static ApiUrls TransformManagementGetTransformStats = new ApiUrls(new[] { "_transform/{transform_id}/_stats" }); + internal static ApiUrls TransformManagementPreviewTransform = new ApiUrls(new[] { "_transform/{transform_id}/_preview", "_transform/_preview" }); + internal static ApiUrls TransformManagementPutTransform = new ApiUrls(new[] { "_transform/{transform_id}" }); + internal static ApiUrls TransformManagementResetTransform = new ApiUrls(new[] { "_transform/{transform_id}/_reset" }); + internal static ApiUrls TransformManagementScheduleNowTransform = new ApiUrls(new[] { "_transform/{transform_id}/_schedule_now" }); + internal static ApiUrls TransformManagementStartTransform = new ApiUrls(new[] { "_transform/{transform_id}/_start" }); + internal static ApiUrls TransformManagementStopTransform = new ApiUrls(new[] { "_transform/{transform_id}/_stop" }); + internal static ApiUrls TransformManagementUpdateTransform = new ApiUrls(new[] { "_transform/{transform_id}/_update" }); + internal static ApiUrls TransformManagementUpgradeTransforms = new ApiUrls(new[] { "_transform/_upgrade" }); + internal static ApiUrls XpackInfo = new ApiUrls(new[] { "_xpack" }); + internal static ApiUrls XpackUsage = new ApiUrls(new[] { "_xpack/usage" }); } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs index aee98618624..d925081818d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs @@ -62,10 +62,6 @@ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : { } - internal AsyncSearchStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : { } - internal AsyncSearchStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs index 220a0037511..9f9cff0d79f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs @@ -39,18 +39,34 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse /// [JsonInclude, JsonPropertyName("completion_status")] public int? CompletionStatus { get; init; } + + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs index 5ad879d908f..51aa060f0ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs @@ -62,10 +62,6 @@ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : { } - internal DeleteAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : { } - internal DeleteAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs index 53ede513868..4e3be7997ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs index fffe37bf22f..009f12b1562 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs @@ -94,10 +94,6 @@ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal GetAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -132,10 +128,6 @@ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal GetAsyncSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs index 77218e32631..705ea995fd2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs @@ -28,18 +28,33 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch; public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse { + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } [JsonInclude, JsonPropertyName("response")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs index a840cf29d4a..b7dab5cb5e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs @@ -194,7 +194,7 @@ public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type ty var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -588,10 +588,10 @@ public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value } } -[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.
///
+[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))] public sealed partial class SubmitAsyncSearchRequest : PlainRequest { public SubmitAsyncSearchRequest() @@ -790,7 +790,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) [JsonIgnore] public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } [JsonInclude, JsonPropertyName("aggregations")] - public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Aggregations { get; set; } [JsonInclude, JsonPropertyName("collapse")] public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; } @@ -953,6 +953,10 @@ public sealed partial class SubmitAsyncSearchRequestDescriptor : Requ { internal SubmitAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SubmitAsyncSearchRequestDescriptor() { } @@ -1004,91 +1008,71 @@ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Ela return Self; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } + private IDictionary> AggregationsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action> CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action> PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private ICollection? StatsValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Suggester? SuggestValue { get; set; } - private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } - private Action SuggestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } private bool? VersionValue { get; set; } - public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SubmitAsyncSearchRequestDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -1100,7 +1084,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.El return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -1108,7 +1092,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldC return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure) + public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -1128,7 +1112,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection< return Self; } - public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -1137,7 +1121,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(QueryDsl.Fie return Self; } - public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action> configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1146,7 +1130,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1185,7 +1169,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -1194,7 +1178,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(QueryDsl.FieldAndFor return Self; } - public SubmitAsyncSearchRequestDescriptor Fields(Action> configure) + public SubmitAsyncSearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1203,7 +1187,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1229,7 +1213,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.E return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1237,7 +1221,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.Highl return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Action> configure) + public SubmitAsyncSearchRequestDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1266,7 +1250,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(ICollection Knn(KnnQueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.KnnQueryDescriptor descriptor) { KnnValue = null; KnnDescriptorAction = null; @@ -1275,7 +1259,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(KnnQueryDescriptor Knn(Action> configure) + public SubmitAsyncSearchRequestDescriptor Knn(Action> configure) { KnnValue = null; KnnDescriptor = null; @@ -1284,7 +1268,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Action Knn(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Knn(params Action>[] configure) { KnnValue = null; KnnDescriptor = null; @@ -1313,7 +1297,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elastic return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -1321,7 +1305,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTime return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -1337,7 +1321,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients. return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -1345,7 +1329,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDe return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(Action> configure) + public SubmitAsyncSearchRequestDescriptor PostFilter(Action> configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -1370,7 +1354,7 @@ public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elast return Self; } - public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -1378,7 +1362,7 @@ public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescrip return Self; } - public SubmitAsyncSearchRequestDescriptor Query(Action> configure) + public SubmitAsyncSearchRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -1395,7 +1379,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(ICollection Rescore(Core.Search.RescoreDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Rescore(Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor descriptor) { RescoreValue = null; RescoreDescriptorAction = null; @@ -1404,7 +1388,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Core.Search.Rescore return Self; } - public SubmitAsyncSearchRequestDescriptor Rescore(Action> configure) + public SubmitAsyncSearchRequestDescriptor Rescore(Action> configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1413,7 +1397,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Action Rescore(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Rescore(params Action>[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1425,18 +1409,18 @@ public SubmitAsyncSearchRequestDescriptor Rescore(params Action /// 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) + public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -1472,7 +1456,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elast return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -1480,7 +1464,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescripto return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(Action> configure) + public SubmitAsyncSearchRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -1497,7 +1481,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1506,7 +1490,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(SortOptionsDescriptor< return Self; } - public SubmitAsyncSearchRequestDescriptor Sort(Action> configure) + public SubmitAsyncSearchRequestDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1515,7 +1499,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(Action Sort(params Action>[] configure) + public SubmitAsyncSearchRequestDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -1559,7 +1543,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Ela return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -1567,7 +1551,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.Suggest return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + public SubmitAsyncSearchRequestDescriptor Suggest(Action> configure) { SuggestValue = null; SuggestDescriptor = null; @@ -1623,17 +1607,7 @@ public SubmitAsyncSearchRequestDescriptor Version(bool? version = tru 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.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -1647,7 +1621,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -1666,7 +1640,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -1675,7 +1649,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1709,7 +1683,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -1718,7 +1692,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1743,7 +1717,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1765,7 +1739,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -1774,7 +1748,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -1800,7 +1774,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -1816,7 +1790,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -1838,7 +1812,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -1854,7 +1828,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -1863,7 +1837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -1913,7 +1887,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -1929,7 +1903,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -1938,7 +1912,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -1976,7 +1950,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -2025,6 +1999,10 @@ public sealed partial class SubmitAsyncSearchRequestDescriptor : RequestDescript { internal SubmitAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this); + public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SubmitAsyncSearchRequestDescriptor() { } @@ -2076,91 +2054,71 @@ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. return Self; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } + private IDictionary AggregationsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private ICollection? StatsValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Suggester? SuggestValue { get; set; } - private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } - private Action SuggestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } private bool? VersionValue { get; set; } - public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SubmitAsyncSearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SubmitAsyncSearchRequestDescriptor Aggregations(Action configure) + public SubmitAsyncSearchRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2172,7 +2130,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -2180,7 +2138,7 @@ public SubmitAsyncSearchRequestDescriptor Collapse(Core.Search.FieldCollapseDesc return Self; } - public SubmitAsyncSearchRequestDescriptor Collapse(Action configure) + public SubmitAsyncSearchRequestDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -2200,7 +2158,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(ICollection configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2218,7 +2176,7 @@ public SubmitAsyncSearchRequestDescriptor DocvalueFields(Action[] configure) + public SubmitAsyncSearchRequestDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2257,7 +2215,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2275,7 +2233,7 @@ public SubmitAsyncSearchRequestDescriptor Fields(Action[] configure) + public SubmitAsyncSearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2301,7 +2259,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2309,7 +2267,7 @@ public SubmitAsyncSearchRequestDescriptor Highlight(Core.Search.HighlightDescrip return Self; } - public SubmitAsyncSearchRequestDescriptor Highlight(Action configure) + public SubmitAsyncSearchRequestDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2338,7 +2296,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Knn(Action configure) { KnnValue = null; KnnDescriptor = null; @@ -2356,7 +2314,7 @@ public SubmitAsyncSearchRequestDescriptor Knn(Action configu return Self; } - public SubmitAsyncSearchRequestDescriptor Knn(params Action[] configure) + public SubmitAsyncSearchRequestDescriptor Knn(params Action[] configure) { KnnValue = null; KnnDescriptor = null; @@ -2385,7 +2343,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -2393,7 +2351,7 @@ public SubmitAsyncSearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDe return Self; } - public SubmitAsyncSearchRequestDescriptor Pit(Action configure) + public SubmitAsyncSearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -2409,7 +2367,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsear return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -2417,7 +2375,7 @@ public SubmitAsyncSearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor de return Self; } - public SubmitAsyncSearchRequestDescriptor PostFilter(Action configure) + public SubmitAsyncSearchRequestDescriptor PostFilter(Action configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -2442,7 +2400,7 @@ public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Qu return Self; } - public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -2450,7 +2408,7 @@ public SubmitAsyncSearchRequestDescriptor Query(QueryDsl.QueryDescriptor descrip return Self; } - public SubmitAsyncSearchRequestDescriptor Query(Action configure) + public SubmitAsyncSearchRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -2467,7 +2425,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Rescore(Action configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2485,7 +2443,7 @@ public SubmitAsyncSearchRequestDescriptor Rescore(Action[] configure) + public SubmitAsyncSearchRequestDescriptor Rescore(params Action[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2497,18 +2455,18 @@ public SubmitAsyncSearchRequestDescriptor Rescore(params Action /// 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) + public SubmitAsyncSearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SubmitAsyncSearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2544,7 +2502,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Sl return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -2552,7 +2510,7 @@ public SubmitAsyncSearchRequestDescriptor Slice(SlicedScrollDescriptor descripto return Self; } - public SubmitAsyncSearchRequestDescriptor Slice(Action configure) + public SubmitAsyncSearchRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -2569,7 +2527,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(ICollection configure) + public SubmitAsyncSearchRequestDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -2587,7 +2545,7 @@ public SubmitAsyncSearchRequestDescriptor Sort(Action con return Self; } - public SubmitAsyncSearchRequestDescriptor Sort(params Action[] configure) + public SubmitAsyncSearchRequestDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -2631,7 +2589,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch. return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SubmitAsyncSearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -2639,7 +2597,7 @@ public SubmitAsyncSearchRequestDescriptor Suggest(Core.Search.SuggesterDescripto return Self; } - public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) + public SubmitAsyncSearchRequestDescriptor Suggest(Action configure) { SuggestValue = null; SuggestDescriptor = null; @@ -2695,17 +2653,7 @@ public SubmitAsyncSearchRequestDescriptor Version(bool? version = true) 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.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -2719,7 +2667,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -2738,7 +2686,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -2747,7 +2695,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2781,7 +2729,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -2790,7 +2738,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2815,7 +2763,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -2837,7 +2785,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -2846,7 +2794,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -2872,7 +2820,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -2888,7 +2836,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -2910,7 +2858,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -2926,7 +2874,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -2935,7 +2883,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -2985,7 +2933,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -3001,7 +2949,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -3010,7 +2958,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -3048,7 +2996,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs index 8fff6812e51..d8390b2f137 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs @@ -28,18 +28,33 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch; public sealed partial class SubmitAsyncSearchResponse : ElasticsearchResponse { + /// + /// Indicates when the async search completed. Only present
when the search has completed.
+ ///
[JsonInclude, JsonPropertyName("completion_time")] public DateTimeOffset? CompletionTime { get; init; } [JsonInclude, JsonPropertyName("completion_time_in_millis")] public long? CompletionTimeInMillis { get; init; } + + /// + /// Indicates when the async search will expire. + /// [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; } + + /// + /// When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards.
While the query is running, `is_partial` is always set to `true`.
+ ///
[JsonInclude, JsonPropertyName("is_partial")] public bool IsPartial { get; init; } + + /// + /// Indicates whether the search is still running or has completed.
NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though `is_running` is `false`.
+ ///
[JsonInclude, JsonPropertyName("is_running")] public bool IsRunning { get; init; } [JsonInclude, JsonPropertyName("response")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs index f1dce9a15de..f53365af257 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs @@ -160,6 +160,10 @@ public sealed partial class BulkRequestDescriptor : RequestDescriptor { internal BulkRequestDescriptor(Action> configure) => configure.Invoke(this); + public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public BulkRequestDescriptor() { } @@ -190,6 +194,8 @@ public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.Inde protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } @@ -200,6 +206,10 @@ public sealed partial class BulkRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public BulkRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public BulkRequestDescriptor() { } @@ -230,5 +240,7 @@ public BulkRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? inde protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs index 865d68f1ecb..a2c342a8ee7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs index d2e4efeca16..29bfde63e45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs index 44a6e801a67..1fdf5b5b3ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs index e3447a5c421..a17abac6f3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs new file mode 100644 index 00000000000..f0599848066 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class ClusterInfoRequestParameters : RequestParameters +{ +} + +/// +/// Returns different information about the cluster. +/// +public sealed partial class ClusterInfoRequest : PlainRequest +{ + public ClusterInfoRequest(IReadOnlyCollection target) : base(r => r.Required("target", target)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.info"; +} + +/// +/// Returns different information about the cluster. +/// +public sealed partial class ClusterInfoRequestDescriptor : RequestDescriptor +{ + internal ClusterInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClusterInfoRequestDescriptor(IReadOnlyCollection target) : base(r => r.Required("target", target)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.info"; + + public ClusterInfoRequestDescriptor Target(IReadOnlyCollection target) + { + RouteValues.Required("target", target); + 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/_Generated/Api/Cluster/ClusterInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs new file mode 100644 index 00000000000..3a0c28fa600 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class ClusterInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Nodes.Http? Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Nodes.Ingest? Ingest { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Nodes.Scripting? Script { get; init; } + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs index 8d82b1b1900..0b7230d2de1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -51,7 +51,7 @@ public ClusterStatsRequest() { } - public ClusterStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? node_id) : base(r => r.Optional("node_id", node_id)) + public ClusterStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) { } @@ -83,6 +83,10 @@ public sealed partial class ClusterStatsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public ClusterStatsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + public ClusterStatsRequestDescriptor() { } @@ -98,9 +102,9 @@ public ClusterStatsRequestDescriptor() public ClusterStatsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); public ClusterStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); - public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? node_id) + public ClusterStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) { - RouteValues.Optional("node_id", node_id); + RouteValues.Optional("node_id", nodeId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs index fa24ebba2aa..e043c33c200 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -50,6 +51,10 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse /// [JsonInclude, JsonPropertyName("nodes")] public Elastic.Clients.Elasticsearch.Cluster.ClusterNodes Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// [JsonInclude, JsonPropertyName("_nodes")] public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..6144948119a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class DeleteComponentTemplateRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes component templates.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+///
+public sealed partial class DeleteComponentTemplateRequest : PlainRequest +{ + public DeleteComponentTemplateRequest(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_component_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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes component templates.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+///
+public sealed partial class DeleteComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal DeleteComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_component_template"; + + public DeleteComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteComponentTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..dbecd33c1cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class DeleteComponentTemplateResponse : 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/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs new file mode 100644 index 00000000000..bef3fa3ee28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class DeleteVotingConfigExclusionsRequestParameters : RequestParameters +{ + /// + /// Specifies whether to wait for all excluded nodes to be removed from the
cluster before clearing the voting configuration exclusions list.
Defaults to true, meaning that all excluded nodes must be removed from
the cluster before this API takes any action. If set to false then the
voting configuration exclusions list is cleared even if some excluded
nodes are still in the cluster.
+ ///
+ public bool? WaitForRemoval { get => Q("wait_for_removal"); set => Q("wait_for_removal", value); } +} + +/// +/// Clears cluster voting config exclusions. +/// +public sealed partial class DeleteVotingConfigExclusionsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteVotingConfigExclusions; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_voting_config_exclusions"; + + /// + /// Specifies whether to wait for all excluded nodes to be removed from the
cluster before clearing the voting configuration exclusions list.
Defaults to true, meaning that all excluded nodes must be removed from
the cluster before this API takes any action. If set to false then the
voting configuration exclusions list is cleared even if some excluded
nodes are still in the cluster.
+ ///
+ [JsonIgnore] + public bool? WaitForRemoval { get => Q("wait_for_removal"); set => Q("wait_for_removal", value); } +} + +/// +/// Clears cluster voting config exclusions. +/// +public sealed partial class DeleteVotingConfigExclusionsRequestDescriptor : RequestDescriptor +{ + internal DeleteVotingConfigExclusionsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteVotingConfigExclusionsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterDeleteVotingConfigExclusions; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.delete_voting_config_exclusions"; + + public DeleteVotingConfigExclusionsRequestDescriptor WaitForRemoval(bool? waitForRemoval = true) => Qs("wait_for_removal", waitForRemoval); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs new file mode 100644 index 00000000000..1b46c283041 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class DeleteVotingConfigExclusionsResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..c2ab4cca8b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class ExistsComponentTemplateRequestParameters : 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); } + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular component template exist +/// +public sealed partial class ExistsComponentTemplateRequest : PlainRequest +{ + public ExistsComponentTemplateRequest(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterExistsComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.exists_component_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); } + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about whether a particular component template exist +/// +public sealed partial class ExistsComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal ExistsComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExistsComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterExistsComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.exists_component_template"; + + public ExistsComponentTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public ExistsComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public ExistsComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..1fea8228f4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class ExistsComponentTemplateResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs index 85288a8ed06..febb734d698 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..8df0b6a4653 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class GetComponentTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return all default configurations for the component template (default: false) + /// + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves information about component templates. +/// +public sealed partial class GetComponentTemplateRequest : PlainRequest +{ + public GetComponentTemplateRequest() + { + } + + public GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_component_template"; + + /// + /// If `true`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// Return all default configurations for the component template (default: false) + /// + [JsonIgnore] + public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieves information about component templates. +/// +public sealed partial class GetComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal GetComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + + public GetComponentTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterGetComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.get_component_template"; + + public GetComponentTemplateRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetComponentTemplateRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetComponentTemplateRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..629ad116f00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class GetComponentTemplateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("component_templates")] + public IReadOnlyCollection ComponentTemplates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs index 16c17caa725..342cb4a4b33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs @@ -69,7 +69,7 @@ public sealed partial class HealthRequestParameters : RequestParameters /// /// 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); } + public object? 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. @@ -154,7 +154,7 @@ public HealthRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => /// 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); } + public object? 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. @@ -182,6 +182,10 @@ public sealed partial class HealthRequestDescriptor : RequestDescript { internal HealthRequestDescriptor(Action> configure) => configure.Invoke(this); + public HealthRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public HealthRequestDescriptor() { } @@ -201,7 +205,7 @@ public HealthRequestDescriptor() public HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); public HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); public HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.WaitForEvents? waitForEvents) => Qs("wait_for_events", waitForEvents); - public HealthRequestDescriptor WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForNodes(object? waitForNodes) => Qs("wait_for_nodes", waitForNodes); 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 WaitForStatus(Elastic.Clients.Elasticsearch.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); @@ -224,6 +228,10 @@ public sealed partial class HealthRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public HealthRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public HealthRequestDescriptor() { } @@ -243,7 +251,7 @@ public HealthRequestDescriptor() public HealthRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); public HealthRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); public HealthRequestDescriptor WaitForEvents(Elastic.Clients.Elasticsearch.WaitForEvents? waitForEvents) => Qs("wait_for_events", waitForEvents); - public HealthRequestDescriptor WaitForNodes(Union? waitForNodes) => Qs("wait_for_nodes", waitForNodes); + public HealthRequestDescriptor WaitForNodes(object? waitForNodes) => Qs("wait_for_nodes", waitForNodes); 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 WaitForStatus(Elastic.Clients.Elasticsearch.HealthStatus? waitForStatus) => Qs("wait_for_status", waitForStatus); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs index 303e5738c66..237fe05a1eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs index 6dc438ee074..024b4bad879 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs new file mode 100644 index 00000000000..2b3c4865356 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class PostVotingConfigExclusionsRequestParameters : RequestParameters +{ + /// + /// A comma-separated list of the persistent ids of the nodes to exclude
from the voting configuration. If specified, you may not also specify node_names.
+ ///
+ public Elastic.Clients.Elasticsearch.Ids? NodeIds { get => Q("node_ids"); set => Q("node_ids", value); } + + /// + /// A comma-separated list of the names of the nodes to exclude from the
voting configuration. If specified, you may not also specify node_ids.
+ ///
+ public Elastic.Clients.Elasticsearch.Names? NodeNames { get => Q("node_names"); set => Q("node_names", value); } + + /// + /// When adding a voting configuration exclusion, the API waits for the
specified nodes to be excluded from the voting configuration before
returning. If the timeout expires before the appropriate condition
is satisfied, the request fails and returns an error.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Updates the cluster voting config exclusions by node ids or node names. +/// +public sealed partial class PostVotingConfigExclusionsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPostVotingConfigExclusions; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.post_voting_config_exclusions"; + + /// + /// A comma-separated list of the persistent ids of the nodes to exclude
from the voting configuration. If specified, you may not also specify node_names.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Ids? NodeIds { get => Q("node_ids"); set => Q("node_ids", value); } + + /// + /// A comma-separated list of the names of the nodes to exclude from the
voting configuration. If specified, you may not also specify node_ids.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Names? NodeNames { get => Q("node_names"); set => Q("node_names", value); } + + /// + /// When adding a voting configuration exclusion, the API waits for the
specified nodes to be excluded from the voting configuration before
returning. If the timeout expires before the appropriate condition
is satisfied, the request fails and returns an error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Updates the cluster voting config exclusions by node ids or node names. +/// +public sealed partial class PostVotingConfigExclusionsRequestDescriptor : RequestDescriptor +{ + internal PostVotingConfigExclusionsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostVotingConfigExclusionsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPostVotingConfigExclusions; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "cluster.post_voting_config_exclusions"; + + public PostVotingConfigExclusionsRequestDescriptor NodeIds(Elastic.Clients.Elasticsearch.Ids? nodeIds) => Qs("node_ids", nodeIds); + public PostVotingConfigExclusionsRequestDescriptor NodeNames(Elastic.Clients.Elasticsearch.Names? nodeNames) => Qs("node_names", nodeNames); + public PostVotingConfigExclusionsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs new file mode 100644 index 00000000000..8f416a03098 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class PostVotingConfigExclusionsResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs new file mode 100644 index 00000000000..dc982538524 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs @@ -0,0 +1,369 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Cluster; + +public sealed partial class PutComponentTemplateRequestParameters : RequestParameters +{ + /// + /// If `true`, this request cannot replace or update existing component templates. + /// + 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequest : PlainRequest +{ + public PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + /// + /// If `true`, this request cannot replace or update existing component templates. + /// + [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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", 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 data streams matching the template must always be explicitly created.
+ ///
+ [JsonInclude, JsonPropertyName("allow_auto_create")] + public bool? AllowAutoCreate { get; set; } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexState Template { get; set; } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ [JsonInclude, JsonPropertyName("version")] + public long? Version { get; set; } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequestDescriptor : RequestDescriptor, PutComponentTemplateRequestParameters> +{ + internal PutComponentTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + public PutComponentTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public PutComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public PutComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private bool? AllowAutoCreateValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexState TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + /// + /// 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 data streams matching the template must always be explicitly created.
+ ///
+ public PutComponentTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ public PutComponentTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexState template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ public PutComponentTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor(TemplateDescriptorAction), options); + } + else + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates a component template.
Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
+/// An index template can be composed of multiple component templates.
To use a component template, specify it in an index template’s `composed_of` list.
Component templates are only applied to new data streams and indices as part of a matching index template.
+/// Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. +/// Component templates are only used during index creation.
For data streams, this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s backing indices.
+/// You can use C-style `/* *\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening curly bracket.
+///
+public sealed partial class PutComponentTemplateRequestDescriptor : RequestDescriptor +{ + internal PutComponentTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutComponentTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPutComponentTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_component_template"; + + public PutComponentTemplateRequestDescriptor Create(bool? create = true) => Qs("create", create); + public PutComponentTemplateRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public PutComponentTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private bool? AllowAutoCreateValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexState TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + /// + /// 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 data streams matching the template must always be explicitly created.
+ ///
+ public PutComponentTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCreate = true) + { + AllowAutoCreateValue = allowAutoCreate; + return Self; + } + + /// + /// Optional user metadata about the component template.
May have any contents. This map is not automatically generated by Elasticsearch.
This information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
+ ///
+ public PutComponentTemplateRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The template to be applied which includes mappings, settings, or aliases configuration. + /// + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexState template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public PutComponentTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
To unset a version, replace the template without specifying a version.
+ ///
+ public PutComponentTemplateRequestDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexStateDescriptor(TemplateDescriptorAction), options); + } + else + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs new file mode 100644 index 00000000000..d0754ce3a58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class PutComponentTemplateResponse : 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/_Generated/Api/CountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs index a5ea385390c..310e99a5814 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs @@ -221,11 +221,11 @@ public sealed partial class CountRequestDescriptor : RequestDescripto { internal CountRequestDescriptor(Action> configure) => configure.Invoke(this); - public CountRequestDescriptor() : this(typeof(TDocument)) + public CountRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) { } - public CountRequestDescriptor(Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public CountRequestDescriptor() { } @@ -259,8 +259,8 @@ public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.I } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -273,7 +273,7 @@ public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.Que return Self; } - public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -281,7 +281,7 @@ public CountRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public CountRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -300,7 +300,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -319,7 +319,7 @@ public sealed partial class CountRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public CountRequestDescriptor(Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public CountRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) { } @@ -357,8 +357,8 @@ public CountRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? ind } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -371,7 +371,7 @@ public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query return Self; } - public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public CountRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -379,7 +379,7 @@ public CountRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public CountRequestDescriptor Query(Action configure) + public CountRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -398,7 +398,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs index 50f94943241..e225c0dee65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs index 959fc5d92d3..710c8e581cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs @@ -84,9 +84,6 @@ public CreateRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clie internal override string OperationName => "create"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// ID of the pipeline to use to preprocess incoming documents.
If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.
If a final pipeline is configured it will always run, regardless of the value of this parameter.
///
@@ -128,6 +125,8 @@ public CreateRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clie ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + [JsonIgnore] + public TDocument Document { get; set; } } /// @@ -136,21 +135,17 @@ public CreateRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clie public sealed partial class CreateRequestDescriptor : RequestDescriptor, CreateRequestParameters> { internal CreateRequestDescriptor(Action> configure) => configure.Invoke(this); + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("index", index).Required("id", id)) => DocumentValue = document; - internal CreateRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("index", index).Required("id", id)) + public CreateRequestDescriptor(TDocument document) : this(document, typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) { } - public CreateRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.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, Elasticsearch.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) + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(document, index, Elastic.Clients.Elasticsearch.Id.From(document)) { } - internal CreateRequestDescriptor() + public CreateRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id id) : this(document, typeof(TDocument), id) { } @@ -184,6 +179,12 @@ public CreateRequestDescriptor Index(Elastic.Clients.Elasticsearch.In private TDocument DocumentValue { get; set; } + public CreateRequestDescriptor Document(TDocument document) + { + DocumentValue = document; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs index 8b479f3e8ed..46461b542a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs new file mode 100644 index 00000000000..2000c438324 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class CcrStatsRequestParameters : RequestParameters +{ +} + +/// +/// Gets all stats related to cross-cluster replication. +/// +public sealed partial class CcrStatsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.stats"; +} + +/// +/// Gets all stats related to cross-cluster replication. +/// +public sealed partial class CcrStatsRequestDescriptor : RequestDescriptor +{ + internal CcrStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public CcrStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.stats"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs new file mode 100644 index 00000000000..774d051bff4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class CcrStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("auto_follow_stats")] + public Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats AutoFollowStats { get; init; } + [JsonInclude, JsonPropertyName("follow_stats")] + public Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats FollowStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs new file mode 100644 index 00000000000..7c9e0440837 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class DeleteAutoFollowPatternRequestParameters : RequestParameters +{ +} + +/// +/// Deletes auto-follow patterns. +/// +public sealed partial class DeleteAutoFollowPatternRequest : PlainRequest +{ + public DeleteAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationDeleteAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.delete_auto_follow_pattern"; +} + +/// +/// Deletes auto-follow patterns. +/// +public sealed partial class DeleteAutoFollowPatternRequestDescriptor : RequestDescriptor +{ + internal DeleteAutoFollowPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteAutoFollowPatternRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationDeleteAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.delete_auto_follow_pattern"; + + public DeleteAutoFollowPatternRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs new file mode 100644 index 00000000000..a84ce8b8a5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class DeleteAutoFollowPatternResponse : 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/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs new file mode 100644 index 00000000000..ef1f6975623 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class FollowInfoRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves information about all follower indices, including parameters and status for each follower index +/// +public sealed partial class FollowInfoRequest : PlainRequest +{ + public FollowInfoRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_info"; +} + +/// +/// Retrieves information about all follower indices, including parameters and status for each follower index +/// +public sealed partial class FollowInfoRequestDescriptor : RequestDescriptor, FollowInfoRequestParameters> +{ + internal FollowInfoRequestDescriptor(Action> configure) => configure.Invoke(this); + + public FollowInfoRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_info"; + + public FollowInfoRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves information about all follower indices, including parameters and status for each follower index +/// +public sealed partial class FollowInfoRequestDescriptor : RequestDescriptor +{ + internal FollowInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public FollowInfoRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_info"; + + public FollowInfoRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs new file mode 100644 index 00000000000..54fcd7202df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("follower_indices")] + public IReadOnlyCollection FollowerIndices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs new file mode 100644 index 00000000000..b57796abd8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs @@ -0,0 +1,468 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class FollowRequestParameters : RequestParameters +{ + /// + /// Sets the number of shard copies that must be active before returning. Defaults to 0. 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.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Creates a new follower index configured to follow the referenced leader index. +/// +public sealed partial class FollowRequest : PlainRequest +{ + public FollowRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.follow"; + + /// + /// Sets the number of shard copies that must be active before returning. Defaults to 0. 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.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + [JsonInclude, JsonPropertyName("leader_index")] + public Elastic.Clients.Elasticsearch.IndexName? LeaderIndex { get; set; } + [JsonInclude, JsonPropertyName("max_outstanding_read_requests")] + public long? MaxOutstandingReadRequests { get; set; } + [JsonInclude, JsonPropertyName("max_outstanding_write_requests")] + public long? MaxOutstandingWriteRequests { get; set; } + [JsonInclude, JsonPropertyName("max_read_request_operation_count")] + public long? MaxReadRequestOperationCount { get; set; } + [JsonInclude, JsonPropertyName("max_read_request_size")] + public string? MaxReadRequestSize { get; set; } + [JsonInclude, JsonPropertyName("max_retry_delay")] + public Elastic.Clients.Elasticsearch.Duration? MaxRetryDelay { get; set; } + [JsonInclude, JsonPropertyName("max_write_buffer_count")] + public long? MaxWriteBufferCount { get; set; } + [JsonInclude, JsonPropertyName("max_write_buffer_size")] + public string? MaxWriteBufferSize { get; set; } + [JsonInclude, JsonPropertyName("max_write_request_operation_count")] + public long? MaxWriteRequestOperationCount { get; set; } + [JsonInclude, JsonPropertyName("max_write_request_size")] + public string? MaxWriteRequestSize { get; set; } + [JsonInclude, JsonPropertyName("read_poll_timeout")] + public Elastic.Clients.Elasticsearch.Duration? ReadPollTimeout { get; set; } + [JsonInclude, JsonPropertyName("remote_cluster")] + public string? RemoteCluster { get; set; } +} + +/// +/// Creates a new follower index configured to follow the referenced leader index. +/// +public sealed partial class FollowRequestDescriptor : RequestDescriptor, FollowRequestParameters> +{ + internal FollowRequestDescriptor(Action> configure) => configure.Invoke(this); + + public FollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.follow"; + + public FollowRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public FollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexName? LeaderIndexValue { get; set; } + private long? MaxOutstandingReadRequestsValue { get; set; } + private long? MaxOutstandingWriteRequestsValue { get; set; } + private long? MaxReadRequestOperationCountValue { get; set; } + private string? MaxReadRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MaxRetryDelayValue { get; set; } + private long? MaxWriteBufferCountValue { get; set; } + private string? MaxWriteBufferSizeValue { get; set; } + private long? MaxWriteRequestOperationCountValue { get; set; } + private string? MaxWriteRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ReadPollTimeoutValue { get; set; } + private string? RemoteClusterValue { get; set; } + + public FollowRequestDescriptor LeaderIndex(Elastic.Clients.Elasticsearch.IndexName? leaderIndex) + { + LeaderIndexValue = leaderIndex; + return Self; + } + + public FollowRequestDescriptor MaxOutstandingReadRequests(long? maxOutstandingReadRequests) + { + MaxOutstandingReadRequestsValue = maxOutstandingReadRequests; + return Self; + } + + public FollowRequestDescriptor MaxOutstandingWriteRequests(long? maxOutstandingWriteRequests) + { + MaxOutstandingWriteRequestsValue = maxOutstandingWriteRequests; + return Self; + } + + public FollowRequestDescriptor MaxReadRequestOperationCount(long? maxReadRequestOperationCount) + { + MaxReadRequestOperationCountValue = maxReadRequestOperationCount; + return Self; + } + + public FollowRequestDescriptor MaxReadRequestSize(string? maxReadRequestSize) + { + MaxReadRequestSizeValue = maxReadRequestSize; + return Self; + } + + public FollowRequestDescriptor MaxRetryDelay(Elastic.Clients.Elasticsearch.Duration? maxRetryDelay) + { + MaxRetryDelayValue = maxRetryDelay; + return Self; + } + + public FollowRequestDescriptor MaxWriteBufferCount(long? maxWriteBufferCount) + { + MaxWriteBufferCountValue = maxWriteBufferCount; + return Self; + } + + public FollowRequestDescriptor MaxWriteBufferSize(string? maxWriteBufferSize) + { + MaxWriteBufferSizeValue = maxWriteBufferSize; + return Self; + } + + public FollowRequestDescriptor MaxWriteRequestOperationCount(long? maxWriteRequestOperationCount) + { + MaxWriteRequestOperationCountValue = maxWriteRequestOperationCount; + return Self; + } + + public FollowRequestDescriptor MaxWriteRequestSize(string? maxWriteRequestSize) + { + MaxWriteRequestSizeValue = maxWriteRequestSize; + return Self; + } + + public FollowRequestDescriptor ReadPollTimeout(Elastic.Clients.Elasticsearch.Duration? readPollTimeout) + { + ReadPollTimeoutValue = readPollTimeout; + return Self; + } + + public FollowRequestDescriptor RemoteCluster(string? remoteCluster) + { + RemoteClusterValue = remoteCluster; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LeaderIndexValue is not null) + { + writer.WritePropertyName("leader_index"); + JsonSerializer.Serialize(writer, LeaderIndexValue, options); + } + + if (MaxOutstandingReadRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_read_requests"); + writer.WriteNumberValue(MaxOutstandingReadRequestsValue.Value); + } + + if (MaxOutstandingWriteRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_write_requests"); + writer.WriteNumberValue(MaxOutstandingWriteRequestsValue.Value); + } + + if (MaxReadRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_read_request_operation_count"); + writer.WriteNumberValue(MaxReadRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxReadRequestSizeValue)) + { + writer.WritePropertyName("max_read_request_size"); + writer.WriteStringValue(MaxReadRequestSizeValue); + } + + if (MaxRetryDelayValue is not null) + { + writer.WritePropertyName("max_retry_delay"); + JsonSerializer.Serialize(writer, MaxRetryDelayValue, options); + } + + if (MaxWriteBufferCountValue.HasValue) + { + writer.WritePropertyName("max_write_buffer_count"); + writer.WriteNumberValue(MaxWriteBufferCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteBufferSizeValue)) + { + writer.WritePropertyName("max_write_buffer_size"); + writer.WriteStringValue(MaxWriteBufferSizeValue); + } + + if (MaxWriteRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_write_request_operation_count"); + writer.WriteNumberValue(MaxWriteRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteRequestSizeValue)) + { + writer.WritePropertyName("max_write_request_size"); + writer.WriteStringValue(MaxWriteRequestSizeValue); + } + + if (ReadPollTimeoutValue is not null) + { + writer.WritePropertyName("read_poll_timeout"); + JsonSerializer.Serialize(writer, ReadPollTimeoutValue, options); + } + + if (!string.IsNullOrEmpty(RemoteClusterValue)) + { + writer.WritePropertyName("remote_cluster"); + writer.WriteStringValue(RemoteClusterValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates a new follower index configured to follow the referenced leader index. +/// +public sealed partial class FollowRequestDescriptor : RequestDescriptor +{ + internal FollowRequestDescriptor(Action configure) => configure.Invoke(this); + + public FollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.follow"; + + public FollowRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public FollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexName? LeaderIndexValue { get; set; } + private long? MaxOutstandingReadRequestsValue { get; set; } + private long? MaxOutstandingWriteRequestsValue { get; set; } + private long? MaxReadRequestOperationCountValue { get; set; } + private string? MaxReadRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MaxRetryDelayValue { get; set; } + private long? MaxWriteBufferCountValue { get; set; } + private string? MaxWriteBufferSizeValue { get; set; } + private long? MaxWriteRequestOperationCountValue { get; set; } + private string? MaxWriteRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ReadPollTimeoutValue { get; set; } + private string? RemoteClusterValue { get; set; } + + public FollowRequestDescriptor LeaderIndex(Elastic.Clients.Elasticsearch.IndexName? leaderIndex) + { + LeaderIndexValue = leaderIndex; + return Self; + } + + public FollowRequestDescriptor MaxOutstandingReadRequests(long? maxOutstandingReadRequests) + { + MaxOutstandingReadRequestsValue = maxOutstandingReadRequests; + return Self; + } + + public FollowRequestDescriptor MaxOutstandingWriteRequests(long? maxOutstandingWriteRequests) + { + MaxOutstandingWriteRequestsValue = maxOutstandingWriteRequests; + return Self; + } + + public FollowRequestDescriptor MaxReadRequestOperationCount(long? maxReadRequestOperationCount) + { + MaxReadRequestOperationCountValue = maxReadRequestOperationCount; + return Self; + } + + public FollowRequestDescriptor MaxReadRequestSize(string? maxReadRequestSize) + { + MaxReadRequestSizeValue = maxReadRequestSize; + return Self; + } + + public FollowRequestDescriptor MaxRetryDelay(Elastic.Clients.Elasticsearch.Duration? maxRetryDelay) + { + MaxRetryDelayValue = maxRetryDelay; + return Self; + } + + public FollowRequestDescriptor MaxWriteBufferCount(long? maxWriteBufferCount) + { + MaxWriteBufferCountValue = maxWriteBufferCount; + return Self; + } + + public FollowRequestDescriptor MaxWriteBufferSize(string? maxWriteBufferSize) + { + MaxWriteBufferSizeValue = maxWriteBufferSize; + return Self; + } + + public FollowRequestDescriptor MaxWriteRequestOperationCount(long? maxWriteRequestOperationCount) + { + MaxWriteRequestOperationCountValue = maxWriteRequestOperationCount; + return Self; + } + + public FollowRequestDescriptor MaxWriteRequestSize(string? maxWriteRequestSize) + { + MaxWriteRequestSizeValue = maxWriteRequestSize; + return Self; + } + + public FollowRequestDescriptor ReadPollTimeout(Elastic.Clients.Elasticsearch.Duration? readPollTimeout) + { + ReadPollTimeoutValue = readPollTimeout; + return Self; + } + + public FollowRequestDescriptor RemoteCluster(string? remoteCluster) + { + RemoteClusterValue = remoteCluster; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LeaderIndexValue is not null) + { + writer.WritePropertyName("leader_index"); + JsonSerializer.Serialize(writer, LeaderIndexValue, options); + } + + if (MaxOutstandingReadRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_read_requests"); + writer.WriteNumberValue(MaxOutstandingReadRequestsValue.Value); + } + + if (MaxOutstandingWriteRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_write_requests"); + writer.WriteNumberValue(MaxOutstandingWriteRequestsValue.Value); + } + + if (MaxReadRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_read_request_operation_count"); + writer.WriteNumberValue(MaxReadRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxReadRequestSizeValue)) + { + writer.WritePropertyName("max_read_request_size"); + writer.WriteStringValue(MaxReadRequestSizeValue); + } + + if (MaxRetryDelayValue is not null) + { + writer.WritePropertyName("max_retry_delay"); + JsonSerializer.Serialize(writer, MaxRetryDelayValue, options); + } + + if (MaxWriteBufferCountValue.HasValue) + { + writer.WritePropertyName("max_write_buffer_count"); + writer.WriteNumberValue(MaxWriteBufferCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteBufferSizeValue)) + { + writer.WritePropertyName("max_write_buffer_size"); + writer.WriteStringValue(MaxWriteBufferSizeValue); + } + + if (MaxWriteRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_write_request_operation_count"); + writer.WriteNumberValue(MaxWriteRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteRequestSizeValue)) + { + writer.WritePropertyName("max_write_request_size"); + writer.WriteStringValue(MaxWriteRequestSizeValue); + } + + if (ReadPollTimeoutValue is not null) + { + writer.WritePropertyName("read_poll_timeout"); + JsonSerializer.Serialize(writer, ReadPollTimeoutValue, options); + } + + if (!string.IsNullOrEmpty(RemoteClusterValue)) + { + writer.WritePropertyName("remote_cluster"); + writer.WriteStringValue(RemoteClusterValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs new file mode 100644 index 00000000000..c30f351af3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("follow_index_created")] + public bool FollowIndexCreated { get; init; } + [JsonInclude, JsonPropertyName("follow_index_shards_acked")] + public bool FollowIndexShardsAcked { get; init; } + [JsonInclude, JsonPropertyName("index_following_started")] + public bool IndexFollowingStarted { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs new file mode 100644 index 00000000000..9baff3f3028 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class FollowStatsRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. +/// +public sealed partial class FollowStatsRequest : PlainRequest +{ + public FollowStatsRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_stats"; +} + +/// +/// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. +/// +public sealed partial class FollowStatsRequestDescriptor : RequestDescriptor, FollowStatsRequestParameters> +{ + internal FollowStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public FollowStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_stats"; + + public FollowStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. +/// +public sealed partial class FollowStatsRequestDescriptor : RequestDescriptor +{ + internal FollowStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public FollowStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationFollowStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.follow_stats"; + + public FollowStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs new file mode 100644 index 00000000000..46fc142371f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs new file mode 100644 index 00000000000..af934946897 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs @@ -0,0 +1,231 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class ForgetFollowerRequestParameters : RequestParameters +{ +} + +/// +/// Removes the follower retention leases from the leader. +/// +public sealed partial class ForgetFollowerRequest : PlainRequest +{ + public ForgetFollowerRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationForgetFollower; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.forget_follower"; + + [JsonInclude, JsonPropertyName("follower_cluster")] + public string? FollowerCluster { get; set; } + [JsonInclude, JsonPropertyName("follower_index")] + public Elastic.Clients.Elasticsearch.IndexName? FollowerIndex { get; set; } + [JsonInclude, JsonPropertyName("follower_index_uuid")] + public string? FollowerIndexUuid { get; set; } + [JsonInclude, JsonPropertyName("leader_remote_cluster")] + public string? LeaderRemoteCluster { get; set; } +} + +/// +/// Removes the follower retention leases from the leader. +/// +public sealed partial class ForgetFollowerRequestDescriptor : RequestDescriptor, ForgetFollowerRequestParameters> +{ + internal ForgetFollowerRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ForgetFollowerRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationForgetFollower; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.forget_follower"; + + public ForgetFollowerRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private string? FollowerClusterValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? FollowerIndexValue { get; set; } + private string? FollowerIndexUuidValue { get; set; } + private string? LeaderRemoteClusterValue { get; set; } + + public ForgetFollowerRequestDescriptor FollowerCluster(string? followerCluster) + { + FollowerClusterValue = followerCluster; + return Self; + } + + public ForgetFollowerRequestDescriptor FollowerIndex(Elastic.Clients.Elasticsearch.IndexName? followerIndex) + { + FollowerIndexValue = followerIndex; + return Self; + } + + public ForgetFollowerRequestDescriptor FollowerIndexUuid(string? followerIndexUuid) + { + FollowerIndexUuidValue = followerIndexUuid; + return Self; + } + + public ForgetFollowerRequestDescriptor LeaderRemoteCluster(string? leaderRemoteCluster) + { + LeaderRemoteClusterValue = leaderRemoteCluster; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FollowerClusterValue)) + { + writer.WritePropertyName("follower_cluster"); + writer.WriteStringValue(FollowerClusterValue); + } + + if (FollowerIndexValue is not null) + { + writer.WritePropertyName("follower_index"); + JsonSerializer.Serialize(writer, FollowerIndexValue, options); + } + + if (!string.IsNullOrEmpty(FollowerIndexUuidValue)) + { + writer.WritePropertyName("follower_index_uuid"); + writer.WriteStringValue(FollowerIndexUuidValue); + } + + if (!string.IsNullOrEmpty(LeaderRemoteClusterValue)) + { + writer.WritePropertyName("leader_remote_cluster"); + writer.WriteStringValue(LeaderRemoteClusterValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Removes the follower retention leases from the leader. +/// +public sealed partial class ForgetFollowerRequestDescriptor : RequestDescriptor +{ + internal ForgetFollowerRequestDescriptor(Action configure) => configure.Invoke(this); + + public ForgetFollowerRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationForgetFollower; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.forget_follower"; + + public ForgetFollowerRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private string? FollowerClusterValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? FollowerIndexValue { get; set; } + private string? FollowerIndexUuidValue { get; set; } + private string? LeaderRemoteClusterValue { get; set; } + + public ForgetFollowerRequestDescriptor FollowerCluster(string? followerCluster) + { + FollowerClusterValue = followerCluster; + return Self; + } + + public ForgetFollowerRequestDescriptor FollowerIndex(Elastic.Clients.Elasticsearch.IndexName? followerIndex) + { + FollowerIndexValue = followerIndex; + return Self; + } + + public ForgetFollowerRequestDescriptor FollowerIndexUuid(string? followerIndexUuid) + { + FollowerIndexUuidValue = followerIndexUuid; + return Self; + } + + public ForgetFollowerRequestDescriptor LeaderRemoteCluster(string? leaderRemoteCluster) + { + LeaderRemoteClusterValue = leaderRemoteCluster; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FollowerClusterValue)) + { + writer.WritePropertyName("follower_cluster"); + writer.WriteStringValue(FollowerClusterValue); + } + + if (FollowerIndexValue is not null) + { + writer.WritePropertyName("follower_index"); + JsonSerializer.Serialize(writer, FollowerIndexValue, options); + } + + if (!string.IsNullOrEmpty(FollowerIndexUuidValue)) + { + writer.WritePropertyName("follower_index_uuid"); + writer.WriteStringValue(FollowerIndexUuidValue); + } + + if (!string.IsNullOrEmpty(LeaderRemoteClusterValue)) + { + writer.WritePropertyName("leader_remote_cluster"); + writer.WriteStringValue(LeaderRemoteClusterValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs new file mode 100644 index 00000000000..cb86186b4b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class ForgetFollowerResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs new file mode 100644 index 00000000000..0060d2e3a9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class GetAutoFollowPatternRequestParameters : RequestParameters +{ +} + +/// +/// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. +/// +public sealed partial class GetAutoFollowPatternRequest : PlainRequest +{ + public GetAutoFollowPatternRequest() + { + } + + public GetAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationGetAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.get_auto_follow_pattern"; +} + +/// +/// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. +/// +public sealed partial class GetAutoFollowPatternRequestDescriptor : RequestDescriptor +{ + internal GetAutoFollowPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetAutoFollowPatternRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + + public GetAutoFollowPatternRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationGetAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.get_auto_follow_pattern"; + + public GetAutoFollowPatternRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs new file mode 100644 index 00000000000..7e0562b9122 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class GetAutoFollowPatternResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("patterns")] + public IReadOnlyCollection Patterns { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs new file mode 100644 index 00000000000..458d88d6e59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class PauseAutoFollowPatternRequestParameters : RequestParameters +{ +} + +/// +/// Pauses an auto-follow pattern +/// +public sealed partial class PauseAutoFollowPatternRequest : PlainRequest +{ + public PauseAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.pause_auto_follow_pattern"; +} + +/// +/// Pauses an auto-follow pattern +/// +public sealed partial class PauseAutoFollowPatternRequestDescriptor : RequestDescriptor +{ + internal PauseAutoFollowPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public PauseAutoFollowPatternRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.pause_auto_follow_pattern"; + + public PauseAutoFollowPatternRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs new file mode 100644 index 00000000000..0f7826b0fc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class PauseAutoFollowPatternResponse : 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/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs new file mode 100644 index 00000000000..216fb5e843c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class PauseFollowRequestParameters : RequestParameters +{ +} + +/// +/// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. +/// +public sealed partial class PauseFollowRequest : PlainRequest +{ + public PauseFollowRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.pause_follow"; +} + +/// +/// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. +/// +public sealed partial class PauseFollowRequestDescriptor : RequestDescriptor, PauseFollowRequestParameters> +{ + internal PauseFollowRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PauseFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.pause_follow"; + + public PauseFollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. +/// +public sealed partial class PauseFollowRequestDescriptor : RequestDescriptor +{ + internal PauseFollowRequestDescriptor(Action configure) => configure.Invoke(this); + + public PauseFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPauseFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.pause_follow"; + + public PauseFollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs new file mode 100644 index 00000000000..7827171c11e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class PauseFollowResponse : 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/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs new file mode 100644 index 00000000000..68f5f0d1910 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class PutAutoFollowPatternRequestParameters : RequestParameters +{ +} + +/// +/// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. +/// +public sealed partial class PutAutoFollowPatternRequest : PlainRequest +{ + public PutAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPutAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.put_auto_follow_pattern"; + + /// + /// The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices. + /// + [JsonInclude, JsonPropertyName("follow_index_pattern")] + public string? FollowIndexPattern { get; set; } + + /// + /// An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed. + /// + [JsonInclude, JsonPropertyName("leader_index_exclusion_patterns")] + public ICollection? LeaderIndexExclusionPatterns { get; set; } + + /// + /// An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. + /// + [JsonInclude, JsonPropertyName("leader_index_patterns")] + public ICollection? LeaderIndexPatterns { get; set; } + + /// + /// The maximum number of outstanding reads requests from the remote cluster. + /// + [JsonInclude, JsonPropertyName("max_outstanding_read_requests")] + public int? MaxOutstandingReadRequests { get; set; } + + /// + /// The maximum number of outstanding reads requests from the remote cluster. + /// + [JsonInclude, JsonPropertyName("max_outstanding_write_requests")] + public int? MaxOutstandingWriteRequests { get; set; } + + /// + /// The maximum number of operations to pull per read from the remote cluster. + /// + [JsonInclude, JsonPropertyName("max_read_request_operation_count")] + public int? MaxReadRequestOperationCount { get; set; } + + /// + /// The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. + /// + [JsonInclude, JsonPropertyName("max_read_request_size")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxReadRequestSize { get; set; } + + /// + /// The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying. + /// + [JsonInclude, JsonPropertyName("max_retry_delay")] + public Elastic.Clients.Elasticsearch.Duration? MaxRetryDelay { get; set; } + + /// + /// The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit. + /// + [JsonInclude, JsonPropertyName("max_write_buffer_count")] + public int? MaxWriteBufferCount { get; set; } + + /// + /// The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit. + /// + [JsonInclude, JsonPropertyName("max_write_buffer_size")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxWriteBufferSize { get; set; } + + /// + /// The maximum number of operations per bulk write request executed on the follower. + /// + [JsonInclude, JsonPropertyName("max_write_request_operation_count")] + public int? MaxWriteRequestOperationCount { get; set; } + + /// + /// The maximum total bytes of operations per bulk write request executed on the follower. + /// + [JsonInclude, JsonPropertyName("max_write_request_size")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxWriteRequestSize { get; set; } + + /// + /// The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again. + /// + [JsonInclude, JsonPropertyName("read_poll_timeout")] + public Elastic.Clients.Elasticsearch.Duration? ReadPollTimeout { get; set; } + + /// + /// The remote cluster containing the leader indices to match against. + /// + [JsonInclude, JsonPropertyName("remote_cluster")] + public string RemoteCluster { get; set; } + + /// + /// Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards). + /// + [JsonInclude, JsonPropertyName("settings")] + public IDictionary? Settings { get; set; } +} + +/// +/// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. +/// +public sealed partial class PutAutoFollowPatternRequestDescriptor : RequestDescriptor +{ + internal PutAutoFollowPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutAutoFollowPatternRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationPutAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.put_auto_follow_pattern"; + + public PutAutoFollowPatternRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private string? FollowIndexPatternValue { get; set; } + private ICollection? LeaderIndexExclusionPatternsValue { get; set; } + private ICollection? LeaderIndexPatternsValue { get; set; } + private int? MaxOutstandingReadRequestsValue { get; set; } + private int? MaxOutstandingWriteRequestsValue { get; set; } + private int? MaxReadRequestOperationCountValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxReadRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MaxRetryDelayValue { get; set; } + private int? MaxWriteBufferCountValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxWriteBufferSizeValue { get; set; } + private int? MaxWriteRequestOperationCountValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxWriteRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ReadPollTimeoutValue { get; set; } + private string RemoteClusterValue { get; set; } + private IDictionary? SettingsValue { get; set; } + + /// + /// The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices. + /// + public PutAutoFollowPatternRequestDescriptor FollowIndexPattern(string? followIndexPattern) + { + FollowIndexPatternValue = followIndexPattern; + return Self; + } + + /// + /// An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed. + /// + public PutAutoFollowPatternRequestDescriptor LeaderIndexExclusionPatterns(ICollection? leaderIndexExclusionPatterns) + { + LeaderIndexExclusionPatternsValue = leaderIndexExclusionPatterns; + return Self; + } + + /// + /// An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. + /// + public PutAutoFollowPatternRequestDescriptor LeaderIndexPatterns(ICollection? leaderIndexPatterns) + { + LeaderIndexPatternsValue = leaderIndexPatterns; + return Self; + } + + /// + /// The maximum number of outstanding reads requests from the remote cluster. + /// + public PutAutoFollowPatternRequestDescriptor MaxOutstandingReadRequests(int? maxOutstandingReadRequests) + { + MaxOutstandingReadRequestsValue = maxOutstandingReadRequests; + return Self; + } + + /// + /// The maximum number of outstanding reads requests from the remote cluster. + /// + public PutAutoFollowPatternRequestDescriptor MaxOutstandingWriteRequests(int? maxOutstandingWriteRequests) + { + MaxOutstandingWriteRequestsValue = maxOutstandingWriteRequests; + return Self; + } + + /// + /// The maximum number of operations to pull per read from the remote cluster. + /// + public PutAutoFollowPatternRequestDescriptor MaxReadRequestOperationCount(int? maxReadRequestOperationCount) + { + MaxReadRequestOperationCountValue = maxReadRequestOperationCount; + return Self; + } + + /// + /// The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. + /// + public PutAutoFollowPatternRequestDescriptor MaxReadRequestSize(Elastic.Clients.Elasticsearch.ByteSize? maxReadRequestSize) + { + MaxReadRequestSizeValue = maxReadRequestSize; + return Self; + } + + /// + /// The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying. + /// + public PutAutoFollowPatternRequestDescriptor MaxRetryDelay(Elastic.Clients.Elasticsearch.Duration? maxRetryDelay) + { + MaxRetryDelayValue = maxRetryDelay; + return Self; + } + + /// + /// The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit. + /// + public PutAutoFollowPatternRequestDescriptor MaxWriteBufferCount(int? maxWriteBufferCount) + { + MaxWriteBufferCountValue = maxWriteBufferCount; + return Self; + } + + /// + /// The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit. + /// + public PutAutoFollowPatternRequestDescriptor MaxWriteBufferSize(Elastic.Clients.Elasticsearch.ByteSize? maxWriteBufferSize) + { + MaxWriteBufferSizeValue = maxWriteBufferSize; + return Self; + } + + /// + /// The maximum number of operations per bulk write request executed on the follower. + /// + public PutAutoFollowPatternRequestDescriptor MaxWriteRequestOperationCount(int? maxWriteRequestOperationCount) + { + MaxWriteRequestOperationCountValue = maxWriteRequestOperationCount; + return Self; + } + + /// + /// The maximum total bytes of operations per bulk write request executed on the follower. + /// + public PutAutoFollowPatternRequestDescriptor MaxWriteRequestSize(Elastic.Clients.Elasticsearch.ByteSize? maxWriteRequestSize) + { + MaxWriteRequestSizeValue = maxWriteRequestSize; + return Self; + } + + /// + /// The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again. + /// + public PutAutoFollowPatternRequestDescriptor ReadPollTimeout(Elastic.Clients.Elasticsearch.Duration? readPollTimeout) + { + ReadPollTimeoutValue = readPollTimeout; + return Self; + } + + /// + /// The remote cluster containing the leader indices to match against. + /// + public PutAutoFollowPatternRequestDescriptor RemoteCluster(string remoteCluster) + { + RemoteClusterValue = remoteCluster; + return Self; + } + + /// + /// Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards). + /// + public PutAutoFollowPatternRequestDescriptor Settings(Func, FluentDictionary> selector) + { + SettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FollowIndexPatternValue)) + { + writer.WritePropertyName("follow_index_pattern"); + writer.WriteStringValue(FollowIndexPatternValue); + } + + if (LeaderIndexExclusionPatternsValue is not null) + { + writer.WritePropertyName("leader_index_exclusion_patterns"); + JsonSerializer.Serialize(writer, LeaderIndexExclusionPatternsValue, options); + } + + if (LeaderIndexPatternsValue is not null) + { + writer.WritePropertyName("leader_index_patterns"); + JsonSerializer.Serialize(writer, LeaderIndexPatternsValue, options); + } + + if (MaxOutstandingReadRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_read_requests"); + writer.WriteNumberValue(MaxOutstandingReadRequestsValue.Value); + } + + if (MaxOutstandingWriteRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_write_requests"); + writer.WriteNumberValue(MaxOutstandingWriteRequestsValue.Value); + } + + if (MaxReadRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_read_request_operation_count"); + writer.WriteNumberValue(MaxReadRequestOperationCountValue.Value); + } + + if (MaxReadRequestSizeValue is not null) + { + writer.WritePropertyName("max_read_request_size"); + JsonSerializer.Serialize(writer, MaxReadRequestSizeValue, options); + } + + if (MaxRetryDelayValue is not null) + { + writer.WritePropertyName("max_retry_delay"); + JsonSerializer.Serialize(writer, MaxRetryDelayValue, options); + } + + if (MaxWriteBufferCountValue.HasValue) + { + writer.WritePropertyName("max_write_buffer_count"); + writer.WriteNumberValue(MaxWriteBufferCountValue.Value); + } + + if (MaxWriteBufferSizeValue is not null) + { + writer.WritePropertyName("max_write_buffer_size"); + JsonSerializer.Serialize(writer, MaxWriteBufferSizeValue, options); + } + + if (MaxWriteRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_write_request_operation_count"); + writer.WriteNumberValue(MaxWriteRequestOperationCountValue.Value); + } + + if (MaxWriteRequestSizeValue is not null) + { + writer.WritePropertyName("max_write_request_size"); + JsonSerializer.Serialize(writer, MaxWriteRequestSizeValue, options); + } + + if (ReadPollTimeoutValue is not null) + { + writer.WritePropertyName("read_poll_timeout"); + JsonSerializer.Serialize(writer, ReadPollTimeoutValue, options); + } + + writer.WritePropertyName("remote_cluster"); + writer.WriteStringValue(RemoteClusterValue); + 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/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs new file mode 100644 index 00000000000..7c3a0564b7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class PutAutoFollowPatternResponse : 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/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs new file mode 100644 index 00000000000..c8a2a4c2675 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class ResumeAutoFollowPatternRequestParameters : RequestParameters +{ +} + +/// +/// Resumes an auto-follow pattern that has been paused +/// +public sealed partial class ResumeAutoFollowPatternRequest : PlainRequest +{ + public ResumeAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.resume_auto_follow_pattern"; +} + +/// +/// Resumes an auto-follow pattern that has been paused +/// +public sealed partial class ResumeAutoFollowPatternRequestDescriptor : RequestDescriptor +{ + internal ResumeAutoFollowPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResumeAutoFollowPatternRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeAutoFollowPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.resume_auto_follow_pattern"; + + public ResumeAutoFollowPatternRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs new file mode 100644 index 00000000000..64ca6e64f4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class ResumeAutoFollowPatternResponse : 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/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs new file mode 100644 index 00000000000..1ebeedbf17d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs @@ -0,0 +1,399 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class ResumeFollowRequestParameters : RequestParameters +{ +} + +/// +/// Resumes a follower index that has been paused +/// +public sealed partial class ResumeFollowRequest : PlainRequest +{ + public ResumeFollowRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.resume_follow"; + + [JsonInclude, JsonPropertyName("max_outstanding_read_requests")] + public long? MaxOutstandingReadRequests { get; set; } + [JsonInclude, JsonPropertyName("max_outstanding_write_requests")] + public long? MaxOutstandingWriteRequests { get; set; } + [JsonInclude, JsonPropertyName("max_read_request_operation_count")] + public long? MaxReadRequestOperationCount { get; set; } + [JsonInclude, JsonPropertyName("max_read_request_size")] + public string? MaxReadRequestSize { get; set; } + [JsonInclude, JsonPropertyName("max_retry_delay")] + public Elastic.Clients.Elasticsearch.Duration? MaxRetryDelay { get; set; } + [JsonInclude, JsonPropertyName("max_write_buffer_count")] + public long? MaxWriteBufferCount { get; set; } + [JsonInclude, JsonPropertyName("max_write_buffer_size")] + public string? MaxWriteBufferSize { get; set; } + [JsonInclude, JsonPropertyName("max_write_request_operation_count")] + public long? MaxWriteRequestOperationCount { get; set; } + [JsonInclude, JsonPropertyName("max_write_request_size")] + public string? MaxWriteRequestSize { get; set; } + [JsonInclude, JsonPropertyName("read_poll_timeout")] + public Elastic.Clients.Elasticsearch.Duration? ReadPollTimeout { get; set; } +} + +/// +/// Resumes a follower index that has been paused +/// +public sealed partial class ResumeFollowRequestDescriptor : RequestDescriptor, ResumeFollowRequestParameters> +{ + internal ResumeFollowRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ResumeFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.resume_follow"; + + public ResumeFollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private long? MaxOutstandingReadRequestsValue { get; set; } + private long? MaxOutstandingWriteRequestsValue { get; set; } + private long? MaxReadRequestOperationCountValue { get; set; } + private string? MaxReadRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MaxRetryDelayValue { get; set; } + private long? MaxWriteBufferCountValue { get; set; } + private string? MaxWriteBufferSizeValue { get; set; } + private long? MaxWriteRequestOperationCountValue { get; set; } + private string? MaxWriteRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ReadPollTimeoutValue { get; set; } + + public ResumeFollowRequestDescriptor MaxOutstandingReadRequests(long? maxOutstandingReadRequests) + { + MaxOutstandingReadRequestsValue = maxOutstandingReadRequests; + return Self; + } + + public ResumeFollowRequestDescriptor MaxOutstandingWriteRequests(long? maxOutstandingWriteRequests) + { + MaxOutstandingWriteRequestsValue = maxOutstandingWriteRequests; + return Self; + } + + public ResumeFollowRequestDescriptor MaxReadRequestOperationCount(long? maxReadRequestOperationCount) + { + MaxReadRequestOperationCountValue = maxReadRequestOperationCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxReadRequestSize(string? maxReadRequestSize) + { + MaxReadRequestSizeValue = maxReadRequestSize; + return Self; + } + + public ResumeFollowRequestDescriptor MaxRetryDelay(Elastic.Clients.Elasticsearch.Duration? maxRetryDelay) + { + MaxRetryDelayValue = maxRetryDelay; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteBufferCount(long? maxWriteBufferCount) + { + MaxWriteBufferCountValue = maxWriteBufferCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteBufferSize(string? maxWriteBufferSize) + { + MaxWriteBufferSizeValue = maxWriteBufferSize; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteRequestOperationCount(long? maxWriteRequestOperationCount) + { + MaxWriteRequestOperationCountValue = maxWriteRequestOperationCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteRequestSize(string? maxWriteRequestSize) + { + MaxWriteRequestSizeValue = maxWriteRequestSize; + return Self; + } + + public ResumeFollowRequestDescriptor ReadPollTimeout(Elastic.Clients.Elasticsearch.Duration? readPollTimeout) + { + ReadPollTimeoutValue = readPollTimeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxOutstandingReadRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_read_requests"); + writer.WriteNumberValue(MaxOutstandingReadRequestsValue.Value); + } + + if (MaxOutstandingWriteRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_write_requests"); + writer.WriteNumberValue(MaxOutstandingWriteRequestsValue.Value); + } + + if (MaxReadRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_read_request_operation_count"); + writer.WriteNumberValue(MaxReadRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxReadRequestSizeValue)) + { + writer.WritePropertyName("max_read_request_size"); + writer.WriteStringValue(MaxReadRequestSizeValue); + } + + if (MaxRetryDelayValue is not null) + { + writer.WritePropertyName("max_retry_delay"); + JsonSerializer.Serialize(writer, MaxRetryDelayValue, options); + } + + if (MaxWriteBufferCountValue.HasValue) + { + writer.WritePropertyName("max_write_buffer_count"); + writer.WriteNumberValue(MaxWriteBufferCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteBufferSizeValue)) + { + writer.WritePropertyName("max_write_buffer_size"); + writer.WriteStringValue(MaxWriteBufferSizeValue); + } + + if (MaxWriteRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_write_request_operation_count"); + writer.WriteNumberValue(MaxWriteRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteRequestSizeValue)) + { + writer.WritePropertyName("max_write_request_size"); + writer.WriteStringValue(MaxWriteRequestSizeValue); + } + + if (ReadPollTimeoutValue is not null) + { + writer.WritePropertyName("read_poll_timeout"); + JsonSerializer.Serialize(writer, ReadPollTimeoutValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Resumes a follower index that has been paused +/// +public sealed partial class ResumeFollowRequestDescriptor : RequestDescriptor +{ + internal ResumeFollowRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResumeFollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationResumeFollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ccr.resume_follow"; + + public ResumeFollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private long? MaxOutstandingReadRequestsValue { get; set; } + private long? MaxOutstandingWriteRequestsValue { get; set; } + private long? MaxReadRequestOperationCountValue { get; set; } + private string? MaxReadRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MaxRetryDelayValue { get; set; } + private long? MaxWriteBufferCountValue { get; set; } + private string? MaxWriteBufferSizeValue { get; set; } + private long? MaxWriteRequestOperationCountValue { get; set; } + private string? MaxWriteRequestSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ReadPollTimeoutValue { get; set; } + + public ResumeFollowRequestDescriptor MaxOutstandingReadRequests(long? maxOutstandingReadRequests) + { + MaxOutstandingReadRequestsValue = maxOutstandingReadRequests; + return Self; + } + + public ResumeFollowRequestDescriptor MaxOutstandingWriteRequests(long? maxOutstandingWriteRequests) + { + MaxOutstandingWriteRequestsValue = maxOutstandingWriteRequests; + return Self; + } + + public ResumeFollowRequestDescriptor MaxReadRequestOperationCount(long? maxReadRequestOperationCount) + { + MaxReadRequestOperationCountValue = maxReadRequestOperationCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxReadRequestSize(string? maxReadRequestSize) + { + MaxReadRequestSizeValue = maxReadRequestSize; + return Self; + } + + public ResumeFollowRequestDescriptor MaxRetryDelay(Elastic.Clients.Elasticsearch.Duration? maxRetryDelay) + { + MaxRetryDelayValue = maxRetryDelay; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteBufferCount(long? maxWriteBufferCount) + { + MaxWriteBufferCountValue = maxWriteBufferCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteBufferSize(string? maxWriteBufferSize) + { + MaxWriteBufferSizeValue = maxWriteBufferSize; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteRequestOperationCount(long? maxWriteRequestOperationCount) + { + MaxWriteRequestOperationCountValue = maxWriteRequestOperationCount; + return Self; + } + + public ResumeFollowRequestDescriptor MaxWriteRequestSize(string? maxWriteRequestSize) + { + MaxWriteRequestSizeValue = maxWriteRequestSize; + return Self; + } + + public ResumeFollowRequestDescriptor ReadPollTimeout(Elastic.Clients.Elasticsearch.Duration? readPollTimeout) + { + ReadPollTimeoutValue = readPollTimeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MaxOutstandingReadRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_read_requests"); + writer.WriteNumberValue(MaxOutstandingReadRequestsValue.Value); + } + + if (MaxOutstandingWriteRequestsValue.HasValue) + { + writer.WritePropertyName("max_outstanding_write_requests"); + writer.WriteNumberValue(MaxOutstandingWriteRequestsValue.Value); + } + + if (MaxReadRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_read_request_operation_count"); + writer.WriteNumberValue(MaxReadRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxReadRequestSizeValue)) + { + writer.WritePropertyName("max_read_request_size"); + writer.WriteStringValue(MaxReadRequestSizeValue); + } + + if (MaxRetryDelayValue is not null) + { + writer.WritePropertyName("max_retry_delay"); + JsonSerializer.Serialize(writer, MaxRetryDelayValue, options); + } + + if (MaxWriteBufferCountValue.HasValue) + { + writer.WritePropertyName("max_write_buffer_count"); + writer.WriteNumberValue(MaxWriteBufferCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteBufferSizeValue)) + { + writer.WritePropertyName("max_write_buffer_size"); + writer.WriteStringValue(MaxWriteBufferSizeValue); + } + + if (MaxWriteRequestOperationCountValue.HasValue) + { + writer.WritePropertyName("max_write_request_operation_count"); + writer.WriteNumberValue(MaxWriteRequestOperationCountValue.Value); + } + + if (!string.IsNullOrEmpty(MaxWriteRequestSizeValue)) + { + writer.WritePropertyName("max_write_request_size"); + writer.WriteStringValue(MaxWriteRequestSizeValue); + } + + if (ReadPollTimeoutValue is not null) + { + writer.WritePropertyName("read_poll_timeout"); + JsonSerializer.Serialize(writer, ReadPollTimeoutValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs new file mode 100644 index 00000000000..13c08f6f707 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class ResumeFollowResponse : 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/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs new file mode 100644 index 00000000000..5893118b84a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.CrossClusterReplication; + +public sealed partial class UnfollowRequestParameters : RequestParameters +{ +} + +/// +/// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. +/// +public sealed partial class UnfollowRequest : PlainRequest +{ + public UnfollowRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationUnfollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.unfollow"; +} + +/// +/// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. +/// +public sealed partial class UnfollowRequestDescriptor : RequestDescriptor, UnfollowRequestParameters> +{ + internal UnfollowRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UnfollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationUnfollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.unfollow"; + + public UnfollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. +/// +public sealed partial class UnfollowRequestDescriptor : RequestDescriptor +{ + internal UnfollowRequestDescriptor(Action configure) => configure.Invoke(this); + + public UnfollowRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.CrossClusterReplicationUnfollow; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ccr.unfollow"; + + public UnfollowRequestDescriptor Index(Elastic.Clients.Elasticsearch.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/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs new file mode 100644 index 00000000000..9ddfba42a37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class UnfollowResponse : 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/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs index f961eabd340..b84dd6c6f7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs index 5613d59157b..4cd4bb23e6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs @@ -387,10 +387,6 @@ public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indi { } - internal DeleteByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -436,11 +432,11 @@ public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elastic private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } /// /// The maximum number of documents to delete. @@ -462,7 +458,7 @@ public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticse return Self; } - public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -470,7 +466,7 @@ public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor< return Self; } - public DeleteByQueryRequestDescriptor Query(Action> configure) + public DeleteByQueryRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -489,7 +485,7 @@ public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticse return Self; } - public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -497,7 +493,7 @@ public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public DeleteByQueryRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -522,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -538,7 +534,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -561,10 +557,6 @@ public DeleteByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indi { } - internal DeleteByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -610,11 +602,11 @@ public DeleteByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indi private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } /// /// The maximum number of documents to delete. @@ -636,7 +628,7 @@ public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryD return Self; } - public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public DeleteByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -644,7 +636,7 @@ public DeleteByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public DeleteByQueryRequestDescriptor Query(Action configure) + public DeleteByQueryRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -663,7 +655,7 @@ public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Sliced return Self; } - public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public DeleteByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -671,7 +663,7 @@ public DeleteByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public DeleteByQueryRequestDescriptor Slice(Action configure) + public DeleteByQueryRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -696,7 +688,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -712,7 +704,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs index cf60a837bcd..04d1a451f0d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs index e63636b1971..91caad419a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class DeleteByQueryRethrottleRequestParameters : RequestPa /// public sealed partial class DeleteByQueryRethrottleRequest : PlainRequest { - public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.TaskId task_id) : base(r => r.Required("task_id", task_id)) + public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.TaskId taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class DeleteByQueryRethrottleRequestDescriptor : RequestDe { internal DeleteByQueryRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.TaskId task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal DeleteByQueryRethrottleRequestDescriptor() + public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.TaskId taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal DeleteByQueryRethrottleRequestDescriptor() public DeleteByQueryRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId task_id) + public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs index 0e89b7aac72..569c30c7690 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs index d732053bd75..22f7c05315c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs @@ -149,30 +149,6 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } - public DeleteRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public DeleteRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public DeleteRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -218,10 +194,6 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } - internal DeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs index f127c382bfd..dc66947e83e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs index 6b64efcf4a2..bfdb19af3b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs @@ -83,10 +83,6 @@ public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base { } - internal DeleteScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -120,10 +116,6 @@ public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base { } - internal DeleteScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceDeleteScript; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs index bdc33329986..ad0375f61bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs index 1562259e60a..3b0e72d4f9b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs @@ -62,10 +62,6 @@ public DeletePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : { } - internal DeletePolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichDeletePolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs index ae3a5864288..3f4bcd5d5ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs index ea55ef287fd..97edca927ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs index 48eebf13164..aa34a75d88b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs @@ -72,10 +72,6 @@ public ExecutePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : { } - internal ExecutePolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichExecutePolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs index f6300228727..16db521cad5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -28,7 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; public sealed partial class ExecutePolicyResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("status")] - public Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus Status { get; init; } + public Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus? Status { get; init; } [JsonInclude, JsonPropertyName("task_id")] public Elastic.Clients.Elasticsearch.TaskId? TaskId { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs index 8e6eba13b38..96e2db2cc05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs @@ -62,6 +62,10 @@ public sealed partial class GetPolicyRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) + { + } + public GetPolicyRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs index f829ce8e150..cadd77f15f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs index 814ea4238c5..b42da1d1c0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs @@ -80,10 +80,6 @@ public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : bas { } - internal PutPolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -99,14 +95,14 @@ public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch. } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? GeoMatchValue { get; set; } - private EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } - private Action> GeoMatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } + private Action> GeoMatchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? MatchValue { get; set; } - private EnrichPolicyDescriptor MatchDescriptor { get; set; } - private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? RangeValue { get; set; } - private EnrichPolicyDescriptor RangeDescriptor { get; set; } - private Action> RangeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action> RangeDescriptorAction { get; set; } /// /// Matches enrich data to incoming documents based on a `geo_shape` query. @@ -119,7 +115,7 @@ public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsea return Self; } - public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { GeoMatchValue = null; GeoMatchDescriptorAction = null; @@ -127,7 +123,7 @@ public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor GeoMatch(Action> configure) + public PutPolicyRequestDescriptor GeoMatch(Action> configure) { GeoMatchValue = null; GeoMatchDescriptor = null; @@ -146,7 +142,7 @@ public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch return Self; } - public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -154,7 +150,7 @@ public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor Match(Action> configure) + public PutPolicyRequestDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -173,7 +169,7 @@ public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch return Self; } - public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { RangeValue = null; RangeDescriptorAction = null; @@ -181,7 +177,7 @@ public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor Range(Action> configure) + public PutPolicyRequestDescriptor Range(Action> configure) { RangeValue = null; RangeDescriptor = null; @@ -200,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GeoMatchDescriptorAction is not null) { writer.WritePropertyName("geo_match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); } else if (GeoMatchValue is not null) { @@ -216,7 +212,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(MatchDescriptorAction), options); } else if (MatchValue is not null) { @@ -232,7 +228,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RangeDescriptorAction is not null) { writer.WritePropertyName("range"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(RangeDescriptorAction), options); } else if (RangeValue is not null) { @@ -255,10 +251,6 @@ public PutPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : bas { } - internal PutPolicyRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EnrichPutPolicy; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -274,14 +266,14 @@ public PutPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? GeoMatchValue { get; set; } - private EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } - private Action GeoMatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor GeoMatchDescriptor { get; set; } + private Action GeoMatchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? MatchValue { get; set; } - private EnrichPolicyDescriptor MatchDescriptor { get; set; } - private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy? RangeValue { get; set; } - private EnrichPolicyDescriptor RangeDescriptor { get; set; } - private Action RangeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor RangeDescriptor { get; set; } + private Action RangeDescriptorAction { get; set; } /// /// Matches enrich data to incoming documents based on a `geo_shape` query. @@ -294,7 +286,7 @@ public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Enrich. return Self; } - public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor GeoMatch(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { GeoMatchValue = null; GeoMatchDescriptorAction = null; @@ -302,7 +294,7 @@ public PutPolicyRequestDescriptor GeoMatch(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor GeoMatch(Action configure) + public PutPolicyRequestDescriptor GeoMatch(Action configure) { GeoMatchValue = null; GeoMatchDescriptor = null; @@ -321,7 +313,7 @@ public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Enrich.Enr return Self; } - public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Match(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -329,7 +321,7 @@ public PutPolicyRequestDescriptor Match(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor Match(Action configure) + public PutPolicyRequestDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -348,7 +340,7 @@ public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Enrich.Enr return Self; } - public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) + public PutPolicyRequestDescriptor Range(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor descriptor) { RangeValue = null; RangeDescriptorAction = null; @@ -356,7 +348,7 @@ public PutPolicyRequestDescriptor Range(EnrichPolicyDescriptor descriptor) return Self; } - public PutPolicyRequestDescriptor Range(Action configure) + public PutPolicyRequestDescriptor Range(Action configure) { RangeValue = null; RangeDescriptor = null; @@ -375,7 +367,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GeoMatchDescriptorAction is not null) { writer.WritePropertyName("geo_match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(GeoMatchDescriptorAction), options); } else if (GeoMatchValue is not null) { @@ -391,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(MatchDescriptorAction), options); } else if (MatchValue is not null) { @@ -407,7 +399,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RangeDescriptorAction is not null) { writer.WritePropertyName("range"); - JsonSerializer.Serialize(writer, new EnrichPolicyDescriptor(RangeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyDescriptor(RangeDescriptorAction), options); } else if (RangeValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs index b1b21ad1422..c41ba1af1e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs index 8c4f2969e4a..283607b7289 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs @@ -62,10 +62,6 @@ public EqlDeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r { } - internal EqlDeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public EqlDeleteRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r { } - internal EqlDeleteRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs index 9ec35f18490..edec0bdb190 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs index 6fcf4b226e6..6e080a9e9db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs @@ -83,10 +83,6 @@ public EqlGetRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => { } - internal EqlGetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -120,10 +116,6 @@ public EqlGetRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => { } - internal EqlGetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs index bc4abc18da0..6cf3a6e7de8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs index cfe3c7d6cdf..809b306abea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs @@ -142,10 +142,6 @@ public EqlSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal EqlSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,18 +164,18 @@ public EqlSearchRequestDescriptor Indices(Elastic.Clients.Elasticsear private Elastic.Clients.Elasticsearch.Field? EventCategoryFieldValue { get; set; } private int? FetchSizeValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } private string QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Eql.ResultPosition? ResultPositionValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TiebreakerFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TimestampFieldValue { get; set; } @@ -209,6 +205,15 @@ public EqlSearchRequestDescriptor EventCategoryField(Expressi return Self; } + /// + /// Field containing the event classification, such as process, file, or network. + /// + public EqlSearchRequestDescriptor EventCategoryField(Expression> eventCategoryField) + { + EventCategoryFieldValue = eventCategoryField; + return Self; + } + /// /// Maximum number of events to search at a time for sequence queries. /// @@ -230,7 +235,7 @@ public EqlSearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public EqlSearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -239,7 +244,7 @@ public EqlSearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescr return Self; } - public EqlSearchRequestDescriptor Fields(Action> configure) + public EqlSearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -248,7 +253,7 @@ public EqlSearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public EqlSearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -269,7 +274,7 @@ public EqlSearchRequestDescriptor Filter(ICollection Filter(QueryDsl.QueryDescriptor descriptor) + public EqlSearchRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -278,7 +283,7 @@ public EqlSearchRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public EqlSearchRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -287,7 +292,7 @@ public EqlSearchRequestDescriptor Filter(Action Filter(params Action>[] configure) + public EqlSearchRequestDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -323,9 +328,9 @@ public EqlSearchRequestDescriptor ResultPosition(Elastic.Clients.Elas return Self; } - public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public EqlSearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -356,6 +361,15 @@ public EqlSearchRequestDescriptor TiebreakerField(Expression< return Self; } + /// + /// Field used to sort hits with the same timestamp in ascending order + /// + public EqlSearchRequestDescriptor TiebreakerField(Expression> tiebreakerField) + { + TiebreakerFieldValue = tiebreakerField; + return Self; + } + /// /// Field containing event timestamp. Default "@timestamp" /// @@ -374,6 +388,15 @@ public EqlSearchRequestDescriptor TimestampField(Expression + /// Field containing event timestamp. Default "@timestamp" + /// + public EqlSearchRequestDescriptor TimestampField(Expression> timestampField) + { + TimestampFieldValue = timestampField; + return Self; + } + public EqlSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? waitForCompletionTimeout) { WaitForCompletionTimeoutValue = waitForCompletionTimeout; @@ -409,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldsDescriptorAction is not null) { writer.WritePropertyName("fields"); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); } else if (FieldsDescriptorActions is not null) { @@ -418,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } if (FieldsDescriptorActions.Length > 1) @@ -438,7 +461,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -447,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -524,10 +547,6 @@ public EqlSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal EqlSearchRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -550,18 +569,18 @@ public EqlSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices private Elastic.Clients.Elasticsearch.Field? EventCategoryFieldValue { get; set; } private int? FetchSizeValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } private string QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Eql.ResultPosition? ResultPositionValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TiebreakerFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TimestampFieldValue { get; set; } @@ -621,7 +640,7 @@ public EqlSearchRequestDescriptor Fields(ICollection configure) + public EqlSearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -639,7 +658,7 @@ public EqlSearchRequestDescriptor Fields(Action[] configure) + public EqlSearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -660,7 +679,7 @@ public EqlSearchRequestDescriptor Filter(ICollection configure) + public EqlSearchRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -678,7 +697,7 @@ public EqlSearchRequestDescriptor Filter(Action config return Self; } - public EqlSearchRequestDescriptor Filter(params Action[] configure) + public EqlSearchRequestDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -714,9 +733,9 @@ public EqlSearchRequestDescriptor ResultPosition(Elastic.Clients.Elasticsearch.E return Self; } - public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public EqlSearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -818,7 +837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldsDescriptorAction is not null) { writer.WritePropertyName("fields"); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); } else if (FieldsDescriptorActions is not null) { @@ -827,7 +846,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } if (FieldsDescriptorActions.Length > 1) @@ -847,7 +866,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -856,7 +875,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs index e8a1e8c1416..5652957f69b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs index 05c4ca0a0b6..7507af95dfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs @@ -62,10 +62,6 @@ public GetEqlStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base { } - internal GetEqlStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGetStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public GetEqlStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base { } - internal GetEqlStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.EqlGetStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs index bdd96f4fcfb..b5ad7f26f12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs index 68ab70bc562..8f76d332896 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs @@ -43,7 +43,6 @@ public sealed partial class EsqlQueryRequestParameters : RequestParameters } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ES|QL request /// public sealed partial class EsqlQueryRequest : PlainRequest @@ -86,7 +85,7 @@ public sealed partial class EsqlQueryRequest : PlainRequestTo avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// [JsonInclude, JsonPropertyName("params")] - public ICollection? Params { get; set; } + public ICollection? Params { get; set; } /// /// The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. @@ -96,7 +95,6 @@ public sealed partial class EsqlQueryRequest : PlainRequest -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ES|QL request /// public sealed partial class EsqlQueryRequestDescriptor : RequestDescriptor, EsqlQueryRequestParameters> @@ -120,10 +118,10 @@ public EsqlQueryRequestDescriptor() private bool? ColumnarValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private string? LocaleValue { get; set; } - private ICollection? ParamsValue { get; set; } + private ICollection? ParamsValue { get; set; } private string QueryValue { get; set; } /// @@ -146,7 +144,7 @@ public EsqlQueryRequestDescriptor Filter(Elastic.Clients.Elasticsearc return Self; } - public EsqlQueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public EsqlQueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -154,7 +152,7 @@ public EsqlQueryRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public EsqlQueryRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -171,9 +169,9 @@ public EsqlQueryRequestDescriptor Locale(string? locale) /// /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// - public EsqlQueryRequestDescriptor Params(ICollection? parameters) + public EsqlQueryRequestDescriptor Params(ICollection? value) { - ParamsValue = parameters; + ParamsValue = value; return Self; } @@ -203,7 +201,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -230,7 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ES|QL request /// public sealed partial class EsqlQueryRequestDescriptor : RequestDescriptor @@ -254,10 +251,10 @@ public EsqlQueryRequestDescriptor() private bool? ColumnarValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private string? LocaleValue { get; set; } - private ICollection? ParamsValue { get; set; } + private ICollection? ParamsValue { get; set; } private string QueryValue { get; set; } /// @@ -280,7 +277,7 @@ public EsqlQueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl. return Self; } - public EsqlQueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public EsqlQueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -288,7 +285,7 @@ public EsqlQueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public EsqlQueryRequestDescriptor Filter(Action configure) + public EsqlQueryRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -305,9 +302,9 @@ public EsqlQueryRequestDescriptor Locale(string? locale) /// /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// - public EsqlQueryRequestDescriptor Params(ICollection? parameters) + public EsqlQueryRequestDescriptor Params(ICollection? value) { - ParamsValue = parameters; + ParamsValue = value; return Self; } @@ -337,7 +334,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryResponse.g.cs index a48f053d4d5..47d6c60463c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryResponse.g.cs @@ -20,14 +20,12 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Esql; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// public sealed partial class EsqlQueryResponse : ElasticsearchResponse { } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs index 8ca9c0a9806..ca1b7ecda2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs @@ -171,30 +171,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } - public ExistsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public ExistsRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public ExistsRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -242,10 +218,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs index 627b2f59667..6d4ccb713e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch; 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/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs index 9135664f0f0..f899080d652 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs @@ -160,30 +160,6 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind { } - public ExistsSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public ExistsSourceRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public ExistsSourceRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -230,10 +206,6 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind { } - internal ExistsSourceRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExistsSource; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs index 7b6535e1a3e..eafd8f07e95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch; 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/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs index c26fff400ca..1e143403c3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs @@ -199,30 +199,6 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, E { } - public ExplainRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public ExplainRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public ExplainRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.Id.From(document)) - { - } - - public ExplainRequestDescriptor(TDocument document, Id id) : this(typeof(TDocument), id) - { - } - - public ExplainRequestDescriptor(Id id) : this(typeof(TDocument), id) - { - } - - internal ExplainRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -257,8 +233,8 @@ public ExplainRequestDescriptor Index(Elastic.Clients.Elasticsearch.I } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -271,7 +247,7 @@ public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.Q return Self; } - public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -279,7 +255,7 @@ public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public ExplainRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -298,7 +274,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -321,10 +297,6 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, E { } - internal ExplainRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceExplain; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -359,8 +331,8 @@ public ExplainRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName in } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Defines the search definition using the Query DSL. @@ -373,7 +345,7 @@ public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Que return Self; } - public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExplainRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -381,7 +353,7 @@ public ExplainRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public ExplainRequestDescriptor Query(Action configure) + public ExplainRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -400,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs index 2838c1f5497..507b277bdfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs new file mode 100644 index 00000000000..9b0025bf7b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Features; + +public sealed partial class GetFeaturesRequestParameters : RequestParameters +{ +} + +/// +/// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot +/// +public sealed partial class GetFeaturesRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.FeaturesGetFeatures; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "features.get_features"; +} + +/// +/// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot +/// +public sealed partial class GetFeaturesRequestDescriptor : RequestDescriptor +{ + internal GetFeaturesRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetFeaturesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.FeaturesGetFeatures; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "features.get_features"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs new file mode 100644 index 00000000000..330a44bf3e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features; + +public sealed partial class GetFeaturesResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("features")] + public IReadOnlyCollection Features { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs new file mode 100644 index 00000000000..6c9746c09ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Features; + +public sealed partial class ResetFeaturesRequestParameters : RequestParameters +{ +} + +/// +/// Resets the internal state of features, usually by deleting system indices +/// +public sealed partial class ResetFeaturesRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.FeaturesResetFeatures; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "features.reset_features"; +} + +/// +/// Resets the internal state of features, usually by deleting system indices +/// +public sealed partial class ResetFeaturesRequestDescriptor : RequestDescriptor +{ + internal ResetFeaturesRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResetFeaturesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.FeaturesResetFeatures; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "features.reset_features"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs new file mode 100644 index 00000000000..d92067d295e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features; + +public sealed partial class ResetFeaturesResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("features")] + public IReadOnlyCollection Features { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs index a0e4bcb1d80..fa03c8f9539 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs @@ -51,6 +51,11 @@ public sealed partial class FieldCapsRequestParameters : RequestParameters /// public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + /// + /// If false, empty fields are not included in the response. + /// + public bool? IncludeEmptyFields { get => Q("include_empty_fields"); set => Q("include_empty_fields", value); } + /// /// If true, unmapped fields are included in the response. /// @@ -107,6 +112,12 @@ public FieldCapsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r [JsonIgnore] public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + /// + /// If false, empty fields are not included in the response. + /// + [JsonIgnore] + public bool? IncludeEmptyFields { get => Q("include_empty_fields"); set => Q("include_empty_fields", value); } + /// /// If true, unmapped fields are included in the response. /// @@ -145,6 +156,10 @@ public sealed partial class FieldCapsRequestDescriptor : RequestDescr { internal FieldCapsRequestDescriptor(Action> configure) => configure.Invoke(this); + public FieldCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FieldCapsRequestDescriptor() { } @@ -161,6 +176,7 @@ public FieldCapsRequestDescriptor() 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 IncludeEmptyFields(bool? includeEmptyFields = true) => Qs("include_empty_fields", includeEmptyFields); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); @@ -172,9 +188,9 @@ public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsear private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action> IndexFilterDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } /// /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. @@ -196,7 +212,7 @@ public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elastic return Self; } - public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -204,7 +220,7 @@ public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescripto return Self; } - public FieldCapsRequestDescriptor IndexFilter(Action> configure) + public FieldCapsRequestDescriptor IndexFilter(Action> configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -215,9 +231,9 @@ public FieldCapsRequestDescriptor IndexFilter(Action /// 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) + public FieldCapsRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -238,7 +254,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { @@ -263,6 +279,10 @@ public sealed partial class FieldCapsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public FieldCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FieldCapsRequestDescriptor() { } @@ -279,6 +299,7 @@ public FieldCapsRequestDescriptor() 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 IncludeEmptyFields(bool? includeEmptyFields = true) => Qs("include_empty_fields", includeEmptyFields); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); public FieldCapsRequestDescriptor Types(ICollection? types) => Qs("types", types); @@ -290,9 +311,9 @@ public FieldCapsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action IndexFilterDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } /// /// List of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. @@ -314,7 +335,7 @@ public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Quer return Self; } - public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public FieldCapsRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -322,7 +343,7 @@ public FieldCapsRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descripto return Self; } - public FieldCapsRequestDescriptor IndexFilter(Action configure) + public FieldCapsRequestDescriptor IndexFilter(Action configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -333,9 +354,9 @@ public FieldCapsRequestDescriptor IndexFilter(Action c /// /// 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) + public FieldCapsRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -356,7 +377,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs index c5b80a6e911..1f2841fe397 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -31,5 +32,6 @@ public sealed partial class FieldCapsResponse : ElasticsearchResponse [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyDictionary))] public IReadOnlyDictionary> Fields { get; init; } [JsonInclude, JsonPropertyName("indices")] - public IReadOnlyCollection Indices { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs index 0117d030c0a..217978713d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs @@ -171,30 +171,6 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elast { } - public GetRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public GetRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public GetRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -242,10 +218,6 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elast { } - internal GetRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs index f6fe231f9f4..0534f279baa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs index 8df83730531..675104dff9c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs index 79f44251872..37a210be29b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs index d1068d49115..52c0fed352b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs @@ -72,10 +72,6 @@ public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r { } - internal GetScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -108,10 +104,6 @@ public GetScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r { } - internal GetScriptRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetScript; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs index c238fa72aeb..e9e8fa8c010 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs index f453543287b..06e5dbdcbf1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs @@ -163,30 +163,6 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, { } - public GetSourceRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public GetSourceRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public GetSourceRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -234,10 +210,6 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, { } - internal GetSourceRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceGetSource; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs index 6da0fe0abd4..d977820c73e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs index 631f13dd0cc..9aa81fc9cf5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs @@ -107,10 +107,6 @@ public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : { } - internal ExploreRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -129,18 +125,18 @@ public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch } private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } - private HopDescriptor ConnectionsDescriptor { get; set; } - private Action> ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.HopDescriptor ConnectionsDescriptor { get; set; } + private Action> ConnectionsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Graph.ExploreControls? ControlsValue { get; set; } - private ExploreControlsDescriptor ControlsDescriptor { get; set; } - private Action> ControlsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor ControlsDescriptor { get; set; } + private Action> ControlsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } + private Elastic.Clients.Elasticsearch.Graph.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. @@ -153,7 +149,7 @@ public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticse return Self; } - public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -161,7 +157,7 @@ public ExploreRequestDescriptor Connections(HopDescriptor return Self; } - public ExploreRequestDescriptor Connections(Action> configure) + public ExploreRequestDescriptor Connections(Action> configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -180,7 +176,7 @@ public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearc return Self; } - public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor descriptor) { ControlsValue = null; ControlsDescriptorAction = null; @@ -188,7 +184,7 @@ public ExploreRequestDescriptor Controls(ExploreControlsDescriptor Controls(Action> configure) + public ExploreRequestDescriptor Controls(Action> configure) { ControlsValue = null; ControlsDescriptor = null; @@ -207,7 +203,7 @@ public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.Q return Self; } - public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -215,7 +211,7 @@ public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public ExploreRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -235,7 +231,7 @@ public ExploreRequestDescriptor Vertices(ICollection Vertices(VertexDefinitionDescriptor descriptor) + public ExploreRequestDescriptor Vertices(Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor descriptor) { VerticesValue = null; VerticesDescriptorAction = null; @@ -244,7 +240,7 @@ public ExploreRequestDescriptor Vertices(VertexDefinitionDescriptor Vertices(Action> configure) + public ExploreRequestDescriptor Vertices(Action> configure) { VerticesValue = null; VerticesDescriptor = null; @@ -253,7 +249,7 @@ public ExploreRequestDescriptor Vertices(Action Vertices(params Action>[] configure) + public ExploreRequestDescriptor Vertices(params Action>[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -273,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -289,7 +285,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ControlsDescriptorAction is not null) { writer.WritePropertyName("controls"); - JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); } else if (ControlsValue is not null) { @@ -305,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -324,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -333,7 +329,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); @@ -359,10 +355,6 @@ public ExploreRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : { } - internal ExploreRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.GraphExplore; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -381,18 +373,18 @@ public ExploreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices in } private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } - private HopDescriptor ConnectionsDescriptor { get; set; } - private Action ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.HopDescriptor ConnectionsDescriptor { get; set; } + private Action ConnectionsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Graph.ExploreControls? ControlsValue { get; set; } - private ExploreControlsDescriptor ControlsDescriptor { get; set; } - private Action ControlsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor ControlsDescriptor { get; set; } + private Action ControlsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } + private Elastic.Clients.Elasticsearch.Graph.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. @@ -405,7 +397,7 @@ public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Graph. return Self; } - public ExploreRequestDescriptor Connections(HopDescriptor descriptor) + public ExploreRequestDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -413,7 +405,7 @@ public ExploreRequestDescriptor Connections(HopDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Connections(Action configure) + public ExploreRequestDescriptor Connections(Action configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -432,7 +424,7 @@ public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Graph.Exp return Self; } - public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) + public ExploreRequestDescriptor Controls(Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor descriptor) { ControlsValue = null; ControlsDescriptorAction = null; @@ -440,7 +432,7 @@ public ExploreRequestDescriptor Controls(ExploreControlsDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Controls(Action configure) + public ExploreRequestDescriptor Controls(Action configure) { ControlsValue = null; ControlsDescriptor = null; @@ -459,7 +451,7 @@ public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Que return Self; } - public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public ExploreRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -467,7 +459,7 @@ public ExploreRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public ExploreRequestDescriptor Query(Action configure) + public ExploreRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -487,7 +479,7 @@ public ExploreRequestDescriptor Vertices(ICollection configure) + public ExploreRequestDescriptor Vertices(Action configure) { VerticesValue = null; VerticesDescriptor = null; @@ -505,7 +497,7 @@ public ExploreRequestDescriptor Vertices(Action conf return Self; } - public ExploreRequestDescriptor Vertices(params Action[] configure) + public ExploreRequestDescriptor Vertices(params Action[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -525,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -541,7 +533,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ControlsDescriptorAction is not null) { writer.WritePropertyName("controls"); - JsonSerializer.Serialize(writer, new ExploreControlsDescriptor(ControlsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.ExploreControlsDescriptor(ControlsDescriptorAction), options); } else if (ControlsValue is not null) { @@ -557,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -576,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -585,7 +577,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs index bcf66c62f61..b916b224e45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs new file mode 100644 index 00000000000..68d75383ca0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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; + +public sealed partial class HealthReportRequestParameters : RequestParameters +{ + /// + /// Limit the number of affected resources the health report API returns. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Explicit operation timeout. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Opt-in for more information about the health of the system. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns the health of the cluster. +/// +public sealed partial class HealthReportRequest : PlainRequest +{ + public HealthReportRequest() + { + } + + public HealthReportRequest(IReadOnlyCollection? feature) : base(r => r.Optional("feature", feature)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "health_report"; + + /// + /// Limit the number of affected resources the health report API returns. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Explicit operation timeout. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Opt-in for more information about the health of the system. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns the health of the cluster. +/// +public sealed partial class HealthReportRequestDescriptor : RequestDescriptor +{ + internal HealthReportRequestDescriptor(Action configure) => configure.Invoke(this); + + public HealthReportRequestDescriptor(IReadOnlyCollection? feature) : base(r => r.Optional("feature", feature)) + { + } + + public HealthReportRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceHealthReport; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "health_report"; + + public HealthReportRequestDescriptor Size(int? size) => Qs("size", size); + public HealthReportRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public HealthReportRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public HealthReportRequestDescriptor Feature(IReadOnlyCollection? feature) + { + RouteValues.Optional("feature", feature); + 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/_Generated/Api/HealthReportResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs new file mode 100644 index 00000000000..a076c3eba52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +public sealed partial class HealthReportResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("indicators")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators Indicators { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs new file mode 100644 index 00000000000..80e79377a15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class DeleteLifecycleRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. +/// +public sealed partial class DeleteLifecycleRequest : PlainRequest +{ + public DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("policy", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.delete_lifecycle"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. +/// +public sealed partial class DeleteLifecycleRequestDescriptor : RequestDescriptor +{ + internal DeleteLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("policy", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.delete_lifecycle"; + + public DeleteLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("policy", 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/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs new file mode 100644 index 00000000000..ea34c3c59d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class DeleteLifecycleResponse : 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/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs new file mode 100644 index 00000000000..6c21dc260f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class GetIlmStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves the current index lifecycle management (ILM) status. +/// +public sealed partial class GetIlmStatusRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.get_status"; +} + +/// +/// Retrieves the current index lifecycle management (ILM) status. +/// +public sealed partial class GetIlmStatusRequestDescriptor : RequestDescriptor +{ + internal GetIlmStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetIlmStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.get_status"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs new file mode 100644 index 00000000000..0cb87d29c09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class GetIlmStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("operation_mode")] + public Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs new file mode 100644 index 00000000000..038ba1bcf4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class GetLifecycleRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves a lifecycle policy. +/// +public sealed partial class GetLifecycleRequest : PlainRequest +{ + public GetLifecycleRequest() + { + } + + public GetLifecycleRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("policy", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.get_lifecycle"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves a lifecycle policy. +/// +public sealed partial class GetLifecycleRequestDescriptor : RequestDescriptor +{ + internal GetLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("policy", name)) + { + } + + public GetLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.get_lifecycle"; + + public GetLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public GetLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) + { + RouteValues.Optional("policy", 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/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs new file mode 100644 index 00000000000..e8ab42d8f8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class GetLifecycleResponse : DictionaryResponse +{ + public GetLifecycleResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetLifecycleResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs new file mode 100644 index 00000000000..cbe969537a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class MigrateToDataTiersRequestParameters : RequestParameters +{ + /// + /// If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration.
This provides a way to retrieve the indices and ILM policies that need to be migrated.
+ ///
+ public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", value); } +} + +/// +/// Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and
attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+
Using node roles enables ILM to automatically move the indices between data tiers.
+///
+public sealed partial class MigrateToDataTiersRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMigrateToDataTiers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.migrate_to_data_tiers"; + + /// + /// If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration.
This provides a way to retrieve the indices and ILM policies that need to be migrated.
+ ///
+ [JsonIgnore] + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", value); } + [JsonInclude, JsonPropertyName("legacy_template_to_delete")] + public string? LegacyTemplateToDelete { get; set; } + [JsonInclude, JsonPropertyName("node_attribute")] + public string? NodeAttribute { get; set; } +} + +/// +/// Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and
attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+
Using node roles enables ILM to automatically move the indices between data tiers.
+///
+public sealed partial class MigrateToDataTiersRequestDescriptor : RequestDescriptor +{ + internal MigrateToDataTiersRequestDescriptor(Action configure) => configure.Invoke(this); + + public MigrateToDataTiersRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMigrateToDataTiers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.migrate_to_data_tiers"; + + public MigrateToDataTiersRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun); + + private string? LegacyTemplateToDeleteValue { get; set; } + private string? NodeAttributeValue { get; set; } + + public MigrateToDataTiersRequestDescriptor LegacyTemplateToDelete(string? legacyTemplateToDelete) + { + LegacyTemplateToDeleteValue = legacyTemplateToDelete; + return Self; + } + + public MigrateToDataTiersRequestDescriptor NodeAttribute(string? nodeAttribute) + { + NodeAttributeValue = nodeAttribute; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(LegacyTemplateToDeleteValue)) + { + writer.WritePropertyName("legacy_template_to_delete"); + writer.WriteStringValue(LegacyTemplateToDeleteValue); + } + + if (!string.IsNullOrEmpty(NodeAttributeValue)) + { + writer.WritePropertyName("node_attribute"); + writer.WriteStringValue(NodeAttributeValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs new file mode 100644 index 00000000000..d0d38a0096a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class MigrateToDataTiersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("dry_run")] + public bool DryRun { get; init; } + [JsonInclude, JsonPropertyName("migrated_component_templates")] + public IReadOnlyCollection MigratedComponentTemplates { get; init; } + [JsonInclude, JsonPropertyName("migrated_composable_templates")] + public IReadOnlyCollection MigratedComposableTemplates { get; init; } + [JsonInclude, JsonPropertyName("migrated_ilm_policies")] + public IReadOnlyCollection MigratedIlmPolicies { get; init; } + [JsonInclude, JsonPropertyName("migrated_indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection MigratedIndices { get; init; } + [JsonInclude, JsonPropertyName("migrated_legacy_templates")] + public IReadOnlyCollection MigratedLegacyTemplates { get; init; } + [JsonInclude, JsonPropertyName("removed_legacy_template")] + public string RemovedLegacyTemplate { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs new file mode 100644 index 00000000000..a68f1be678a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class MoveToStepRequestParameters : RequestParameters +{ +} + +/// +/// Manually moves an index into the specified step and executes that step. +/// +public sealed partial class MoveToStepRequest : PlainRequest +{ + public MoveToStepRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMoveToStep; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.move_to_step"; + + [JsonInclude, JsonPropertyName("current_step")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStep { get; set; } + [JsonInclude, JsonPropertyName("next_step")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStep { get; set; } +} + +/// +/// Manually moves an index into the specified step and executes that step. +/// +public sealed partial class MoveToStepRequestDescriptor : RequestDescriptor, MoveToStepRequestParameters> +{ + internal MoveToStepRequestDescriptor(Action> configure) => configure.Invoke(this); + + public MoveToStepRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMoveToStep; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.move_to_step"; + + public MoveToStepRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor CurrentStepDescriptor { get; set; } + private Action CurrentStepDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor NextStepDescriptor { get; set; } + private Action NextStepDescriptorAction { get; set; } + + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? currentStep) + { + CurrentStepDescriptor = null; + CurrentStepDescriptorAction = null; + CurrentStepValue = currentStep; + return Self; + } + + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor descriptor) + { + CurrentStepValue = null; + CurrentStepDescriptorAction = null; + CurrentStepDescriptor = descriptor; + return Self; + } + + public MoveToStepRequestDescriptor CurrentStep(Action configure) + { + CurrentStepValue = null; + CurrentStepDescriptor = null; + CurrentStepDescriptorAction = configure; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? nextStep) + { + NextStepDescriptor = null; + NextStepDescriptorAction = null; + NextStepValue = nextStep; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor descriptor) + { + NextStepValue = null; + NextStepDescriptorAction = null; + NextStepDescriptor = descriptor; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Action configure) + { + NextStepValue = null; + NextStepDescriptor = null; + NextStepDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CurrentStepDescriptor is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, CurrentStepDescriptor, options); + } + else if (CurrentStepDescriptorAction is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(CurrentStepDescriptorAction), options); + } + else if (CurrentStepValue is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, CurrentStepValue, options); + } + + if (NextStepDescriptor is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, NextStepDescriptor, options); + } + else if (NextStepDescriptorAction is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(NextStepDescriptorAction), options); + } + else if (NextStepValue is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, NextStepValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Manually moves an index into the specified step and executes that step. +/// +public sealed partial class MoveToStepRequestDescriptor : RequestDescriptor +{ + internal MoveToStepRequestDescriptor(Action configure) => configure.Invoke(this); + + public MoveToStepRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementMoveToStep; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.move_to_step"; + + public MoveToStepRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? CurrentStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor CurrentStepDescriptor { get; set; } + private Action CurrentStepDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? NextStepValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor NextStepDescriptor { get; set; } + private Action NextStepDescriptorAction { get; set; } + + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? currentStep) + { + CurrentStepDescriptor = null; + CurrentStepDescriptorAction = null; + CurrentStepValue = currentStep; + return Self; + } + + public MoveToStepRequestDescriptor CurrentStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor descriptor) + { + CurrentStepValue = null; + CurrentStepDescriptorAction = null; + CurrentStepDescriptor = descriptor; + return Self; + } + + public MoveToStepRequestDescriptor CurrentStep(Action configure) + { + CurrentStepValue = null; + CurrentStepDescriptor = null; + CurrentStepDescriptorAction = configure; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey? nextStep) + { + NextStepDescriptor = null; + NextStepDescriptorAction = null; + NextStepValue = nextStep; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor descriptor) + { + NextStepValue = null; + NextStepDescriptorAction = null; + NextStepDescriptor = descriptor; + return Self; + } + + public MoveToStepRequestDescriptor NextStep(Action configure) + { + NextStepValue = null; + NextStepDescriptor = null; + NextStepDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CurrentStepDescriptor is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, CurrentStepDescriptor, options); + } + else if (CurrentStepDescriptorAction is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(CurrentStepDescriptorAction), options); + } + else if (CurrentStepValue is not null) + { + writer.WritePropertyName("current_step"); + JsonSerializer.Serialize(writer, CurrentStepValue, options); + } + + if (NextStepDescriptor is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, NextStepDescriptor, options); + } + else if (NextStepDescriptorAction is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyDescriptor(NextStepDescriptorAction), options); + } + else if (NextStepValue is not null) + { + writer.WritePropertyName("next_step"); + JsonSerializer.Serialize(writer, NextStepValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs new file mode 100644 index 00000000000..cdb38fab612 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class MoveToStepResponse : 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/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs new file mode 100644 index 00000000000..1d2c9140da5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class PutLifecycleRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented. +/// +public sealed partial class PutLifecycleRequest : PlainRequest +{ + public PutLifecycleRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("policy", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.put_lifecycle"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + [JsonInclude, JsonPropertyName("policy")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy? Policy { get; set; } +} + +/// +/// Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented. +/// +public sealed partial class PutLifecycleRequestDescriptor : RequestDescriptor +{ + internal PutLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("policy", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ilm.put_lifecycle"; + + public PutLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("policy", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy? PolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicyDescriptor PolicyDescriptor { get; set; } + private Action PolicyDescriptorAction { get; set; } + + public PutLifecycleRequestDescriptor Policy(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy? policy) + { + PolicyDescriptor = null; + PolicyDescriptorAction = null; + PolicyValue = policy; + return Self; + } + + public PutLifecycleRequestDescriptor Policy(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicyDescriptor descriptor) + { + PolicyValue = null; + PolicyDescriptorAction = null; + PolicyDescriptor = descriptor; + return Self; + } + + public PutLifecycleRequestDescriptor Policy(Action configure) + { + PolicyValue = null; + PolicyDescriptor = null; + PolicyDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PolicyDescriptor is not null) + { + writer.WritePropertyName("policy"); + JsonSerializer.Serialize(writer, PolicyDescriptor, options); + } + else if (PolicyDescriptorAction is not null) + { + writer.WritePropertyName("policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicyDescriptor(PolicyDescriptorAction), options); + } + else if (PolicyValue is not null) + { + writer.WritePropertyName("policy"); + JsonSerializer.Serialize(writer, PolicyValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs new file mode 100644 index 00000000000..4a27668e714 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class PutLifecycleResponse : 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/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs new file mode 100644 index 00000000000..3ce2c05b201 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class RemovePolicyRequestParameters : RequestParameters +{ +} + +/// +/// Removes the assigned lifecycle policy and stops managing the specified index +/// +public sealed partial class RemovePolicyRequest : PlainRequest +{ + public RemovePolicyRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRemovePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.remove_policy"; +} + +/// +/// Removes the assigned lifecycle policy and stops managing the specified index +/// +public sealed partial class RemovePolicyRequestDescriptor : RequestDescriptor, RemovePolicyRequestParameters> +{ + internal RemovePolicyRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RemovePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRemovePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.remove_policy"; + + public RemovePolicyRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Removes the assigned lifecycle policy and stops managing the specified index +/// +public sealed partial class RemovePolicyRequestDescriptor : RequestDescriptor +{ + internal RemovePolicyRequestDescriptor(Action configure) => configure.Invoke(this); + + public RemovePolicyRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRemovePolicy; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.remove_policy"; + + public RemovePolicyRequestDescriptor Index(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs new file mode 100644 index 00000000000..2b40e8f3b60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class RemovePolicyResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("failed_indexes")] + public IReadOnlyCollection FailedIndexes { get; init; } + [JsonInclude, JsonPropertyName("has_failures")] + public bool HasFailures { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs new file mode 100644 index 00000000000..bc0e2e5a0d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class RetryRequestParameters : RequestParameters +{ +} + +/// +/// Retries executing the policy for an index that is in the ERROR step. +/// +public sealed partial class RetryRequest : PlainRequest +{ + public RetryRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRetry; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.retry"; +} + +/// +/// Retries executing the policy for an index that is in the ERROR step. +/// +public sealed partial class RetryRequestDescriptor : RequestDescriptor, RetryRequestParameters> +{ + internal RetryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RetryRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRetry; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.retry"; + + public RetryRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retries executing the policy for an index that is in the ERROR step. +/// +public sealed partial class RetryRequestDescriptor : RequestDescriptor +{ + internal RetryRequestDescriptor(Action configure) => configure.Invoke(this); + + public RetryRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementRetry; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.retry"; + + public RetryRequestDescriptor Index(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs new file mode 100644 index 00000000000..f5f3c13bd8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class RetryResponse : 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/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs new file mode 100644 index 00000000000..3d26af8e7a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class StartIlmRequestParameters : RequestParameters +{ + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Start the index lifecycle management (ILM) plugin. +/// +public sealed partial class StartIlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.start"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Start the index lifecycle management (ILM) plugin. +/// +public sealed partial class StartIlmRequestDescriptor : RequestDescriptor +{ + internal StartIlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartIlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.start"; + + public StartIlmRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public StartIlmRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs new file mode 100644 index 00000000000..d9d622befdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class StartIlmResponse : 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/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs new file mode 100644 index 00000000000..ca72caa91ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexLifecycleManagement; + +public sealed partial class StopIlmRequestParameters : RequestParameters +{ + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin +/// +public sealed partial class StopIlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.stop"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin +/// +public sealed partial class StopIlmRequestDescriptor : RequestDescriptor +{ + internal StopIlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopIlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ilm.stop"; + + public StopIlmRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public StopIlmRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs new file mode 100644 index 00000000000..7ce7d199f01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class StopIlmResponse : 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/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs new file mode 100644 index 00000000000..3d48c5b90e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs @@ -0,0 +1,509 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class AnalyzeIndexRequestParameters : RequestParameters +{ +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequest : PlainRequest +{ + public AnalyzeIndexRequest() + { + } + + public AnalyzeIndexRequest(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + [JsonInclude, JsonPropertyName("attributes")] + public ICollection? Attributes { get; set; } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + [JsonInclude, JsonPropertyName("explain")] + public bool? Explain { get; set; } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + + /// + /// Normalizer to use to convert text into a single token. + /// + [JsonInclude, JsonPropertyName("normalizer")] + public string? Normalizer { get; set; } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ [JsonInclude, JsonPropertyName("text")] + [SingleOrManyCollectionConverter(typeof(string))] + public ICollection? Text { get; set; } + + /// + /// Tokenizer to use to convert text into tokens. + /// + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Analysis.ITokenizer? Tokenizer { get; set; } +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequestDescriptor : RequestDescriptor, AnalyzeIndexRequestParameters> +{ + internal AnalyzeIndexRequestDescriptor(Action> configure) => configure.Invoke(this); + + public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + public AnalyzeIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + public AnalyzeIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private string? AnalyzerValue { get; set; } + private ICollection? AttributesValue { get; set; } + private ICollection? CharFilterValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private ICollection? FilterValue { get; set; } + private string? NormalizerValue { get; set; } + private ICollection? TextValue { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ public AnalyzeIndexRequestDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + public AnalyzeIndexRequestDescriptor Attributes(ICollection? attributes) + { + AttributesValue = attributes; + return Self; + } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + public AnalyzeIndexRequestDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + public AnalyzeIndexRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + public AnalyzeIndexRequestDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// Normalizer to use to convert text into a single token. + /// + public AnalyzeIndexRequestDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ public AnalyzeIndexRequestDescriptor Text(ICollection? text) + { + TextValue = text; + return Self; + } + + /// + /// Tokenizer to use to convert text into tokens. + /// + public AnalyzeIndexRequestDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Analysis.ITokenizer? tokenizer) + { + TokenizerValue = tokenizer; + 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 (AttributesValue is not null) + { + writer.WritePropertyName("attributes"); + JsonSerializer.Serialize(writer, AttributesValue, options); + } + + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, 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 (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (TextValue is not null) + { + writer.WritePropertyName("text"); + SingleOrManySerializationHelper.Serialize(TextValue, writer, options); + } + + if (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Performs analysis on a text string and returns the resulting tokens. +/// +public sealed partial class AnalyzeIndexRequestDescriptor : RequestDescriptor +{ + internal AnalyzeIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public AnalyzeIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + + public AnalyzeIndexRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementAnalyze; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.analyze"; + + public AnalyzeIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? index) + { + RouteValues.Optional("index", index); + return Self; + } + + private string? AnalyzerValue { get; set; } + private ICollection? AttributesValue { get; set; } + private ICollection? CharFilterValue { get; set; } + private bool? ExplainValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private ICollection? FilterValue { get; set; } + private string? NormalizerValue { get; set; } + private ICollection? TextValue { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// The name of the analyzer that should be applied to the provided `text`.
This could be a built-in analyzer, or an analyzer that’s been configured in the index.
+ ///
+ public AnalyzeIndexRequestDescriptor Analyzer(string? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + + /// + /// Array of token attributes used to filter the output of the `explain` parameter. + /// + public AnalyzeIndexRequestDescriptor Attributes(ICollection? attributes) + { + AttributesValue = attributes; + return Self; + } + + /// + /// Array of character filters used to preprocess characters before the tokenizer. + /// + public AnalyzeIndexRequestDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// If `true`, the response includes token attributes and additional details. + /// + public AnalyzeIndexRequestDescriptor Explain(bool? explain = true) + { + ExplainValue = explain; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Field used to derive the analyzer.
To use this parameter, you must specify an index.
If specified, the `analyzer` parameter overrides this value.
+ ///
+ public AnalyzeIndexRequestDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Array of token filters used to apply after the tokenizer. + /// + public AnalyzeIndexRequestDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// Normalizer to use to convert text into a single token. + /// + public AnalyzeIndexRequestDescriptor Normalizer(string? normalizer) + { + NormalizerValue = normalizer; + return Self; + } + + /// + /// Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.
+ ///
+ public AnalyzeIndexRequestDescriptor Text(ICollection? text) + { + TextValue = text; + return Self; + } + + /// + /// Tokenizer to use to convert text into tokens. + /// + public AnalyzeIndexRequestDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Analysis.ITokenizer? tokenizer) + { + TokenizerValue = tokenizer; + 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 (AttributesValue is not null) + { + writer.WritePropertyName("attributes"); + JsonSerializer.Serialize(writer, AttributesValue, options); + } + + if (CharFilterValue is not null) + { + writer.WritePropertyName("char_filter"); + JsonSerializer.Serialize(writer, CharFilterValue, 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 (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (!string.IsNullOrEmpty(NormalizerValue)) + { + writer.WritePropertyName("normalizer"); + writer.WriteStringValue(NormalizerValue); + } + + if (TextValue is not null) + { + writer.WritePropertyName("text"); + SingleOrManySerializationHelper.Serialize(TextValue, writer, options); + } + + if (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs new file mode 100644 index 00000000000..13b4f7e9f3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class AnalyzeIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("detail")] + public Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail? Detail { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection? Tokens { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs new file mode 100644 index 00000000000..d56c1df76d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs @@ -0,0 +1,216 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ClearCacheRequestParameters : 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`, clears the fields cache.
Use the `fields` parameter to clear the cache of specific fields only.
+ ///
+ public bool? Fielddata { get => Q("fielddata"); set => Q("fielddata", value); } + + /// + /// Comma-separated list of field names used to limit the `fielddata` parameter. + /// + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", 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`, clears the query cache. + /// + public bool? Query { get => Q("query"); set => Q("query", value); } + + /// + /// If `true`, clears the request cache. + /// + public bool? Request { get => Q("request"); set => Q("request", value); } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequest : PlainRequest +{ + public ClearCacheRequest() + { + } + + public ClearCacheRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + /// + /// 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`, clears the fields cache.
Use the `fields` parameter to clear the cache of specific fields only.
+ ///
+ [JsonIgnore] + public bool? Fielddata { get => Q("fielddata"); set => Q("fielddata", value); } + + /// + /// Comma-separated list of field names used to limit the `fielddata` parameter. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", 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`, clears the query cache. + /// + [JsonIgnore] + public bool? Query { get => Q("query"); set => Q("query", value); } + + /// + /// If `true`, clears the request cache. + /// + [JsonIgnore] + public bool? Request { get => Q("request"); set => Q("request", value); } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor, ClearCacheRequestParameters> +{ + internal ClearCacheRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor Fielddata(bool? fielddata = true) => Qs("fielddata", fielddata); + public ClearCacheRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ClearCacheRequestDescriptor Query(bool? query = true) => Qs("query", query); + public ClearCacheRequestDescriptor Request(bool? request = true) => Qs("request", request); + + public ClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Clears the caches of one or more indices.
For data streams, the API clears the caches of the stream’s backing indices.
+///
+public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor +{ + internal ClearCacheRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor Fielddata(bool? fielddata = true) => Qs("fielddata", fielddata); + public ClearCacheRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ClearCacheRequestDescriptor Query(bool? query = true) => Qs("query", query); + public ClearCacheRequestDescriptor Request(bool? request = true) => Qs("request", request); + + public ClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs new file mode 100644 index 00000000000..e6a477283bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ClearCacheResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs index 0caf160cc82..2b31d2f13c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs @@ -106,10 +106,6 @@ public CloneIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } - internal CloneIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClone; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -134,15 +130,15 @@ public CloneIndexRequestDescriptor Target(Elastic.Clients.Elasticsear return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// Aliases for the resulting index. /// - public CloneIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CloneIndexRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -185,10 +181,6 @@ public CloneIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } - internal CloneIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClone; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -213,15 +205,15 @@ public CloneIndexRequestDescriptor Target(Elastic.Clients.Elasticsearch.Name tar return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// Aliases for the resulting index. /// - public CloneIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CloneIndexRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs index 79804cc6d4f..e4a02be3cea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs index ac5fc2b73cf..a7ff84abcc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs @@ -127,10 +127,6 @@ public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices { } - internal CloseIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,10 +164,6 @@ public CloseIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices { } - internal CloseIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementClose; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs index f1f79fedad8..388a41401eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs index aa3d118a778..7e71b5f4c39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs @@ -62,10 +62,6 @@ public CreateDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.DataStrea { } - internal CreateDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreateDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs index 3df6b64fa9f..2d686c77fde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs index cc91144fb72..c6f6af60431 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -112,14 +112,6 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } - public CreateIndexRequestDescriptor(TDocument document) : this(typeof(TDocument)) - { - } - - internal CreateIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -138,20 +130,20 @@ public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsear return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } /// /// Aliases for the index. /// - public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CreateIndexRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -166,7 +158,7 @@ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elastics return Self; } - public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -174,7 +166,7 @@ public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescr return Self; } - public CreateIndexRequestDescriptor Mappings(Action> configure) + public CreateIndexRequestDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -193,7 +185,7 @@ public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elastics return Self; } - public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -201,7 +193,7 @@ public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor< return Self; } - public CreateIndexRequestDescriptor Settings(Action> configure) + public CreateIndexRequestDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -226,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -242,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -265,10 +257,6 @@ public CreateIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } - internal CreateIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementCreate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -287,20 +275,20 @@ public CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexNam return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } /// /// Aliases for the index. /// - public CreateIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public CreateIndexRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -315,7 +303,7 @@ public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mappi return Self; } - public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public CreateIndexRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -323,7 +311,7 @@ public CreateIndexRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descr return Self; } - public CreateIndexRequestDescriptor Mappings(Action configure) + public CreateIndexRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -342,7 +330,7 @@ public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.Index return Self; } - public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) + public CreateIndexRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -350,7 +338,7 @@ public CreateIndexRequestDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public CreateIndexRequestDescriptor Settings(Action configure) + public CreateIndexRequestDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -375,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -391,7 +379,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs index 37986558ddf..8a847b2e204 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs new file mode 100644 index 00000000000..99ec9c25a51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class DataStreamsStatsRequestParameters : 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); } +} + +/// +/// Retrieves statistics for one or more data streams. +/// +public sealed partial class DataStreamsStatsRequest : PlainRequest +{ + public DataStreamsStatsRequest() + { + } + + public DataStreamsStatsRequest(Elastic.Clients.Elasticsearch.IndexName? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDataStreamsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.data_streams_stats"; + + /// + /// 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); } +} + +/// +/// Retrieves statistics for one or more data streams. +/// +public sealed partial class DataStreamsStatsRequestDescriptor : RequestDescriptor +{ + internal DataStreamsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? name) : base(r => r.Optional("name", name)) + { + } + + public DataStreamsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDataStreamsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.data_streams_stats"; + + public DataStreamsStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + + public DataStreamsStatsRequestDescriptor Name(Elastic.Clients.Elasticsearch.IndexName? 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/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs new file mode 100644 index 00000000000..656df1ad503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class DataStreamsStatsResponse : ElasticsearchResponse +{ + /// + /// Total number of backing indices for the selected data streams. + /// + [JsonInclude, JsonPropertyName("backing_indices")] + public int BackingIndices { get; init; } + + /// + /// Total number of selected data streams. + /// + [JsonInclude, JsonPropertyName("data_stream_count")] + public int DataStreamCount { get; init; } + + /// + /// Contains statistics for the selected data streams. + /// + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } + + /// + /// Contains information about shards that attempted to execute the request. + /// + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + + /// + /// Total size, in bytes, of all shards for the selected data streams. + /// + [JsonInclude, JsonPropertyName("total_store_size_bytes")] + public long TotalStoreSizeBytes { get; init; } + + /// + /// Total size of all shards for the selected data streams.
This property is included only if the `human` query parameter is `true`
+ ///
+ [JsonInclude, JsonPropertyName("total_store_sizes")] + public Elastic.Clients.Elasticsearch.ByteSize? TotalStoreSizes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs index 605d7ca9a60..edec7a5a790 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs @@ -83,10 +83,6 @@ public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indice { } - internal DeleteAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -126,10 +122,6 @@ public DeleteAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indice { } - internal DeleteAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs index 31af3d46f6d..ef28a4af4c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs index 6671e6328ea..038b592ced3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs @@ -94,10 +94,6 @@ public DeleteDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.DataSt { } - internal DeleteDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs index 0937372783b..014b0f5e6fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs index 03884a7b272..5f43cdba501 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs @@ -72,10 +72,6 @@ public DeleteDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.DataStrea { } - internal DeleteDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs index f9c4c59409c..3cc16ad4ed6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs index c86c976b3fe..4e50df8424a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs @@ -116,10 +116,6 @@ public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indice { } - internal DeleteIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -156,10 +152,6 @@ public DeleteIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indice { } - internal DeleteIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDelete; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs index f11cfcb8da2..5307c612903 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,6 +28,9 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class DeleteIndexResponse : 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; } [JsonInclude, JsonPropertyName("_shards")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs index 3ffe4dae0fd..5c56786f72a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -83,10 +83,6 @@ public DeleteIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Names { } - internal DeleteIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs index f618e27479a..b8723fab17e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs index da800c37d7d..97bff0f8601 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs @@ -83,10 +83,6 @@ public DeleteTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) { } - internal DeleteTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDeleteTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs index 98a4929c24d..f0aa7f43904 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs new file mode 100644 index 00000000000..ad8b06e0e61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class DiskUsageRequestParameters : 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`, the API performs a flush before analysis.
If `false`, the response may not include uncommitted data.
+ ///
+ public bool? Flush { get => Q("flush"); set => Q("flush", 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); } + + /// + /// Analyzing field disk usage is resource-intensive.
To use the API, this parameter must be set to `true`.
+ ///
+ public bool? RunExpensiveTasks { get => Q("run_expensive_tasks"); set => Q("run_expensive_tasks", value); } +} + +/// +/// Analyzes the disk usage of each field of an index or data stream. +/// +public sealed partial class DiskUsageRequest : PlainRequest +{ + public DiskUsageRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDiskUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.disk_usage"; + + /// + /// 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`, the API performs a flush before analysis.
If `false`, the response may not include uncommitted data.
+ ///
+ [JsonIgnore] + public bool? Flush { get => Q("flush"); set => Q("flush", 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); } + + /// + /// Analyzing field disk usage is resource-intensive.
To use the API, this parameter must be set to `true`.
+ ///
+ [JsonIgnore] + public bool? RunExpensiveTasks { get => Q("run_expensive_tasks"); set => Q("run_expensive_tasks", value); } +} + +/// +/// Analyzes the disk usage of each field of an index or data stream. +/// +public sealed partial class DiskUsageRequestDescriptor : RequestDescriptor, DiskUsageRequestParameters> +{ + internal DiskUsageRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DiskUsageRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDiskUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.disk_usage"; + + public DiskUsageRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DiskUsageRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DiskUsageRequestDescriptor Flush(bool? flush = true) => Qs("flush", flush); + public DiskUsageRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DiskUsageRequestDescriptor RunExpensiveTasks(bool? runExpensiveTasks = true) => Qs("run_expensive_tasks", runExpensiveTasks); + + public DiskUsageRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Analyzes the disk usage of each field of an index or data stream. +/// +public sealed partial class DiskUsageRequestDescriptor : RequestDescriptor +{ + internal DiskUsageRequestDescriptor(Action configure) => configure.Invoke(this); + + public DiskUsageRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDiskUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.disk_usage"; + + public DiskUsageRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public DiskUsageRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public DiskUsageRequestDescriptor Flush(bool? flush = true) => Qs("flush", flush); + public DiskUsageRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public DiskUsageRequestDescriptor RunExpensiveTasks(bool? runExpensiveTasks = true) => Qs("run_expensive_tasks", runExpensiveTasks); + + public DiskUsageRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs new file mode 100644 index 00000000000..5f5bc40839c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class DiskUsageResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs new file mode 100644 index 00000000000..1013bc89067 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class DownsampleRequestParameters : RequestParameters +{ +} + +/// +/// Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. +/// +public sealed partial class DownsampleRequest : PlainRequest +{ + public DownsampleRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName targetIndex) : base(r => r.Required("index", index).Required("target_index", targetIndex)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDownsample; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.downsample"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig Config { get; set; } +} + +/// +/// Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. +/// +public sealed partial class DownsampleRequestDescriptor : RequestDescriptor, DownsampleRequestParameters> +{ + internal DownsampleRequestDescriptor(Action> configure) => configure.Invoke(this); + public DownsampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName targetIndex) : base(r => r.Required("index", index).Required("target_index", targetIndex)) => ConfigValue = config; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDownsample; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.downsample"; + + public DownsampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + public DownsampleRequestDescriptor TargetIndex(Elastic.Clients.Elasticsearch.IndexName targetIndex) + { + RouteValues.Required("target_index", targetIndex); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + + public DownsampleRequestDescriptor Config(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public DownsampleRequestDescriptor Config(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public DownsampleRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. +/// +public sealed partial class DownsampleRequestDescriptor : RequestDescriptor +{ + internal DownsampleRequestDescriptor(Action configure) => configure.Invoke(this); + public DownsampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName targetIndex) : base(r => r.Required("index", index).Required("target_index", targetIndex)) => ConfigValue = config; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementDownsample; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.downsample"; + + public DownsampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + RouteValues.Required("index", index); + return Self; + } + + public DownsampleRequestDescriptor TargetIndex(Elastic.Clients.Elasticsearch.IndexName targetIndex) + { + RouteValues.Required("target_index", targetIndex); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + + public DownsampleRequestDescriptor Config(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public DownsampleRequestDescriptor Config(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public DownsampleRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + 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/_Generated/Api/IndexManagement/DownsampleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs new file mode 100644 index 00000000000..e348e886329 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class DownsampleResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs index 9d796588826..6defcc04931 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs @@ -105,15 +105,11 @@ public sealed partial class ExistsAliasRequestDescriptor : RequestDes { internal ExistsAliasRequestDescriptor(Action> configure) => configure.Invoke(this); - public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) - { - } - public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names name) : base(r => r.Optional("index", indices).Required("name", name)) { } - internal ExistsAliasRequestDescriptor() + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) { } @@ -130,15 +126,15 @@ internal ExistsAliasRequestDescriptor() 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.Names name) + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Required("name", name); + RouteValues.Optional("index", indices); return Self; } - public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names name) { - RouteValues.Optional("index", indices); + RouteValues.Required("name", name); return Self; } @@ -154,15 +150,11 @@ public sealed partial class ExistsAliasRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) - { - } - public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names name) : base(r => r.Optional("index", indices).Required("name", name)) { } - internal ExistsAliasRequestDescriptor() + public ExistsAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) { } @@ -179,15 +171,15 @@ internal ExistsAliasRequestDescriptor() 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.Names name) + public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Required("name", name); + RouteValues.Optional("index", indices); return Self; } - public ExistsAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public ExistsAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names name) { - RouteValues.Optional("index", indices); + RouteValues.Required("name", name); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs index 8d09788d9ff..b3a7486f58f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs index 06f2f44cd46..88adf29ff4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs @@ -72,10 +72,6 @@ public ExistsIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name n { } - internal ExistsIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs index c3cee009c6e..0ba3b979027 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs index c9f1e12af42..3eb132fb7c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs @@ -127,10 +127,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; @@ -168,10 +164,6 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : { } - internal ExistsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExists; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs index 1dc4064c711..346d0d8ade9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs index 4a631c7cf0c..4fdb47b699b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs @@ -94,10 +94,6 @@ public ExistsTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) { } - internal ExistsTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExistsTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.HEAD; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs index e8b80489f83..20eeab8d7ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,8 +28,4 @@ namespace Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs index 7ef406a100e..52b54f99969 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs @@ -83,10 +83,6 @@ public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Indic { } - internal ExplainDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -120,10 +116,6 @@ public ExplainDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Indic { } - internal ExplainDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementExplainDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs index 2d14309d461..8dfd1f29eeb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs new file mode 100644 index 00000000000..6cffa8ba19b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs @@ -0,0 +1,204 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class FieldUsageStatsRequestParameters : 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); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in the statistics. + /// + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", 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); } + + /// + /// 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.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.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.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Returns field usage information for each shard and field of an index. +/// +public sealed partial class FieldUsageStatsRequest : PlainRequest +{ + public FieldUsageStatsRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementFieldUsageStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.field_usage_stats"; + + /// + /// 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); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in the statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", 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); } + + /// + /// 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.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.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.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } +} + +/// +/// Returns field usage information for each shard and field of an index. +/// +public sealed partial class FieldUsageStatsRequestDescriptor : RequestDescriptor, FieldUsageStatsRequestParameters> +{ + internal FieldUsageStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public FieldUsageStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementFieldUsageStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.field_usage_stats"; + + public FieldUsageStatsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public FieldUsageStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public FieldUsageStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public FieldUsageStatsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public FieldUsageStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public FieldUsageStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public FieldUsageStatsRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public FieldUsageStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns field usage information for each shard and field of an index. +/// +public sealed partial class FieldUsageStatsRequestDescriptor : RequestDescriptor +{ + internal FieldUsageStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public FieldUsageStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementFieldUsageStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.field_usage_stats"; + + public FieldUsageStatsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public FieldUsageStatsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public FieldUsageStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public FieldUsageStatsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public FieldUsageStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public FieldUsageStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public FieldUsageStatsRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public FieldUsageStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs new file mode 100644 index 00000000000..f5e5ded303a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class FieldUsageStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs index c96c20bdb83..2194f089487 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs @@ -116,6 +116,10 @@ public sealed partial class FlushRequestDescriptor : RequestDescripto { internal FlushRequestDescriptor(Action> configure) => configure.Invoke(this); + public FlushRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FlushRequestDescriptor() { } @@ -152,6 +156,10 @@ public sealed partial class FlushRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public FlushRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public FlushRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs index d4a544b5051..9d14dafca8e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs index e1af70b5448..4245584ec42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs @@ -138,6 +138,10 @@ public sealed partial class ForcemergeRequestDescriptor : RequestDesc { internal ForcemergeRequestDescriptor(Action> configure) => configure.Invoke(this); + public ForcemergeRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public ForcemergeRequestDescriptor() { } @@ -176,6 +180,10 @@ public sealed partial class ForcemergeRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public ForcemergeRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public ForcemergeRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs index 7bdc887d19f..d4278ce4438 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs index d136b39b73f..70c3452e508 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs @@ -113,15 +113,11 @@ public sealed partial class GetAliasRequestDescriptor : RequestDescri { internal GetAliasRequestDescriptor(Action> configure) => configure.Invoke(this); - public GetAliasRequestDescriptor() - { - } - public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) { } - public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public GetAliasRequestDescriptor() { } @@ -138,15 +134,15 @@ public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) 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.Names? name) + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Optional("name", name); + RouteValues.Optional("index", indices); return Self; } - public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name) { - RouteValues.Optional("index", indices); + RouteValues.Optional("name", name); return Self; } @@ -162,15 +158,11 @@ public sealed partial class GetAliasRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public GetAliasRequestDescriptor() - { - } - public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) { } - public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public GetAliasRequestDescriptor() { } @@ -187,15 +179,15 @@ public GetAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) 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.Names? name) + public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Optional("name", name); + RouteValues.Optional("index", indices); return Self; } - public GetAliasRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public GetAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name) { - RouteValues.Optional("index", indices); + RouteValues.Optional("name", name); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs index f3728afc512..ecb0b64623b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs @@ -83,10 +83,6 @@ public GetDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.DataStrea { } - internal GetDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs index 2921ab6b516..9fcbcfc0c5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs index 294bc4ad045..8073f2bde00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs @@ -83,6 +83,10 @@ public sealed partial class GetDataStreamRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.DataStreamNames? name) : base(r => r.Optional("name", name)) + { + } + public GetDataStreamRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs index 9e5ef9f88f6..f6c1a882edf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs index 812bb30d32e..b5899de3820 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs @@ -116,15 +116,11 @@ public sealed partial class GetFieldMappingRequestDescriptor : Reques { internal GetFieldMappingRequestDescriptor(Action> configure) => configure.Invoke(this); - public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Required("fields", fields)) - { - } - public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Optional("index", indices).Required("fields", fields)) { } - internal GetFieldMappingRequestDescriptor() + public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Required("fields", fields)) { } @@ -166,15 +162,11 @@ public sealed partial class GetFieldMappingRequestDescriptor : RequestDescriptor { internal GetFieldMappingRequestDescriptor(Action configure) => configure.Invoke(this); - public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Required("fields", fields)) - { - } - public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Optional("index", indices).Required("fields", fields)) { } - internal GetFieldMappingRequestDescriptor() + public GetFieldMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Fields fields) : base(r => r.Required("fields", fields)) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs index c98745fe433..087b6d67d5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs @@ -149,10 +149,6 @@ public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal GetIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -192,10 +188,6 @@ public GetIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal GetIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGet; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs index c47881f28af..f228e56a8fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -105,6 +105,10 @@ public sealed partial class GetIndexTemplateRequestDescriptor : RequestDescripto { internal GetIndexTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public GetIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + public GetIndexTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs index 8a30077c61e..bc57e63ef5e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs new file mode 100644 index 00000000000..02070aa4e22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class GetIndicesSettingsRequestParameters : 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`, 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. 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequest : PlainRequest +{ + public GetIndicesSettingsRequest() + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + /// + /// If `false`, the request returns an error if any wildcard expression, index
alias, or `_all` value targets only missing or closed indices. This
behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index
starts with foo but no index starts with `bar`.
+ ///
+ [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`, 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. 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequestDescriptor : RequestDescriptor, GetIndicesSettingsRequestParameters> +{ + internal GetIndicesSettingsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + public GetIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndicesSettingsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndicesSettingsRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + public GetIndicesSettingsRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name) + { + RouteValues.Optional("name", name); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns setting information for one or more indices. For data streams,
returns setting information for the stream’s backing indices.
+///
+public sealed partial class GetIndicesSettingsRequestDescriptor : RequestDescriptor +{ + internal GetIndicesSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("index", indices).Optional("name", name)) + { + } + + public GetIndicesSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementGetSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_settings"; + + public GetIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public GetIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public GetIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public GetIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetIndicesSettingsRequestDescriptor IncludeDefaults(bool? includeDefaults = true) => Qs("include_defaults", includeDefaults); + public GetIndicesSettingsRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + public GetIndicesSettingsRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs new file mode 100644 index 00000000000..ab6b10aa35e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class GetIndicesSettingsResponse : DictionaryResponse +{ + public GetIndicesSettingsResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetIndicesSettingsResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs index 93c153af3f5..0fd72ff5efb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs @@ -116,6 +116,10 @@ public sealed partial class GetMappingRequestDescriptor : RequestDesc { internal GetMappingRequestDescriptor(Action> configure) => configure.Invoke(this); + public GetMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public GetMappingRequestDescriptor() { } @@ -152,6 +156,10 @@ public sealed partial class GetMappingRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public GetMappingRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs index 134ece5a0b1..34778267083 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs @@ -94,6 +94,10 @@ public sealed partial class GetTemplateRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) + { + } + public GetTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs index ef093af60f8..6e21bd21446 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs @@ -168,15 +168,11 @@ public sealed partial class IndicesStatsRequestDescriptor : RequestDe { internal IndicesStatsRequestDescriptor(Action> configure) => configure.Invoke(this); - public IndicesStatsRequestDescriptor() - { - } - - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) { } - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + public IndicesStatsRequestDescriptor() { } @@ -198,15 +194,15 @@ public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indi public IndicesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); public IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? level) => Qs("level", level); - public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Optional("metric", metric); + RouteValues.Optional("index", indices); return Self; } - public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) { - RouteValues.Optional("index", indices); + RouteValues.Optional("metric", metric); return Self; } @@ -222,15 +218,11 @@ public sealed partial class IndicesStatsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public IndicesStatsRequestDescriptor() - { - } - - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) { } - public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("index", indices).Optional("metric", metric)) + public IndicesStatsRequestDescriptor() { } @@ -252,15 +244,15 @@ public IndicesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indi public IndicesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); public IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? level) => Qs("level", level); - public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { - RouteValues.Optional("metric", metric); + RouteValues.Optional("index", indices); return Self; } - public IndicesStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + public IndicesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) { - RouteValues.Optional("index", indices); + RouteValues.Optional("metric", metric); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs index 53f2fe76f3f..7a78a645850 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs index dd79636690e..59cb8ce63a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs @@ -62,10 +62,6 @@ public MigrateToDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.IndexN { } - internal MigrateToDataStreamRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementMigrateToDataStream; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs index a367af13458..b5c7b91cc7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs new file mode 100644 index 00000000000..f4e6b53c5ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs @@ -0,0 +1,155 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ModifyDataStreamRequestParameters : RequestParameters +{ +} + +/// +/// Performs one or more data stream modification actions in a single atomic operation. +/// +public sealed partial class ModifyDataStreamRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementModifyDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.modify_data_stream"; + + /// + /// Actions to perform. + /// + [JsonInclude, JsonPropertyName("actions")] + public ICollection Actions { get; set; } +} + +/// +/// Performs one or more data stream modification actions in a single atomic operation. +/// +public sealed partial class ModifyDataStreamRequestDescriptor : RequestDescriptor +{ + internal ModifyDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public ModifyDataStreamRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementModifyDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.modify_data_stream"; + + private ICollection ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } + + /// + /// Actions to perform. + /// + public ModifyDataStreamRequestDescriptor Actions(ICollection actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsValue = actions; + return Self; + } + + public ModifyDataStreamRequestDescriptor Actions(Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamActionDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptorActions = null; + ActionsDescriptor = descriptor; + return Self; + } + + public ModifyDataStreamRequestDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorActions = null; + ActionsDescriptorAction = configure; + return Self; + } + + public ModifyDataStreamRequestDescriptor 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamActionDescriptor(ActionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ActionsDescriptorActions is not null) + { + writer.WritePropertyName("actions"); + writer.WriteStartArray(); + foreach (var action in ActionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamActionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs new file mode 100644 index 00000000000..c7e42aec1f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ModifyDataStreamResponse : 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/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs index 561dc424b7c..2bd635d04c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs @@ -127,10 +127,6 @@ public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal OpenIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -168,10 +164,6 @@ public OpenIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) { } - internal OpenIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementOpen; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs index 608a81e0998..bfbbff8b77c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs new file mode 100644 index 00000000000..a89d5cf7089 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class PromoteDataStreamRequestParameters : RequestParameters +{ +} + +/// +/// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream +/// +public sealed partial class PromoteDataStreamRequest : PlainRequest +{ + public PromoteDataStreamRequest(Elastic.Clients.Elasticsearch.IndexName name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPromoteDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.promote_data_stream"; +} + +/// +/// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream +/// +public sealed partial class PromoteDataStreamRequestDescriptor : RequestDescriptor +{ + internal PromoteDataStreamRequestDescriptor(Action configure) => configure.Invoke(this); + + public PromoteDataStreamRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPromoteDataStream; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.promote_data_stream"; + + public PromoteDataStreamRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs new file mode 100644 index 00000000000..de362b627e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class PromoteDataStreamResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs index 3b004fb2a75..07e41492fed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs @@ -113,10 +113,6 @@ public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices, { } - internal PutAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -141,8 +137,8 @@ public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.N } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private bool? IsWriteIndexValue { get; set; } private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } @@ -159,7 +155,7 @@ public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch return Self; } - public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -167,7 +163,7 @@ public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public PutAliasRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -222,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -269,10 +265,6 @@ public PutAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices, { } - internal PutAliasRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutAlias; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -297,8 +289,8 @@ public PutAliasRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private bool? IsWriteIndexValue { get; set; } private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } @@ -315,7 +307,7 @@ public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Q return Self; } - public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public PutAliasRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -323,7 +315,7 @@ public PutAliasRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public PutAliasRequestDescriptor Filter(Action configure) + public PutAliasRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -378,7 +370,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs index 65189177f9d..87b1cc6d102 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs index 7f2f7efea53..2619aa271a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs @@ -106,10 +106,6 @@ public PutDataLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.DataStrea { } - internal PutDataLifecycleRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutDataLifecycle; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -130,8 +126,8 @@ public PutDataLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Data private Elastic.Clients.Elasticsearch.Duration? DataRetentionValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } - private DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } - private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { 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.
@@ -153,7 +149,7 @@ public PutDataLifecycleRequestDescriptor Downsampling(Elastic.Clients.Elasticsea return Self; } - public PutDataLifecycleRequestDescriptor Downsampling(DataStreamLifecycleDownsamplingDescriptor descriptor) + public PutDataLifecycleRequestDescriptor Downsampling(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) { DownsamplingValue = null; DownsamplingDescriptorAction = null; @@ -161,7 +157,7 @@ public PutDataLifecycleRequestDescriptor Downsampling(DataStreamLifecycleDownsam return Self; } - public PutDataLifecycleRequestDescriptor Downsampling(Action configure) + public PutDataLifecycleRequestDescriptor Downsampling(Action configure) { DownsamplingValue = null; DownsamplingDescriptor = null; @@ -186,7 +182,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DownsamplingDescriptorAction is not null) { writer.WritePropertyName("downsampling"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); } else if (DownsamplingValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs index 4d7c8b652cc..c0f909a7717 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs index e1070ed689b..7835c405fe6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -114,10 +114,6 @@ public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name { } - internal PutIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -136,14 +132,14 @@ public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elastic private ICollection? ComposedOfValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } - private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } - private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action> TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -166,7 +162,7 @@ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.E return Self; } - public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -174,7 +170,7 @@ public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibil return Self; } - public PutIndexTemplateRequestDescriptor DataStream(Action configure) + public PutIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -220,7 +216,7 @@ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Ela return Self; } - public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -228,7 +224,7 @@ public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappin return Self; } - public PutIndexTemplateRequestDescriptor Template(Action> configure) + public PutIndexTemplateRequestDescriptor Template(Action> configure) { TemplateValue = null; TemplateDescriptor = null; @@ -262,7 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -296,7 +292,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -304,10 +300,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -325,10 +321,6 @@ public PutIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name { } - internal PutIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -347,14 +339,14 @@ public PutIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name private ICollection? ComposedOfValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } - private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } - private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -377,7 +369,7 @@ public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearc return Self; } - public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public PutIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -385,7 +377,7 @@ public PutIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescript return Self; } - public PutIndexTemplateRequestDescriptor DataStream(Action configure) + public PutIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -431,7 +423,7 @@ public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch. return Self; } - public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public PutIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -439,7 +431,7 @@ public PutIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor return Self; } - public PutIndexTemplateRequestDescriptor Template(Action configure) + public PutIndexTemplateRequestDescriptor Template(Action configure) { TemplateValue = null; TemplateDescriptor = null; @@ -473,7 +465,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -507,7 +499,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -515,10 +507,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs index 7ac4d061975..6e12915ef44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs new file mode 100644 index 00000000000..7a2516f304e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs @@ -0,0 +1,262 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class PutIndicesSettingsRequestParameters : 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`, returns settings in flat format. + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns settings in flat format. + /// + 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If `true`, existing index settings remain unchanged. + /// + public bool? PreserveExisting { get => Q("preserve_existing"); set => Q("preserve_existing", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequest : PlainRequest +{ + public PutIndicesSettingsRequest() + { + } + + public PutIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + /// + /// If `false`, the request returns an error if any wildcard expression, index
alias, or `_all` value targets only missing or closed indices. This
behavior applies even if the request targets other open indices. For
example, a request targeting `foo*,bar*` returns an error if an index
starts with `foo` but no index starts with `bar`.
+ ///
+ [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`, returns settings in flat format. + /// + [JsonIgnore] + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// If `true`, returns settings in flat format. + /// + [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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If `true`, existing index settings remain unchanged. + /// + [JsonIgnore] + public bool? PreserveExisting { get => Q("preserve_existing"); set => Q("preserve_existing", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings Settings { get; set; } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequestDescriptor : RequestDescriptor, PutIndicesSettingsRequestParameters> +{ + internal PutIndicesSettingsRequestDescriptor(Action> configure) => configure.Invoke(this); + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) => SettingsValue = settings; + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings) => SettingsValue = settings; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + public PutIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public PutIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutIndicesSettingsRequestDescriptor PreserveExisting(bool? preserveExisting = true) => Qs("preserve_existing", preserveExisting); + public PutIndicesSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Changes a dynamic index setting in real time. For data streams, index setting
changes are applied to all backing indices by default.
+///
+public sealed partial class PutIndicesSettingsRequestDescriptor : RequestDescriptor +{ + internal PutIndicesSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) => SettingsValue = settings; + public PutIndicesSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings) => SettingsValue = settings; + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.put_settings"; + + public PutIndicesSettingsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutIndicesSettingsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutIndicesSettingsRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public PutIndicesSettingsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public PutIndicesSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutIndicesSettingsRequestDescriptor PreserveExisting(bool? preserveExisting = true) => Qs("preserve_existing", preserveExisting); + public PutIndicesSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutIndicesSettingsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutIndicesSettingsRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs new file mode 100644 index 00000000000..56d556c345d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class PutIndicesSettingsResponse : 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/_Generated/Api/IndexManagement/PutMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs index 201481b71a3..8ba1497b27a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs @@ -137,7 +137,7 @@ public PutMappingRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r /// Specify dynamic templates for the mapping. ///
[JsonInclude, JsonPropertyName("dynamic_templates")] - [SingleOrManyCollectionConverter(typeof(IDictionary))] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] public ICollection>? DynamicTemplates { get; set; } /// @@ -195,10 +195,6 @@ public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices { } - internal PutMappingRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -225,18 +221,18 @@ public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsea private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.RoutingField? RoutingValue { get; set; } - private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary> RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SourceField? SourceValue { get; set; } - private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Controls whether dynamic date detection is enabled. @@ -285,7 +281,7 @@ public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elastic return Self; } - public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -293,7 +289,7 @@ public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesField return Self; } - public PutMappingRequestDescriptor FieldNames(Action configure) + public PutMappingRequestDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -329,23 +325,15 @@ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elastic 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) + public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.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) + public PutMappingRequestDescriptor Properties(Action> configure) { - var descriptor = new Mapping.PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -362,7 +350,7 @@ public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsea return Self; } - public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -370,7 +358,7 @@ public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescri return Self; } - public PutMappingRequestDescriptor Routing(Action configure) + public PutMappingRequestDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -381,9 +369,9 @@ public PutMappingRequestDescriptor Routing(Action /// Mapping of runtime fields for the index. ///
- public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + public PutMappingRequestDescriptor Runtime(Func>, FluentDescriptorDictionary>> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -398,7 +386,7 @@ public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsear return Self; } - public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -406,7 +394,7 @@ public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescript return Self; } - public PutMappingRequestDescriptor Source(Action configure) + public PutMappingRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -449,7 +437,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -483,7 +471,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -505,7 +493,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { @@ -528,10 +516,6 @@ public PutMappingRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices { } - internal PutMappingRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementPutMapping; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -558,18 +542,18 @@ public PutMappingRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.RoutingField? RoutingValue { get; set; } - private Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SourceField? SourceValue { get; set; } - private Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Controls whether dynamic date detection is enabled. @@ -618,7 +602,7 @@ public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapp return Self; } - public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor descriptor) + public PutMappingRequestDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -626,7 +610,7 @@ public PutMappingRequestDescriptor FieldNames(Mapping.FieldNamesFieldDescriptor return Self; } - public PutMappingRequestDescriptor FieldNames(Action configure) + public PutMappingRequestDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -662,23 +646,15 @@ public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp 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) + public PutMappingRequestDescriptor Properties(Elastic.Clients.Elasticsearch.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) + public PutMappingRequestDescriptor Properties(Action> configure) { - var descriptor = new Mapping.PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -695,7 +671,7 @@ public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping return Self; } - public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descriptor) + public PutMappingRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -703,7 +679,7 @@ public PutMappingRequestDescriptor Routing(Mapping.RoutingFieldDescriptor descri return Self; } - public PutMappingRequestDescriptor Routing(Action configure) + public PutMappingRequestDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -714,9 +690,9 @@ public PutMappingRequestDescriptor Routing(Action /// Mapping of runtime fields for the index. ///
- public PutMappingRequestDescriptor Runtime(Func, FluentDictionary> selector) + public PutMappingRequestDescriptor Runtime(Func, FluentDescriptorDictionary> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -731,7 +707,7 @@ public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descriptor) + public PutMappingRequestDescriptor Source(Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -739,7 +715,7 @@ public PutMappingRequestDescriptor Source(Mapping.SourceFieldDescriptor descript return Self; } - public PutMappingRequestDescriptor Source(Action configure) + public PutMappingRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -782,7 +758,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -816,7 +792,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -838,7 +814,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs index 423ac7313cf..db53aeee67d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -27,6 +28,9 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class PutMappingResponse : 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; } [JsonInclude, JsonPropertyName("_shards")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs index 027e1222391..25ba220bd25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -135,15 +135,176 @@ public PutTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r /// /// 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 +public sealed partial class PutTemplateRequestDescriptor : RequestDescriptor, PutTemplateRequestParameters> { - internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + internal PutTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.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.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutTemplateRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private IDictionary> AliasesValue { get; set; } + private ICollection? IndexPatternsValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.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>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.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.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + 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 PutTemplateRequestDescriptor : RequestDescriptor +{ + internal PutTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) { } @@ -166,11 +327,11 @@ public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private ICollection? IndexPatternsValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } @@ -178,9 +339,9 @@ public PutTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name /// /// Aliases for the index. /// - public PutTemplateRequestDescriptor Aliases(Func, FluentDictionary> selector) + public PutTemplateRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -204,7 +365,7 @@ public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mappi return Self; } - public PutTemplateRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public PutTemplateRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -212,7 +373,7 @@ public PutTemplateRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descr return Self; } - public PutTemplateRequestDescriptor Mappings(Action configure) + public PutTemplateRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -271,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -291,10 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs index 00739aff16e..3d866680bdc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs new file mode 100644 index 00000000000..839eb4c1ce4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class RecoveryRequestParameters : RequestParameters +{ + /// + /// If `true`, the response only includes ongoing shard recoveries. + /// + public bool? ActiveOnly { get => Q("active_only"); set => Q("active_only", value); } + + /// + /// If `true`, the response includes detailed information about shard recoveries. + /// + public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequest : PlainRequest +{ + public RecoveryRequest() + { + } + + public RecoveryRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + /// + /// If `true`, the response only includes ongoing shard recoveries. + /// + [JsonIgnore] + public bool? ActiveOnly { get => Q("active_only"); set => Q("active_only", value); } + + /// + /// If `true`, the response includes detailed information about shard recoveries. + /// + [JsonIgnore] + public bool? Detailed { get => Q("detailed"); set => Q("detailed", value); } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequestDescriptor : RequestDescriptor, RecoveryRequestParameters> +{ + internal RecoveryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RecoveryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public RecoveryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + public RecoveryRequestDescriptor ActiveOnly(bool? activeOnly = true) => Qs("active_only", activeOnly); + public RecoveryRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + public RecoveryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns information about ongoing and completed shard recoveries for one or more indices.
For data streams, the API returns information for the stream’s backing indices.
+///
+public sealed partial class RecoveryRequestDescriptor : RequestDescriptor +{ + internal RecoveryRequestDescriptor(Action configure) => configure.Invoke(this); + + public RecoveryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public RecoveryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementRecovery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.recovery"; + + public RecoveryRequestDescriptor ActiveOnly(bool? activeOnly = true) => Qs("active_only", activeOnly); + public RecoveryRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed); + + public RecoveryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/RecoveryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs new file mode 100644 index 00000000000..a072a6f90b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryResponse : DictionaryResponse +{ + public RecoveryResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public RecoveryResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs index 20b10f712d3..41eff24cccd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs @@ -94,6 +94,10 @@ public sealed partial class RefreshRequestDescriptor : RequestDescrip { internal RefreshRequestDescriptor(Action> configure) => configure.Invoke(this); + public RefreshRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RefreshRequestDescriptor() { } @@ -128,6 +132,10 @@ public sealed partial class RefreshRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public RefreshRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RefreshRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs index 25716c86fdf..62e229a3ed0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs new file mode 100644 index 00000000000..5f250b864b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ReloadSearchAnalyzersRequestParameters : 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); } + + /// + /// 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 indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Reloads an index's search analyzers and their resources. +/// +public sealed partial class ReloadSearchAnalyzersRequest : PlainRequest +{ + public ReloadSearchAnalyzersRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementReloadSearchAnalyzers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.reload_search_analyzers"; + + /// + /// 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); } + + /// + /// 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 indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Reloads an index's search analyzers and their resources. +/// +public sealed partial class ReloadSearchAnalyzersRequestDescriptor : RequestDescriptor, ReloadSearchAnalyzersRequestParameters> +{ + internal ReloadSearchAnalyzersRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ReloadSearchAnalyzersRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementReloadSearchAnalyzers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.reload_search_analyzers"; + + public ReloadSearchAnalyzersRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ReloadSearchAnalyzersRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ReloadSearchAnalyzersRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public ReloadSearchAnalyzersRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Reloads an index's search analyzers and their resources. +/// +public sealed partial class ReloadSearchAnalyzersRequestDescriptor : RequestDescriptor +{ + internal ReloadSearchAnalyzersRequestDescriptor(Action configure) => configure.Invoke(this); + + public ReloadSearchAnalyzersRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementReloadSearchAnalyzers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.reload_search_analyzers"; + + public ReloadSearchAnalyzersRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ReloadSearchAnalyzersRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ReloadSearchAnalyzersRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public ReloadSearchAnalyzersRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs new file mode 100644 index 00000000000..63b89ee9ae3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ReloadSearchAnalyzersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("reload_details")] + public IReadOnlyCollection ReloadDetails { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs new file mode 100644 index 00000000000..256d8ae84bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ResolveClusterRequestParameters : 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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. Defaults to false. + /// + 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. Defaults to false. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Resolves the specified index expressions to return information about each cluster, including
the local cluster, if included.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveClusterRequest : PlainRequest +{ + public ResolveClusterRequest(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveCluster; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_cluster"; + + /// + /// 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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. Defaults to false. + /// + [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. Defaults to false. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Resolves the specified index expressions to return information about each cluster, including
the local cluster, if included.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveClusterRequestDescriptor : RequestDescriptor +{ + internal ResolveClusterRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResolveClusterRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveCluster; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_cluster"; + + public ResolveClusterRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ResolveClusterRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ResolveClusterRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled); + public ResolveClusterRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public ResolveClusterRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs new file mode 100644 index 00000000000..6632d166905 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ResolveClusterResponse : DictionaryResponse +{ + public ResolveClusterResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public ResolveClusterResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs new file mode 100644 index 00000000000..cbd3db9fb0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ResolveIndexRequestParameters : RequestParameters +{ + /// + /// 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); } +} + +/// +/// Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveIndexRequest : PlainRequest +{ + public ResolveIndexRequest(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_index"; + + /// + /// 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); } +} + +/// +/// Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams.
Multiple patterns and remote clusters are supported.
+///
+public sealed partial class ResolveIndexRequestDescriptor : RequestDescriptor +{ + internal ResolveIndexRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResolveIndexRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementResolveIndex; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.resolve_index"; + + public ResolveIndexRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + + public ResolveIndexRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs new file mode 100644 index 00000000000..9fa71a9fca0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ResolveIndexResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyCollection Aliases { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs index 8c2f02e4259..e11b0c04754 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -61,7 +61,7 @@ public RolloverRequest(Elastic.Clients.Elasticsearch.IndexAlias alias) : base(r { } - public RolloverRequest(Elastic.Clients.Elasticsearch.IndexAlias alias, Elastic.Clients.Elasticsearch.IndexName? new_index) : base(r => r.Required("alias", alias).Optional("new_index", new_index)) + public RolloverRequest(Elastic.Clients.Elasticsearch.IndexAlias alias, Elastic.Clients.Elasticsearch.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) { } @@ -125,19 +125,187 @@ public RolloverRequest(Elastic.Clients.Elasticsearch.IndexAlias alias, Elastic.C /// /// Creates a new index for a data stream or index alias. /// -public sealed partial class RolloverRequestDescriptor : RequestDescriptor +public sealed partial class RolloverRequestDescriptor : RequestDescriptor, RolloverRequestParameters> { - internal RolloverRequestDescriptor(Action configure) => configure.Invoke(this); + internal RolloverRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias, Elastic.Clients.Elasticsearch.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) + { + } public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias) : base(r => r.Required("alias", alias)) { } - public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias, Elastic.Clients.Elasticsearch.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"; + + public RolloverRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun); + public RolloverRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RolloverRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public RolloverRequestDescriptor WaitForActiveShards(Elastic.Clients.Elasticsearch.WaitForActiveShards? waitForActiveShards) => Qs("wait_for_active_shards", waitForActiveShards); + + public RolloverRequestDescriptor Alias(Elastic.Clients.Elasticsearch.IndexAlias alias) + { + RouteValues.Required("alias", alias); + return Self; + } + + public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.IndexName? newIndex) + { + RouteValues.Optional("new_index", newIndex); + return Self; + } + + private IDictionary> AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.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>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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.IndexManagement.RolloverConditions? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsValue = conditions; + return Self; + } + + public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor descriptor) { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptor = descriptor; + return Self; } - internal RolloverRequestDescriptor() + 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.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.IndexManagement.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 Elastic.Clients.Elasticsearch.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(); + } +} + +/// +/// 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.IndexAlias alias, Elastic.Clients.Elasticsearch.IndexName? newIndex) : base(r => r.Required("alias", alias).Optional("new_index", newIndex)) + { + } + + public RolloverRequestDescriptor(Elastic.Clients.Elasticsearch.IndexAlias alias) : base(r => r.Required("alias", alias)) { } @@ -160,27 +328,27 @@ public RolloverRequestDescriptor Alias(Elastic.Clients.Elasticsearch.IndexAlias return Self; } - public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.IndexName? new_index) + public RolloverRequestDescriptor NewIndex(Elastic.Clients.Elasticsearch.IndexName? newIndex) { - RouteValues.Optional("new_index", new_index); + RouteValues.Optional("new_index", newIndex); return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions? ConditionsValue { get; set; } - private RolloverConditionsDescriptor ConditionsDescriptor { get; set; } - private Action ConditionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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) + public RolloverRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -195,7 +363,7 @@ public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.IndexM return Self; } - public RolloverRequestDescriptor Conditions(RolloverConditionsDescriptor descriptor) + public RolloverRequestDescriptor Conditions(Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor descriptor) { ConditionsValue = null; ConditionsDescriptorAction = null; @@ -203,7 +371,7 @@ public RolloverRequestDescriptor Conditions(RolloverConditionsDescriptor descrip return Self; } - public RolloverRequestDescriptor Conditions(Action configure) + public RolloverRequestDescriptor Conditions(Action configure) { ConditionsValue = null; ConditionsDescriptor = null; @@ -222,7 +390,7 @@ public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public RolloverRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public RolloverRequestDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -230,7 +398,7 @@ public RolloverRequestDescriptor Mappings(Mapping.TypeMappingDescriptor descript return Self; } - public RolloverRequestDescriptor Mappings(Action configure) + public RolloverRequestDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -264,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConditionsDescriptorAction is not null) { writer.WritePropertyName("conditions"); - JsonSerializer.Serialize(writer, new RolloverConditionsDescriptor(ConditionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor(ConditionsDescriptorAction), options); } else if (ConditionsValue is not null) { @@ -280,7 +448,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs index ef11d68a3ba..cf9804a869f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs new file mode 100644 index 00000000000..0040eb05b5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class SegmentsRequestParameters : 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 returns a verbose response. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequest : PlainRequest +{ + public SegmentsRequest() + { + } + + public SegmentsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + /// + /// 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 returns a verbose response. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequestDescriptor : RequestDescriptor, SegmentsRequestParameters> +{ + internal SegmentsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SegmentsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SegmentsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + public SegmentsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SegmentsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SegmentsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SegmentsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SegmentsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns low-level information about the Lucene segments in index shards.
For data streams, the API returns information about the stream’s backing indices.
+///
+public sealed partial class SegmentsRequestDescriptor : RequestDescriptor +{ + internal SegmentsRequestDescriptor(Action configure) => configure.Invoke(this); + + public SegmentsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SegmentsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSegments; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.segments"; + + public SegmentsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public SegmentsRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public SegmentsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SegmentsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public SegmentsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/SegmentsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs new file mode 100644 index 00000000000..eba31e77e85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class SegmentsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyDictionary Indices { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs new file mode 100644 index 00000000000..56fa019cda4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ShardStoresRequestParameters : 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.
+ ///
+ 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); } + + /// + /// List of shard health statuses used to limit the request. + /// + public ICollection? Status { get => Q?>("status"); set => Q("status", value); } +} + +/// +/// Retrieves store information about replica shards in one or more indices.
For data streams, the API retrieves store information for the stream’s backing indices.
+///
+public sealed partial class ShardStoresRequest : PlainRequest +{ + public ShardStoresRequest() + { + } + + public ShardStoresRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementShardStores; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.shard_stores"; + + /// + /// 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.
+ ///
+ [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); } + + /// + /// List of shard health statuses used to limit the request. + /// + [JsonIgnore] + public ICollection? Status { get => Q?>("status"); set => Q("status", value); } +} + +/// +/// Retrieves store information about replica shards in one or more indices.
For data streams, the API retrieves store information for the stream’s backing indices.
+///
+public sealed partial class ShardStoresRequestDescriptor : RequestDescriptor, ShardStoresRequestParameters> +{ + internal ShardStoresRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ShardStoresRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ShardStoresRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementShardStores; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.shard_stores"; + + public ShardStoresRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ShardStoresRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ShardStoresRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ShardStoresRequestDescriptor Status(ICollection? status) => Qs("status", status); + + public ShardStoresRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves store information about replica shards in one or more indices.
For data streams, the API retrieves store information for the stream’s backing indices.
+///
+public sealed partial class ShardStoresRequestDescriptor : RequestDescriptor +{ + internal ShardStoresRequestDescriptor(Action configure) => configure.Invoke(this); + + public ShardStoresRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ShardStoresRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementShardStores; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.shard_stores"; + + public ShardStoresRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ShardStoresRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ShardStoresRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ShardStoresRequestDescriptor Status(ICollection? status) => Qs("status", status); + + public ShardStoresRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs new file mode 100644 index 00000000000..09e274b9898 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardStoresResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("indices")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores))] + public IReadOnlyDictionary Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs index fe401e76994..1712f206011 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs @@ -106,10 +106,6 @@ public ShrinkIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } - internal ShrinkIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementShrink; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -134,15 +130,15 @@ public ShrinkIndexRequestDescriptor Target(Elastic.Clients.Elasticsea return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// The key is the alias name.
Index alias names support date math.
///
- public ShrinkIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public ShrinkIndexRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -185,10 +181,6 @@ public ShrinkIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } - internal ShrinkIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementShrink; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -213,15 +205,15 @@ public ShrinkIndexRequestDescriptor Target(Elastic.Clients.Elasticsearch.IndexNa return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// The key is the alias name.
Index alias names support date math.
///
- public ShrinkIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public ShrinkIndexRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs index 722cb06ef05..5cdc0a85eaf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs index ae647c3f80f..66fda58aec3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -89,7 +89,7 @@ public SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name name) : b /// 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; } + public ICollection? ComposedOf { 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.
@@ -136,10 +136,6 @@ public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name { } - internal SimulateIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -159,16 +155,16 @@ public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.El } private bool? AllowAutoCreateValue { get; set; } - private ICollection? ComposedOfValue { get; set; } + private ICollection? ComposedOfValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } - private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } - private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action> TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -183,7 +179,7 @@ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? a /// /// 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) + public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) { ComposedOfValue = composedOf; return Self; @@ -200,7 +196,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clie return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -208,7 +204,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVi return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -254,7 +250,7 @@ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Client return Self; } - public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -262,7 +258,7 @@ public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateM return Self; } - public SimulateIndexTemplateRequestDescriptor Template(Action> configure) + public SimulateIndexTemplateRequestDescriptor Template(Action> configure) { TemplateValue = null; TemplateDescriptor = null; @@ -302,7 +298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -336,7 +332,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -344,10 +340,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -362,10 +358,6 @@ public SimulateIndexTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name { } - internal SimulateIndexTemplateRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateIndexTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -385,16 +377,16 @@ public SimulateIndexTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch } private bool? AllowAutoCreateValue { get; set; } - private ICollection? ComposedOfValue { get; set; } + private ICollection? ComposedOfValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility? DataStreamValue { get; set; } - private DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } - private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndexPatternsValue { get; set; } private IDictionary? MetaValue { get; set; } private int? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping? TemplateValue { get; set; } - private IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } - private Action TemplateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } private long? VersionValue { get; set; } /// @@ -409,7 +401,7 @@ public SimulateIndexTemplateRequestDescriptor AllowAutoCreate(bool? allowAutoCre /// /// 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) + public SimulateIndexTemplateRequestDescriptor ComposedOf(ICollection? composedOf) { ComposedOfValue = composedOf; return Self; @@ -426,7 +418,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elastic return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor descriptor) { DataStreamValue = null; DataStreamDescriptorAction = null; @@ -434,7 +426,7 @@ public SimulateIndexTemplateRequestDescriptor DataStream(DataStreamVisibilityDes return Self; } - public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) + public SimulateIndexTemplateRequestDescriptor DataStream(Action configure) { DataStreamValue = null; DataStreamDescriptor = null; @@ -480,7 +472,7 @@ public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticse return Self; } - public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescriptor descriptor) + public SimulateIndexTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor descriptor) { TemplateValue = null; TemplateDescriptorAction = null; @@ -488,7 +480,7 @@ public SimulateIndexTemplateRequestDescriptor Template(IndexTemplateMappingDescr return Self; } - public SimulateIndexTemplateRequestDescriptor Template(Action configure) + public SimulateIndexTemplateRequestDescriptor Template(Action configure) { TemplateValue = null; TemplateDescriptor = null; @@ -528,7 +520,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamDescriptorAction is not null) { writer.WritePropertyName("data_stream"); - JsonSerializer.Serialize(writer, new DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor(DataStreamDescriptorAction), options); } else if (DataStreamValue is not null) { @@ -562,7 +554,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TemplateDescriptorAction is not null) { writer.WritePropertyName("template"); - JsonSerializer.Serialize(writer, new IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingDescriptor(TemplateDescriptorAction), options); } else if (TemplateValue is not null) { @@ -570,10 +562,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TemplateValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs index e08148abe69..7637c5aeb9e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs index 92c72c9a886..b8ec9ebc9c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -64,7 +64,7 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base( protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - internal override bool SupportsBody => false; + internal override bool SupportsBody => true; internal override string OperationName => "indices.simulate_template"; @@ -85,6 +85,74 @@ public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base( ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate? Template { get; set; } +} + +/// +/// Returns the index configuration that would be applied by a particular index template. +/// +public sealed partial class SimulateTemplateRequestDescriptor : RequestDescriptor, SimulateTemplateRequestParameters> +{ + internal SimulateTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SimulateTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + + public SimulateTemplateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSimulateTemplate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + 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.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SimulateTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) + { + RouteValues.Optional("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } } /// @@ -94,6 +162,10 @@ public sealed partial class SimulateTemplateRequestDescriptor : RequestDescripto { internal SimulateTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public SimulateTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) + { + } + public SimulateTemplateRequestDescriptor() { } @@ -102,7 +174,7 @@ public SimulateTemplateRequestDescriptor() protected override HttpMethod StaticHttpMethod => HttpMethod.POST; - internal override bool SupportsBody => false; + internal override bool SupportsBody => true; internal override string OperationName => "indices.simulate_template"; @@ -116,6 +188,34 @@ public SimulateTemplateRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name return Self; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SimulateTemplateRequestDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs index c4992934ecc..13d495ed53a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs index f292f1233ad..a48971cb076 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs @@ -106,10 +106,6 @@ public SplitIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } - internal SplitIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSplit; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -134,15 +130,15 @@ public SplitIndexRequestDescriptor Target(Elastic.Clients.Elasticsear return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// Aliases for the resulting index. /// - public SplitIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public SplitIndexRequestDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -185,10 +181,6 @@ public SplitIndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index { } - internal SplitIndexRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementSplit; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -213,15 +205,15 @@ public SplitIndexRequestDescriptor Target(Elastic.Clients.Elasticsearch.IndexNam return Self; } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private IDictionary? SettingsValue { get; set; } /// /// Aliases for the resulting index. /// - public SplitIndexRequestDescriptor Aliases(Func, FluentDictionary> selector) + public SplitIndexRequestDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs index c26b0812690..f029453776f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs index 6f887a9bb25..e87d84b0d43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs @@ -71,7 +71,7 @@ public sealed partial class UpdateAliasesRequest : PlainRequestActions to perform. /// [JsonInclude, JsonPropertyName("actions")] - public ICollection? Actions { get; set; } + public ICollection? Actions { get; set; } } /// @@ -96,15 +96,15 @@ public UpdateAliasesRequestDescriptor() public UpdateAliasesRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); public UpdateAliasesRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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; } + private ICollection? ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor ActionsDescriptor { get; set; } + private Action> ActionsDescriptorAction { get; set; } + private Action>[] ActionsDescriptorActions { get; set; } /// /// Actions to perform. /// - public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) { ActionsDescriptor = null; ActionsDescriptorAction = null; @@ -113,7 +113,7 @@ public UpdateAliasesRequestDescriptor Actions(ICollection Actions(ActionDescriptor descriptor) + public UpdateAliasesRequestDescriptor Actions(Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor descriptor) { ActionsValue = null; ActionsDescriptorAction = null; @@ -122,7 +122,7 @@ public UpdateAliasesRequestDescriptor Actions(ActionDescriptor Actions(Action> configure) + public UpdateAliasesRequestDescriptor Actions(Action> configure) { ActionsValue = null; ActionsDescriptor = null; @@ -131,7 +131,7 @@ public UpdateAliasesRequestDescriptor Actions(Action Actions(params Action>[] configure) + public UpdateAliasesRequestDescriptor Actions(params Action>[] configure) { ActionsValue = null; ActionsDescriptor = null; @@ -154,7 +154,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("actions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor(ActionsDescriptorAction), options); writer.WriteEndArray(); } else if (ActionsDescriptorActions is not null) @@ -163,7 +163,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ActionsDescriptorActions) { - JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor(action), options); } writer.WriteEndArray(); @@ -200,15 +200,15 @@ public UpdateAliasesRequestDescriptor() public UpdateAliasesRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); public UpdateAliasesRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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; } + private ICollection? ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private Action[] ActionsDescriptorActions { get; set; } /// /// Actions to perform. /// - public UpdateAliasesRequestDescriptor Actions(ICollection? actions) + public UpdateAliasesRequestDescriptor Actions(ICollection? actions) { ActionsDescriptor = null; ActionsDescriptorAction = null; @@ -217,7 +217,7 @@ public UpdateAliasesRequestDescriptor Actions(ICollection configure) + public UpdateAliasesRequestDescriptor Actions(Action configure) { ActionsValue = null; ActionsDescriptor = null; @@ -235,7 +235,7 @@ public UpdateAliasesRequestDescriptor Actions(Action configure return Self; } - public UpdateAliasesRequestDescriptor Actions(params Action[] configure) + public UpdateAliasesRequestDescriptor Actions(params Action[] configure) { ActionsValue = null; ActionsDescriptor = null; @@ -258,7 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("actions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ActionDescriptor(ActionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor(ActionsDescriptorAction), options); writer.WriteEndArray(); } else if (ActionsDescriptorActions is not null) @@ -267,7 +267,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ActionsDescriptorActions) { - JsonSerializer.Serialize(writer, new ActionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs index 59d71f7ca15..e0ab1fe35eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs new file mode 100644 index 00000000000..fd9b53415bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public sealed partial class ValidateQueryRequestParameters : 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); } + + /// + /// If `true`, the validation is executed on all shards instead of one random shard per index. + /// + public bool? AllShards { get => Q("all_shards"); set => Q("all_shards", 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. + /// + 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.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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, the response returns detailed information if an error has occurred. + /// + public bool? Explain { get => Q("explain"); set => Q("explain", 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. + /// + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Query in the Lucene query string syntax. + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. + /// + public bool? Rewrite { get => Q("rewrite"); set => Q("rewrite", value); } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequest : PlainRequest +{ + public ValidateQueryRequest() + { + } + + public ValidateQueryRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + /// + /// 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); } + + /// + /// If `true`, the validation is executed on all shards instead of one random shard per index. + /// + [JsonIgnore] + public bool? AllShards { get => Q("all_shards"); set => Q("all_shards", 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. + /// + [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.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`.
Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, the response returns detailed information if an error has occurred. + /// + [JsonIgnore] + public bool? Explain { get => Q("explain"); set => Q("explain", 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. + /// + [JsonIgnore] + public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); } + + /// + /// Query in the Lucene query string syntax. + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. + /// + [JsonIgnore] + public bool? Rewrite { get => Q("rewrite"); set => Q("rewrite", value); } + + /// + /// Query in the Lucene query string syntax. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequestDescriptor : RequestDescriptor, ValidateQueryRequestParameters> +{ + internal ValidateQueryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ValidateQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ValidateQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + public ValidateQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ValidateQueryRequestDescriptor AllShards(bool? allShards = true) => Qs("all_shards", allShards); + public ValidateQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public ValidateQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public ValidateQueryRequestDescriptor Df(string? df) => Qs("df", df); + public ValidateQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ValidateQueryRequestDescriptor Explain(bool? explain = true) => Qs("explain", explain); + public ValidateQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ValidateQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public ValidateQueryRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax); + public ValidateQueryRequestDescriptor Rewrite(bool? rewrite = true) => Qs("rewrite", rewrite); + + public ValidateQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + /// + /// Query in the Lucene query string syntax. + /// + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ValidateQueryRequestDescriptor 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Validates a potentially expensive query without executing it. +/// +public sealed partial class ValidateQueryRequestDescriptor : RequestDescriptor +{ + internal ValidateQueryRequestDescriptor(Action configure) => configure.Invoke(this); + + public ValidateQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ValidateQueryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.IndexManagementValidateQuery; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "indices.validate_query"; + + public ValidateQueryRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ValidateQueryRequestDescriptor AllShards(bool? allShards = true) => Qs("all_shards", allShards); + public ValidateQueryRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer); + public ValidateQueryRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard); + public ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator); + public ValidateQueryRequestDescriptor Df(string? df) => Qs("df", df); + public ValidateQueryRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ValidateQueryRequestDescriptor Explain(bool? explain = true) => Qs("explain", explain); + public ValidateQueryRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public ValidateQueryRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); + public ValidateQueryRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax); + public ValidateQueryRequestDescriptor Rewrite(bool? rewrite = true) => Qs("rewrite", rewrite); + + public ValidateQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + /// + /// Query in the Lucene query string syntax. + /// + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public ValidateQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public ValidateQueryRequestDescriptor 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 Elastic.Clients.Elasticsearch.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/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs new file mode 100644 index 00000000000..90f6de37d06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ValidateQueryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + [JsonInclude, JsonPropertyName("explanations")] + public IReadOnlyCollection? Explanations { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("valid")] + public bool Valid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs index d55dd471c70..943c270409c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs @@ -108,9 +108,6 @@ public IndexRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r internal override string OperationName => "index"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// Only perform the operation if the document has this primary term. /// @@ -176,6 +173,8 @@ public IndexRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r ///
[JsonIgnore] public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } + [JsonIgnore] + public TDocument Document { get; set; } } /// @@ -184,25 +183,17 @@ public IndexRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r public sealed partial class IndexRequestDescriptor : RequestDescriptor, IndexRequestParameters> { internal IndexRequestDescriptor(Action> configure) => configure.Invoke(this); + public IndexRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", index).Optional("id", id)) => DocumentValue = document; - internal IndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", index).Optional("id", id)) + public IndexRequestDescriptor(TDocument document) : this(document, typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)) { } - public IndexRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.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, Elasticsearch.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(TDocument document, Elastic.Clients.Elasticsearch.IndexName index) : this(document, index, Elastic.Clients.Elasticsearch.Id.From(document)) { } - public IndexRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) - { - } - - internal IndexRequestDescriptor() + public IndexRequestDescriptor(TDocument document, Elastic.Clients.Elasticsearch.Id? id) : this(document, typeof(TDocument), id) { } @@ -240,6 +231,12 @@ public IndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ind private TDocument DocumentValue { get; set; } + public IndexRequestDescriptor Document(TDocument document) + { + DocumentValue = document; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { SourceSerialization.Serialize(DocumentValue, writer, settings.SourceSerializer); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs index 25ef9832e8c..455cc3bffd8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelRequest.g.cs new file mode 100644 index 00000000000..32776650fb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Inference; + +public sealed partial class DeleteModelRequestParameters : RequestParameters +{ +} + +/// +/// Delete an inference service model +/// +public sealed partial class DeleteModelRequest : PlainRequest +{ + public DeleteModelRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + public DeleteModelRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceDeleteModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "inference.delete_model"; +} + +/// +/// Delete an inference service model +/// +public sealed partial class DeleteModelRequestDescriptor : RequestDescriptor +{ + internal DeleteModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + public DeleteModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceDeleteModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "inference.delete_model"; + + public DeleteModelRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId) + { + RouteValues.Required("inference_id", inferenceId); + return Self; + } + + public DeleteModelRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + RouteValues.Optional("task_type", taskType); + 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/_Generated/Api/Inference/DeleteModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelResponse.g.cs new file mode 100644 index 00000000000..2cec0ca460c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteModelResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class DeleteModelResponse : 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/_Generated/Api/Inference/GetModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.g.cs new file mode 100644 index 00000000000..12e0b52495a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Inference; + +public sealed partial class GetModelRequestParameters : RequestParameters +{ +} + +/// +/// Get an inference service model +/// +public sealed partial class GetModelRequest : PlainRequest +{ + public GetModelRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + public GetModelRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceGetModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "inference.get_model"; +} + +/// +/// Get an inference service model +/// +public sealed partial class GetModelRequestDescriptor : RequestDescriptor +{ + internal GetModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + public GetModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceGetModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "inference.get_model"; + + public GetModelRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId) + { + RouteValues.Required("inference_id", inferenceId); + return Self; + } + + public GetModelRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + RouteValues.Optional("task_type", taskType); + 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/_Generated/Api/Inference/GetModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelResponse.g.cs new file mode 100644 index 00000000000..d808e8a8e83 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetModelResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class GetModelResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("models")] + public IReadOnlyCollection Models { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs new file mode 100644 index 00000000000..6144812f843 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Inference; + +public sealed partial class InferenceRequestParameters : RequestParameters +{ +} + +/// +/// Perform inference on the service +/// +public sealed partial class InferenceRequest : PlainRequest +{ + public InferenceRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + public InferenceRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceInference; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.inference"; + + /// + /// Text input to the model.
Either a string or an array of strings.
+ ///
+ [JsonInclude, JsonPropertyName("input")] + [SingleOrManyCollectionConverter(typeof(string))] + public ICollection Input { get; set; } + + /// + /// Optional task settings + /// + [JsonInclude, JsonPropertyName("task_settings")] + public object? TaskSettings { get; set; } +} + +/// +/// Perform inference on the service +/// +public sealed partial class InferenceRequestDescriptor : RequestDescriptor +{ + internal InferenceRequestDescriptor(Action configure) => configure.Invoke(this); + + public InferenceRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + public InferenceRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferenceInference; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.inference"; + + public InferenceRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId) + { + RouteValues.Required("inference_id", inferenceId); + return Self; + } + + public InferenceRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + RouteValues.Optional("task_type", taskType); + return Self; + } + + private ICollection InputValue { get; set; } + private object? TaskSettingsValue { get; set; } + + /// + /// Text input to the model.
Either a string or an array of strings.
+ ///
+ public InferenceRequestDescriptor Input(ICollection input) + { + InputValue = input; + return Self; + } + + /// + /// Optional task settings + /// + public InferenceRequestDescriptor TaskSettings(object? taskSettings) + { + TaskSettingsValue = taskSettings; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("input"); + SingleOrManySerializationHelper.Serialize(InputValue, writer, options); + if (TaskSettingsValue is not null) + { + writer.WritePropertyName("task_settings"); + JsonSerializer.Serialize(writer, TaskSettingsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs new file mode 100644 index 00000000000..fb55c4afc55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class InferenceResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelRequest.g.cs new file mode 100644 index 00000000000..412a85e65de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Inference; + +public sealed partial class PutModelRequestParameters : RequestParameters +{ +} + +/// +/// Create an inference service model +/// +public sealed partial class PutModelRequest : PlainRequest +{ + public PutModelRequest(Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) + { + } + + public PutModelRequest(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferencePutModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.put_model"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Inference.ModelConfig ModelConfig { get; set; } +} + +/// +/// Create an inference service model +/// +public sealed partial class PutModelRequestDescriptor : RequestDescriptor +{ + internal PutModelRequestDescriptor(Action configure) => configure.Invoke(this); + public PutModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.ModelConfig modelConfig, Elastic.Clients.Elasticsearch.Inference.TaskType? taskType, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Optional("task_type", taskType).Required("inference_id", inferenceId)) => ModelConfigValue = modelConfig; + public PutModelRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.ModelConfig modelConfig, Elastic.Clients.Elasticsearch.Id inferenceId) : base(r => r.Required("inference_id", inferenceId)) => ModelConfigValue = modelConfig; + + internal override ApiUrls ApiUrls => ApiUrlLookup.InferencePutModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.put_model"; + + public PutModelRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId) + { + RouteValues.Required("inference_id", inferenceId); + return Self; + } + + public PutModelRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskType? taskType) + { + RouteValues.Optional("task_type", taskType); + return Self; + } + + private Elastic.Clients.Elasticsearch.Inference.ModelConfig ModelConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.Inference.ModelConfigDescriptor ModelConfigDescriptor { get; set; } + private Action ModelConfigDescriptorAction { get; set; } + + public PutModelRequestDescriptor ModelConfig(Elastic.Clients.Elasticsearch.Inference.ModelConfig modelConfig) + { + ModelConfigDescriptor = null; + ModelConfigDescriptorAction = null; + ModelConfigValue = modelConfig; + return Self; + } + + public PutModelRequestDescriptor ModelConfig(Elastic.Clients.Elasticsearch.Inference.ModelConfigDescriptor descriptor) + { + ModelConfigValue = null; + ModelConfigDescriptorAction = null; + ModelConfigDescriptor = descriptor; + return Self; + } + + public PutModelRequestDescriptor ModelConfig(Action configure) + { + ModelConfigValue = null; + ModelConfigDescriptor = null; + ModelConfigDescriptorAction = configure; + 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/_Generated/Api/Inference/PutModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelResponse.g.cs new file mode 100644 index 00000000000..68c96463b2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutModelResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public sealed partial class PutModelResponse : ElasticsearchResponse +{ + /// + /// The model Id + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The service type + /// + [JsonInclude, JsonPropertyName("service")] + public string Service { get; init; } + + /// + /// Settings specific to the service + /// + [JsonInclude, JsonPropertyName("service_settings")] + public object ServiceSettings { get; init; } + + /// + /// Task settings specific to the service and model + /// + [JsonInclude, JsonPropertyName("task_settings")] + public object TaskSettings { get; init; } + + /// + /// The model's task type + /// + [JsonInclude, JsonPropertyName("task_type")] + public Elastic.Clients.Elasticsearch.Inference.TaskType TaskType { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs index 91e7726aad7..0558e1d8735 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs index dc020079687..72398cb5ee5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs @@ -83,10 +83,6 @@ public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal DeletePipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -120,10 +116,6 @@ public DeletePipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal DeletePipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestDeletePipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs index 35995ee31d3..96935c5a750 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs index 921948328db..f502707ac22 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -31,7 +32,7 @@ public sealed partial class GeoIpStatsResponse : ElasticsearchResponse /// Downloaded GeoIP2 databases for each node. ///
[JsonInclude, JsonPropertyName("nodes")] - public IReadOnlyDictionary Nodes { get; init; } + public IReadOnlyDictionary Nodes { get; init; } /// /// Download statistics for all GeoIP2 databases. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs index c49c214adcf..8c361a3306d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs @@ -83,6 +83,10 @@ public sealed partial class GetPipelineRequestDescriptor : RequestDes { internal GetPipelineRequestDescriptor(Action> configure) => configure.Invoke(this); + public GetPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public GetPipelineRequestDescriptor() { } @@ -116,6 +120,10 @@ public sealed partial class GetPipelineRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public GetPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public GetPipelineRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs index f08cba75a06..823c43ea0e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs index 0b582088c30..0f8b422897b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs @@ -124,10 +124,6 @@ public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base( { } - internal PutPipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -149,13 +145,13 @@ public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch. private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -188,7 +184,7 @@ public PutPipelineRequestDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PutPipelineRequestDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -197,7 +193,7 @@ public PutPipelineRequestDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public PutPipelineRequestDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -206,7 +202,7 @@ public PutPipelineRequestDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PutPipelineRequestDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -227,7 +223,7 @@ public PutPipelineRequestDescriptor Processors(ICollection Processors(ProcessorDescriptor descriptor) + public PutPipelineRequestDescriptor Processors(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { ProcessorsValue = null; ProcessorsDescriptorAction = null; @@ -236,7 +232,7 @@ public PutPipelineRequestDescriptor Processors(ProcessorDescriptor Processors(Action> configure) + public PutPipelineRequestDescriptor Processors(Action> configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -245,7 +241,7 @@ public PutPipelineRequestDescriptor Processors(Action Processors(params Action>[] configure) + public PutPipelineRequestDescriptor Processors(params Action>[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -289,7 +285,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -298,7 +294,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -320,7 +316,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -329,7 +325,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -340,10 +336,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -361,10 +357,6 @@ public PutPipelineRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base( { } - internal PutPipelineRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.IngestPutPipeline; protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; @@ -386,13 +378,13 @@ public PutPipelineRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -425,7 +417,7 @@ public PutPipelineRequestDescriptor OnFailure(ICollection configure) + public PutPipelineRequestDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -443,7 +435,7 @@ public PutPipelineRequestDescriptor OnFailure(Action config return Self; } - public PutPipelineRequestDescriptor OnFailure(params Action[] configure) + public PutPipelineRequestDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -464,7 +456,7 @@ public PutPipelineRequestDescriptor Processors(ICollection configure) + public PutPipelineRequestDescriptor Processors(Action configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -482,7 +474,7 @@ public PutPipelineRequestDescriptor Processors(Action confi return Self; } - public PutPipelineRequestDescriptor Processors(params Action[] configure) + public PutPipelineRequestDescriptor Processors(params Action[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -526,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -535,7 +527,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -557,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -566,7 +558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -577,10 +569,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs index c2023a0fa75..985e039799a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs index 09b6d31db7e..025c9b805d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -84,6 +84,10 @@ public sealed partial class SimulateRequestDescriptor : RequestDescri { internal SimulateRequestDescriptor(Action> configure) => configure.Invoke(this); + public SimulateRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public SimulateRequestDescriptor() { } @@ -105,12 +109,12 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? } private ICollection? DocsValue { get; set; } - private DocumentDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.Pipeline? PipelineValue { get; set; } - private PipelineDescriptor PipelineDescriptor { get; set; } - private Action> PipelineDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor PipelineDescriptor { get; set; } + private Action> PipelineDescriptorAction { get; set; } /// /// Sample documents to test in the pipeline. @@ -124,7 +128,7 @@ public SimulateRequestDescriptor Docs(ICollection Docs(DocumentDescriptor descriptor) + public SimulateRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -133,7 +137,7 @@ public SimulateRequestDescriptor Docs(DocumentDescriptor descriptor) return Self; } - public SimulateRequestDescriptor Docs(Action configure) + public SimulateRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -142,7 +146,7 @@ public SimulateRequestDescriptor Docs(Action conf return Self; } - public SimulateRequestDescriptor Docs(params Action[] configure) + public SimulateRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -162,7 +166,7 @@ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsear return Self; } - public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor descriptor) { PipelineValue = null; PipelineDescriptorAction = null; @@ -170,7 +174,7 @@ public SimulateRequestDescriptor Pipeline(PipelineDescriptor Pipeline(Action> configure) + public SimulateRequestDescriptor Pipeline(Action> configure) { PipelineValue = null; PipelineDescriptor = null; @@ -192,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -201,7 +205,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor(action), options); } writer.WriteEndArray(); @@ -220,7 +224,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PipelineDescriptorAction is not null) { writer.WritePropertyName("pipeline"); - JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor(PipelineDescriptorAction), options); } else if (PipelineValue is not null) { @@ -239,6 +243,10 @@ public sealed partial class SimulateRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public SimulateRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public SimulateRequestDescriptor() { } @@ -260,12 +268,12 @@ public SimulateRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) } private ICollection? DocsValue { get; set; } - private DocumentDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.Pipeline? PipelineValue { get; set; } - private PipelineDescriptor PipelineDescriptor { get; set; } - private Action PipelineDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor PipelineDescriptor { get; set; } + private Action PipelineDescriptorAction { get; set; } /// /// Sample documents to test in the pipeline. @@ -279,7 +287,7 @@ public SimulateRequestDescriptor Docs(ICollection configure) + public SimulateRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -297,7 +305,7 @@ public SimulateRequestDescriptor Docs(Action configure) return Self; } - public SimulateRequestDescriptor Docs(params Action[] configure) + public SimulateRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -317,7 +325,7 @@ public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.P return Self; } - public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) + public SimulateRequestDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor descriptor) { PipelineValue = null; PipelineDescriptorAction = null; @@ -325,7 +333,7 @@ public SimulateRequestDescriptor Pipeline(PipelineDescriptor descriptor) return Self; } - public SimulateRequestDescriptor Pipeline(Action configure) + public SimulateRequestDescriptor Pipeline(Action configure) { PipelineValue = null; PipelineDescriptor = null; @@ -347,7 +355,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -356,7 +364,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.DocumentDescriptor(action), options); } writer.WriteEndArray(); @@ -375,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PipelineDescriptorAction is not null) { writer.WritePropertyName("pipeline"); - JsonSerializer.Serialize(writer, new PipelineDescriptor(PipelineDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.PipelineDescriptor(PipelineDescriptorAction), options); } else if (PipelineValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs index d0c7fb0f55a..89f21cf9de1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs new file mode 100644 index 00000000000..6d85456825a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class DeleteLicenseRequestParameters : RequestParameters +{ +} + +/// +/// Deletes licensing information for the cluster +/// +public sealed partial class DeleteLicenseRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.delete"; +} + +/// +/// Deletes licensing information for the cluster +/// +public sealed partial class DeleteLicenseRequestDescriptor : RequestDescriptor +{ + internal DeleteLicenseRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteLicenseRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.delete"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs new file mode 100644 index 00000000000..137545b7db4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class DeleteLicenseResponse : 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/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs new file mode 100644 index 00000000000..4fa85de0c69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class GetBasicStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves information about the status of the basic license. +/// +public sealed partial class GetBasicStatusRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGetBasicStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get_basic_status"; +} + +/// +/// Retrieves information about the status of the basic license. +/// +public sealed partial class GetBasicStatusRequestDescriptor : RequestDescriptor +{ + internal GetBasicStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetBasicStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGetBasicStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get_basic_status"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs new file mode 100644 index 00000000000..ec1e0cba8ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class GetBasicStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("eligible_to_start_basic")] + public bool EligibleToStartBasic { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs new file mode 100644 index 00000000000..a9f4deda992 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class GetLicenseRequestParameters : RequestParameters +{ + /// + /// Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. + /// + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// This API returns information about the type of license, when it was issued, and when it expires, for example.
For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
+///
+public sealed partial class GetLicenseRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get"; + + /// + /// Specifies whether to retrieve local information. The default value is `false`, which means the information is retrieved from the master node. + /// + [JsonIgnore] + public bool? Local { get => Q("local"); set => Q("local", value); } +} + +/// +/// This API returns information about the type of license, when it was issued, and when it expires, for example.
For more information about the different types of licenses, see https://www.elastic.co/subscriptions.
+///
+public sealed partial class GetLicenseRequestDescriptor : RequestDescriptor +{ + internal GetLicenseRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetLicenseRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get"; + + public GetLicenseRequestDescriptor Local(bool? local = true) => Qs("local", local); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs new file mode 100644 index 00000000000..fae9931e751 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class GetLicenseResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation License { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs new file mode 100644 index 00000000000..4c2f2611be4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class GetTrialStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves information about the status of the trial license. +/// +public sealed partial class GetTrialStatusRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGetTrialStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get_trial_status"; +} + +/// +/// Retrieves information about the status of the trial license. +/// +public sealed partial class GetTrialStatusRequestDescriptor : RequestDescriptor +{ + internal GetTrialStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTrialStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementGetTrialStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.get_trial_status"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs new file mode 100644 index 00000000000..0fa20962a0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class GetTrialStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("eligible_to_start_trial")] + public bool EligibleToStartTrial { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs new file mode 100644 index 00000000000..7016fb05548 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs @@ -0,0 +1,212 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class PostRequestParameters : RequestParameters +{ + /// + /// Specifies whether you acknowledge the license changes. + /// + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } +} + +/// +/// Updates the license for the cluster. +/// +public sealed partial class PostRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPost; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "license.post"; + + /// + /// Specifies whether you acknowledge the license changes. + /// + [JsonIgnore] + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.LicenseManagement.License? License { get; set; } + + /// + /// A sequence of one or more JSON documents containing the license information. + /// + [JsonInclude, JsonPropertyName("licenses")] + public ICollection? Licenses { get; set; } +} + +/// +/// Updates the license for the cluster. +/// +public sealed partial class PostRequestDescriptor : RequestDescriptor +{ + internal PostRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPost; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "license.post"; + + public PostRequestDescriptor Acknowledge(bool? acknowledge = true) => Qs("acknowledge", acknowledge); + + private Elastic.Clients.Elasticsearch.LicenseManagement.License? LicenseValue { get; set; } + private Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor LicenseDescriptor { get; set; } + private Action LicenseDescriptorAction { get; set; } + private ICollection? LicensesValue { get; set; } + private Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor LicensesDescriptor { get; set; } + private Action LicensesDescriptorAction { get; set; } + private Action[] LicensesDescriptorActions { get; set; } + + public PostRequestDescriptor License(Elastic.Clients.Elasticsearch.LicenseManagement.License? license) + { + LicenseDescriptor = null; + LicenseDescriptorAction = null; + LicenseValue = license; + return Self; + } + + public PostRequestDescriptor License(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor descriptor) + { + LicenseValue = null; + LicenseDescriptorAction = null; + LicenseDescriptor = descriptor; + return Self; + } + + public PostRequestDescriptor License(Action configure) + { + LicenseValue = null; + LicenseDescriptor = null; + LicenseDescriptorAction = configure; + return Self; + } + + /// + /// A sequence of one or more JSON documents containing the license information. + /// + public PostRequestDescriptor Licenses(ICollection? licenses) + { + LicensesDescriptor = null; + LicensesDescriptorAction = null; + LicensesDescriptorActions = null; + LicensesValue = licenses; + return Self; + } + + public PostRequestDescriptor Licenses(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor descriptor) + { + LicensesValue = null; + LicensesDescriptorAction = null; + LicensesDescriptorActions = null; + LicensesDescriptor = descriptor; + return Self; + } + + public PostRequestDescriptor Licenses(Action configure) + { + LicensesValue = null; + LicensesDescriptor = null; + LicensesDescriptorActions = null; + LicensesDescriptorAction = configure; + return Self; + } + + public PostRequestDescriptor Licenses(params Action[] configure) + { + LicensesValue = null; + LicensesDescriptor = null; + LicensesDescriptorAction = null; + LicensesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (LicenseDescriptor is not null) + { + writer.WritePropertyName("license"); + JsonSerializer.Serialize(writer, LicenseDescriptor, options); + } + else if (LicenseDescriptorAction is not null) + { + writer.WritePropertyName("license"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor(LicenseDescriptorAction), options); + } + else if (LicenseValue is not null) + { + writer.WritePropertyName("license"); + JsonSerializer.Serialize(writer, LicenseValue, options); + } + + if (LicensesDescriptor is not null) + { + writer.WritePropertyName("licenses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, LicensesDescriptor, options); + writer.WriteEndArray(); + } + else if (LicensesDescriptorAction is not null) + { + writer.WritePropertyName("licenses"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor(LicensesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (LicensesDescriptorActions is not null) + { + writer.WritePropertyName("licenses"); + writer.WriteStartArray(); + foreach (var action in LicensesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (LicensesValue is not null) + { + writer.WritePropertyName("licenses"); + JsonSerializer.Serialize(writer, LicensesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs new file mode 100644 index 00000000000..1ba8f7e99c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class PostResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledge")] + public Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement? Acknowledge { get; init; } + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("license_status")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus LicenseStatus { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs new file mode 100644 index 00000000000..04cee67761e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class PostStartBasicRequestParameters : RequestParameters +{ + /// + /// whether the user has acknowledged acknowledge messages (default: false) + /// + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } +} + +/// +/// The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.
To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html).
+///
+public sealed partial class PostStartBasicRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPostStartBasic; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.post_start_basic"; + + /// + /// whether the user has acknowledged acknowledge messages (default: false) + /// + [JsonIgnore] + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } +} + +/// +/// The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.
To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html).
+///
+public sealed partial class PostStartBasicRequestDescriptor : RequestDescriptor +{ + internal PostStartBasicRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostStartBasicRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPostStartBasic; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.post_start_basic"; + + public PostStartBasicRequestDescriptor Acknowledge(bool? acknowledge = true) => Qs("acknowledge", acknowledge); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs new file mode 100644 index 00000000000..9d33f61d74b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class PostStartBasicResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledge")] + public IReadOnlyDictionary>>? Acknowledge { get; init; } + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("basic_was_started")] + public bool BasicWasStarted { get; init; } + [JsonInclude, JsonPropertyName("error_message")] + public string? ErrorMessage { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs new file mode 100644 index 00000000000..022a8830690 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.LicenseManagement; + +public sealed partial class PostStartTrialRequestParameters : RequestParameters +{ + /// + /// whether the user has acknowledged acknowledge messages (default: false) + /// + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } + public string? TypeQueryString { get => Q("type_query_string"); set => Q("type_query_string", value); } +} + +/// +/// The start trial API enables you to start a 30-day trial, which gives access to all subscription features. +/// +public sealed partial class PostStartTrialRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPostStartTrial; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.post_start_trial"; + + /// + /// whether the user has acknowledged acknowledge messages (default: false) + /// + [JsonIgnore] + public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } + [JsonIgnore] + public string? TypeQueryString { get => Q("type_query_string"); set => Q("type_query_string", value); } +} + +/// +/// The start trial API enables you to start a 30-day trial, which gives access to all subscription features. +/// +public sealed partial class PostStartTrialRequestDescriptor : RequestDescriptor +{ + internal PostStartTrialRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostStartTrialRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.LicenseManagementPostStartTrial; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "license.post_start_trial"; + + public PostStartTrialRequestDescriptor Acknowledge(bool? acknowledge = true) => Qs("acknowledge", acknowledge); + public PostStartTrialRequestDescriptor TypeQueryString(string? typeQueryString) => Qs("type_query_string", typeQueryString); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs new file mode 100644 index 00000000000..c95c366c974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class PostStartTrialResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("error_message")] + public string? ErrorMessage { get; init; } + [JsonInclude, JsonPropertyName("trial_was_started")] + public bool TrialWasStarted { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs new file mode 100644 index 00000000000..f4143c394b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ClearTrainedModelDeploymentCacheRequestParameters : RequestParameters +{ +} + +/// +/// Clears a trained model deployment cache on all nodes where the trained model is assigned.
A trained model deployment may have an inference cache enabled.
As requests are handled by each allocated node, their responses may be cached on that individual node.
Calling this API clears the caches without restarting the deployment.
+///
+public sealed partial class ClearTrainedModelDeploymentCacheRequest : PlainRequest +{ + public ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.clear_trained_model_deployment_cache"; +} + +/// +/// Clears a trained model deployment cache on all nodes where the trained model is assigned.
A trained model deployment may have an inference cache enabled.
As requests are handled by each allocated node, their responses may be cached on that individual node.
Calling this API clears the caches without restarting the deployment.
+///
+public sealed partial class ClearTrainedModelDeploymentCacheRequestDescriptor : RequestDescriptor +{ + internal ClearTrainedModelDeploymentCacheRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearTrainedModelDeploymentCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.clear_trained_model_deployment_cache"; + + public ClearTrainedModelDeploymentCacheRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs new file mode 100644 index 00000000000..8043e6d4bfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ClearTrainedModelDeploymentCacheResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cleared")] + public bool Cleared { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs new file mode 100644 index 00000000000..f48013e56b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class CloseJobRequestParameters : RequestParameters +{ +} + +/// +/// Closes one or more anomaly detection jobs.
A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.
When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.
If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.
When a datafeed that has a specified end date stops, it automatically closes its associated job.
+///
+public sealed partial class CloseJobRequest : PlainRequest +{ + public CloseJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningCloseJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.close_job"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the descriptiion for the `force` query parameter. + /// + [JsonInclude, JsonPropertyName("force")] + public bool? Force { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Closes one or more anomaly detection jobs.
A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.
When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.
If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.
When a datafeed that has a specified end date stops, it automatically closes its associated job.
+///
+public sealed partial class CloseJobRequestDescriptor : RequestDescriptor +{ + internal CloseJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public CloseJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningCloseJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.close_job"; + + public CloseJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private bool? ForceValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public CloseJobRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the descriptiion for the `force` query parameter. + /// + public CloseJobRequestDescriptor Force(bool? force = true) + { + ForceValue = force; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public CloseJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (ForceValue.HasValue) + { + writer.WritePropertyName("force"); + writer.WriteBooleanValue(ForceValue.Value); + } + + 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/_Generated/Api/MachineLearning/CloseJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs new file mode 100644 index 00000000000..6548e5bf9b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class CloseJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("closed")] + public bool Closed { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs new file mode 100644 index 00000000000..a5daf598486 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteCalendarEventRequestParameters : RequestParameters +{ +} + +/// +/// Deletes scheduled events from a calendar. +/// +public sealed partial class DeleteCalendarEventRequest : PlainRequest +{ + public DeleteCalendarEventRequest(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId) : base(r => r.Required("calendar_id", calendarId).Required("event_id", eventId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarEvent; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_event"; +} + +/// +/// Deletes scheduled events from a calendar. +/// +public sealed partial class DeleteCalendarEventRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarEventRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarEventRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId) : base(r => r.Required("calendar_id", calendarId).Required("event_id", eventId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarEvent; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_event"; + + public DeleteCalendarEventRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public DeleteCalendarEventRequestDescriptor EventId(Elastic.Clients.Elasticsearch.Id eventId) + { + RouteValues.Required("event_id", eventId); + 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/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs new file mode 100644 index 00000000000..a8d36991da3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteCalendarEventResponse : 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/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs new file mode 100644 index 00000000000..281898bc718 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteCalendarJobRequestParameters : RequestParameters +{ +} + +/// +/// Deletes anomaly detection jobs from a calendar. +/// +public sealed partial class DeleteCalendarJobRequest : PlainRequest +{ + public DeleteCalendarJobRequest(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_job"; +} + +/// +/// Deletes anomaly detection jobs from a calendar. +/// +public sealed partial class DeleteCalendarJobRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar_job"; + + public DeleteCalendarJobRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public DeleteCalendarJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Ids jobId) + { + RouteValues.Required("job_id", jobId); + 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/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs new file mode 100644 index 00000000000..0f3e3d32561 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteCalendarJobResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs new file mode 100644 index 00000000000..931621931ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteCalendarRequestParameters : RequestParameters +{ +} + +/// +/// Removes all scheduled events from a calendar, then deletes it. +/// +public sealed partial class DeleteCalendarRequest : PlainRequest +{ + public DeleteCalendarRequest(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar"; +} + +/// +/// Removes all scheduled events from a calendar, then deletes it. +/// +public sealed partial class DeleteCalendarRequestDescriptor : RequestDescriptor +{ + internal DeleteCalendarRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteCalendarRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_calendar"; + + public DeleteCalendarRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + 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/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs new file mode 100644 index 00000000000..758838f8437 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteCalendarResponse : 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/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..3332f0c3adc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// The time to wait for the job to be deleted. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequest : PlainRequest +{ + public DeleteDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + /// + /// If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// The time to wait for the job to be deleted. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequestDescriptor : RequestDescriptor, DeleteDataFrameAnalyticsRequestParameters> +{ + internal DeleteDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + public DeleteDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes a data frame analytics job. +/// +public sealed partial class DeleteDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal DeleteDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_data_frame_analytics"; + + public DeleteDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..b453bd91c0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteDataFrameAnalyticsResponse : 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/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs new file mode 100644 index 00000000000..0649ed439df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteDatafeedRequestParameters : RequestParameters +{ + /// + /// Use to forcefully delete a started datafeed; this method is quicker than
stopping and deleting the datafeed.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing datafeed. +/// +public sealed partial class DeleteDatafeedRequest : PlainRequest +{ + public DeleteDatafeedRequest(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_datafeed"; + + /// + /// Use to forcefully delete a started datafeed; this method is quicker than
stopping and deleting the datafeed.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing datafeed. +/// +public sealed partial class DeleteDatafeedRequestDescriptor : RequestDescriptor +{ + internal DeleteDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_datafeed"; + + public DeleteDatafeedRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public DeleteDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + 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/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs new file mode 100644 index 00000000000..7fe6cb1edb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteDatafeedResponse : 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/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs new file mode 100644 index 00000000000..dcf1dabfeae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteExpiredDataRequestParameters : RequestParameters +{ +} + +/// +/// Deletes expired and unused machine learning data.
Deletes all job results, model snapshots and forecast data that have exceeded
their retention days period. Machine learning state documents that are not
associated with any job are also deleted.
You can limit the request to a single or set of anomaly detection jobs by
using a job identifier, a group name, a comma-separated list of jobs, or a
wildcard expression. You can delete expired data for all anomaly detection
jobs by using _all, by specifying * as the , or by omitting the
.
+///
+public sealed partial class DeleteExpiredDataRequest : PlainRequest +{ + public DeleteExpiredDataRequest() + { + } + + public DeleteExpiredDataRequest(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteExpiredData; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.delete_expired_data"; + + /// + /// The desired requests per second for the deletion processes. The default
behavior is no throttling.
+ ///
+ [JsonInclude, JsonPropertyName("requests_per_second")] + public float? RequestsPerSecond { get; set; } + + /// + /// How long can the underlying delete processes run until they are canceled. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Deletes expired and unused machine learning data.
Deletes all job results, model snapshots and forecast data that have exceeded
their retention days period. Machine learning state documents that are not
associated with any job are also deleted.
You can limit the request to a single or set of anomaly detection jobs by
using a job identifier, a group name, a comma-separated list of jobs, or a
wildcard expression. You can delete expired data for all anomaly detection
jobs by using _all, by specifying * as the , or by omitting the
.
+///
+public sealed partial class DeleteExpiredDataRequestDescriptor : RequestDescriptor +{ + internal DeleteExpiredDataRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteExpiredDataRequestDescriptor(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public DeleteExpiredDataRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteExpiredData; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.delete_expired_data"; + + public DeleteExpiredDataRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + RouteValues.Optional("job_id", jobId); + return Self; + } + + private float? RequestsPerSecondValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// The desired requests per second for the deletion processes. The default
behavior is no throttling.
+ ///
+ public DeleteExpiredDataRequestDescriptor RequestsPerSecond(float? requestsPerSecond) + { + RequestsPerSecondValue = requestsPerSecond; + return Self; + } + + /// + /// How long can the underlying delete processes run until they are canceled. + /// + public DeleteExpiredDataRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RequestsPerSecondValue.HasValue) + { + writer.WritePropertyName("requests_per_second"); + writer.WriteNumberValue(RequestsPerSecondValue.Value); + } + + 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/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs new file mode 100644 index 00000000000..2fa4f758f7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteExpiredDataResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("deleted")] + public bool Deleted { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs new file mode 100644 index 00000000000..b977b7ab8c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteFilterRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a filter.
If an anomaly detection job references the filter, you cannot delete the
filter. You must update or delete the job before you can delete the filter.
+///
+public sealed partial class DeleteFilterRequest : PlainRequest +{ + public DeleteFilterRequest(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_filter"; +} + +/// +/// Deletes a filter.
If an anomaly detection job references the filter, you cannot delete the
filter. You must update or delete the job before you can delete the filter.
+///
+public sealed partial class DeleteFilterRequestDescriptor : RequestDescriptor +{ + internal DeleteFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_filter"; + + public DeleteFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Id filterId) + { + RouteValues.Required("filter_id", filterId); + 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/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs new file mode 100644 index 00000000000..83dfc664923 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteFilterResponse : 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/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs new file mode 100644 index 00000000000..20274253dcf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteForecastRequestParameters : RequestParameters +{ + /// + /// Specifies whether an error occurs when there are no forecasts. In
particular, if this parameter is set to `false` and there are no
forecasts associated with the job, attempts to delete all forecasts
return an error.
+ ///
+ public bool? AllowNoForecasts { get => Q("allow_no_forecasts"); set => Q("allow_no_forecasts", value); } + + /// + /// Specifies the period of time to wait for the completion of the delete
operation. When this period of time elapses, the API fails and returns an
error.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes forecasts from a machine learning job.
By default, forecasts are retained for 14 days. You can specify a
different retention period with the `expires_in` parameter in the forecast
jobs API. The delete forecast API enables you to delete one or more
forecasts before they expire.
+///
+public sealed partial class DeleteForecastRequest : PlainRequest +{ + public DeleteForecastRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + public DeleteForecastRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id? forecastId) : base(r => r.Required("job_id", jobId).Optional("forecast_id", forecastId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_forecast"; + + /// + /// Specifies whether an error occurs when there are no forecasts. In
particular, if this parameter is set to `false` and there are no
forecasts associated with the job, attempts to delete all forecasts
return an error.
+ ///
+ [JsonIgnore] + public bool? AllowNoForecasts { get => Q("allow_no_forecasts"); set => Q("allow_no_forecasts", value); } + + /// + /// Specifies the period of time to wait for the completion of the delete
operation. When this period of time elapses, the API fails and returns an
error.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes forecasts from a machine learning job.
By default, forecasts are retained for 14 days. You can specify a
different retention period with the `expires_in` parameter in the forecast
jobs API. The delete forecast API enables you to delete one or more
forecasts before they expire.
+///
+public sealed partial class DeleteForecastRequestDescriptor : RequestDescriptor +{ + internal DeleteForecastRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id? forecastId) : base(r => r.Required("job_id", jobId).Optional("forecast_id", forecastId)) + { + } + + public DeleteForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_forecast"; + + public DeleteForecastRequestDescriptor AllowNoForecasts(bool? allowNoForecasts = true) => Qs("allow_no_forecasts", allowNoForecasts); + public DeleteForecastRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteForecastRequestDescriptor ForecastId(Elastic.Clients.Elasticsearch.Id? forecastId) + { + RouteValues.Optional("forecast_id", forecastId); + return Self; + } + + public DeleteForecastRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs new file mode 100644 index 00000000000..1f0e8e5cb16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteForecastResponse : 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/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs new file mode 100644 index 00000000000..26ca6bb63a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteJobRequestParameters : RequestParameters +{ + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Use to forcefully delete an opened job; this method is quicker than
closing and deleting the job.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Specifies whether the request should return immediately or wait until the
job deletion completes.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Deletes an anomaly detection job. +/// All job configuration, model state and results are deleted.
It is not currently possible to delete multiple jobs using wildcards or a
comma separated list. If you delete a job that has a datafeed, the request
first tries to delete the datafeed. This behavior is equivalent to calling
the delete datafeed API with the same timeout and force parameters as the
delete job request.
+///
+public sealed partial class DeleteJobRequest : PlainRequest +{ + public DeleteJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_job"; + + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ [JsonIgnore] + public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Use to forcefully delete an opened job; this method is quicker than
closing and deleting the job.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Specifies whether the request should return immediately or wait until the
job deletion completes.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Deletes an anomaly detection job. +/// All job configuration, model state and results are deleted.
It is not currently possible to delete multiple jobs using wildcards or a
comma separated list. If you delete a job that has a datafeed, the request
first tries to delete the datafeed. This behavior is equivalent to calling
the delete datafeed API with the same timeout and force parameters as the
delete job request.
+///
+public sealed partial class DeleteJobRequestDescriptor : RequestDescriptor +{ + internal DeleteJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_job"; + + public DeleteJobRequestDescriptor DeleteUserAnnotations(bool? deleteUserAnnotations = true) => Qs("delete_user_annotations", deleteUserAnnotations); + public DeleteJobRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public DeleteJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs new file mode 100644 index 00000000000..0bc6b3a5475 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteJobResponse : 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/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..ab71fe4a076 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing model snapshot.
You cannot delete the active model snapshot. To delete that snapshot, first
revert to a different one. To identify the active model snapshot, refer to
the `model_snapshot_id` in the results from the get jobs API.
+///
+public sealed partial class DeleteModelSnapshotRequest : PlainRequest +{ + public DeleteModelSnapshotRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_model_snapshot"; +} + +/// +/// Deletes an existing model snapshot.
You cannot delete the active model snapshot. To delete that snapshot, first
revert to a different one. To identify the active model snapshot, refer to
the `model_snapshot_id` in the results from the get jobs API.
+///
+public sealed partial class DeleteModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal DeleteModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_model_snapshot"; + + public DeleteModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public DeleteModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..46319a9c252 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteModelSnapshotResponse : 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/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs new file mode 100644 index 00000000000..d8ecf19812b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteTrainedModelAliasRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a trained model alias.
This API deletes an existing model alias that refers to a trained model. If
the model alias is missing or refers to a model other than the one identified
by the `model_id`, this API returns an error.
+///
+public sealed partial class DeleteTrainedModelAliasRequest : PlainRequest +{ + public DeleteTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model_alias"; +} + +/// +/// Deletes a trained model alias.
This API deletes an existing model alias that refers to a trained model. If
the model alias is missing or refers to a model other than the one identified
by the `model_id`, this API returns an error.
+///
+public sealed partial class DeleteTrainedModelAliasRequestDescriptor : RequestDescriptor +{ + internal DeleteTrainedModelAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTrainedModelAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model_alias"; + + public DeleteTrainedModelAliasRequestDescriptor ModelAlias(Elastic.Clients.Elasticsearch.Name modelAlias) + { + RouteValues.Required("model_alias", modelAlias); + return Self; + } + + public DeleteTrainedModelAliasRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs new file mode 100644 index 00000000000..6bdcaf15fe5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteTrainedModelAliasResponse : 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/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs new file mode 100644 index 00000000000..f804231c394 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class DeleteTrainedModelRequestParameters : RequestParameters +{ + /// + /// Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing trained inference model that is currently not referenced
by an ingest pipeline.
+///
+public sealed partial class DeleteTrainedModelRequest : PlainRequest +{ + public DeleteTrainedModelRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model"; + + /// + /// Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Deletes an existing trained inference model that is currently not referenced
by an ingest pipeline.
+///
+public sealed partial class DeleteTrainedModelRequestDescriptor : RequestDescriptor +{ + internal DeleteTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningDeleteTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.delete_trained_model"; + + public DeleteTrainedModelRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public DeleteTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs new file mode 100644 index 00000000000..eb443b640fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DeleteTrainedModelResponse : 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/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs new file mode 100644 index 00000000000..f7dbbac0e2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class EstimateModelMemoryRequestParameters : RequestParameters +{ +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfig { get; set; } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ [JsonInclude, JsonPropertyName("max_bucket_cardinality")] + public IDictionary? MaxBucketCardinality { get; set; } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ [JsonInclude, JsonPropertyName("overall_cardinality")] + public IDictionary? OverallCardinality { get; set; } +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequestDescriptor : RequestDescriptor, EstimateModelMemoryRequestParameters> +{ + internal EstimateModelMemoryRequestDescriptor(Action> configure) => configure.Invoke(this); + + public EstimateModelMemoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private IDictionary? MaxBucketCardinalityValue { get; set; } + private IDictionary? OverallCardinalityValue { get; set; } + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ public EstimateModelMemoryRequestDescriptor MaxBucketCardinality(Func, FluentDictionary> selector) + { + MaxBucketCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ public EstimateModelMemoryRequestDescriptor OverallCardinality(Func, FluentDictionary> selector) + { + OverallCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (MaxBucketCardinalityValue is not null) + { + writer.WritePropertyName("max_bucket_cardinality"); + JsonSerializer.Serialize(writer, MaxBucketCardinalityValue, options); + } + + if (OverallCardinalityValue is not null) + { + writer.WritePropertyName("overall_cardinality"); + JsonSerializer.Serialize(writer, OverallCardinalityValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Makes an estimation of the memory usage for an anomaly detection job model.
It is based on analysis configuration details for the job and cardinality
estimates for the fields it references.
+///
+public sealed partial class EstimateModelMemoryRequestDescriptor : RequestDescriptor +{ + internal EstimateModelMemoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public EstimateModelMemoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEstimateModelMemory; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.estimate_model_memory"; + + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private IDictionary? MaxBucketCardinalityValue { get; set; } + private IDictionary? OverallCardinalityValue { get; set; } + + /// + /// For a list of the properties that you can specify in the
`analysis_config` component of the body of this API.
+ ///
+ public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public EstimateModelMemoryRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Estimates of the highest cardinality in a single bucket that is observed
for influencer fields over the time period that the job analyzes data.
To produce a good answer, values must be provided for all influencer
fields. Providing values for fields that are not listed as `influencers`
has no effect on the estimation.
+ ///
+ public EstimateModelMemoryRequestDescriptor MaxBucketCardinality(Func, FluentDictionary> selector) + { + MaxBucketCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Estimates of the cardinality that is observed for fields over the whole
time period that the job analyzes data. To produce a good answer, values
must be provided for fields referenced in the `by_field_name`,
`over_field_name` and `partition_field_name` of any detectors. Providing
values for other fields has no effect on the estimation. It can be
omitted from the request if no detectors have a `by_field_name`,
`over_field_name` or `partition_field_name`.
+ ///
+ public EstimateModelMemoryRequestDescriptor OverallCardinality(Func, FluentDictionary> selector) + { + OverallCardinalityValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (MaxBucketCardinalityValue is not null) + { + writer.WritePropertyName("max_bucket_cardinality"); + JsonSerializer.Serialize(writer, MaxBucketCardinalityValue, options); + } + + if (OverallCardinalityValue is not null) + { + writer.WritePropertyName("overall_cardinality"); + JsonSerializer.Serialize(writer, OverallCardinalityValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs new file mode 100644 index 00000000000..c420b7ffc87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class EstimateModelMemoryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("model_memory_estimate")] + public string ModelMemoryEstimate { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs new file mode 100644 index 00000000000..e3450537970 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs @@ -0,0 +1,328 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class EvaluateDataFrameRequestParameters : RequestParameters +{ +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + /// + /// Defines the type of evaluation you want to perform. + /// + [JsonInclude, JsonPropertyName("evaluation")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation Evaluation { get; set; } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName Index { get; set; } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequestDescriptor : RequestDescriptor, EvaluateDataFrameRequestParameters> +{ + internal EvaluateDataFrameRequestDescriptor(Action> configure) => configure.Invoke(this); + + public EvaluateDataFrameRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation EvaluationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor EvaluationDescriptor { get; set; } + private Action> EvaluationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + /// + /// Defines the type of evaluation you want to perform. + /// + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation evaluation) + { + EvaluationDescriptor = null; + EvaluationDescriptorAction = null; + EvaluationValue = evaluation; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor descriptor) + { + EvaluationValue = null; + EvaluationDescriptorAction = null; + EvaluationDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Action> configure) + { + EvaluationValue = null; + EvaluationDescriptor = null; + EvaluationDescriptorAction = configure; + return Self; + } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + public EvaluateDataFrameRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EvaluationDescriptor is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationDescriptor, options); + } + else if (EvaluationDescriptorAction is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor(EvaluationDescriptorAction), options); + } + else + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationValue, options); + } + + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Evaluates the data frame analytics for an annotated index.
The API packages together commonly used evaluation metrics for various types
of machine learning features. This has been designed for use on indexes
created by data frame analytics. Evaluation requires both a ground truth
field and an analytics result field to be present.
+///
+public sealed partial class EvaluateDataFrameRequestDescriptor : RequestDescriptor +{ + internal EvaluateDataFrameRequestDescriptor(Action configure) => configure.Invoke(this); + + public EvaluateDataFrameRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningEvaluateDataFrame; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.evaluate_data_frame"; + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation EvaluationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor EvaluationDescriptor { get; set; } + private Action EvaluationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + /// + /// Defines the type of evaluation you want to perform. + /// + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation evaluation) + { + EvaluationDescriptor = null; + EvaluationDescriptorAction = null; + EvaluationValue = evaluation; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor descriptor) + { + EvaluationValue = null; + EvaluationDescriptorAction = null; + EvaluationDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Evaluation(Action configure) + { + EvaluationValue = null; + EvaluationDescriptor = null; + EvaluationDescriptorAction = configure; + return Self; + } + + /// + /// Defines the `index` in which the evaluation will be performed. + /// + public EvaluateDataFrameRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EvaluateDataFrameRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EvaluationDescriptor is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationDescriptor, options); + } + else if (EvaluationDescriptorAction is not null) + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationDescriptor(EvaluationDescriptorAction), options); + } + else + { + writer.WritePropertyName("evaluation"); + JsonSerializer.Serialize(writer, EvaluationValue, options); + } + + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs new file mode 100644 index 00000000000..8cad649908a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class EvaluateDataFrameResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("classification")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary? Classification { get; init; } + [JsonInclude, JsonPropertyName("outlier_detection")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary? OutlierDetection { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary? Regression { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..26054820e68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,674 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ExplainDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequest : PlainRequest +{ + public ExplainDataFrameAnalyticsRequest() + { + } + + public ExplainDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis? Analysis { get; set; } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination? Dest { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource? Source { get; set; } +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequestDescriptor : RequestDescriptor, ExplainDataFrameAnalyticsRequestParameters> +{ + internal ExplainDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ExplainDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public ExplainDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + public ExplainDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis? AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action> DestDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public ExplainDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Action> configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Explains a data frame analytics config.
This API provides explanations for a data frame analytics config that either
exists already or one that has not been created yet. The following
explanations are provided:
* which fields are included or not in the analysis and why,
* how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.
+///
+public sealed partial class ExplainDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal ExplainDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExplainDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public ExplainDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningExplainDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.explain_data_frame_analytics"; + + public ExplainDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis? AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis? analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specify includes and/or excludes patterns to select which fields will be
included in the analysis. The patterns specified in excludes are applied
last, therefore excludes takes precedence. In other words, if the same
field is specified in both includes and excludes, then the field will not
be included in the analysis.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public ExplainDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration, consisting of index and optionally
results_field (ml by default).
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try to
create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. It requires an
index. Optionally, query and _source may be specified.
+ ///
+ public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public ExplainDataFrameAnalyticsRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else if (AnalysisValue is not null) + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..ad528abbf72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ExplainDataFrameAnalyticsResponse : ElasticsearchResponse +{ + /// + /// An array of objects that explain selection for each field, sorted by the field names. + /// + [JsonInclude, JsonPropertyName("field_selection")] + public IReadOnlyCollection FieldSelection { get; init; } + + /// + /// An array of objects that explain selection for each field, sorted by the field names. + /// + [JsonInclude, JsonPropertyName("memory_estimation")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation MemoryEstimation { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs new file mode 100644 index 00000000000..e809e475d54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class FlushJobRequestParameters : RequestParameters +{ +} + +/// +/// Forces any buffered data to be processed by the job.
The flush jobs API is only applicable when sending data for analysis using
the post data API. Depending on the content of the buffer, then it might
additionally calculate new results. Both flush and close operations are
similar, however the flush is more efficient if you are expecting to send
more data for analysis. When flushing, the job remains open and is available
to continue analyzing data. A close operation additionally prunes and
persists the model state to disk and the job must be opened again before
analyzing further data.
+///
+public sealed partial class FlushJobRequest : PlainRequest +{ + public FlushJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningFlushJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.flush_job"; + + /// + /// Refer to the description for the `advance_time` query parameter. + /// + [JsonInclude, JsonPropertyName("advance_time")] + public DateTimeOffset? AdvanceTime { get; set; } + + /// + /// Refer to the description for the `calc_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("calc_interim")] + public bool? CalcInterim { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `skip_time` query parameter. + /// + [JsonInclude, JsonPropertyName("skip_time")] + public DateTimeOffset? SkipTime { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Forces any buffered data to be processed by the job.
The flush jobs API is only applicable when sending data for analysis using
the post data API. Depending on the content of the buffer, then it might
additionally calculate new results. Both flush and close operations are
similar, however the flush is more efficient if you are expecting to send
more data for analysis. When flushing, the job remains open and is available
to continue analyzing data. A close operation additionally prunes and
persists the model state to disk and the job must be opened again before
analyzing further data.
+///
+public sealed partial class FlushJobRequestDescriptor : RequestDescriptor +{ + internal FlushJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public FlushJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningFlushJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.flush_job"; + + public FlushJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private DateTimeOffset? AdvanceTimeValue { get; set; } + private bool? CalcInterimValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private DateTimeOffset? SkipTimeValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `advance_time` query parameter. + /// + public FlushJobRequestDescriptor AdvanceTime(DateTimeOffset? advanceTime) + { + AdvanceTimeValue = advanceTime; + return Self; + } + + /// + /// Refer to the description for the `calc_interim` query parameter. + /// + public FlushJobRequestDescriptor CalcInterim(bool? calcInterim = true) + { + CalcInterimValue = calcInterim; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public FlushJobRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `skip_time` query parameter. + /// + public FlushJobRequestDescriptor SkipTime(DateTimeOffset? skipTime) + { + SkipTimeValue = skipTime; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public FlushJobRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AdvanceTimeValue is not null) + { + writer.WritePropertyName("advance_time"); + JsonSerializer.Serialize(writer, AdvanceTimeValue, options); + } + + if (CalcInterimValue.HasValue) + { + writer.WritePropertyName("calc_interim"); + writer.WriteBooleanValue(CalcInterimValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (SkipTimeValue is not null) + { + writer.WritePropertyName("skip_time"); + JsonSerializer.Serialize(writer, SkipTimeValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs new file mode 100644 index 00000000000..15b7c579122 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class FlushJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("flushed")] + public bool Flushed { get; init; } + + /// + /// Provides the timestamp (in milliseconds since the epoch) of the end of
the last bucket that was processed.
+ ///
+ [JsonInclude, JsonPropertyName("last_finalized_bucket_end")] + public int? LastFinalizedBucketEnd { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs new file mode 100644 index 00000000000..2096e1459af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ForecastRequestParameters : RequestParameters +{ +} + +/// +/// Predicts the future behavior of a time series by using its historical
behavior.
+/// Forecasts are not supported for jobs that perform population analysis; an
error occurs if you try to create a forecast for a job that has an
`over_field_name` in its configuration.
+///
+public sealed partial class ForecastRequest : PlainRequest +{ + public ForecastRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.forecast"; + + /// + /// Refer to the description for the `duration` query parameter. + /// + [JsonInclude, JsonPropertyName("duration")] + public Elastic.Clients.Elasticsearch.Duration? Duration { get; set; } + + /// + /// Refer to the description for the `expires_in` query parameter. + /// + [JsonInclude, JsonPropertyName("expires_in")] + public Elastic.Clients.Elasticsearch.Duration? ExpiresIn { get; set; } + + /// + /// Refer to the description for the `max_model_memory` query parameter. + /// + [JsonInclude, JsonPropertyName("max_model_memory")] + public string? MaxModelMemory { get; set; } +} + +/// +/// Predicts the future behavior of a time series by using its historical
behavior.
+/// Forecasts are not supported for jobs that perform population analysis; an
error occurs if you try to create a forecast for a job that has an
`over_field_name` in its configuration.
+///
+public sealed partial class ForecastRequestDescriptor : RequestDescriptor +{ + internal ForecastRequestDescriptor(Action configure) => configure.Invoke(this); + + public ForecastRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningForecast; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.forecast"; + + public ForecastRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Duration? DurationValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ExpiresInValue { get; set; } + private string? MaxModelMemoryValue { get; set; } + + /// + /// Refer to the description for the `duration` query parameter. + /// + public ForecastRequestDescriptor Duration(Elastic.Clients.Elasticsearch.Duration? duration) + { + DurationValue = duration; + return Self; + } + + /// + /// Refer to the description for the `expires_in` query parameter. + /// + public ForecastRequestDescriptor ExpiresIn(Elastic.Clients.Elasticsearch.Duration? expiresIn) + { + ExpiresInValue = expiresIn; + return Self; + } + + /// + /// Refer to the description for the `max_model_memory` query parameter. + /// + public ForecastRequestDescriptor MaxModelMemory(string? maxModelMemory) + { + MaxModelMemoryValue = maxModelMemory; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DurationValue is not null) + { + writer.WritePropertyName("duration"); + JsonSerializer.Serialize(writer, DurationValue, options); + } + + if (ExpiresInValue is not null) + { + writer.WritePropertyName("expires_in"); + JsonSerializer.Serialize(writer, ExpiresInValue, options); + } + + if (!string.IsNullOrEmpty(MaxModelMemoryValue)) + { + writer.WritePropertyName("max_model_memory"); + writer.WriteStringValue(MaxModelMemoryValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs new file mode 100644 index 00000000000..90c4b0f3cb0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ForecastResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("forecast_id")] + public string ForecastId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs new file mode 100644 index 00000000000..eabf6d5c27e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs @@ -0,0 +1,559 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetBucketsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of buckets. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of buckets to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequest : PlainRequest +{ + public GetBucketsRequest(Elastic.Clients.Elasticsearch.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + /// + /// Skips the specified number of buckets. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of buckets to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + [JsonInclude, JsonPropertyName("anomaly_score")] + public double? AnomalyScore { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + + /// + /// Refer to the description for the `expand` query parameter. + /// + [JsonInclude, JsonPropertyName("expand")] + public bool? Expand { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequestDescriptor : RequestDescriptor, GetBucketsRequestParameters> +{ + internal GetBucketsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + public GetBucketsRequestDescriptor From(int? from) => Qs("from", from); + public GetBucketsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetBucketsRequestDescriptor Timestamp(DateTimeOffset? timestamp) + { + RouteValues.Optional("timestamp", timestamp); + return Self; + } + + private double? AnomalyScoreValue { get; set; } + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + public GetBucketsRequestDescriptor AnomalyScore(double? anomalyScore) + { + AnomalyScoreValue = anomalyScore; + return Self; + } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetBucketsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `expand` query parameter. + /// + public GetBucketsRequestDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetBucketsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnomalyScoreValue.HasValue) + { + writer.WritePropertyName("anomaly_score"); + writer.WriteNumberValue(AnomalyScoreValue.Value); + } + + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly detection job results for one or more buckets.
The API presents a chronological view of the records, grouped by bucket.
+///
+public sealed partial class GetBucketsRequestDescriptor : RequestDescriptor +{ + internal GetBucketsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, DateTimeOffset? timestamp) : base(r => r.Required("job_id", jobId).Optional("timestamp", timestamp)) + { + } + + public GetBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_buckets"; + + public GetBucketsRequestDescriptor From(int? from) => Qs("from", from); + public GetBucketsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetBucketsRequestDescriptor Timestamp(DateTimeOffset? timestamp) + { + RouteValues.Optional("timestamp", timestamp); + return Self; + } + + private double? AnomalyScoreValue { get; set; } + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private bool? ExpandValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `anomaly_score` query parameter. + /// + public GetBucketsRequestDescriptor AnomalyScore(double? anomalyScore) + { + AnomalyScoreValue = anomalyScore; + return Self; + } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetBucketsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `expand` query parameter. + /// + public GetBucketsRequestDescriptor Expand(bool? expand = true) + { + ExpandValue = expand; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetBucketsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetBucketsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the desription for the `sort` query parameter. + /// + public GetBucketsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnomalyScoreValue.HasValue) + { + writer.WritePropertyName("anomaly_score"); + writer.WriteNumberValue(AnomalyScoreValue.Value); + } + + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (ExpandValue.HasValue) + { + writer.WritePropertyName("expand"); + writer.WriteBooleanValue(ExpandValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs new file mode 100644 index 00000000000..a4c60815b86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetBucketsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("buckets")] + public IReadOnlyCollection Buckets { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs new file mode 100644 index 00000000000..7603b8839e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetCalendarEventsRequestParameters : RequestParameters +{ + /// + /// Specifies to get events with timestamps earlier than this time. + /// + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// Skips the specified number of events. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of `_all` or `*`. + /// + public Elastic.Clients.Elasticsearch.Id? JobId { get => Q("job_id"); set => Q("job_id", value); } + + /// + /// Specifies the maximum number of events to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies to get events with timestamps after this time. + /// + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves information about the scheduled events in calendars. +/// +public sealed partial class GetCalendarEventsRequest : PlainRequest +{ + public GetCalendarEventsRequest(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_calendar_events"; + + /// + /// Specifies to get events with timestamps earlier than this time. + /// + [JsonIgnore] + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// Skips the specified number of events. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of `_all` or `*`. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Id? JobId { get => Q("job_id"); set => Q("job_id", value); } + + /// + /// Specifies the maximum number of events to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies to get events with timestamps after this time. + /// + [JsonIgnore] + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves information about the scheduled events in calendars. +/// +public sealed partial class GetCalendarEventsRequestDescriptor : RequestDescriptor +{ + internal GetCalendarEventsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCalendarEventsRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_calendar_events"; + + public GetCalendarEventsRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetCalendarEventsRequestDescriptor From(int? from) => Qs("from", from); + public GetCalendarEventsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) => Qs("job_id", jobId); + public GetCalendarEventsRequestDescriptor Size(int? size) => Qs("size", size); + public GetCalendarEventsRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetCalendarEventsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + 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/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs new file mode 100644 index 00000000000..a8e698977df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetCalendarEventsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("events")] + public IReadOnlyCollection Events { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs new file mode 100644 index 00000000000..cdd39f489e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetCalendarsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for calendars. +/// +public sealed partial class GetCalendarsRequest : PlainRequest +{ + public GetCalendarsRequest() + { + } + + public GetCalendarsRequest(Elastic.Clients.Elasticsearch.Id? calendarId) : base(r => r.Optional("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendars; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_calendars"; + + /// + /// Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// This object is supported only when you omit the calendar identifier. + /// + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves configuration information for calendars. +/// +public sealed partial class GetCalendarsRequestDescriptor : RequestDescriptor +{ + internal GetCalendarsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCalendarsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? calendarId) : base(r => r.Optional("calendar_id", calendarId)) + { + } + + public GetCalendarsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCalendars; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_calendars"; + + public GetCalendarsRequestDescriptor From(int? from) => Qs("from", from); + public GetCalendarsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetCalendarsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id? calendarId) + { + RouteValues.Optional("calendar_id", calendarId); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// This object is supported only when you omit the calendar identifier. + /// + public GetCalendarsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetCalendarsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetCalendarsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs new file mode 100644 index 00000000000..4b098d1cd30 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetCalendarsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("calendars")] + public IReadOnlyCollection Calendars { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs new file mode 100644 index 00000000000..bca475cdf32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetCategoriesRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of categories. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Only return categories for the specified partition. + /// + public string? PartitionFieldValue { get => Q("partition_field_value"); set => Q("partition_field_value", value); } + + /// + /// Specifies the maximum number of categories to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more categories. +/// +public sealed partial class GetCategoriesRequest : PlainRequest +{ + public GetCategoriesRequest(Elastic.Clients.Elasticsearch.Id jobId, string? categoryId) : base(r => r.Required("job_id", jobId).Optional("category_id", categoryId)) + { + } + + public GetCategoriesRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCategories; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_categories"; + + /// + /// Skips the specified number of categories. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Only return categories for the specified partition. + /// + [JsonIgnore] + public string? PartitionFieldValue { get => Q("partition_field_value"); set => Q("partition_field_value", value); } + + /// + /// Specifies the maximum number of categories to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more categories. +/// +public sealed partial class GetCategoriesRequestDescriptor : RequestDescriptor +{ + internal GetCategoriesRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetCategoriesRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, string? categoryId) : base(r => r.Required("job_id", jobId).Optional("category_id", categoryId)) + { + } + + public GetCategoriesRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetCategories; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_categories"; + + public GetCategoriesRequestDescriptor From(int? from) => Qs("from", from); + public GetCategoriesRequestDescriptor PartitionFieldValue(string? partitionFieldValue) => Qs("partition_field_value", partitionFieldValue); + public GetCategoriesRequestDescriptor Size(int? size) => Qs("size", size); + + public GetCategoriesRequestDescriptor CategoryId(string? categoryId) + { + RouteValues.Optional("category_id", categoryId); + return Self; + } + + public GetCategoriesRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetCategoriesRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetCategoriesRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetCategoriesRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs new file mode 100644 index 00000000000..0a9fef54aeb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetCategoriesResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("categories")] + public IReadOnlyCollection Categories { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..42d81e508d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequest : PlainRequest +{ + public GetDataFrameAnalyticsRequest() + { + } + + public GetDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequestDescriptor : RequestDescriptor, GetDataFrameAnalyticsRequestParameters> +{ + internal GetDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + public GetDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetDataFrameAnalyticsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves configuration information for data frame analytics jobs.
You can get information for multiple data frame analytics jobs in a single
API request by using a comma-separated list of data frame analytics jobs or a
wildcard expression.
+///
+public sealed partial class GetDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal GetDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics"; + + public GetDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetDataFrameAnalyticsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..060a4e1ff7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of data frame analytics job resources, which are sorted by the id value in ascending order. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public IReadOnlyCollection DataFrameAnalytics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs new file mode 100644 index 00000000000..89d1fe9a70a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Defines whether the stats response should be verbose. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequest : PlainRequest +{ + public GetDataFrameAnalyticsStatsRequest() + { + } + + public GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value returns an empty data_frame_analytics array when there
are no matches and the subset of results when there are partial matches.
If this parameter is `false`, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of data frame analytics jobs. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of data frame analytics jobs to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Defines whether the stats response should be verbose. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequestDescriptor : RequestDescriptor, GetDataFrameAnalyticsStatsRequestParameters> +{ + internal GetDataFrameAnalyticsStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + public GetDataFrameAnalyticsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsStatsRequestDescriptor Size(int? size) => Qs("size", size); + public GetDataFrameAnalyticsStatsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetDataFrameAnalyticsStatsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves usage information for data frame analytics jobs. +/// +public sealed partial class GetDataFrameAnalyticsStatsRequestDescriptor : RequestDescriptor +{ + internal GetDataFrameAnalyticsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDataFrameAnalyticsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetDataFrameAnalyticsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDataFrameAnalyticsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_data_frame_analytics_stats"; + + public GetDataFrameAnalyticsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDataFrameAnalyticsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetDataFrameAnalyticsStatsRequestDescriptor Size(int? size) => Qs("size", size); + public GetDataFrameAnalyticsStatsRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetDataFrameAnalyticsStatsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs new file mode 100644 index 00000000000..2c0ec5bd968 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetDataFrameAnalyticsStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// An array of objects that contain usage information for data frame analytics jobs, which are sorted by the id value in ascending order. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public IReadOnlyCollection DataFrameAnalytics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs new file mode 100644 index 00000000000..39f0a1089c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetDatafeedStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for datafeeds.
You can get statistics for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get statistics for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``. If the datafeed is stopped, the
only information you receive is the `datafeed_id` and the `state`.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedStatsRequest : PlainRequest +{ + public GetDatafeedStatsRequest() + { + } + + public GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeedStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeed_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for datafeeds.
You can get statistics for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get statistics for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``. If the datafeed is stopped, the
only information you receive is the `datafeed_id` and the `state`.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedStatsRequestDescriptor : RequestDescriptor +{ + internal GetDatafeedStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDatafeedStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + public GetDatafeedStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeedStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeed_stats"; + + public GetDatafeedStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetDatafeedStatsRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Ids? datafeedId) + { + RouteValues.Optional("datafeed_id", datafeedId); + 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/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs new file mode 100644 index 00000000000..5b5b708f0f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetDatafeedStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyCollection Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs new file mode 100644 index 00000000000..51a7015c73d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetDatafeedsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for datafeeds.
You can get information for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get information for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedsRequest : PlainRequest +{ + public GetDatafeedsRequest() + { + } + + public GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeeds"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no datafeeds that match.
2. Contains the `_all` string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `datafeeds` array
when there are no matches and the subset of results when there are
partial matches. If this parameter is `false`, the request returns a
`404` status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for datafeeds.
You can get information for multiple datafeeds in a single API request by
using a comma-separated list of datafeeds or a wildcard expression. You can
get information for all datafeeds by using `_all`, by specifying `*` as the
``, or by omitting the ``.
This API returns a maximum of 10,000 datafeeds.
+///
+public sealed partial class GetDatafeedsRequestDescriptor : RequestDescriptor +{ + internal GetDatafeedsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetDatafeedsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) + { + } + + public GetDatafeedsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetDatafeeds; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_datafeeds"; + + public GetDatafeedsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetDatafeedsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + + public GetDatafeedsRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Ids? datafeedId) + { + RouteValues.Optional("datafeed_id", datafeedId); + 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/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs new file mode 100644 index 00000000000..080ae74ef84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetDatafeedsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyCollection Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs new file mode 100644 index 00000000000..89bcf0782b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetFiltersRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of filters. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of filters to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves filters.
You can get a single filter or all filters.
+///
+public sealed partial class GetFiltersRequest : PlainRequest +{ + public GetFiltersRequest() + { + } + + public GetFiltersRequest(Elastic.Clients.Elasticsearch.Ids? filterId) : base(r => r.Optional("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetFilters; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_filters"; + + /// + /// Skips the specified number of filters. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of filters to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves filters.
You can get a single filter or all filters.
+///
+public sealed partial class GetFiltersRequestDescriptor : RequestDescriptor +{ + internal GetFiltersRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetFiltersRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? filterId) : base(r => r.Optional("filter_id", filterId)) + { + } + + public GetFiltersRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetFilters; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_filters"; + + public GetFiltersRequestDescriptor From(int? from) => Qs("from", from); + public GetFiltersRequestDescriptor Size(int? size) => Qs("size", size); + + public GetFiltersRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Ids? filterId) + { + RouteValues.Optional("filter_id", filterId); + 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/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs new file mode 100644 index 00000000000..e7c60c8592c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetFiltersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("filters")] + public IReadOnlyCollection Filters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs new file mode 100644 index 00000000000..10ed37283b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs @@ -0,0 +1,321 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetInfluencersRequestParameters : RequestParameters +{ + /// + /// If true, the results are sorted in descending order. + /// + public bool? Desc { get => Q("desc"); set => Q("desc", value); } + + /// + /// Returns influencers with timestamps earlier than this time.
The default value means it is unset and results are not limited to
specific timestamps.
+ ///
+ public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// If true, the output excludes interim results. By default, interim results
are included.
+ ///
+ public bool? ExcludeInterim { get => Q("exclude_interim"); set => Q("exclude_interim", value); } + + /// + /// Skips the specified number of influencers. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Returns influencers with anomaly scores greater than or equal to this
value.
+ ///
+ public double? InfluencerScore { get => Q("influencer_score"); set => Q("influencer_score", value); } + + /// + /// Specifies the maximum number of influencers to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies the sort field for the requested influencers. By default, the
influencers are sorted by the `influencer_score` value.
+ ///
+ public Elastic.Clients.Elasticsearch.Field? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Returns influencers with timestamps after this time. The default value
means it is unset and results are not limited to specific timestamps.
+ ///
+ public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequest : PlainRequest +{ + public GetInfluencersRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + /// + /// If true, the results are sorted in descending order. + /// + [JsonIgnore] + public bool? Desc { get => Q("desc"); set => Q("desc", value); } + + /// + /// Returns influencers with timestamps earlier than this time.
The default value means it is unset and results are not limited to
specific timestamps.
+ ///
+ [JsonIgnore] + public DateTimeOffset? End { get => Q("end"); set => Q("end", value); } + + /// + /// If true, the output excludes interim results. By default, interim results
are included.
+ ///
+ [JsonIgnore] + public bool? ExcludeInterim { get => Q("exclude_interim"); set => Q("exclude_interim", value); } + + /// + /// Skips the specified number of influencers. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Returns influencers with anomaly scores greater than or equal to this
value.
+ ///
+ [JsonIgnore] + public double? InfluencerScore { get => Q("influencer_score"); set => Q("influencer_score", value); } + + /// + /// Specifies the maximum number of influencers to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Specifies the sort field for the requested influencers. By default, the
influencers are sorted by the `influencer_score` value.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Field? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Returns influencers with timestamps after this time. The default value
means it is unset and results are not limited to specific timestamps.
+ ///
+ [JsonIgnore] + public DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequestDescriptor : RequestDescriptor, GetInfluencersRequestParameters> +{ + internal GetInfluencersRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetInfluencersRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + public GetInfluencersRequestDescriptor Desc(bool? desc = true) => Qs("desc", desc); + public GetInfluencersRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetInfluencersRequestDescriptor ExcludeInterim(bool? excludeInterim = true) => Qs("exclude_interim", excludeInterim); + public GetInfluencersRequestDescriptor From(int? from) => Qs("from", from); + public GetInfluencersRequestDescriptor InfluencerScore(double? influencerScore) => Qs("influencer_score", influencerScore); + public GetInfluencersRequestDescriptor Size(int? size) => Qs("size", size); + public GetInfluencersRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) => Qs("sort", sort); + public GetInfluencersRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetInfluencersRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly detection job results for one or more influencers.
Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
`influencer_field_name` is specified in the job configuration.
+///
+public sealed partial class GetInfluencersRequestDescriptor : RequestDescriptor +{ + internal GetInfluencersRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetInfluencersRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetInfluencers; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_influencers"; + + public GetInfluencersRequestDescriptor Desc(bool? desc = true) => Qs("desc", desc); + public GetInfluencersRequestDescriptor End(DateTimeOffset? end) => Qs("end", end); + public GetInfluencersRequestDescriptor ExcludeInterim(bool? excludeInterim = true) => Qs("exclude_interim", excludeInterim); + public GetInfluencersRequestDescriptor From(int? from) => Qs("from", from); + public GetInfluencersRequestDescriptor InfluencerScore(double? influencerScore) => Qs("influencer_score", influencerScore); + public GetInfluencersRequestDescriptor Size(int? size) => Qs("size", size); + public GetInfluencersRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) => Qs("sort", sort); + public GetInfluencersRequestDescriptor Start(DateTimeOffset? start) => Qs("start", start); + + public GetInfluencersRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + + /// + /// Configures pagination.
This parameter has the `from` and `size` properties.
+ ///
+ public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetInfluencersRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs new file mode 100644 index 00000000000..f4291db8161 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetInfluencersResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// Array of influencer objects + /// + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs new file mode 100644 index 00000000000..bc7d95fe739 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetJobStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If `true`, the API returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If `false`, the API returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection jobs. +/// +public sealed partial class GetJobStatsRequest : PlainRequest +{ + public GetJobStatsRequest() + { + } + + public GetJobStatsRequest(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_job_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If `true`, the API returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If `false`, the API returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection jobs. +/// +public sealed partial class GetJobStatsRequestDescriptor : RequestDescriptor +{ + internal GetJobStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetJobStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public GetJobStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_job_stats"; + + public GetJobStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetJobStatsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + RouteValues.Optional("job_id", jobId); + 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/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs new file mode 100644 index 00000000000..190a243cb18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetJobStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs new file mode 100644 index 00000000000..02aa509d27f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetJobsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If this parameter is `false`, the request returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for anomaly detection jobs.
You can get information for multiple anomaly detection jobs in a single API
request by using a group name, a comma-separated list of jobs, or a wildcard
expression. You can get information for all anomaly detection jobs by using
`_all`, by specifying `*` as the ``, or by omitting the ``.
+///
+public sealed partial class GetJobsRequest : PlainRequest +{ + public GetJobsRequest() + { + } + + public GetJobsRequest(Elastic.Clients.Elasticsearch.Ids? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_jobs"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is `true`, which returns an empty `jobs` array when
there are no matches and the subset of results when there are partial
matches. If this parameter is `false`, the request returns a `404` status
code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } +} + +/// +/// Retrieves configuration information for anomaly detection jobs.
You can get information for multiple anomaly detection jobs in a single API
request by using a group name, a comma-separated list of jobs, or a wildcard
expression. You can get information for all anomaly detection jobs by using
`_all`, by specifying `*` as the ``, or by omitting the ``.
+///
+public sealed partial class GetJobsRequestDescriptor : RequestDescriptor +{ + internal GetJobsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetJobsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? jobId) : base(r => r.Optional("job_id", jobId)) + { + } + + public GetJobsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_jobs"; + + public GetJobsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetJobsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + + public GetJobsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Ids? jobId) + { + RouteValues.Optional("job_id", jobId); + 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/_Generated/Api/MachineLearning/GetJobsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs new file mode 100644 index 00000000000..419693e599b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetJobsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs new file mode 100644 index 00000000000..b4a34e23f65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetMemoryStatsRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
+///
+public sealed partial class GetMemoryStatsRequest : PlainRequest +{ + public GetMemoryStatsRequest() + { + } + + public GetMemoryStatsRequest(Elastic.Clients.Elasticsearch.Id? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetMemoryStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_memory_stats"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Get information about how machine learning jobs and trained models are using memory,
on each node, both within the JVM heap, and natively, outside of the JVM.
+///
+public sealed partial class GetMemoryStatsRequestDescriptor : RequestDescriptor +{ + internal GetMemoryStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetMemoryStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public GetMemoryStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetMemoryStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_memory_stats"; + + public GetMemoryStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetMemoryStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public GetMemoryStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.Id? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs new file mode 100644 index 00000000000..ebfed58ba91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetMemoryStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics NodeStatistics { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs new file mode 100644 index 00000000000..87ca63dcc9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetModelSnapshotUpgradeStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no jobs that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty jobs array when there are no matches and the subset of results
when there are partial matches. If this parameter is false, the request returns a 404 status code when there are
no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection job model snapshot upgrades. +/// +public sealed partial class GetModelSnapshotUpgradeStatsRequest : PlainRequest +{ + public GetModelSnapshotUpgradeStatsRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshotUpgradeStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_model_snapshot_upgrade_stats"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no jobs that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty jobs array when there are no matches and the subset of results
when there are partial matches. If this parameter is false, the request returns a 404 status code when there are
no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } +} + +/// +/// Retrieves usage information for anomaly detection job model snapshot upgrades. +/// +public sealed partial class GetModelSnapshotUpgradeStatsRequestDescriptor : RequestDescriptor +{ + internal GetModelSnapshotUpgradeStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetModelSnapshotUpgradeStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshotUpgradeStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_model_snapshot_upgrade_stats"; + + public GetModelSnapshotUpgradeStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + + public GetModelSnapshotUpgradeStatsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotUpgradeStatsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs new file mode 100644 index 00000000000..45fd57704ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetModelSnapshotUpgradeStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_upgrades")] + public IReadOnlyCollection ModelSnapshotUpgrades { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs new file mode 100644 index 00000000000..43711302677 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs @@ -0,0 +1,445 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetModelSnapshotsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of snapshots. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of snapshots to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequest : PlainRequest +{ + public GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + /// + /// Skips the specified number of snapshots. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of snapshots to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the description for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequestDescriptor : RequestDescriptor, GetModelSnapshotsRequestParameters> +{ + internal GetModelSnapshotsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + public GetModelSnapshotsRequestDescriptor From(int? from) => Qs("from", from); + public GetModelSnapshotsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetModelSnapshotsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id? snapshotId) + { + RouteValues.Optional("snapshot_id", snapshotId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetModelSnapshotsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves information about model snapshots. +/// +public sealed partial class GetModelSnapshotsRequestDescriptor : RequestDescriptor +{ + internal GetModelSnapshotsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id? snapshotId) : base(r => r.Required("job_id", jobId).Optional("snapshot_id", snapshotId)) + { + } + + public GetModelSnapshotsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetModelSnapshots; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_model_snapshots"; + + public GetModelSnapshotsRequestDescriptor From(int? from) => Qs("from", from); + public GetModelSnapshotsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetModelSnapshotsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public GetModelSnapshotsRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id? snapshotId) + { + RouteValues.Optional("snapshot_id", snapshotId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetModelSnapshotsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetModelSnapshotsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetModelSnapshotsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs new file mode 100644 index 00000000000..b56ff39f247 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetModelSnapshotsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("model_snapshots")] + public IReadOnlyCollection ModelSnapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs new file mode 100644 index 00000000000..adddfbabd8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs @@ -0,0 +1,241 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetOverallBucketsRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves overall bucket results that summarize the bucket results of
multiple anomaly detection jobs.
+/// The `overall_score` is calculated by combining the scores of all the
buckets within the overall bucket span. First, the maximum
`anomaly_score` per anomaly detection job in the overall bucket is
calculated. Then the `top_n` of those scores are averaged to result in
the `overall_score`. This means that you can fine-tune the
`overall_score` so that it is more or less sensitive to the number of
jobs that detect an anomaly at the same time. For example, if you set
`top_n` to `1`, the `overall_score` is the maximum bucket score in the
overall bucket. Alternatively, if you set `top_n` to the number of jobs,
the `overall_score` is high only when all jobs detect anomalies in that
overall bucket. If you set the `bucket_span` parameter (to a value
greater than its default), the `overall_score` is the maximum
`overall_score` of the overall buckets that have a span equal to the
jobs' largest bucket span.
+///
+public sealed partial class GetOverallBucketsRequest : PlainRequest +{ + public GetOverallBucketsRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetOverallBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_overall_buckets"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the description for the `bucket_span` query parameter. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Duration? BucketSpan { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + + /// + /// Refer to the description for the `overall_score` query parameter. + /// + [JsonInclude, JsonPropertyName("overall_score")] + public object? OverallScore { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } + + /// + /// Refer to the description for the `top_n` query parameter. + /// + [JsonInclude, JsonPropertyName("top_n")] + public int? TopN { get; set; } +} + +/// +/// Retrieves overall bucket results that summarize the bucket results of
multiple anomaly detection jobs.
+/// The `overall_score` is calculated by combining the scores of all the
buckets within the overall bucket span. First, the maximum
`anomaly_score` per anomaly detection job in the overall bucket is
calculated. Then the `top_n` of those scores are averaged to result in
the `overall_score`. This means that you can fine-tune the
`overall_score` so that it is more or less sensitive to the number of
jobs that detect an anomaly at the same time. For example, if you set
`top_n` to `1`, the `overall_score` is the maximum bucket score in the
overall bucket. Alternatively, if you set `top_n` to the number of jobs,
the `overall_score` is high only when all jobs detect anomalies in that
overall bucket. If you set the `bucket_span` parameter (to a value
greater than its default), the `overall_score` is the maximum
`overall_score` of the overall buckets that have a span equal to the
jobs' largest bucket span.
+///
+public sealed partial class GetOverallBucketsRequestDescriptor : RequestDescriptor +{ + internal GetOverallBucketsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetOverallBucketsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetOverallBuckets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_overall_buckets"; + + public GetOverallBucketsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? BucketSpanValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private object? OverallScoreValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + private int? TopNValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public GetOverallBucketsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the description for the `bucket_span` query parameter. + /// + public GetOverallBucketsRequestDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetOverallBucketsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetOverallBucketsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + /// + /// Refer to the description for the `overall_score` query parameter. + /// + public GetOverallBucketsRequestDescriptor OverallScore(object? overallScore) + { + OverallScoreValue = overallScore; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetOverallBucketsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + /// + /// Refer to the description for the `top_n` query parameter. + /// + public GetOverallBucketsRequestDescriptor TopN(int? topN) + { + TopNValue = topN; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (OverallScoreValue is not null) + { + writer.WritePropertyName("overall_score"); + JsonSerializer.Serialize(writer, OverallScoreValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + if (TopNValue.HasValue) + { + writer.WritePropertyName("top_n"); + writer.WriteNumberValue(TopNValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs new file mode 100644 index 00000000000..0583178b551 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetOverallBucketsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// Array of overall bucket objects + /// + [JsonInclude, JsonPropertyName("overall_buckets")] + public IReadOnlyCollection OverallBuckets { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs new file mode 100644 index 00000000000..09c226f35ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetRecordsRequestParameters : RequestParameters +{ + /// + /// Skips the specified number of records. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of records to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequest : PlainRequest +{ + public GetRecordsRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + /// + /// Skips the specified number of records. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of records to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Refer to the description for the `desc` query parameter. + /// + [JsonInclude, JsonPropertyName("desc")] + public bool? Desc { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + [JsonInclude, JsonPropertyName("exclude_interim")] + public bool? ExcludeInterim { get; set; } + [JsonInclude, JsonPropertyName("page")] + public Elastic.Clients.Elasticsearch.MachineLearning.Page? Page { get; set; } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + [JsonInclude, JsonPropertyName("record_score")] + public double? RecordScore { get; set; } + + /// + /// Refer to the description for the `sort` query parameter. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Field? Sort { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequestDescriptor : RequestDescriptor, GetRecordsRequestParameters> +{ + internal GetRecordsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetRecordsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + public GetRecordsRequestDescriptor From(int? from) => Qs("from", from); + public GetRecordsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetRecordsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private double? RecordScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetRecordsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetRecordsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetRecordsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetRecordsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + public GetRecordsRequestDescriptor RecordScore(double? recordScore) + { + RecordScoreValue = recordScore; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetRecordsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (RecordScoreValue.HasValue) + { + writer.WritePropertyName("record_score"); + writer.WriteNumberValue(RecordScoreValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Retrieves anomaly records for an anomaly detection job.
Records contain the detailed analytical results. They describe the anomalous
activity that has been identified in the input data based on the detector
configuration.
There can be many anomaly records depending on the characteristics and size
of the input data. In practice, there are often too many to be able to
manually process them. The machine learning features therefore perform a
sophisticated aggregation of the anomaly records into buckets.
The number of record results depends on the number of anomalies found in each
bucket, which relates to the number of time series being modeled and the
number of detectors.
+///
+public sealed partial class GetRecordsRequestDescriptor : RequestDescriptor +{ + internal GetRecordsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRecordsRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetRecords; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.get_records"; + + public GetRecordsRequestDescriptor From(int? from) => Qs("from", from); + public GetRecordsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetRecordsRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? DescValue { get; set; } + private DateTimeOffset? EndValue { get; set; } + private bool? ExcludeInterimValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Page? PageValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor PageDescriptor { get; set; } + private Action PageDescriptorAction { get; set; } + private double? RecordScoreValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? SortValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + + /// + /// Refer to the description for the `desc` query parameter. + /// + public GetRecordsRequestDescriptor Desc(bool? desc = true) + { + DescValue = desc; + return Self; + } + + /// + /// Refer to the description for the `end` query parameter. + /// + public GetRecordsRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `exclude_interim` query parameter. + /// + public GetRecordsRequestDescriptor ExcludeInterim(bool? excludeInterim = true) + { + ExcludeInterimValue = excludeInterim; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.Page? page) + { + PageDescriptor = null; + PageDescriptorAction = null; + PageValue = page; + return Self; + } + + public GetRecordsRequestDescriptor Page(Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor descriptor) + { + PageValue = null; + PageDescriptorAction = null; + PageDescriptor = descriptor; + return Self; + } + + public GetRecordsRequestDescriptor Page(Action configure) + { + PageValue = null; + PageDescriptor = null; + PageDescriptorAction = configure; + return Self; + } + + /// + /// Refer to the description for the `record_score` query parameter. + /// + public GetRecordsRequestDescriptor RecordScore(double? recordScore) + { + RecordScoreValue = recordScore; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Field? sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `sort` query parameter. + /// + public GetRecordsRequestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public GetRecordsRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DescValue.HasValue) + { + writer.WritePropertyName("desc"); + writer.WriteBooleanValue(DescValue.Value); + } + + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (ExcludeInterimValue.HasValue) + { + writer.WritePropertyName("exclude_interim"); + writer.WriteBooleanValue(ExcludeInterimValue.Value); + } + + if (PageDescriptor is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageDescriptor, options); + } + else if (PageDescriptorAction is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PageDescriptor(PageDescriptorAction), options); + } + else if (PageValue is not null) + { + writer.WritePropertyName("page"); + JsonSerializer.Serialize(writer, PageValue, options); + } + + if (RecordScoreValue.HasValue) + { + writer.WritePropertyName("record_score"); + writer.WriteNumberValue(RecordScoreValue.Value); + } + + if (SortValue is not null) + { + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs new file mode 100644 index 00000000000..10805cbe3fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetRecordsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("records")] + public IReadOnlyCollection Records { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs new file mode 100644 index 00000000000..594a5205299 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetTrainedModelsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Specifies whether the included model definition should be returned as a
JSON map (true) or in a custom compressed format (false).
+ ///
+ public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of models. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// A comma delimited string of optional fields to include in the response
body.
+ ///
+ public Elastic.Clients.Elasticsearch.MachineLearning.Include? Include { get => Q("include"); set => Q("include", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or
none. When supplied, only trained models that contain all the supplied
tags are returned.
+ ///
+ public string? Tags { get => Q("tags"); set => Q("tags", value); } +} + +/// +/// Retrieves configuration information for a trained model. +/// +public sealed partial class GetTrainedModelsRequest : PlainRequest +{ + public GetTrainedModelsRequest() + { + } + + public GetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Id? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModels; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Specifies whether the included model definition should be returned as a
JSON map (true) or in a custom compressed format (false).
+ ///
+ [JsonIgnore] + public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } + + /// + /// Indicates if certain fields should be removed from the configuration on
retrieval. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of models. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// A comma delimited string of optional fields to include in the response
body.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.MachineLearning.Include? Include { get => Q("include"); set => Q("include", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or
none. When supplied, only trained models that contain all the supplied
tags are returned.
+ ///
+ [JsonIgnore] + public string? Tags { get => Q("tags"); set => Q("tags", value); } +} + +/// +/// Retrieves configuration information for a trained model. +/// +public sealed partial class GetTrainedModelsRequestDescriptor : RequestDescriptor +{ + internal GetTrainedModelsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTrainedModelsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + public GetTrainedModelsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModels; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models"; + + public GetTrainedModelsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTrainedModelsRequestDescriptor DecompressDefinition(bool? decompressDefinition = true) => Qs("decompress_definition", decompressDefinition); + public GetTrainedModelsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetTrainedModelsRequestDescriptor From(int? from) => Qs("from", from); + public GetTrainedModelsRequestDescriptor Include(Elastic.Clients.Elasticsearch.MachineLearning.Include? include) => Qs("include", include); + public GetTrainedModelsRequestDescriptor Size(int? size) => Qs("size", size); + public GetTrainedModelsRequestDescriptor Tags(string? tags) => Qs("tags", tags); + + public GetTrainedModelsRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id? modelId) + { + RouteValues.Optional("model_id", modelId); + 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/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs new file mode 100644 index 00000000000..a3d245c1d25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetTrainedModelsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of trained model resources, which are sorted by the model_id value in ascending order. + /// + [JsonInclude, JsonPropertyName("trained_model_configs")] + public IReadOnlyCollection TrainedModelConfigs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs new file mode 100644 index 00000000000..c753296b995 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class GetTrainedModelsStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of models. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves usage information for trained models. You can get usage information for multiple trained
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.
+///
+public sealed partial class GetTrainedModelsStatsRequest : PlainRequest +{ + public GetTrainedModelsStatsRequest() + { + } + + public GetTrainedModelsStatsRequest(Elastic.Clients.Elasticsearch.Ids? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModelsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models_stats"; + + /// + /// Specifies what to do when the request: + /// - Contains wildcard expressions and there are no models that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
+ /// If true, it returns an empty array when there are no matches and the
subset of results when there are partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of models. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of models to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves usage information for trained models. You can get usage information for multiple trained
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.
+///
+public sealed partial class GetTrainedModelsStatsRequestDescriptor : RequestDescriptor +{ + internal GetTrainedModelsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTrainedModelsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids? modelId) : base(r => r.Optional("model_id", modelId)) + { + } + + public GetTrainedModelsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningGetTrainedModelsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.get_trained_models_stats"; + + public GetTrainedModelsStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTrainedModelsStatsRequestDescriptor From(int? from) => Qs("from", from); + public GetTrainedModelsStatsRequestDescriptor Size(int? size) => Qs("size", size); + + public GetTrainedModelsStatsRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Ids? modelId) + { + RouteValues.Optional("model_id", modelId); + 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/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs new file mode 100644 index 00000000000..2fc3544348b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GetTrainedModelsStatsResponse : ElasticsearchResponse +{ + /// + /// The total number of trained model statistics that matched the requested ID patterns. Could be higher than the number of items in the trained_model_stats array as the size of the array is restricted by the supplied size parameter. + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// An array of trained model statistics, which are sorted by the model_id value in ascending order. + /// + [JsonInclude, JsonPropertyName("trained_model_stats")] + public IReadOnlyCollection TrainedModelStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs new file mode 100644 index 00000000000..9209f758cd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class InferTrainedModelRequestParameters : RequestParameters +{ + /// + /// Controls the amount of time to wait for inference results. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequest : PlainRequest +{ + public InferTrainedModelRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + /// + /// Controls the amount of time to wait for inference results. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ [JsonInclude, JsonPropertyName("docs")] + public ICollection> Docs { get; set; } + + /// + /// The inference configuration updates to apply on the API call + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate? InferenceConfig { get; set; } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequestDescriptor : RequestDescriptor, InferTrainedModelRequestParameters> +{ + internal InferTrainedModelRequestDescriptor(Action> configure) => configure.Invoke(this); + + public InferTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + public InferTrainedModelRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public InferTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection> DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ public InferTrainedModelRequestDescriptor Docs(ICollection> docs) + { + DocsValue = docs; + return Self; + } + + /// + /// The inference configuration updates to apply on the API call + /// + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Evaluates a trained model. +/// +public sealed partial class InferTrainedModelRequestDescriptor : RequestDescriptor +{ + internal InferTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public InferTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInferTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.infer_trained_model"; + + public InferTrainedModelRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public InferTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection> DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + + /// + /// An array of objects to pass to the model for inference. The objects should contain a fields matching your
configured trained model input. Typically, for NLP models, the field name is `text_field`.
Currently, for NLP models, only a single value is allowed.
+ ///
+ public InferTrainedModelRequestDescriptor Docs(ICollection> docs) + { + DocsValue = docs; + return Self; + } + + /// + /// The inference configuration updates to apply on the API call + /// + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public InferTrainedModelRequestDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("docs"); + JsonSerializer.Serialize(writer, DocsValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs new file mode 100644 index 00000000000..b9edc44911f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class InferTrainedModelResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("inference_results")] + public IReadOnlyCollection InferenceResults { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs new file mode 100644 index 00000000000..0115e340291 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class MlInfoRequestParameters : RequestParameters +{ +} + +/// +/// Returns defaults and limits used by machine learning.
This endpoint is designed to be used by a user interface that needs to fully
understand machine learning configurations where some options are not
specified, meaning that the defaults should be used. This endpoint may be
used to find out what those defaults are. It also provides information about
the maximum size of machine learning jobs that could run in the current
cluster configuration.
+///
+public sealed partial class MlInfoRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.info"; +} + +/// +/// Returns defaults and limits used by machine learning.
This endpoint is designed to be used by a user interface that needs to fully
understand machine learning configurations where some options are not
specified, meaning that the defaults should be used. This endpoint may be
used to find out what those defaults are. It also provides information about
the maximum size of machine learning jobs that could run in the current
cluster configuration.
+///
+public sealed partial class MlInfoRequestDescriptor : RequestDescriptor +{ + internal MlInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public MlInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.info"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs new file mode 100644 index 00000000000..7f86fd9da05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class MlInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("defaults")] + public Elastic.Clients.Elasticsearch.MachineLearning.Defaults Defaults { get; init; } + [JsonInclude, JsonPropertyName("limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.Limits Limits { get; init; } + [JsonInclude, JsonPropertyName("native_code")] + public Elastic.Clients.Elasticsearch.MachineLearning.NativeCode NativeCode { get; init; } + [JsonInclude, JsonPropertyName("upgrade_mode")] + public bool UpgradeMode { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs new file mode 100644 index 00000000000..4b4c39fc04b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class OpenJobRequestParameters : RequestParameters +{ +} + +/// +/// Opens one or more anomaly detection jobs.
An anomaly detection job must be opened in order for it to be ready to
receive and analyze data. It can be opened and closed multiple times
throughout its lifecycle.
When you open a new job, it starts with an empty model.
When you open an existing job, the most recent model state is automatically
loaded. The job is ready to resume its analysis from where it left off, once
new data is received.
+///
+public sealed partial class OpenJobRequest : PlainRequest +{ + public OpenJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningOpenJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.open_job"; + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Opens one or more anomaly detection jobs.
An anomaly detection job must be opened in order for it to be ready to
receive and analyze data. It can be opened and closed multiple times
throughout its lifecycle.
When you open a new job, it starts with an empty model.
When you open an existing job, the most recent model state is automatically
loaded. The job is ready to resume its analysis from where it left off, once
new data is received.
+///
+public sealed partial class OpenJobRequestDescriptor : RequestDescriptor +{ + internal OpenJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public OpenJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningOpenJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.open_job"; + + public OpenJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public OpenJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Api/MachineLearning/OpenJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs new file mode 100644 index 00000000000..80946336696 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class OpenJobResponse : ElasticsearchResponse +{ + /// + /// The ID of the node that the job was started on. In serverless this will be the "serverless".
If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
+ ///
+ [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("opened")] + public bool Opened { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs new file mode 100644 index 00000000000..075eda09e02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PostCalendarEventsRequestParameters : RequestParameters +{ +} + +/// +/// Adds scheduled events to a calendar. +/// +public sealed partial class PostCalendarEventsRequest : PlainRequest +{ + public PostCalendarEventsRequest(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPostCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.post_calendar_events"; + + /// + /// A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("events")] + public ICollection Events { get; set; } +} + +/// +/// Adds scheduled events to a calendar. +/// +public sealed partial class PostCalendarEventsRequestDescriptor : RequestDescriptor +{ + internal PostCalendarEventsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PostCalendarEventsRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPostCalendarEvents; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.post_calendar_events"; + + public PostCalendarEventsRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + private ICollection EventsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.CalendarEventDescriptor EventsDescriptor { get; set; } + private Action EventsDescriptorAction { get; set; } + private Action[] EventsDescriptorActions { get; set; } + + /// + /// A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. + /// + public PostCalendarEventsRequestDescriptor Events(ICollection events) + { + EventsDescriptor = null; + EventsDescriptorAction = null; + EventsDescriptorActions = null; + EventsValue = events; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(Elastic.Clients.Elasticsearch.MachineLearning.CalendarEventDescriptor descriptor) + { + EventsValue = null; + EventsDescriptorAction = null; + EventsDescriptorActions = null; + EventsDescriptor = descriptor; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(Action configure) + { + EventsValue = null; + EventsDescriptor = null; + EventsDescriptorActions = null; + EventsDescriptorAction = configure; + return Self; + } + + public PostCalendarEventsRequestDescriptor Events(params Action[] configure) + { + EventsValue = null; + EventsDescriptor = null; + EventsDescriptorAction = null; + EventsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EventsDescriptor is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, EventsDescriptor, options); + writer.WriteEndArray(); + } + else if (EventsDescriptorAction is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.CalendarEventDescriptor(EventsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (EventsDescriptorActions is not null) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + foreach (var action in EventsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.CalendarEventDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("events"); + JsonSerializer.Serialize(writer, EventsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs new file mode 100644 index 00000000000..e8742653958 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PostCalendarEventsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("events")] + public IReadOnlyCollection Events { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..6a7db339c8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PreviewDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequest : PlainRequest +{ + public PreviewDataFrameAnalyticsRequest() + { + } + + public PreviewDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig? Config { get; set; } +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequestDescriptor : RequestDescriptor, PreviewDataFrameAnalyticsRequestParameters> +{ + internal PreviewDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PreviewDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public PreviewDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + public PreviewDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor ConfigDescriptor { get; set; } + private Action> ConfigDescriptorAction { get; set; } + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Action> configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Previews the extracted features used by a data frame analytics config. +/// +public sealed partial class PreviewDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal PreviewDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PreviewDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public PreviewDataFrameAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPreviewDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.preview_data_frame_analytics"; + + public PreviewDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + + /// + /// A data frame analytics config as described in create data frame analytics
jobs. Note that `id` and `dest` don’t need to be provided in the context of
this API.
+ ///
+ public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PreviewDataFrameAnalyticsRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..9e82f462ce5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PreviewDataFrameAnalyticsResponse : ElasticsearchResponse +{ + /// + /// An array of objects that contain feature name and value pairs. The features have been processed and indicate what will be sent to the model for training. + /// + [JsonInclude, JsonPropertyName("feature_values")] + public IReadOnlyCollection> FeatureValues { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs new file mode 100644 index 00000000000..9b93d36c44b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutCalendarJobRequestParameters : RequestParameters +{ +} + +/// +/// Adds an anomaly detection job to a calendar. +/// +public sealed partial class PutCalendarJobRequest : PlainRequest +{ + public PutCalendarJobRequest(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_calendar_job"; +} + +/// +/// Adds an anomaly detection job to a calendar. +/// +public sealed partial class PutCalendarJobRequestDescriptor : RequestDescriptor +{ + internal PutCalendarJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutCalendarJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("calendar_id", calendarId).Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendarJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_calendar_job"; + + public PutCalendarJobRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + public PutCalendarJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs new file mode 100644 index 00000000000..790e9582f5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutCalendarJobResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs new file mode 100644 index 00000000000..721793f7f21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutCalendarRequestParameters : RequestParameters +{ +} + +/// +/// Creates a calendar. +/// +public sealed partial class PutCalendarRequest : PlainRequest +{ + public PutCalendarRequest(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_calendar"; + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An array of anomaly detection job identifiers. + /// + [JsonInclude, JsonPropertyName("job_ids")] + public ICollection? JobIds { get; set; } +} + +/// +/// Creates a calendar. +/// +public sealed partial class PutCalendarRequestDescriptor : RequestDescriptor +{ + internal PutCalendarRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutCalendarRequestDescriptor(Elastic.Clients.Elasticsearch.Id calendarId) : base(r => r.Required("calendar_id", calendarId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutCalendar; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_calendar"; + + public PutCalendarRequestDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id calendarId) + { + RouteValues.Required("calendar_id", calendarId); + return Self; + } + + private string? DescriptionValue { get; set; } + private ICollection? JobIdsValue { get; set; } + + /// + /// A description of the calendar. + /// + public PutCalendarRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of anomaly detection job identifiers. + /// + public PutCalendarRequestDescriptor JobIds(ICollection? jobIds) + { + JobIdsValue = jobIds; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdsValue is not null) + { + writer.WritePropertyName("job_ids"); + JsonSerializer.Serialize(writer, JobIdsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs new file mode 100644 index 00000000000..1f99d1ba02d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutCalendarResponse : ElasticsearchResponse +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A list of anomaly detection job identifiers or group names. + /// + [JsonInclude, JsonPropertyName("job_ids")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..87c5e3f8dcb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,718 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequest : PlainRequest +{ + public PutDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination configuration. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } + [JsonInclude, JsonPropertyName("headers")] + public IDictionary>>? Headers { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + + /// + /// The configuration of how to source the analysis data. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; set; } +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequestDescriptor : RequestDescriptor, PutDataFrameAnalyticsRequestParameters> +{ + internal PutDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + public PutDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action> DestDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private string? VersionValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration. + /// + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Action> configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. + /// + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (!string.IsNullOrEmpty(VersionValue)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(VersionValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a data frame analytics job.
This API creates a data frame analytics job that performs an analysis on the
source indices and stores the outcome in a destination index.
+///
+public sealed partial class PutDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal PutDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_data_frame_analytics"; + + public PutDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private string? VersionValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node. If
set to `false` and a machine learning node with capacity to run the job
cannot be immediately found, the API returns an error. If set to `true`,
the API does not return an error; the job waits in the `starting` state
until sufficient machine learning node capacity is available. This
behavior is also affected by the cluster-wide
`xpack.ml.max_lazy_ml_nodes` setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// The analysis configuration, which contains the information necessary to
perform one of the following types of analysis: classification, outlier
detection, or regression.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + /// + /// Specifies `includes` and/or `excludes` patterns to select which fields
will be included in the analysis. The patterns specified in `excludes`
are applied last, therefore `excludes` takes precedence. In other words,
if the same field is specified in both `includes` and `excludes`, then
the field will not be included in the analysis. If `analyzed_fields` is
not set, only the relevant fields will be included. For example, all the
numeric fields for outlier detection.
The supported fields vary for each type of analysis. Outlier detection
requires numeric or `boolean` data to analyze. The algorithms don’t
support missing values therefore fields that have data types other than
numeric or boolean are ignored. Documents where included fields contain
missing values, null values, or an array are also ignored. Therefore the
`dest` index may contain documents that don’t have an outlier score.
Regression supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the regression analysis.
Classification supports fields that are numeric, `boolean`, `text`,
`keyword`, and `ip` data types. It is also tolerant of missing values.
Fields that are supported are included in the analysis, other fields are
ignored. Documents where included fields contain an array with two or
more values are also ignored. Documents in the `dest` index that don’t
contain a results field are not included in the classification analysis.
Classification analysis can be improved by mapping ordinal variable
values to a single number. For example, in case of age ranges, you can
model the values as `0-14 = 0`, `15-24 = 1`, `25-34 = 2`, and so on.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination configuration. + /// + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public PutDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + /// + /// The configuration of how to source the analysis data. + /// + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + public PutDataFrameAnalyticsRequestDescriptor Version(string? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (!string.IsNullOrEmpty(VersionValue)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(VersionValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..099dad14f57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs new file mode 100644 index 00000000000..be5f831d7b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs @@ -0,0 +1,1117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutDatafeedRequestParameters : RequestParameters +{ + /// + /// If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`
string or when no indices are specified.
+ ///
+ 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.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, unavailable indices (missing or closed) are ignored. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +internal sealed partial class PutDatafeedRequestConverter : JsonConverter +{ + public override PutDatafeedRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new PutDatafeedRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations") + { + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "headers") + { + variant.Headers = JsonSerializer.Deserialize>>?>(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, PutDatafeedRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Headers is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, value.Headers, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+[JsonConverter(typeof(PutDatafeedRequestConverter))] +public sealed partial class PutDatafeedRequest : PlainRequest +{ + public PutDatafeedRequest(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + public PutDatafeedRequest() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + /// + /// If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all`
string or when no indices are specified.
+ ///
+ [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.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If true, unavailable indices (missing or closed) are ignored. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + [JsonInclude, JsonPropertyName("headers")] + public IDictionary>>? Headers { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Indices? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search + /// + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; set; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ [JsonInclude, JsonPropertyName("scroll_size")] + public int? ScrollSize { get; set; } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+public sealed partial class PutDatafeedRequestDescriptor : RequestDescriptor, PutDatafeedRequestParameters> +{ + internal PutDatafeedRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + public PutDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public PutDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ public PutDatafeedRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ public PutDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + public PutDatafeedRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public PutDatafeedRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search + /// + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + /// + /// Identifier for the anomaly detection job. + /// + public PutDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public PutDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public PutDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public PutDatafeedRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public PutDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ public PutDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates a datafeed.
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
You can associate only one datafeed with each anomaly detection job.
The datafeed contains a query that runs at a defined interval (`frequency`).
If you are concerned about delayed data, you can add a delay (`query_delay') at each interval.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index.
+///
+public sealed partial class PutDatafeedRequestDescriptor : RequestDescriptor +{ + internal PutDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_datafeed"; + + public PutDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public PutDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public PutDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public PutDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches.
Support for aggregations is limited and should be used only with low cardinality data.
+ ///
+ public PutDatafeedRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years.
This search is split into time chunks in order to ensure the load on Elasticsearch is managed.
Chunking configuration controls how the size of these time chunks are calculated;
it is an advanced configuration option.
+ ///
+ public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window.
The datafeed can optionally search over indices that have already been read in an effort to determine whether
any data has subsequently been added to the index. If missing data is found, it is a good indication that the
`query_delay` is set too low and the data is being indexed after the datafeed has passed that moment in time.
This check runs only on real-time datafeeds.
+ ///
+ public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time.
The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible
fraction of the bucket span. When `frequency` is shorter than the bucket span, interim results for the last
(partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses
aggregations, this value must be divisible by the interval of the date histogram aggregation.
+ ///
+ public PutDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + public PutDatafeedRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public PutDatafeedRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search + /// + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + /// + /// Identifier for the anomaly detection job. + /// + public PutDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public PutDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch.
+ ///
+ public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PutDatafeedRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public PutDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public PutDatafeedRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public PutDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
+ ///
+ public PutDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs new file mode 100644 index 00000000000..0a02dd03b3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; init; } + [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; init; } + [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Duration QueryDelay { get; init; } + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IReadOnlyDictionary? RuntimeMappings { get; init; } + [JsonInclude, JsonPropertyName("script_fields")] + public IReadOnlyDictionary? ScriptFields { get; init; } + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs new file mode 100644 index 00000000000..708976653e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutFilterRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates a filter.
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
Specifically, filters are referenced in the `custom_rules` property of detector configuration objects.
+///
+public sealed partial class PutFilterRequest : PlainRequest +{ + public PutFilterRequest(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_filter"; + + /// + /// A description of the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.
Up to 10000 items are allowed in each filter.
+ ///
+ [JsonInclude, JsonPropertyName("items")] + public ICollection? Items { get; set; } +} + +/// +/// Instantiates a filter.
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
Specifically, filters are referenced in the `custom_rules` property of detector configuration objects.
+///
+public sealed partial class PutFilterRequestDescriptor : RequestDescriptor +{ + internal PutFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_filter"; + + public PutFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Id filterId) + { + RouteValues.Required("filter_id", filterId); + return Self; + } + + private string? DescriptionValue { get; set; } + private ICollection? ItemsValue { get; set; } + + /// + /// A description of the filter. + /// + public PutFilterRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The items of the filter. A wildcard `*` can be used at the beginning or the end of an item.
Up to 10000 items are allowed in each filter.
+ ///
+ public PutFilterRequestDescriptor Items(ICollection? items) + { + ItemsValue = items; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (ItemsValue is not null) + { + writer.WritePropertyName("items"); + JsonSerializer.Serialize(writer, ItemsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs new file mode 100644 index 00000000000..03d0bc4ab06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutFilterResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs new file mode 100644 index 00000000000..d04b8630414 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs @@ -0,0 +1,988 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutJobRequestParameters : RequestParameters +{ +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequest : PlainRequest +{ + public PutJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig AnalysisConfig { get; set; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimits { get; set; } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; set; } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; set; } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; set; } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig? DatafeedConfig { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + [JsonInclude, JsonPropertyName("groups")] + public ICollection? Groups { get; set; } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; set; } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + [JsonInclude, JsonPropertyName("results_index_name")] + public Elastic.Clients.Elasticsearch.IndexName? ResultsIndexName { get; set; } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; set; } +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor, PutJobRequestParameters> +{ + internal PutJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + public PutJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? BackgroundPersistIntervalValue { get; set; } + private object? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action> DataDescriptionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig? DatafeedConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor DatafeedConfigDescriptor { get; set; } + private Action> DatafeedConfigDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action> ModelPlotConfigDescriptorAction { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? ResultsIndexNameValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + public PutJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + public PutJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + public PutJobRequestDescriptor CustomSettings(object? customSettings) + { + CustomSettingsValue = customSettings; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + public PutJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescription dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Action> configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig? datafeedConfig) + { + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigValue = datafeedConfig; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor descriptor) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Action> configure) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public PutJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Action> configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + public PutJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + public PutJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + public PutJobRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + public PutJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (DatafeedConfigDescriptor is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigDescriptor, options); + } + else if (DatafeedConfigDescriptorAction is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor(DatafeedConfigDescriptorAction), options); + } + else if (DatafeedConfigValue is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Instantiates an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor +{ + internal PutJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_job"; + + public PutJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? BackgroundPersistIntervalValue { get; set; } + private object? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action DataDescriptionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig? DatafeedConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor DatafeedConfigDescriptor { get; set; } + private Action DatafeedConfigDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action ModelPlotConfigDescriptorAction { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? ResultsIndexNameValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available. + /// + public PutJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + /// + /// Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational. + /// + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low. + /// + public PutJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job. + /// + public PutJobRequestDescriptor CustomSettings(object? customSettings) + { + CustomSettingsValue = customSettings; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to `model_snapshot_retention_days`. + /// + public PutJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained. + /// + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescription dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DataDescription(Action configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + /// + /// Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. + /// + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig? datafeedConfig) + { + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigValue = datafeedConfig; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor descriptor) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptorAction = null; + DatafeedConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor DatafeedConfig(Action configure) + { + DatafeedConfigValue = null; + DatafeedConfigDescriptor = null; + DatafeedConfigDescriptorAction = configure; + return Self; + } + + /// + /// A description of the job. + /// + public PutJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public PutJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + /// + /// This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced. + /// + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor ModelPlotConfig(Action configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted. + /// + public PutJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans. + /// + public PutJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`. + /// + public PutJobRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever. + /// + public PutJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (DatafeedConfigDescriptor is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigDescriptor, options); + } + else if (DatafeedConfigDescriptorAction is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigDescriptor(DatafeedConfigDescriptorAction), options); + } + else if (DatafeedConfigValue is not null) + { + writer.WritePropertyName("datafeed_config"); + JsonSerializer.Serialize(writer, DatafeedConfigValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs new file mode 100644 index 00000000000..cd8cb1f1ccf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; init; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; init; } + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset CreateTime { get; init; } + [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; init; } + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.Datafeed? DatafeedConfig { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("job_type")] + public string JobType { get; init; } + [JsonInclude, JsonPropertyName("job_version")] + public string JobVersion { get; init; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs new file mode 100644 index 00000000000..89893da547e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutTrainedModelAliasRequestParameters : RequestParameters +{ + /// + /// Specifies whether the alias gets reassigned to the specified trained
model if it is already assigned to a different model. If the alias is
already assigned and this parameter is false, the API returns an error.
+ ///
+ public bool? Reassign { get => Q("reassign"); set => Q("reassign", value); } +} + +/// +/// Creates or updates a trained model alias. A trained model alias is a logical
name used to reference a single trained model.
You can use aliases instead of trained model identifiers to make it easier to
reference your models. For example, you can use aliases in inference
aggregations and processors.
An alias must be unique and refer to only a single trained model. However,
you can have multiple aliases for each trained model.
If you use this API to update an alias such that it references a different
trained model ID and the model uses a different type of data frame analytics,
an error occurs. For example, this situation occurs if you have a trained
model for regression analysis and a trained model for classification
analysis; you cannot reassign an alias from one type of trained model to
another.
If you use this API to update an alias and there are very few input fields in
common between the old and new trained models for the model alias, the API
returns a warning.
+///
+public sealed partial class PutTrainedModelAliasRequest : PlainRequest +{ + public PutTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_trained_model_alias"; + + /// + /// Specifies whether the alias gets reassigned to the specified trained
model if it is already assigned to a different model. If the alias is
already assigned and this parameter is false, the API returns an error.
+ ///
+ [JsonIgnore] + public bool? Reassign { get => Q("reassign"); set => Q("reassign", value); } +} + +/// +/// Creates or updates a trained model alias. A trained model alias is a logical
name used to reference a single trained model.
You can use aliases instead of trained model identifiers to make it easier to
reference your models. For example, you can use aliases in inference
aggregations and processors.
An alias must be unique and refer to only a single trained model. However,
you can have multiple aliases for each trained model.
If you use this API to update an alias such that it references a different
trained model ID and the model uses a different type of data frame analytics,
an error occurs. For example, this situation occurs if you have a trained
model for regression analysis and a trained model for classification
analysis; you cannot reassign an alias from one type of trained model to
another.
If you use this API to update an alias and there are very few input fields in
common between the old and new trained models for the model alias, the API
returns a warning.
+///
+public sealed partial class PutTrainedModelAliasRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelAliasRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelAliasRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) : base(r => r.Required("model_id", modelId).Required("model_alias", modelAlias)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelAlias; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.put_trained_model_alias"; + + public PutTrainedModelAliasRequestDescriptor Reassign(bool? reassign = true) => Qs("reassign", reassign); + + public PutTrainedModelAliasRequestDescriptor ModelAlias(Elastic.Clients.Elasticsearch.Name modelAlias) + { + RouteValues.Required("model_alias", modelAlias); + return Self; + } + + public PutTrainedModelAliasRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs new file mode 100644 index 00000000000..ad0fe90c7d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutTrainedModelAliasResponse : 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/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs new file mode 100644 index 00000000000..8a9308866b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutTrainedModelDefinitionPartRequestParameters : RequestParameters +{ +} + +/// +/// Creates part of a trained model definition. +/// +public sealed partial class PutTrainedModelDefinitionPartRequest : PlainRequest +{ + public PutTrainedModelDefinitionPartRequest(Elastic.Clients.Elasticsearch.Id modelId, int part) : base(r => r.Required("model_id", modelId).Required("part", part)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelDefinitionPart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_definition_part"; + + /// + /// The definition part for the model. Must be a base64 encoded string. + /// + [JsonInclude, JsonPropertyName("definition")] + public string Definition { get; set; } + + /// + /// The total uncompressed definition length in bytes. Not base64 encoded. + /// + [JsonInclude, JsonPropertyName("total_definition_length")] + public long TotalDefinitionLength { get; set; } + + /// + /// The total number of parts that will be uploaded. Must be greater than 0. + /// + [JsonInclude, JsonPropertyName("total_parts")] + public int TotalParts { get; set; } +} + +/// +/// Creates part of a trained model definition. +/// +public sealed partial class PutTrainedModelDefinitionPartRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelDefinitionPartRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelDefinitionPartRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId, int part) : base(r => r.Required("model_id", modelId).Required("part", part)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelDefinitionPart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_definition_part"; + + public PutTrainedModelDefinitionPartRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + public PutTrainedModelDefinitionPartRequestDescriptor Part(int part) + { + RouteValues.Required("part", part); + return Self; + } + + private string DefinitionValue { get; set; } + private long TotalDefinitionLengthValue { get; set; } + private int TotalPartsValue { get; set; } + + /// + /// The definition part for the model. Must be a base64 encoded string. + /// + public PutTrainedModelDefinitionPartRequestDescriptor Definition(string definition) + { + DefinitionValue = definition; + return Self; + } + + /// + /// The total uncompressed definition length in bytes. Not base64 encoded. + /// + public PutTrainedModelDefinitionPartRequestDescriptor TotalDefinitionLength(long totalDefinitionLength) + { + TotalDefinitionLengthValue = totalDefinitionLength; + return Self; + } + + /// + /// The total number of parts that will be uploaded. Must be greater than 0. + /// + public PutTrainedModelDefinitionPartRequestDescriptor TotalParts(int totalParts) + { + TotalPartsValue = totalParts; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("definition"); + writer.WriteStringValue(DefinitionValue); + writer.WritePropertyName("total_definition_length"); + writer.WriteNumberValue(TotalDefinitionLengthValue); + writer.WritePropertyName("total_parts"); + writer.WriteNumberValue(TotalPartsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs new file mode 100644 index 00000000000..2d95bb16a12 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutTrainedModelDefinitionPartResponse : 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/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs new file mode 100644 index 00000000000..db3cb27c163 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs @@ -0,0 +1,803 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutTrainedModelRequestParameters : RequestParameters +{ + /// + /// If set to `true` and a `compressed_definition` is provided,
the request defers definition decompression and skips relevant
validations.
+ ///
+ public bool? DeferDefinitionDecompression { get => Q("defer_definition_decompression"); set => Q("defer_definition_decompression", value); } + + /// + /// Whether to wait for all child operations (e.g. model download)
to complete.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequest : PlainRequest +{ + public PutTrainedModelRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + /// + /// If set to `true` and a `compressed_definition` is provided,
the request defers definition decompression and skips relevant
validations.
+ ///
+ [JsonIgnore] + public bool? DeferDefinitionDecompression { get => Q("defer_definition_decompression"); set => Q("defer_definition_decompression", value); } + + /// + /// Whether to wait for all child operations (e.g. model download)
to complete.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; set; } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ [JsonInclude, JsonPropertyName("definition")] + public Elastic.Clients.Elasticsearch.MachineLearning.Definition? Definition { get; set; } + + /// + /// A human-readable description of the inference trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? InferenceConfig { get; set; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.MachineLearning.Input? Input { get; set; } + + /// + /// An object map that contains metadata about the model. + /// + [JsonInclude, JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ [JsonInclude, JsonPropertyName("model_size_bytes")] + public long? ModelSizeBytes { get; set; } + + /// + /// The model type. + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? ModelType { get; set; } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ [JsonInclude, JsonPropertyName("platform_architecture")] + public string? PlatformArchitecture { get; set; } + + /// + /// Optional prefix strings applied at inference + /// + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; set; } + + /// + /// An array of tags to organize the model. + /// + [JsonInclude, JsonPropertyName("tags")] + public ICollection? Tags { get; set; } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequestDescriptor : RequestDescriptor, PutTrainedModelRequestParameters> +{ + internal PutTrainedModelRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + public PutTrainedModelRequestDescriptor DeferDefinitionDecompression(bool? deferDefinitionDecompression = true) => Qs("defer_definition_decompression", deferDefinitionDecompression); + public PutTrainedModelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public PutTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private string? CompressedDefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Definition? DefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor DefinitionDescriptor { get; set; } + private Action DefinitionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Input? InputValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor InputDescriptor { get; set; } + private Action InputDescriptorAction { get; set; } + private object? MetadataValue { get; set; } + private long? ModelSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? ModelTypeValue { get; set; } + private string? PlatformArchitectureValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? PrefixStringsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor PrefixStringsDescriptor { get; set; } + private Action PrefixStringsDescriptorAction { get; set; } + private ICollection? TagsValue { get; set; } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ public PutTrainedModelRequestDescriptor CompressedDefinition(string? compressedDefinition) + { + CompressedDefinitionValue = compressedDefinition; + return Self; + } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.MachineLearning.Definition? definition) + { + DefinitionDescriptor = null; + DefinitionDescriptorAction = null; + DefinitionValue = definition; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor descriptor) + { + DefinitionValue = null; + DefinitionDescriptorAction = null; + DefinitionDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Action configure) + { + DefinitionValue = null; + DefinitionDescriptor = null; + DefinitionDescriptorAction = configure; + return Self; + } + + /// + /// A human-readable description of the inference trained model. + /// + public PutTrainedModelRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Action> configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + /// + /// The input field names for the model definition. + /// + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.MachineLearning.Input? input) + { + InputDescriptor = null; + InputDescriptorAction = null; + InputValue = input; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor descriptor) + { + InputValue = null; + InputDescriptorAction = null; + InputDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Action configure) + { + InputValue = null; + InputDescriptor = null; + InputDescriptorAction = configure; + return Self; + } + + /// + /// An object map that contains metadata about the model. + /// + public PutTrainedModelRequestDescriptor Metadata(object? metadata) + { + MetadataValue = metadata; + return Self; + } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ public PutTrainedModelRequestDescriptor ModelSizeBytes(long? modelSizeBytes) + { + ModelSizeBytesValue = modelSizeBytes; + return Self; + } + + /// + /// The model type. + /// + public PutTrainedModelRequestDescriptor ModelType(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? modelType) + { + ModelTypeValue = modelType; + return Self; + } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ public PutTrainedModelRequestDescriptor PlatformArchitecture(string? platformArchitecture) + { + PlatformArchitectureValue = platformArchitecture; + return Self; + } + + /// + /// Optional prefix strings applied at inference + /// + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? prefixStrings) + { + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = null; + PrefixStringsValue = prefixStrings; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor descriptor) + { + PrefixStringsValue = null; + PrefixStringsDescriptorAction = null; + PrefixStringsDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Action configure) + { + PrefixStringsValue = null; + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = configure; + return Self; + } + + /// + /// An array of tags to organize the model. + /// + public PutTrainedModelRequestDescriptor Tags(ICollection? tags) + { + TagsValue = tags; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CompressedDefinitionValue)) + { + writer.WritePropertyName("compressed_definition"); + writer.WriteStringValue(CompressedDefinitionValue); + } + + if (DefinitionDescriptor is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionDescriptor, options); + } + else if (DefinitionDescriptorAction is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor(DefinitionDescriptorAction), options); + } + else if (DefinitionValue is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (InputDescriptor is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputDescriptor, options); + } + else if (InputDescriptorAction is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor(InputDescriptorAction), options); + } + else if (InputValue is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (ModelSizeBytesValue.HasValue) + { + writer.WritePropertyName("model_size_bytes"); + writer.WriteNumberValue(ModelSizeBytesValue.Value); + } + + if (ModelTypeValue is not null) + { + writer.WritePropertyName("model_type"); + JsonSerializer.Serialize(writer, ModelTypeValue, options); + } + + if (!string.IsNullOrEmpty(PlatformArchitectureValue)) + { + writer.WritePropertyName("platform_architecture"); + writer.WriteStringValue(PlatformArchitectureValue); + } + + if (PrefixStringsDescriptor is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsDescriptor, options); + } + else if (PrefixStringsDescriptorAction is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor(PrefixStringsDescriptorAction), options); + } + else if (PrefixStringsValue is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsValue, options); + } + + if (TagsValue is not null) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, TagsValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Enables you to supply a trained model that is not created by data frame analytics. +/// +public sealed partial class PutTrainedModelRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModel; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model"; + + public PutTrainedModelRequestDescriptor DeferDefinitionDecompression(bool? deferDefinitionDecompression = true) => Qs("defer_definition_decompression", deferDefinitionDecompression); + public PutTrainedModelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public PutTrainedModelRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private string? CompressedDefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Definition? DefinitionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor DefinitionDescriptor { get; set; } + private Action DefinitionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? InferenceConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Input? InputValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor InputDescriptor { get; set; } + private Action InputDescriptorAction { get; set; } + private object? MetadataValue { get; set; } + private long? ModelSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? ModelTypeValue { get; set; } + private string? PlatformArchitectureValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? PrefixStringsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor PrefixStringsDescriptor { get; set; } + private Action PrefixStringsDescriptorAction { get; set; } + private ICollection? TagsValue { get; set; } + + /// + /// The compressed (GZipped and Base64 encoded) inference definition of the
model. If compressed_definition is specified, then definition cannot be
specified.
+ ///
+ public PutTrainedModelRequestDescriptor CompressedDefinition(string? compressedDefinition) + { + CompressedDefinitionValue = compressedDefinition; + return Self; + } + + /// + /// The inference definition for the model. If definition is specified, then
compressed_definition cannot be specified.
+ ///
+ public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.MachineLearning.Definition? definition) + { + DefinitionDescriptor = null; + DefinitionDescriptorAction = null; + DefinitionValue = definition; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor descriptor) + { + DefinitionValue = null; + DefinitionDescriptorAction = null; + DefinitionDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Definition(Action configure) + { + DefinitionValue = null; + DefinitionDescriptor = null; + DefinitionDescriptorAction = configure; + return Self; + } + + /// + /// A human-readable description of the inference trained model. + /// + public PutTrainedModelRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The default configuration for inference. This can be either a regression
or classification configuration. It must match the underlying
definition.trained_model's target_type. For pre-packaged models such as
ELSER the config is not required.
+ ///
+ public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? inferenceConfig) + { + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = null; + InferenceConfigValue = inferenceConfig; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor descriptor) + { + InferenceConfigValue = null; + InferenceConfigDescriptorAction = null; + InferenceConfigDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor InferenceConfig(Action configure) + { + InferenceConfigValue = null; + InferenceConfigDescriptor = null; + InferenceConfigDescriptorAction = configure; + return Self; + } + + /// + /// The input field names for the model definition. + /// + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.MachineLearning.Input? input) + { + InputDescriptor = null; + InputDescriptorAction = null; + InputValue = input; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor descriptor) + { + InputValue = null; + InputDescriptorAction = null; + InputDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor Input(Action configure) + { + InputValue = null; + InputDescriptor = null; + InputDescriptorAction = configure; + return Self; + } + + /// + /// An object map that contains metadata about the model. + /// + public PutTrainedModelRequestDescriptor Metadata(object? metadata) + { + MetadataValue = metadata; + return Self; + } + + /// + /// The estimated memory usage in bytes to keep the trained model in memory.
This property is supported only if defer_definition_decompression is true
or the model definition is not supplied.
+ ///
+ public PutTrainedModelRequestDescriptor ModelSizeBytes(long? modelSizeBytes) + { + ModelSizeBytesValue = modelSizeBytes; + return Self; + } + + /// + /// The model type. + /// + public PutTrainedModelRequestDescriptor ModelType(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? modelType) + { + ModelTypeValue = modelType; + return Self; + } + + /// + /// The platform architecture (if applicable) of the trained mode. If the model
only works on one platform, because it is heavily optimized for a particular
processor architecture and OS combination, then this field specifies which.
The format of the string must match the platform identifiers used by Elasticsearch,
so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`,
or `windows-x86_64`. For portable models (those that work independent of processor
architecture or OS features), leave this field unset.
+ ///
+ public PutTrainedModelRequestDescriptor PlatformArchitecture(string? platformArchitecture) + { + PlatformArchitectureValue = platformArchitecture; + return Self; + } + + /// + /// Optional prefix strings applied at inference + /// + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? prefixStrings) + { + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = null; + PrefixStringsValue = prefixStrings; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor descriptor) + { + PrefixStringsValue = null; + PrefixStringsDescriptorAction = null; + PrefixStringsDescriptor = descriptor; + return Self; + } + + public PutTrainedModelRequestDescriptor PrefixStrings(Action configure) + { + PrefixStringsValue = null; + PrefixStringsDescriptor = null; + PrefixStringsDescriptorAction = configure; + return Self; + } + + /// + /// An array of tags to organize the model. + /// + public PutTrainedModelRequestDescriptor Tags(ICollection? tags) + { + TagsValue = tags; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CompressedDefinitionValue)) + { + writer.WritePropertyName("compressed_definition"); + writer.WriteStringValue(CompressedDefinitionValue); + } + + if (DefinitionDescriptor is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionDescriptor, options); + } + else if (DefinitionDescriptorAction is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DefinitionDescriptor(DefinitionDescriptorAction), options); + } + else if (DefinitionValue is not null) + { + writer.WritePropertyName("definition"); + JsonSerializer.Serialize(writer, DefinitionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateDescriptor(InferenceConfigDescriptorAction), options); + } + else if (InferenceConfigValue is not null) + { + writer.WritePropertyName("inference_config"); + JsonSerializer.Serialize(writer, InferenceConfigValue, options); + } + + if (InputDescriptor is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputDescriptor, options); + } + else if (InputDescriptorAction is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.InputDescriptor(InputDescriptorAction), options); + } + else if (InputValue is not null) + { + writer.WritePropertyName("input"); + JsonSerializer.Serialize(writer, InputValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (ModelSizeBytesValue.HasValue) + { + writer.WritePropertyName("model_size_bytes"); + writer.WriteNumberValue(ModelSizeBytesValue.Value); + } + + if (ModelTypeValue is not null) + { + writer.WritePropertyName("model_type"); + JsonSerializer.Serialize(writer, ModelTypeValue, options); + } + + if (!string.IsNullOrEmpty(PlatformArchitectureValue)) + { + writer.WritePropertyName("platform_architecture"); + writer.WriteStringValue(PlatformArchitectureValue); + } + + if (PrefixStringsDescriptor is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsDescriptor, options); + } + else if (PrefixStringsDescriptorAction is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsDescriptor(PrefixStringsDescriptorAction), options); + } + else if (PrefixStringsValue is not null) + { + writer.WritePropertyName("prefix_strings"); + JsonSerializer.Serialize(writer, PrefixStringsValue, options); + } + + if (TagsValue is not null) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, TagsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs new file mode 100644 index 00000000000..7c3cf04a8ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutTrainedModelResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; init; } + + /// + /// Information on the creator of the trained model. + /// + [JsonInclude, JsonPropertyName("created_by")] + public string? CreatedBy { get; init; } + + /// + /// The time when the trained model was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Any field map described in the inference configuration takes precedence. + /// + [JsonInclude, JsonPropertyName("default_field_map")] + public IReadOnlyDictionary? DefaultFieldMap { get; init; } + + /// + /// The free-text description of the trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The estimated heap usage in bytes to keep the trained model in memory. + /// + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public int? EstimatedHeapMemoryUsageBytes { get; init; } + + /// + /// The estimated number of operations to use the trained model. + /// + [JsonInclude, JsonPropertyName("estimated_operations")] + public int? EstimatedOperations { get; init; } + + /// + /// True if the full model definition is present. + /// + [JsonInclude, JsonPropertyName("fully_defined")] + public bool? FullyDefined { get; init; } + + /// + /// The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required. + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? InferenceConfig { get; init; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput Input { get; init; } + + /// + /// The license level of the trained model. + /// + [JsonInclude, JsonPropertyName("license_level")] + public string? LicenseLevel { get; init; } + [JsonInclude, JsonPropertyName("location")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation? Location { get; init; } + + /// + /// An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects. + /// + [JsonInclude, JsonPropertyName("metadata")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata? Metadata { get; init; } + + /// + /// Identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize? ModelSizeBytes { get; init; } + + /// + /// The model type + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? ModelType { get; init; } + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; init; } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or none. + /// + [JsonInclude, JsonPropertyName("tags")] + public IReadOnlyCollection Tags { get; init; } + + /// + /// The Elasticsearch version number in which the trained model was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs new file mode 100644 index 00000000000..f6477fa0f2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class PutTrainedModelVocabularyRequestParameters : RequestParameters +{ +} + +/// +/// Creates a trained model vocabulary.
This API is supported only for natural language processing (NLP) models.
The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition.
+///
+public sealed partial class PutTrainedModelVocabularyRequest : PlainRequest +{ + public PutTrainedModelVocabularyRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelVocabulary; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_vocabulary"; + + /// + /// The optional model merges if required by the tokenizer. + /// + [JsonInclude, JsonPropertyName("merges")] + public ICollection? Merges { get; set; } + + /// + /// The optional vocabulary value scores if required by the tokenizer. + /// + [JsonInclude, JsonPropertyName("scores")] + public ICollection? Scores { get; set; } + + /// + /// The model vocabulary, which must not be empty. + /// + [JsonInclude, JsonPropertyName("vocabulary")] + public ICollection Vocabulary { get; set; } +} + +/// +/// Creates a trained model vocabulary.
This API is supported only for natural language processing (NLP) models.
The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition.
+///
+public sealed partial class PutTrainedModelVocabularyRequestDescriptor : RequestDescriptor +{ + internal PutTrainedModelVocabularyRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTrainedModelVocabularyRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningPutTrainedModelVocabulary; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.put_trained_model_vocabulary"; + + public PutTrainedModelVocabularyRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + return Self; + } + + private ICollection? MergesValue { get; set; } + private ICollection? ScoresValue { get; set; } + private ICollection VocabularyValue { get; set; } + + /// + /// The optional model merges if required by the tokenizer. + /// + public PutTrainedModelVocabularyRequestDescriptor Merges(ICollection? merges) + { + MergesValue = merges; + return Self; + } + + /// + /// The optional vocabulary value scores if required by the tokenizer. + /// + public PutTrainedModelVocabularyRequestDescriptor Scores(ICollection? scores) + { + ScoresValue = scores; + return Self; + } + + /// + /// The model vocabulary, which must not be empty. + /// + public PutTrainedModelVocabularyRequestDescriptor Vocabulary(ICollection vocabulary) + { + VocabularyValue = vocabulary; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MergesValue is not null) + { + writer.WritePropertyName("merges"); + JsonSerializer.Serialize(writer, MergesValue, options); + } + + if (ScoresValue is not null) + { + writer.WritePropertyName("scores"); + JsonSerializer.Serialize(writer, ScoresValue, options); + } + + writer.WritePropertyName("vocabulary"); + JsonSerializer.Serialize(writer, VocabularyValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs new file mode 100644 index 00000000000..8acbf4ee3c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PutTrainedModelVocabularyResponse : 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/_Generated/Api/MachineLearning/ResetJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs new file mode 100644 index 00000000000..e0943d8e9e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ResetJobRequestParameters : RequestParameters +{ + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Should this request wait until the operation has completed before
returning.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Resets an anomaly detection job.
All model state and results are deleted. The job is ready to start over as if
it had just been created.
It is not currently possible to reset multiple jobs using wildcards or a
comma separated list.
+///
+public sealed partial class ResetJobRequest : PlainRequest +{ + public ResetJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.reset_job"; + + /// + /// Specifies whether annotations that have been added by the
user should be deleted along with any auto-generated annotations when the job is
reset.
+ ///
+ [JsonIgnore] + public bool? DeleteUserAnnotations { get => Q("delete_user_annotations"); set => Q("delete_user_annotations", value); } + + /// + /// Should this request wait until the operation has completed before
returning.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Resets an anomaly detection job.
All model state and results are deleted. The job is ready to start over as if
it had just been created.
It is not currently possible to reset multiple jobs using wildcards or a
comma separated list.
+///
+public sealed partial class ResetJobRequestDescriptor : RequestDescriptor +{ + internal ResetJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResetJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.reset_job"; + + public ResetJobRequestDescriptor DeleteUserAnnotations(bool? deleteUserAnnotations = true) => Qs("delete_user_annotations", deleteUserAnnotations); + public ResetJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public ResetJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + 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/_Generated/Api/MachineLearning/ResetJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs new file mode 100644 index 00000000000..0e4d2efea7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ResetJobResponse : 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/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..8b7e8443ffe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class RevertModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Reverts to a specific snapshot.
The machine learning features react quickly to anomalous input, learning new
behaviors in data. Highly anomalous input increases the variance in the
models whilst the system learns whether this is a new step-change in behavior
or a one-off event. In the case where this anomalous input is known to be a
one-off, then it might be appropriate to reset the model state to a time
before this event. For example, you might consider reverting to a saved
snapshot after Black Friday or a critical system failure.
+///
+public sealed partial class RevertModelSnapshotRequest : PlainRequest +{ + public RevertModelSnapshotRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningRevertModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.revert_model_snapshot"; + + /// + /// Refer to the description for the `delete_intervening_results` query parameter. + /// + [JsonInclude, JsonPropertyName("delete_intervening_results")] + public bool? DeleteInterveningResults { get; set; } +} + +/// +/// Reverts to a specific snapshot.
The machine learning features react quickly to anomalous input, learning new
behaviors in data. Highly anomalous input increases the variance in the
models whilst the system learns whether this is a new step-change in behavior
or a one-off event. In the case where this anomalous input is known to be a
one-off, then it might be appropriate to reset the model state to a time
before this event. For example, you might consider reverting to a saved
snapshot after Black Friday or a critical system failure.
+///
+public sealed partial class RevertModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal RevertModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public RevertModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningRevertModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.revert_model_snapshot"; + + public RevertModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public RevertModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + return Self; + } + + private bool? DeleteInterveningResultsValue { get; set; } + + /// + /// Refer to the description for the `delete_intervening_results` query parameter. + /// + public RevertModelSnapshotRequestDescriptor DeleteInterveningResults(bool? deleteInterveningResults = true) + { + DeleteInterveningResultsValue = deleteInterveningResults; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DeleteInterveningResultsValue.HasValue) + { + writer.WritePropertyName("delete_intervening_results"); + writer.WriteBooleanValue(DeleteInterveningResultsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..845e682de52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class RevertModelSnapshotResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("model")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs new file mode 100644 index 00000000000..6e00c1bb4c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class SetUpgradeModeRequestParameters : RequestParameters +{ + /// + /// When `true`, it enables `upgrade_mode` which temporarily halts all job
and datafeed tasks and prohibits new job and datafeed tasks from
starting.
+ ///
+ public bool? Enabled { get => Q("enabled"); set => Q("enabled", value); } + + /// + /// The time to wait for the request to be completed. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Sets a cluster wide upgrade_mode setting that prepares machine learning
indices for an upgrade.
When upgrading your cluster, in some circumstances you must restart your
nodes and reindex your machine learning indices. In those circumstances,
there must be no machine learning jobs running. You can close the machine
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
you can use this API to temporarily halt tasks associated with the jobs and
datafeeds and prevent new jobs from opening. You can also use this API
during upgrades that do not require you to reindex your machine learning
indices, though stopping jobs is not a requirement in that case.
You can see the current value for the upgrade_mode setting by using the get
machine learning info API.
+///
+public sealed partial class SetUpgradeModeRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningSetUpgradeMode; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.set_upgrade_mode"; + + /// + /// When `true`, it enables `upgrade_mode` which temporarily halts all job
and datafeed tasks and prohibits new job and datafeed tasks from
starting.
+ ///
+ [JsonIgnore] + public bool? Enabled { get => Q("enabled"); set => Q("enabled", value); } + + /// + /// The time to wait for the request to be completed. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Sets a cluster wide upgrade_mode setting that prepares machine learning
indices for an upgrade.
When upgrading your cluster, in some circumstances you must restart your
nodes and reindex your machine learning indices. In those circumstances,
there must be no machine learning jobs running. You can close the machine
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
you can use this API to temporarily halt tasks associated with the jobs and
datafeeds and prevent new jobs from opening. You can also use this API
during upgrades that do not require you to reindex your machine learning
indices, though stopping jobs is not a requirement in that case.
You can see the current value for the upgrade_mode setting by using the get
machine learning info API.
+///
+public sealed partial class SetUpgradeModeRequestDescriptor : RequestDescriptor +{ + internal SetUpgradeModeRequestDescriptor(Action configure) => configure.Invoke(this); + + public SetUpgradeModeRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningSetUpgradeMode; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.set_upgrade_mode"; + + public SetUpgradeModeRequestDescriptor Enabled(bool? enabled = true) => Qs("enabled", enabled); + public SetUpgradeModeRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs new file mode 100644 index 00000000000..ba87e130c59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class SetUpgradeModeResponse : 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/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..5fa61a21051 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StartDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Controls the amount of time to wait until the data frame analytics job
starts.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequest : PlainRequest +{ + public StartDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + /// + /// Controls the amount of time to wait until the data frame analytics job
starts.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequestDescriptor : RequestDescriptor, StartDataFrameAnalyticsRequestParameters> +{ + internal StartDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StartDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + public StartDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public StartDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Starts a data frame analytics job.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
If the destination index does not exist, it is created automatically the
first time you start the data frame analytics job. The
`index.number_of_shards` and `index.number_of_replicas` settings for the
destination index are copied from the source index. If there are multiple
source indices, the destination index copies the highest setting values. The
mappings for the destination index are also copied from the source indices.
If there are any mapping conflicts, the job fails to start.
If the destination index exists, it is used as is. You can therefore set up
the destination index in advance with custom settings and mappings.
+///
+public sealed partial class StartDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal StartDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_data_frame_analytics"; + + public StartDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public StartDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..b4b1722342b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StartDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + + /// + /// The ID of the node that the job was started on. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
The node ID of the node the job has been assigned to, or
an empty string if it hasn't been assigned to a node. In
serverless if the job has been assigned to run then the
node ID will be "serverless".
+ ///
+ [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs new file mode 100644 index 00000000000..17bdf02d400 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StartDatafeedRequestParameters : RequestParameters +{ +} + +/// +/// Starts one or more datafeeds. +/// A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+/// Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. +/// If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.
+/// When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
authorization headers when you created or updated the datafeed, those credentials are used instead.
+///
+public sealed partial class StartDatafeedRequest : PlainRequest +{ + public StartDatafeedRequest(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.start_datafeed"; + + /// + /// Refer to the description for the `end` query parameter. + /// + [JsonInclude, JsonPropertyName("end")] + public DateTimeOffset? End { get; set; } + + /// + /// Refer to the description for the `start` query parameter. + /// + [JsonInclude, JsonPropertyName("start")] + public DateTimeOffset? Start { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Starts one or more datafeeds. +/// A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+/// Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. +/// If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.
+/// When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
authorization headers when you created or updated the datafeed, those credentials are used instead.
+///
+public sealed partial class StartDatafeedRequestDescriptor : RequestDescriptor +{ + internal StartDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.start_datafeed"; + + public StartDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private DateTimeOffset? EndValue { get; set; } + private DateTimeOffset? StartValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `end` query parameter. + /// + public StartDatafeedRequestDescriptor End(DateTimeOffset? end) + { + EndValue = end; + return Self; + } + + /// + /// Refer to the description for the `start` query parameter. + /// + public StartDatafeedRequestDescriptor Start(DateTimeOffset? start) + { + StartValue = start; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public StartDatafeedRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EndValue is not null) + { + writer.WritePropertyName("end"); + JsonSerializer.Serialize(writer, EndValue, options); + } + + if (StartValue is not null) + { + writer.WritePropertyName("start"); + JsonSerializer.Serialize(writer, StartValue, options); + } + + 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/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs new file mode 100644 index 00000000000..ce72f25268a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StartDatafeedResponse : ElasticsearchResponse +{ + /// + /// The ID of the node that the job was started on. In serverless this will be the "serverless".
If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
+ ///
+ [JsonInclude, JsonPropertyName("node")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Node { get; init; } + + /// + /// For a successful response, this value is always `true`. On failure, an exception is returned instead. + /// + [JsonInclude, JsonPropertyName("started")] + public bool Started { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs new file mode 100644 index 00000000000..1b19bd129e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StartTrainedModelDeploymentRequestParameters : RequestParameters +{ + /// + /// The inference cache size (in memory outside the JVM heap) per node for the model.
The default value is the same size as the `model_size_bytes`. To disable the cache,
`0b` can be provided.
+ ///
+ public Elastic.Clients.Elasticsearch.ByteSize? CacheSize { get => Q("cache_size"); set => Q("cache_size", value); } + + /// + /// A unique identifier for the deployment of the model. + /// + public string? DeploymentId { get => Q("deployment_id"); set => Q("deployment_id", value); } + + /// + /// The number of model allocations on each node where the model is deployed.
All allocations on a node share the same copy of the model in memory but use
a separate set of threads to evaluate the model.
Increasing this value generally increases the throughput.
If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ public int? NumberOfAllocations { get => Q("number_of_allocations"); set => Q("number_of_allocations", value); } + + /// + /// The deployment priority. + /// + public Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority? Priority { get => Q("priority"); set => Q("priority", value); } + + /// + /// Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
this value, new requests are rejected with a 429 error.
+ ///
+ public int? QueueCapacity { get => Q("queue_capacity"); set => Q("queue_capacity", value); } + + /// + /// Sets the number of threads used by each model allocation during inference. This generally increases
the inference speed. The inference process is a compute-bound process; any number
greater than the number of available hardware threads on the machine does not increase the
inference speed. If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ public int? ThreadsPerAllocation { get => Q("threads_per_allocation"); set => Q("threads_per_allocation", value); } + + /// + /// Specifies the amount of time to wait for the model to deploy. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specifies the allocation status to wait for before returning. + /// + public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState? WaitFor { get => Q("wait_for"); set => Q("wait_for", value); } +} + +/// +/// Starts a trained model deployment, which allocates the model to every machine learning node. +/// +public sealed partial class StartTrainedModelDeploymentRequest : PlainRequest +{ + public StartTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_trained_model_deployment"; + + /// + /// The inference cache size (in memory outside the JVM heap) per node for the model.
The default value is the same size as the `model_size_bytes`. To disable the cache,
`0b` can be provided.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.ByteSize? CacheSize { get => Q("cache_size"); set => Q("cache_size", value); } + + /// + /// A unique identifier for the deployment of the model. + /// + [JsonIgnore] + public string? DeploymentId { get => Q("deployment_id"); set => Q("deployment_id", value); } + + /// + /// The number of model allocations on each node where the model is deployed.
All allocations on a node share the same copy of the model in memory but use
a separate set of threads to evaluate the model.
Increasing this value generally increases the throughput.
If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ [JsonIgnore] + public int? NumberOfAllocations { get => Q("number_of_allocations"); set => Q("number_of_allocations", value); } + + /// + /// The deployment priority. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority? Priority { get => Q("priority"); set => Q("priority", value); } + + /// + /// Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
this value, new requests are rejected with a 429 error.
+ ///
+ [JsonIgnore] + public int? QueueCapacity { get => Q("queue_capacity"); set => Q("queue_capacity", value); } + + /// + /// Sets the number of threads used by each model allocation during inference. This generally increases
the inference speed. The inference process is a compute-bound process; any number
greater than the number of available hardware threads on the machine does not increase the
inference speed. If this setting is greater than the number of hardware threads
it will automatically be changed to a value less than the number of hardware threads.
+ ///
+ [JsonIgnore] + public int? ThreadsPerAllocation { get => Q("threads_per_allocation"); set => Q("threads_per_allocation", value); } + + /// + /// Specifies the amount of time to wait for the model to deploy. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Specifies the allocation status to wait for before returning. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState? WaitFor { get => Q("wait_for"); set => Q("wait_for", value); } +} + +/// +/// Starts a trained model deployment, which allocates the model to every machine learning node. +/// +public sealed partial class StartTrainedModelDeploymentRequestDescriptor : RequestDescriptor +{ + internal StartTrainedModelDeploymentRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartTrainedModelDeploymentRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStartTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.start_trained_model_deployment"; + + public StartTrainedModelDeploymentRequestDescriptor CacheSize(Elastic.Clients.Elasticsearch.ByteSize? cacheSize) => Qs("cache_size", cacheSize); + public StartTrainedModelDeploymentRequestDescriptor DeploymentId(string? deploymentId) => Qs("deployment_id", deploymentId); + public StartTrainedModelDeploymentRequestDescriptor NumberOfAllocations(int? numberOfAllocations) => Qs("number_of_allocations", numberOfAllocations); + public StartTrainedModelDeploymentRequestDescriptor Priority(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority? priority) => Qs("priority", priority); + public StartTrainedModelDeploymentRequestDescriptor QueueCapacity(int? queueCapacity) => Qs("queue_capacity", queueCapacity); + public StartTrainedModelDeploymentRequestDescriptor ThreadsPerAllocation(int? threadsPerAllocation) => Qs("threads_per_allocation", threadsPerAllocation); + public StartTrainedModelDeploymentRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public StartTrainedModelDeploymentRequestDescriptor WaitFor(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState? waitFor) => Qs("wait_for", waitFor); + + public StartTrainedModelDeploymentRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs new file mode 100644 index 00000000000..de829f86d0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StartTrainedModelDeploymentResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("assignment")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Assignment { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..564c737f2ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs @@ -0,0 +1,156 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StopDataFrameAnalyticsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty data_frame_analytics
array when there are no matches and the subset of results when there are
partial matches. If this parameter is false, the request returns a 404
status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If true, the data frame analytics job is stopped forcefully. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Controls the amount of time to wait until the data frame analytics job
stops. Defaults to 20 seconds.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequest : PlainRequest +{ + public StopDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no data frame analytics
jobs that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// The default value is true, which returns an empty data_frame_analytics
array when there are no matches and the subset of results when there are
partial matches. If this parameter is false, the request returns a 404
status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If true, the data frame analytics job is stopped forcefully. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Controls the amount of time to wait until the data frame analytics job
stops. Defaults to 20 seconds.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequestDescriptor : RequestDescriptor, StopDataFrameAnalyticsRequestParameters> +{ + internal StopDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StopDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + public StopDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public StopDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Stops one or more data frame analytics jobs.
A data frame analytics job can be started and stopped multiple times
throughout its lifecycle.
+///
+public sealed partial class StopDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal StopDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_data_frame_analytics"; + + public StopDataFrameAnalyticsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopDataFrameAnalyticsRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopDataFrameAnalyticsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public StopDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..b367f3fd569 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StopDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs new file mode 100644 index 00000000000..c3bc6307a5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StopDatafeedRequestParameters : RequestParameters +{ +} + +/// +/// Stops one or more datafeeds.
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+///
+public sealed partial class StopDatafeedRequest : PlainRequest +{ + public StopDatafeedRequest(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.stop_datafeed"; + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + [JsonInclude, JsonPropertyName("allow_no_match")] + public bool? AllowNoMatch { get; set; } + + /// + /// Refer to the description for the `force` query parameter. + /// + [JsonInclude, JsonPropertyName("force")] + public bool? Force { get; set; } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Stops one or more datafeeds.
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
multiple times throughout its lifecycle.
+///
+public sealed partial class StopDatafeedRequestDescriptor : RequestDescriptor +{ + internal StopDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.stop_datafeed"; + + public StopDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private bool? AllowNoMatchValue { get; set; } + private bool? ForceValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// Refer to the description for the `allow_no_match` query parameter. + /// + public StopDatafeedRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) + { + AllowNoMatchValue = allowNoMatch; + return Self; + } + + /// + /// Refer to the description for the `force` query parameter. + /// + public StopDatafeedRequestDescriptor Force(bool? force = true) + { + ForceValue = force; + return Self; + } + + /// + /// Refer to the description for the `timeout` query parameter. + /// + public StopDatafeedRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowNoMatchValue.HasValue) + { + writer.WritePropertyName("allow_no_match"); + writer.WriteBooleanValue(AllowNoMatchValue.Value); + } + + if (ForceValue.HasValue) + { + writer.WritePropertyName("force"); + writer.WriteBooleanValue(ForceValue.Value); + } + + 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/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs new file mode 100644 index 00000000000..984d91eafa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StopDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs new file mode 100644 index 00000000000..79f4acf9cbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class StopTrainedModelDeploymentRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and
there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
If `false`, the request returns a 404 status code when there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you
restart the model deployment.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Stops a trained model deployment. +/// +public sealed partial class StopTrainedModelDeploymentRequest : PlainRequest +{ + public StopTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_trained_model_deployment"; + + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and
there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
If `false`, the request returns a 404 status code when there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you
restart the model deployment.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Stops a trained model deployment. +/// +public sealed partial class StopTrainedModelDeploymentRequestDescriptor : RequestDescriptor +{ + internal StopTrainedModelDeploymentRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopTrainedModelDeploymentRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningStopTrainedModelDeployment; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.stop_trained_model_deployment"; + + public StopTrainedModelDeploymentRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopTrainedModelDeploymentRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public StopTrainedModelDeploymentRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId) + { + RouteValues.Required("model_id", modelId); + 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/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs new file mode 100644 index 00000000000..b7e839abf4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class StopTrainedModelDeploymentResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs new file mode 100644 index 00000000000..c4f8ebbcbf2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpdateDataFrameAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequest : PlainRequest +{ + public UpdateDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequestDescriptor : RequestDescriptor, UpdateDataFrameAnalyticsRequestParameters> +{ + internal UpdateDataFrameAnalyticsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + public UpdateDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private string? DescriptionValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates an existing data frame analytics job. +/// +public sealed partial class UpdateDataFrameAnalyticsRequestDescriptor : RequestDescriptor +{ + internal UpdateDataFrameAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateDataFrameAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDataFrameAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_data_frame_analytics"; + + public UpdateDataFrameAnalyticsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private bool? AllowLazyStartValue { get; set; } + private string? DescriptionValue { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// Specifies whether this job can start when there is insufficient machine
learning node capacity for it to be immediately assigned to a node.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor AllowLazyStart(bool? allowLazyStart = true) + { + AllowLazyStartValue = allowLazyStart; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateDataFrameAnalyticsRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The maximum number of threads to be used by the analysis. Using more
threads may decrease the time necessary to complete the analysis at the
cost of using more CPU. Note that the process may use additional threads
for operational functionality other than the analysis itself.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are permitted for
analytical processing. If your `elasticsearch.yml` file contains an
`xpack.ml.max_model_memory_limit` setting, an error occurs when you try
to create data frame analytics jobs that have `model_memory_limit` values
greater than that setting.
+ ///
+ public UpdateDataFrameAnalyticsRequestDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyStartValue.HasValue) + { + writer.WritePropertyName("allow_lazy_start"); + writer.WriteBooleanValue(AllowLazyStartValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs new file mode 100644 index 00000000000..b1c66fc047e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpdateDataFrameAnalyticsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs new file mode 100644 index 00000000000..b1ddad51af0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs @@ -0,0 +1,1069 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpdateDatafeedRequestParameters : RequestParameters +{ + /// + /// If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the
`_all` string or when no indices are specified.
+ ///
+ 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. Valid values are:
+ /// * `all`: Match any data stream or index, including hidden ones.
* `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
* `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or both.
* `none`: Wildcard patterns are not accepted.
* `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, unavailable indices (missing or closed) are ignored. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +internal sealed partial class UpdateDatafeedRequestConverter : JsonConverter +{ + public override UpdateDatafeedRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new UpdateDatafeedRequest(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations") + { + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, UpdateDatafeedRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+[JsonConverter(typeof(UpdateDatafeedRequestConverter))] +public sealed partial class UpdateDatafeedRequest : PlainRequest +{ + public UpdateDatafeedRequest(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + public UpdateDatafeedRequest() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + /// + /// If `true`, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the
`_all` string or when no indices are specified.
+ ///
+ [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. Valid values are:
+ /// * `all`: Match any data stream or index, including hidden ones.
* `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
* `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or both.
* `none`: Wildcard patterns are not accepted.
* `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
+ ///
+ [JsonIgnore] + public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } + + /// + /// If `true`, unavailable indices (missing or closed) are ignored. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public ICollection? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search. + /// + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; set; } + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ [JsonInclude, JsonPropertyName("script_fields")] + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ [JsonInclude, JsonPropertyName("scroll_size")] + public int? ScrollSize { get; set; } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+public sealed partial class UpdateDatafeedRequestDescriptor : RequestDescriptor, UpdateDatafeedRequestParameters> +{ + internal UpdateDatafeedRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + public UpdateDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public UpdateDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ public UpdateDatafeedRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ public UpdateDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public UpdateDatafeedRequestDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public UpdateDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public UpdateDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public UpdateDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public UpdateDatafeedRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public UpdateDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ public UpdateDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates the properties of a datafeed.
You must stop and start the datafeed for the changes to be applied.
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
those credentials are used instead.
+///
+public sealed partial class UpdateDatafeedRequestDescriptor : RequestDescriptor +{ + internal UpdateDatafeedRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateDatafeedRequestDescriptor(Elastic.Clients.Elasticsearch.Id datafeedId) : base(r => r.Required("datafeed_id", datafeedId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateDatafeed; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_datafeed"; + + public UpdateDatafeedRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public UpdateDatafeedRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public UpdateDatafeedRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public UpdateDatafeedRequestDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id datafeedId) + { + RouteValues.Required("datafeed_id", datafeedId); + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only
with low cardinality data.
+ ///
+ public UpdateDatafeedRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might search over long time periods, for several months or years. This search is split into time
chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of
these time chunks are calculated; it is an advanced configuration option.
+ ///
+ public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally
search over indices that have already been read in an effort to determine whether any data has subsequently been
added to the index. If missing data is found, it is a good indication that the `query_delay` is set too low and
the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time
datafeeds.
+ ///
+ public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is
either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
span. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are
written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value
must be divisible by the interval of the date histogram aggregation.
+ ///
+ public UpdateDatafeedRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine
learning nodes must have the `remote_cluster_client` role.
+ ///
+ public UpdateDatafeedRequestDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public UpdateDatafeedRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period), it automatically
stops and closes the associated job after this many real-time searches return no documents. In other words,
it stops after `frequency` times `max_empty_searches` of real-time operation. If not set, a datafeed with no
end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
+ ///
+ public UpdateDatafeedRequestDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an
Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this
object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also
changed. Therefore, the time required to learn might be long and the understandability of the results is
unpredictable. If you want to make significant changes to the source data, it is recommended that you
clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one
when you are satisfied with the results of the job.
+ ///
+ public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public UpdateDatafeedRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might
not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default
value is randomly selected between `60s` and `120s`. This randomness improves the query performance
when there are multiple jobs running on the same node.
+ ///
+ public UpdateDatafeedRequestDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public UpdateDatafeedRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.
The detector configuration objects in a job can contain functions that use these script fields.
+ ///
+ public UpdateDatafeedRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.
The maximum value is the value of `index.max_result_window`.
+ ///
+ public UpdateDatafeedRequestDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs new file mode 100644 index 00000000000..ebee97ee8e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpdateDatafeedResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("chunking_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; init; } + [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + [JsonInclude, JsonPropertyName("delayed_data_check_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("indices_options")] + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_empty_searches")] + public int? MaxEmptySearches { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; init; } + [JsonInclude, JsonPropertyName("query_delay")] + public Elastic.Clients.Elasticsearch.Duration QueryDelay { get; init; } + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IReadOnlyDictionary? RuntimeMappings { get; init; } + [JsonInclude, JsonPropertyName("script_fields")] + public IReadOnlyDictionary? ScriptFields { get; init; } + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs new file mode 100644 index 00000000000..60f988ecd8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpdateFilterRequestParameters : RequestParameters +{ +} + +/// +/// Updates the description of a filter, adds items, or removes items from the list. +/// +public sealed partial class UpdateFilterRequest : PlainRequest +{ + public UpdateFilterRequest(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_filter"; + + /// + /// The items to add to the filter. + /// + [JsonInclude, JsonPropertyName("add_items")] + public ICollection? AddItems { get; set; } + + /// + /// A description for the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The items to remove from the filter. + /// + [JsonInclude, JsonPropertyName("remove_items")] + public ICollection? RemoveItems { get; set; } +} + +/// +/// Updates the description of a filter, adds items, or removes items from the list. +/// +public sealed partial class UpdateFilterRequestDescriptor : RequestDescriptor +{ + internal UpdateFilterRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateFilterRequestDescriptor(Elastic.Clients.Elasticsearch.Id filterId) : base(r => r.Required("filter_id", filterId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateFilter; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_filter"; + + public UpdateFilterRequestDescriptor FilterId(Elastic.Clients.Elasticsearch.Id filterId) + { + RouteValues.Required("filter_id", filterId); + return Self; + } + + private ICollection? AddItemsValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? RemoveItemsValue { get; set; } + + /// + /// The items to add to the filter. + /// + public UpdateFilterRequestDescriptor AddItems(ICollection? addItems) + { + AddItemsValue = addItems; + return Self; + } + + /// + /// A description for the filter. + /// + public UpdateFilterRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The items to remove from the filter. + /// + public UpdateFilterRequestDescriptor RemoveItems(ICollection? removeItems) + { + RemoveItemsValue = removeItems; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AddItemsValue is not null) + { + writer.WritePropertyName("add_items"); + JsonSerializer.Serialize(writer, AddItemsValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (RemoveItemsValue is not null) + { + writer.WritePropertyName("remove_items"); + JsonSerializer.Serialize(writer, RemoveItemsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs new file mode 100644 index 00000000000..7cbe0f06cbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpdateFilterResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs new file mode 100644 index 00000000000..ac17cc4be02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs @@ -0,0 +1,944 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpdateJobRequestParameters : RequestParameters +{ +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequest : PlainRequest +{ + public UpdateJobRequest(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool? AllowLazyOpen { get; set; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit? AnalysisLimits { get; set; } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; set; } + [JsonInclude, JsonPropertyName("categorization_filters")] + public ICollection? CategorizationFilters { get; set; } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ [JsonInclude, JsonPropertyName("custom_settings")] + public IDictionary? CustomSettings { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; set; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// An array of detector update objects. + /// + [JsonInclude, JsonPropertyName("detectors")] + public ICollection? Detectors { get; set; } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + [JsonInclude, JsonPropertyName("groups")] + public ICollection? Groups { get; set; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } + [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Duration? ModelPruneWindow { get; set; } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; set; } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; set; } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; set; } +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequestDescriptor : RequestDescriptor, UpdateJobRequestParameters> +{ + internal UpdateJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + public UpdateJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? BackgroundPersistIntervalValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private IDictionary? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action> DetectorsDescriptorAction { get; set; } + private Action>[] DetectorsDescriptorActions { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action> ModelPlotConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ModelPruneWindowValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ public UpdateJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ public UpdateJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + public UpdateJobRequestDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ public UpdateJobRequestDescriptor CustomSettings(Func, FluentDictionary> selector) + { + CustomSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ public UpdateJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of detector update objects. + /// + public UpdateJobRequestDescriptor Detectors(ICollection? detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Action> configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(params Action>[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public UpdateJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Action> configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ public UpdateJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ public UpdateJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ public UpdateJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DetectorsValue is not null) + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates certain properties of an anomaly detection job. +/// +public sealed partial class UpdateJobRequestDescriptor : RequestDescriptor +{ + internal UpdateJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId) : base(r => r.Required("job_id", jobId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_job"; + + public UpdateJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + private bool? AllowLazyOpenValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? BackgroundPersistIntervalValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private IDictionary? CustomSettingsValue { get; set; } + private long? DailyModelSnapshotRetentionAfterDaysValue { get; set; } + private string? DescriptionValue { get; set; } + private ICollection? DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action DetectorsDescriptorAction { get; set; } + private Action[] DetectorsDescriptorActions { get; set; } + private ICollection? GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotConfigDescriptor { get; set; } + private Action ModelPlotConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ModelPruneWindowValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private long? RenormalizationWindowDaysValue { get; set; } + private long? ResultsRetentionDaysValue { get; set; } + + /// + /// Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If `false` and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this
option is set to `true`, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
+ ///
+ public UpdateJobRequestDescriptor AllowLazyOpen(bool? allowLazyOpen = true) + { + AllowLazyOpenValue = allowLazyOpen; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The time between each periodic persistence
of the model.
The default value is a randomized value between 3 to 4 hours, which
avoids all jobs persisting at exactly the same time. The smallest allowed
value is 1 hour.
For very large models (several GB), persistence could take 10-20 minutes,
so do not set the value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
+ ///
+ public UpdateJobRequestDescriptor BackgroundPersistInterval(Elastic.Clients.Elasticsearch.Duration? backgroundPersistInterval) + { + BackgroundPersistIntervalValue = backgroundPersistInterval; + return Self; + } + + public UpdateJobRequestDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
+ ///
+ public UpdateJobRequestDescriptor CustomSettings(Func, FluentDictionary> selector) + { + CustomSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to `model_snapshot_retention_days`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
+ ///
+ public UpdateJobRequestDescriptor DailyModelSnapshotRetentionAfterDays(long? dailyModelSnapshotRetentionAfterDays) + { + DailyModelSnapshotRetentionAfterDaysValue = dailyModelSnapshotRetentionAfterDays; + return Self; + } + + /// + /// A description of the job. + /// + public UpdateJobRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// An array of detector update objects. + /// + public UpdateJobRequestDescriptor Detectors(ICollection? detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(Action configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor Detectors(params Action[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A list of job groups. A job can belong to no groups or many. + /// + public UpdateJobRequestDescriptor Groups(ICollection? groups) + { + GroupsValue = groups; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlotConfig) + { + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigValue = modelPlotConfig; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptorAction = null; + ModelPlotConfigDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor ModelPlotConfig(Action configure) + { + ModelPlotConfigValue = null; + ModelPlotConfigDescriptor = null; + ModelPlotConfigDescriptorAction = configure; + return Self; + } + + public UpdateJobRequestDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies the maximum period of time (in
days) that snapshots are retained. This period is relative to the
timestamp of the most recent snapshot for this job.
+ ///
+ public UpdateJobRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public UpdateJobRequestDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
+ ///
+ public UpdateJobRequestDescriptor RenormalizationWindowDays(long? renormalizationWindowDays) + { + RenormalizationWindowDaysValue = renormalizationWindowDays; + return Self; + } + + /// + /// Advanced configuration option. The period of time (in days) that results
are retained. Age is calculated relative to the timestamp of the latest
bucket result. If this property has a non-null value, once per day at
00:30 (server time), results that are the specified number of days older
than the latest bucket result are deleted from Elasticsearch. The default
value is null, which means all results are retained.
+ ///
+ public UpdateJobRequestDescriptor ResultsRetentionDays(long? resultsRetentionDays) + { + ResultsRetentionDaysValue = resultsRetentionDays; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowLazyOpenValue.HasValue) + { + writer.WritePropertyName("allow_lazy_open"); + writer.WriteBooleanValue(AllowLazyOpenValue.Value); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (BackgroundPersistIntervalValue is not null) + { + writer.WritePropertyName("background_persist_interval"); + JsonSerializer.Serialize(writer, BackgroundPersistIntervalValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (CustomSettingsValue is not null) + { + writer.WritePropertyName("custom_settings"); + JsonSerializer.Serialize(writer, CustomSettingsValue, options); + } + + if (DailyModelSnapshotRetentionAfterDaysValue.HasValue) + { + writer.WritePropertyName("daily_model_snapshot_retention_after_days"); + writer.WriteNumberValue(DailyModelSnapshotRetentionAfterDaysValue.Value); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (DetectorsValue is not null) + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (GroupsValue is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (ModelPlotConfigDescriptor is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigDescriptor, options); + } + else if (ModelPlotConfigDescriptorAction is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotConfigDescriptorAction), options); + } + else if (ModelPlotConfigValue is not null) + { + writer.WritePropertyName("model_plot_config"); + JsonSerializer.Serialize(writer, ModelPlotConfigValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (RenormalizationWindowDaysValue.HasValue) + { + writer.WritePropertyName("renormalization_window_days"); + writer.WriteNumberValue(RenormalizationWindowDaysValue.Value); + } + + if (ResultsRetentionDaysValue.HasValue) + { + writer.WritePropertyName("results_retention_days"); + writer.WriteNumberValue(ResultsRetentionDaysValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs new file mode 100644 index 00000000000..0fbf50d92cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpdateJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; init; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; init; } + [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("custom_settings")] + public IReadOnlyDictionary? CustomSettings { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; init; } + [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.Datafeed? DatafeedConfig { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("finished_time")] + public long? FinishedTime { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("job_type")] + public string JobType { get; init; } + [JsonInclude, JsonPropertyName("job_version")] + public string JobVersion { get; init; } + [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs new file mode 100644 index 00000000000..f00d20aedc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpdateModelSnapshotRequestParameters : RequestParameters +{ +} + +/// +/// Updates certain properties of a snapshot. +/// +public sealed partial class UpdateModelSnapshotRequest : PlainRequest +{ + public UpdateModelSnapshotRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_model_snapshot"; + + /// + /// A description of the model snapshot. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// If `true`, this snapshot will not be deleted during automatic cleanup of
snapshots older than `model_snapshot_retention_days`. However, this
snapshot will be deleted when the job is deleted.
+ ///
+ [JsonInclude, JsonPropertyName("retain")] + public bool? Retain { get; set; } +} + +/// +/// Updates certain properties of a snapshot. +/// +public sealed partial class UpdateModelSnapshotRequestDescriptor : RequestDescriptor +{ + internal UpdateModelSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateModelSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpdateModelSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.update_model_snapshot"; + + public UpdateModelSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public UpdateModelSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + return Self; + } + + private string? DescriptionValue { get; set; } + private bool? RetainValue { get; set; } + + /// + /// A description of the model snapshot. + /// + public UpdateModelSnapshotRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// If `true`, this snapshot will not be deleted during automatic cleanup of
snapshots older than `model_snapshot_retention_days`. However, this
snapshot will be deleted when the job is deleted.
+ ///
+ public UpdateModelSnapshotRequestDescriptor Retain(bool? retain = true) + { + RetainValue = retain; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (RetainValue.HasValue) + { + writer.WritePropertyName("retain"); + writer.WriteBooleanValue(RetainValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs new file mode 100644 index 00000000000..c5fb4fc4670 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpdateModelSnapshotResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("model")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs new file mode 100644 index 00000000000..2014df017fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class UpgradeJobSnapshotRequestParameters : RequestParameters +{ + /// + /// Controls the time to wait for the request to complete. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// When true, the API won’t respond until the upgrade is complete.
Otherwise, it responds as soon as the upgrade task is assigned to a node.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Upgrades an anomaly detection model snapshot to the latest major version.
Over time, older snapshot formats are deprecated and removed. Anomaly
detection jobs support only snapshots that are from the current or previous
major version.
This API provides a means to upgrade a snapshot to the current major version.
This aids in preparing the cluster for an upgrade to the next major version.
Only one snapshot per anomaly detection job can be upgraded at a time and the
upgraded snapshot cannot be the current snapshot of the anomaly detection
job.
+///
+public sealed partial class UpgradeJobSnapshotRequest : PlainRequest +{ + public UpgradeJobSnapshotRequest(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpgradeJobSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.upgrade_job_snapshot"; + + /// + /// Controls the time to wait for the request to complete. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// When true, the API won’t respond until the upgrade is complete.
Otherwise, it responds as soon as the upgrade task is assigned to a node.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Upgrades an anomaly detection model snapshot to the latest major version.
Over time, older snapshot formats are deprecated and removed. Anomaly
detection jobs support only snapshots that are from the current or previous
major version.
This API provides a means to upgrade a snapshot to the current major version.
This aids in preparing the cluster for an upgrade to the next major version.
Only one snapshot per anomaly detection job can be upgraded at a time and the
upgraded snapshot cannot be the current snapshot of the anomaly detection
job.
+///
+public sealed partial class UpgradeJobSnapshotRequestDescriptor : RequestDescriptor +{ + internal UpgradeJobSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpgradeJobSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) : base(r => r.Required("job_id", jobId).Required("snapshot_id", snapshotId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningUpgradeJobSnapshot; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "ml.upgrade_job_snapshot"; + + public UpgradeJobSnapshotRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public UpgradeJobSnapshotRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public UpgradeJobSnapshotRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id jobId) + { + RouteValues.Required("job_id", jobId); + return Self; + } + + public UpgradeJobSnapshotRequestDescriptor SnapshotId(Elastic.Clients.Elasticsearch.Id snapshotId) + { + RouteValues.Required("snapshot_id", snapshotId); + 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/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs new file mode 100644 index 00000000000..51315ffcabe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class UpgradeJobSnapshotResponse : ElasticsearchResponse +{ + /// + /// When true, this means the task is complete. When false, it is still running. + /// + [JsonInclude, JsonPropertyName("completed")] + public bool Completed { get; init; } + + /// + /// The ID of the node that the upgrade task was started on if it is still running. In serverless this will be the "serverless". + /// + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs new file mode 100644 index 00000000000..26515adc6fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ValidateDetectorRequestParameters : RequestParameters +{ +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.MachineLearning.Detector Detector { get; set; } +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequestDescriptor : RequestDescriptor, ValidateDetectorRequestParameters> +{ + internal ValidateDetectorRequestDescriptor(Action> configure) => configure.Invoke(this); + public ValidateDetectorRequestDescriptor(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector) => DetectorValue = detector; + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + private Elastic.Clients.Elasticsearch.MachineLearning.Detector DetectorValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorDescriptor { get; set; } + private Action> DetectorDescriptorAction { get; set; } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector) + { + DetectorDescriptor = null; + DetectorDescriptorAction = null; + DetectorValue = detector; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorValue = null; + DetectorDescriptorAction = null; + DetectorDescriptor = descriptor; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Action> configure) + { + DetectorValue = null; + DetectorDescriptor = null; + DetectorDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Validates an anomaly detection detector. +/// +public sealed partial class ValidateDetectorRequestDescriptor : RequestDescriptor +{ + internal ValidateDetectorRequestDescriptor(Action configure) => configure.Invoke(this); + public ValidateDetectorRequestDescriptor(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector) => DetectorValue = detector; + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidateDetector; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate_detector"; + + private Elastic.Clients.Elasticsearch.MachineLearning.Detector DetectorValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorDescriptor { get; set; } + private Action DetectorDescriptorAction { get; set; } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector) + { + DetectorDescriptor = null; + DetectorDescriptorAction = null; + DetectorValue = detector; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorValue = null; + DetectorDescriptorAction = null; + DetectorDescriptor = descriptor; + return Self; + } + + public ValidateDetectorRequestDescriptor Detector(Action configure) + { + DetectorValue = null; + DetectorDescriptor = null; + DetectorDescriptorAction = configure; + 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/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs new file mode 100644 index 00000000000..e9c159efb1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ValidateDetectorResponse : 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/_Generated/Api/MachineLearning/ValidateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs new file mode 100644 index 00000000000..fdf773f5e5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class ValidateRequestParameters : RequestParameters +{ +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfig { get; set; } + [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimits { get; set; } + [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataDescription? DataDescription { get; set; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + [JsonInclude, JsonPropertyName("job_id")] + public Elastic.Clients.Elasticsearch.Id? JobId { get; set; } + [JsonInclude, JsonPropertyName("model_plot")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlot { get; set; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public Elastic.Clients.Elasticsearch.Id? ModelSnapshotId { get; set; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long? ModelSnapshotRetentionDays { get; set; } + [JsonInclude, JsonPropertyName("results_index_name")] + public Elastic.Clients.Elasticsearch.IndexName? ResultsIndexName { get; set; } +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequestDescriptor : RequestDescriptor, ValidateRequestParameters> +{ + internal ValidateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ValidateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action> AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescription? DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action> DataDescriptionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotDescriptor { get; set; } + private Action> ModelPlotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? ModelSnapshotIdValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? ResultsIndexNameValue { get; set; } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Action> configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescription? dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Action> configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public ValidateRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlot) + { + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = null; + ModelPlotValue = modelPlot; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotValue = null; + ModelPlotDescriptorAction = null; + ModelPlotDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Action> configure) + { + ModelPlotValue = null; + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotId(Elastic.Clients.Elasticsearch.Id? modelSnapshotId) + { + ModelSnapshotIdValue = modelSnapshotId; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + public ValidateRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else if (DataDescriptionValue is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (ModelPlotDescriptor is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotDescriptor, options); + } + else if (ModelPlotDescriptorAction is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotDescriptorAction), options); + } + else if (ModelPlotValue is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotValue, options); + } + + if (ModelSnapshotIdValue is not null) + { + writer.WritePropertyName("model_snapshot_id"); + JsonSerializer.Serialize(writer, ModelSnapshotIdValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Validates an anomaly detection job. +/// +public sealed partial class ValidateRequestDescriptor : RequestDescriptor +{ + internal ValidateRequestDescriptor(Action configure) => configure.Invoke(this); + + public ValidateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningValidate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "ml.validate"; + + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? AnalysisConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor AnalysisConfigDescriptor { get; set; } + private Action AnalysisConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimitsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor AnalysisLimitsDescriptor { get; set; } + private Action AnalysisLimitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescription? DataDescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor DataDescriptionDescriptor { get; set; } + private Action DataDescriptionDescriptorAction { get; set; } + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor ModelPlotDescriptor { get; set; } + private Action ModelPlotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? ModelSnapshotIdValue { get; set; } + private long? ModelSnapshotRetentionDaysValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? ResultsIndexNameValue { get; set; } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig? analysisConfig) + { + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigValue = analysisConfig; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor descriptor) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptorAction = null; + AnalysisConfigDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisConfig(Action configure) + { + AnalysisConfigValue = null; + AnalysisConfigDescriptor = null; + AnalysisConfigDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? analysisLimits) + { + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsValue = analysisLimits; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor descriptor) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptorAction = null; + AnalysisLimitsDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor AnalysisLimits(Action configure) + { + AnalysisLimitsValue = null; + AnalysisLimitsDescriptor = null; + AnalysisLimitsDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescription? dataDescription) + { + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = null; + DataDescriptionValue = dataDescription; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor descriptor) + { + DataDescriptionValue = null; + DataDescriptionDescriptorAction = null; + DataDescriptionDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor DataDescription(Action configure) + { + DataDescriptionValue = null; + DataDescriptionDescriptor = null; + DataDescriptionDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + public ValidateRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? modelPlot) + { + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = null; + ModelPlotValue = modelPlot; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor descriptor) + { + ModelPlotValue = null; + ModelPlotDescriptorAction = null; + ModelPlotDescriptor = descriptor; + return Self; + } + + public ValidateRequestDescriptor ModelPlot(Action configure) + { + ModelPlotValue = null; + ModelPlotDescriptor = null; + ModelPlotDescriptorAction = configure; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotId(Elastic.Clients.Elasticsearch.Id? modelSnapshotId) + { + ModelSnapshotIdValue = modelSnapshotId; + return Self; + } + + public ValidateRequestDescriptor ModelSnapshotRetentionDays(long? modelSnapshotRetentionDays) + { + ModelSnapshotRetentionDaysValue = modelSnapshotRetentionDays; + return Self; + } + + public ValidateRequestDescriptor ResultsIndexName(Elastic.Clients.Elasticsearch.IndexName? resultsIndexName) + { + ResultsIndexNameValue = resultsIndexName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalysisConfigDescriptor is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigDescriptor, options); + } + else if (AnalysisConfigDescriptorAction is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigDescriptor(AnalysisConfigDescriptorAction), options); + } + else if (AnalysisConfigValue is not null) + { + writer.WritePropertyName("analysis_config"); + JsonSerializer.Serialize(writer, AnalysisConfigValue, options); + } + + if (AnalysisLimitsDescriptor is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsDescriptor, options); + } + else if (AnalysisLimitsDescriptorAction is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsDescriptor(AnalysisLimitsDescriptorAction), options); + } + else if (AnalysisLimitsValue is not null) + { + writer.WritePropertyName("analysis_limits"); + JsonSerializer.Serialize(writer, AnalysisLimitsValue, options); + } + + if (DataDescriptionDescriptor is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionDescriptor, options); + } + else if (DataDescriptionDescriptorAction is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionDescriptor(DataDescriptionDescriptorAction), options); + } + else if (DataDescriptionValue is not null) + { + writer.WritePropertyName("data_description"); + JsonSerializer.Serialize(writer, DataDescriptionValue, options); + } + + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (ModelPlotDescriptor is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotDescriptor, options); + } + else if (ModelPlotDescriptorAction is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigDescriptor(ModelPlotDescriptorAction), options); + } + else if (ModelPlotValue is not null) + { + writer.WritePropertyName("model_plot"); + JsonSerializer.Serialize(writer, ModelPlotValue, options); + } + + if (ModelSnapshotIdValue is not null) + { + writer.WritePropertyName("model_snapshot_id"); + JsonSerializer.Serialize(writer, ModelSnapshotIdValue, options); + } + + if (ModelSnapshotRetentionDaysValue.HasValue) + { + writer.WritePropertyName("model_snapshot_retention_days"); + writer.WriteNumberValue(ModelSnapshotRetentionDaysValue.Value); + } + + if (ResultsIndexNameValue is not null) + { + writer.WritePropertyName("results_index_name"); + JsonSerializer.Serialize(writer, ResultsIndexNameValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs new file mode 100644 index 00000000000..f0ca585fd42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ValidateResponse : 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/_Generated/Api/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs index dac954b98ed..89e689fc2c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs @@ -85,7 +85,7 @@ public MultiGetRequest(Elastic.Clients.Elasticsearch.IndexName? index) : base(r { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -161,11 +161,15 @@ public sealed partial class MultiGetRequestDescriptor : RequestDescri { internal MultiGetRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiGetRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -189,9 +193,9 @@ public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch. } 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.Core.MGet.MultiGetOperationDescriptor DocsDescriptor { get; set; } + private Action> DocsDescriptorAction { get; set; } + private Action>[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ids? IdsValue { get; set; } /// @@ -206,7 +210,7 @@ public MultiGetRequestDescriptor Docs(ICollection Docs(Core.MGet.MultiGetOperationDescriptor descriptor) + public MultiGetRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -215,7 +219,7 @@ public MultiGetRequestDescriptor Docs(Core.MGet.MultiGetOperationDesc return Self; } - public MultiGetRequestDescriptor Docs(Action configure) + public MultiGetRequestDescriptor Docs(Action> configure) { DocsValue = null; DocsDescriptor = null; @@ -224,7 +228,7 @@ public MultiGetRequestDescriptor Docs(Action Docs(params Action[] configure) + public MultiGetRequestDescriptor Docs(params Action>[] configure) { DocsValue = null; DocsDescriptor = null; @@ -256,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -265,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationDescriptor(action), options); } writer.WriteEndArray(); @@ -293,11 +297,15 @@ public sealed partial class MultiGetRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public MultiGetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiGetRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMget; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiGet; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -321,9 +329,9 @@ public MultiGetRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? } 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.Core.MGet.MultiGetOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ids? IdsValue { get; set; } /// @@ -338,7 +346,7 @@ public MultiGetRequestDescriptor Docs(ICollection configure) + public MultiGetRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -356,7 +364,7 @@ public MultiGetRequestDescriptor Docs(Action[] configure) + public MultiGetRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -388,7 +396,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -397,7 +405,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.MGet.MultiGetOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs index 9228f06c409..13199e2f0a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs index 617ee9ac0ac..f1eb9e6102f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs @@ -107,7 +107,7 @@ public MultiSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -186,7 +186,7 @@ public MultiSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base /// [JsonIgnore] public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } - public List Searches { get; set; } + public List Searches { get; set; } void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) { @@ -214,15 +214,19 @@ async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClien /// /// Allows to execute several search operations in one request. /// -public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, MultiSearchRequestParameters>, IStreamSerializable +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, MultiSearchRequestParameters> { internal MultiSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -253,33 +257,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + public MultiSearchRequestDescriptor AddSearches(Elastic.Clients.Elasticsearch.Core.MSearch.SearchRequestItem searches) { - _items.Add(search); + _items.Add(searches); return this; } } @@ -287,15 +269,19 @@ public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequ /// /// Allows to execute several search operations in one request. /// -public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor, IStreamSerializable +public sealed partial class MultiSearchRequestDescriptor : RequestDescriptor { internal MultiSearchRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearch; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearch; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -326,33 +312,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchRequestDescriptor AddSearch(Core.MSearch.SearchRequestItem search) + public MultiSearchRequestDescriptor AddSearches(Elastic.Clients.Elasticsearch.Core.MSearch.SearchRequestItem searches) { - _items.Add(search); + _items.Add(searches); return this; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs index 2e26e205372..a942a757900 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs index 354f0d980ea..d410b8ebff7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs @@ -72,7 +72,7 @@ public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Indices? indices { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -109,7 +109,7 @@ public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Indices? indices /// [JsonIgnore] public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } - public List SearchTemplates { get; set; } + public List SearchTemplates { get; set; } void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting) { @@ -137,15 +137,19 @@ async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClien /// /// Runs multiple templated searches with a single request. /// -public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, MultiSearchTemplateRequestParameters>, IStreamSerializable +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, MultiSearchTemplateRequestParameters> { internal MultiSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchTemplateRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -169,33 +173,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + public MultiSearchTemplateRequestDescriptor AddSearchTemplates(Elastic.Clients.Elasticsearch.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates) { - _items.Add(item); + _items.Add(searchTemplates); return this; } } @@ -203,15 +185,19 @@ public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate. /// /// Runs multiple templated searches with a single request. /// -public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor, IStreamSerializable +public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor { internal MultiSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public MultiSearchTemplateRequestDescriptor() { } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMsearchTemplate; + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -235,33 +221,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { } - 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); - } - } + List _items = new(); - public MultiSearchTemplateRequestDescriptor Add(Core.MSearchTemplate.SearchTemplateRequestItem item) + public MultiSearchTemplateRequestDescriptor AddSearchTemplates(Elastic.Clients.Elasticsearch.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates) { - _items.Add(item); + _items.Add(searchTemplates); return this; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs index c1c41cb3605..061ee312555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs index cf46f4ff5c8..5222ce4935a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -194,6 +194,10 @@ public sealed partial class MultiTermVectorsRequestDescriptor : Reque { internal MultiTermVectorsRequestDescriptor(Action> configure) => configure.Invoke(this); + public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiTermVectorsRequestDescriptor() { } @@ -225,9 +229,9 @@ public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasti } private ICollection? DocsValue { get; set; } - private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } - private Action> DocsDescriptorAction { get; set; } - private Action>[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action> DocsDescriptorAction { get; set; } + private Action>[] DocsDescriptorActions { get; set; } private ICollection? IdsValue { get; set; } /// @@ -242,7 +246,7 @@ public MultiTermVectorsRequestDescriptor Docs(ICollection Docs(Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) + public MultiTermVectorsRequestDescriptor Docs(Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor descriptor) { DocsValue = null; DocsDescriptorAction = null; @@ -251,7 +255,7 @@ public MultiTermVectorsRequestDescriptor Docs(Core.Mtermvectors.Multi return Self; } - public MultiTermVectorsRequestDescriptor Docs(Action> configure) + public MultiTermVectorsRequestDescriptor Docs(Action> configure) { DocsValue = null; DocsDescriptor = null; @@ -260,7 +264,7 @@ public MultiTermVectorsRequestDescriptor Docs(Action Docs(params Action>[] configure) + public MultiTermVectorsRequestDescriptor Docs(params Action>[] configure) { DocsValue = null; DocsDescriptor = null; @@ -292,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -301,7 +305,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); } writer.WriteEndArray(); @@ -329,6 +333,10 @@ public sealed partial class MultiTermVectorsRequestDescriptor : RequestDescripto { internal MultiTermVectorsRequestDescriptor(Action configure) => configure.Invoke(this); + public MultiTermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) + { + } + public MultiTermVectorsRequestDescriptor() { } @@ -360,9 +368,9 @@ public MultiTermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ind } private ICollection? DocsValue { get; set; } - private Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } - private Action DocsDescriptorAction { get; set; } - private Action[] DocsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } private ICollection? IdsValue { get; set; } /// @@ -377,7 +385,7 @@ public MultiTermVectorsRequestDescriptor Docs(ICollection configure) + public MultiTermVectorsRequestDescriptor Docs(Action configure) { DocsValue = null; DocsDescriptor = null; @@ -395,7 +403,7 @@ public MultiTermVectorsRequestDescriptor Docs(Action[] configure) + public MultiTermVectorsRequestDescriptor Docs(params Action[] configure) { DocsValue = null; DocsDescriptor = null; @@ -427,7 +435,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docs"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(DocsDescriptorAction), options); writer.WriteEndArray(); } else if (DocsDescriptorActions is not null) @@ -436,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs index 0dc8a1d11fb..36c309f3cab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs new file mode 100644 index 00000000000..80e8073ac2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class ClearRepositoriesMeteringArchiveRequestParameters : RequestParameters +{ +} + +/// +/// You can use this API to clear the archived repositories metering information in the cluster. +/// +public sealed partial class ClearRepositoriesMeteringArchiveRequest : PlainRequest +{ + public ClearRepositoriesMeteringArchiveRequest(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion) : base(r => r.Required("node_id", nodeId).Required("max_archive_version", maxArchiveVersion)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesClearRepositoriesMeteringArchive; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.clear_repositories_metering_archive"; +} + +/// +/// You can use this API to clear the archived repositories metering information in the cluster. +/// +public sealed partial class ClearRepositoriesMeteringArchiveRequestDescriptor : RequestDescriptor +{ + internal ClearRepositoriesMeteringArchiveRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearRepositoriesMeteringArchiveRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion) : base(r => r.Required("node_id", nodeId).Required("max_archive_version", maxArchiveVersion)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesClearRepositoriesMeteringArchive; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.clear_repositories_metering_archive"; + + public ClearRepositoriesMeteringArchiveRequestDescriptor MaxArchiveVersion(long maxArchiveVersion) + { + RouteValues.Required("max_archive_version", maxArchiveVersion); + return Self; + } + + public ClearRepositoriesMeteringArchiveRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds nodeId) + { + RouteValues.Required("node_id", nodeId); + 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/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs new file mode 100644 index 00000000000..faf3fa4ce04 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ClearRepositoriesMeteringArchiveResponse : ElasticsearchResponse +{ + /// + /// Name of the cluster. Based on the [Cluster name setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#cluster-name). + /// + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + + /// + /// Contains repositories metering information for the nodes selected by the request. + /// + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs new file mode 100644 index 00000000000..32a960b86fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class GetRepositoriesMeteringInfoRequestParameters : RequestParameters +{ +} + +/// +/// You can use the cluster repositories metering API to retrieve repositories metering information in a cluster.
This API exposes monotonically non-decreasing counters and it’s expected that clients would durably store the
information needed to compute aggregations over a period of time. Additionally, the information exposed by this
API is volatile, meaning that it won’t be present after node restarts.
+///
+public sealed partial class GetRepositoriesMeteringInfoRequest : PlainRequest +{ + public GetRepositoriesMeteringInfoRequest(Elastic.Clients.Elasticsearch.NodeIds nodeId) : base(r => r.Required("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesGetRepositoriesMeteringInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.get_repositories_metering_info"; +} + +/// +/// You can use the cluster repositories metering API to retrieve repositories metering information in a cluster.
This API exposes monotonically non-decreasing counters and it’s expected that clients would durably store the
information needed to compute aggregations over a period of time. Additionally, the information exposed by this
API is volatile, meaning that it won’t be present after node restarts.
+///
+public sealed partial class GetRepositoriesMeteringInfoRequestDescriptor : RequestDescriptor +{ + internal GetRepositoriesMeteringInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRepositoriesMeteringInfoRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds nodeId) : base(r => r.Required("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesGetRepositoriesMeteringInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.get_repositories_metering_info"; + + public GetRepositoriesMeteringInfoRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds nodeId) + { + RouteValues.Required("node_id", nodeId); + 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/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs new file mode 100644 index 00000000000..e3526737654 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class GetRepositoriesMeteringInfoResponse : ElasticsearchResponse +{ + /// + /// Name of the cluster. Based on the [Cluster name setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#cluster-name). + /// + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + + /// + /// Contains repositories metering information for the nodes selected by the request. + /// + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs new file mode 100644 index 00000000000..212869482e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class HotThreadsRequestParameters : RequestParameters +{ + /// + /// If true, known idle threads (e.g. waiting in a socket select, or to get
a task from an empty queue) are filtered out.
+ ///
+ public bool? IgnoreIdleThreads { get => Q("ignore_idle_threads"); set => Q("ignore_idle_threads", value); } + + /// + /// The interval to do the second sampling of threads. + /// + public Elastic.Clients.Elasticsearch.Duration? Interval { get => Q("interval"); set => Q("interval", 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Number of samples of thread stacktrace. + /// + public long? Snapshots { get => Q("snapshots"); set => Q("snapshots", value); } + + /// + /// The sort order for 'cpu' type (default: total) + /// + public Elastic.Clients.Elasticsearch.ThreadType? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Specifies the number of hot threads to provide information for. + /// + public long? Threads { get => Q("threads"); set => Q("threads", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// The type to sample. + /// + public Elastic.Clients.Elasticsearch.ThreadType? Type { get => Q("type"); set => Q("type", value); } +} + +/// +/// This API yields a breakdown of the hot threads on each selected node in the cluster.
The output is plain text with a breakdown of each node’s top hot threads.
+///
+public sealed partial class HotThreadsRequest : PlainRequest +{ + public HotThreadsRequest() + { + } + + public HotThreadsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesHotThreads; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.hot_threads"; + + /// + /// If true, known idle threads (e.g. waiting in a socket select, or to get
a task from an empty queue) are filtered out.
+ ///
+ [JsonIgnore] + public bool? IgnoreIdleThreads { get => Q("ignore_idle_threads"); set => Q("ignore_idle_threads", value); } + + /// + /// The interval to do the second sampling of threads. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Interval { get => Q("interval"); set => Q("interval", 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Number of samples of thread stacktrace. + /// + [JsonIgnore] + public long? Snapshots { get => Q("snapshots"); set => Q("snapshots", value); } + + /// + /// The sort order for 'cpu' type (default: total) + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.ThreadType? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// Specifies the number of hot threads to provide information for. + /// + [JsonIgnore] + public long? Threads { get => Q("threads"); set => Q("threads", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// The type to sample. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.ThreadType? Type { get => Q("type"); set => Q("type", value); } +} + +/// +/// This API yields a breakdown of the hot threads on each selected node in the cluster.
The output is plain text with a breakdown of each node’s top hot threads.
+///
+public sealed partial class HotThreadsRequestDescriptor : RequestDescriptor +{ + internal HotThreadsRequestDescriptor(Action configure) => configure.Invoke(this); + + public HotThreadsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public HotThreadsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesHotThreads; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.hot_threads"; + + public HotThreadsRequestDescriptor IgnoreIdleThreads(bool? ignoreIdleThreads = true) => Qs("ignore_idle_threads", ignoreIdleThreads); + public HotThreadsRequestDescriptor Interval(Elastic.Clients.Elasticsearch.Duration? interval) => Qs("interval", interval); + public HotThreadsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public HotThreadsRequestDescriptor Snapshots(long? snapshots) => Qs("snapshots", snapshots); + public HotThreadsRequestDescriptor Sort(Elastic.Clients.Elasticsearch.ThreadType? sort) => Qs("sort", sort); + public HotThreadsRequestDescriptor Threads(long? threads) => Qs("threads", threads); + public HotThreadsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public HotThreadsRequestDescriptor Type(Elastic.Clients.Elasticsearch.ThreadType? type) => Qs("type", type); + + public HotThreadsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/Nodes/HotThreadsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs new file mode 100644 index 00000000000..c64300ec776 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class HotThreadsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("hot_threads")] + public IReadOnlyCollection HotThreads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs new file mode 100644 index 00000000000..a928f948846 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class NodesInfoRequestParameters : RequestParameters +{ + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster nodes information. +/// +public sealed partial class NodesInfoRequest : PlainRequest +{ + public NodesInfoRequest() + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesInfoRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.info"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns cluster nodes information. +/// +public sealed partial class NodesInfoRequestDescriptor : RequestDescriptor +{ + internal NodesInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public NodesInfoRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + public NodesInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.info"; + + public NodesInfoRequestDescriptor FlatSettings(bool? flatSettings = true) => Qs("flat_settings", flatSettings); + public NodesInfoRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesInfoRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public NodesInfoRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesInfoRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/Nodes/NodesInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs new file mode 100644 index 00000000000..d68d4fa9b2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodesInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs new file mode 100644 index 00000000000..be5862b28da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class NodesStatsRequestParameters : RequestParameters +{ + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + /// + public Elastic.Clients.Elasticsearch.Fields? CompletionFields { get => Q("completion_fields"); set => Q("completion_fields", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + /// + public Elastic.Clients.Elasticsearch.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.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + public bool? 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.Level? Level { get => Q("level"); set => Q("level", 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// A comma-separated list of document types for the indexing index metric. + /// + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequest : PlainRequest +{ + public NodesStatsRequest() + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.Metrics? metric, Elastic.Clients.Elasticsearch.Metrics? indexMetric) : base(r => r.Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric, Elastic.Clients.Elasticsearch.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.stats"; + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Fields? CompletionFields { get => Q("completion_fields"); set => Q("completion_fields", value); } + + /// + /// Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.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.Fields? Fields { get => Q("fields"); set => Q("fields", value); } + + /// + /// Comma-separated list of search groups to include in the search statistics. + /// + [JsonIgnore] + public bool? 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.Level? Level { get => Q("level"); set => Q("level", 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// A comma-separated list of document types for the indexing index metric. + /// + [JsonIgnore] + public ICollection? Types { get => Q?>("types"); set => Q("types", value); } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequestDescriptor : RequestDescriptor, NodesStatsRequestParameters> +{ + internal NodesStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public NodesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric, Elastic.Clients.Elasticsearch.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.stats"; + + public NodesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Fields? completionFields) => Qs("completion_fields", completionFields); + public NodesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public NodesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public NodesStatsRequestDescriptor Groups(bool? groups = true) => Qs("groups", groups); + public NodesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public NodesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? level) => Qs("level", level); + public NodesStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public NodesStatsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public NodesStatsRequestDescriptor IndexMetric(Elastic.Clients.Elasticsearch.Metrics? indexMetric) + { + RouteValues.Optional("index_metric", indexMetric); + return Self; + } + + public NodesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns cluster nodes statistics. +/// +public sealed partial class NodesStatsRequestDescriptor : RequestDescriptor +{ + internal NodesStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public NodesStatsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric, Elastic.Clients.Elasticsearch.Metrics? indexMetric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric).Optional("index_metric", indexMetric)) + { + } + + public NodesStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.stats"; + + public NodesStatsRequestDescriptor CompletionFields(Elastic.Clients.Elasticsearch.Fields? completionFields) => Qs("completion_fields", completionFields); + public NodesStatsRequestDescriptor FielddataFields(Elastic.Clients.Elasticsearch.Fields? fielddataFields) => Qs("fielddata_fields", fielddataFields); + public NodesStatsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); + public NodesStatsRequestDescriptor Groups(bool? groups = true) => Qs("groups", groups); + public NodesStatsRequestDescriptor IncludeSegmentFileSizes(bool? includeSegmentFileSizes = true) => Qs("include_segment_file_sizes", includeSegmentFileSizes); + public NodesStatsRequestDescriptor IncludeUnloadedSegments(bool? includeUnloadedSegments = true) => Qs("include_unloaded_segments", includeUnloadedSegments); + public NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? level) => Qs("level", level); + public NodesStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public NodesStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public NodesStatsRequestDescriptor Types(ICollection? types) => Qs("types", types); + + public NodesStatsRequestDescriptor IndexMetric(Elastic.Clients.Elasticsearch.Metrics? indexMetric) + { + RouteValues.Optional("index_metric", indexMetric); + return Self; + } + + public NodesStatsRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/Nodes/NodesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs new file mode 100644 index 00000000000..1f707d23f34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodesStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string? ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs new file mode 100644 index 00000000000..a4f4bb0efa7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class NodesUsageRequestParameters : RequestParameters +{ + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns information on the usage of features. +/// +public sealed partial class NodesUsageRequest : PlainRequest +{ + public NodesUsageRequest() + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("metric", metric)) + { + } + + public NodesUsageRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.usage"; + + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Returns information on the usage of features. +/// +public sealed partial class NodesUsageRequestDescriptor : RequestDescriptor +{ + internal NodesUsageRequestDescriptor(Action configure) => configure.Invoke(this); + + public NodesUsageRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId, Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("node_id", nodeId).Optional("metric", metric)) + { + } + + public NodesUsageRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "nodes.usage"; + + public NodesUsageRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public NodesUsageRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Metrics? metric) + { + RouteValues.Optional("metric", metric); + return Self; + } + + public NodesUsageRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/Nodes/NodesUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs new file mode 100644 index 00000000000..a0c67acf133 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodesUsageResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs new file mode 100644 index 00000000000..d3e12dab29b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class ReloadSecureSettingsRequestParameters : RequestParameters +{ + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Reloads the keystore on nodes in the cluster. +/// +public sealed partial class ReloadSecureSettingsRequest : PlainRequest +{ + public ReloadSecureSettingsRequest() + { + } + + public ReloadSecureSettingsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesReloadSecureSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "nodes.reload_secure_settings"; + + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// The password for the Elasticsearch keystore. + /// + [JsonInclude, JsonPropertyName("secure_settings_password")] + public string? SecureSettingsPassword { get; set; } +} + +/// +/// Reloads the keystore on nodes in the cluster. +/// +public sealed partial class ReloadSecureSettingsRequestDescriptor : RequestDescriptor +{ + internal ReloadSecureSettingsRequestDescriptor(Action configure) => configure.Invoke(this); + + public ReloadSecureSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public ReloadSecureSettingsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NodesReloadSecureSettings; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "nodes.reload_secure_settings"; + + public ReloadSecureSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public ReloadSecureSettingsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + return Self; + } + + private string? SecureSettingsPasswordValue { get; set; } + + /// + /// The password for the Elasticsearch keystore. + /// + public ReloadSecureSettingsRequestDescriptor SecureSettingsPassword(string? secureSettingsPassword) + { + SecureSettingsPasswordValue = secureSettingsPassword; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(SecureSettingsPasswordValue)) + { + writer.WritePropertyName("secure_settings_password"); + writer.WriteStringValue(SecureSettingsPasswordValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs new file mode 100644 index 00000000000..fb74d3b0184 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ReloadSecureSettingsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } + + /// + /// Contains statistics about the number of nodes selected by the request’s node filters. + /// + [JsonInclude, JsonPropertyName("_nodes")] + public Elastic.Clients.Elasticsearch.NodeStatistics? NodeStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs index e89b21a6e35..9d4d32e1f0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs @@ -116,10 +116,6 @@ public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Indices in { } - internal OpenPointInTimeRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -156,10 +152,6 @@ public OpenPointInTimeRequestDescriptor(Elastic.Clients.Elasticsearch.Indices in { } - internal OpenPointInTimeRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceOpenPointInTime; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs index 653207b35e9..cc2ea924c79 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs index 3bba05308d7..55a9d57329a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs index 035539caa29..c5a0821e05e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs @@ -89,15 +89,11 @@ public sealed partial class PutScriptRequestDescriptor : RequestDescr { internal PutScriptRequestDescriptor(Action> configure) => configure.Invoke(this); - public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) - { - } - public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id, Elastic.Clients.Elasticsearch.Name? context) : base(r => r.Required("id", id).Optional("context", context)) { } - internal PutScriptRequestDescriptor() + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) { } @@ -112,21 +108,21 @@ internal PutScriptRequestDescriptor() public PutScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); public PutScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); - public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Name? context) { - RouteValues.Required("id", id); + RouteValues.Optional("context", context); return Self; } - public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Name? context) + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) { - RouteValues.Optional("context", context); + RouteValues.Required("id", id); return Self; } private Elastic.Clients.Elasticsearch.StoredScript ScriptValue { get; set; } - private StoredScriptDescriptor ScriptDescriptor { get; set; } - private Action ScriptDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } /// /// Contains the script or search template, its parameters, and its language. @@ -139,7 +135,7 @@ public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearc return Self; } - public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.StoredScriptDescriptor descriptor) { ScriptValue = null; ScriptDescriptorAction = null; @@ -147,7 +143,7 @@ public PutScriptRequestDescriptor Script(StoredScriptDescriptor descr return Self; } - public PutScriptRequestDescriptor Script(Action configure) + public PutScriptRequestDescriptor Script(Action configure) { ScriptValue = null; ScriptDescriptor = null; @@ -166,7 +162,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptDescriptorAction is not null) { writer.WritePropertyName("script"); - JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.StoredScriptDescriptor(ScriptDescriptorAction), options); } else { @@ -185,15 +181,11 @@ public sealed partial class PutScriptRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) - { - } - public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id, Elastic.Clients.Elasticsearch.Name? context) : base(r => r.Required("id", id).Optional("context", context)) { } - internal PutScriptRequestDescriptor() + public PutScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) { } @@ -208,21 +200,21 @@ internal PutScriptRequestDescriptor() public PutScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); public PutScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); - public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Name? context) { - RouteValues.Required("id", id); + RouteValues.Optional("context", context); return Self; } - public PutScriptRequestDescriptor Context(Elastic.Clients.Elasticsearch.Name? context) + public PutScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) { - RouteValues.Optional("context", context); + RouteValues.Required("id", id); return Self; } private Elastic.Clients.Elasticsearch.StoredScript ScriptValue { get; set; } - private StoredScriptDescriptor ScriptDescriptor { get; set; } - private Action ScriptDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.StoredScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } /// /// Contains the script or search template, its parameters, and its language. @@ -235,7 +227,7 @@ public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.StoredScr return Self; } - public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) + public PutScriptRequestDescriptor Script(Elastic.Clients.Elasticsearch.StoredScriptDescriptor descriptor) { ScriptValue = null; ScriptDescriptorAction = null; @@ -243,7 +235,7 @@ public PutScriptRequestDescriptor Script(StoredScriptDescriptor descriptor) return Self; } - public PutScriptRequestDescriptor Script(Action configure) + public PutScriptRequestDescriptor Script(Action configure) { ScriptValue = null; ScriptDescriptor = null; @@ -262,7 +254,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptDescriptorAction is not null) { writer.WritePropertyName("script"); - JsonSerializer.Serialize(writer, new StoredScriptDescriptor(ScriptDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.StoredScriptDescriptor(ScriptDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs index d614466ef62..94467b97c47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.g.cs new file mode 100644 index 00000000000..bb747a746c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.QueryRuleset; + +public sealed partial class DeleteQueryRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a query ruleset. +/// +public sealed partial class DeleteQueryRulesetRequest : PlainRequest +{ + public DeleteQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.delete"; +} + +/// +/// Deletes a query ruleset. +/// +public sealed partial class DeleteQueryRulesetRequestDescriptor : RequestDescriptor +{ + internal DeleteQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.delete"; + + public DeleteQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + 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/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.g.cs new file mode 100644 index 00000000000..78aa51fd513 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/DeleteQueryRulesetResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class DeleteQueryRulesetResponse : 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/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.g.cs new file mode 100644 index 00000000000..19c9d8aa9da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.QueryRuleset; + +public sealed partial class GetQueryRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Returns the details about a query ruleset +/// +public sealed partial class GetQueryRulesetRequest : PlainRequest +{ + public GetQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.get"; +} + +/// +/// Returns the details about a query ruleset +/// +public sealed partial class GetQueryRulesetRequestDescriptor : RequestDescriptor +{ + internal GetQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.get"; + + public GetQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + 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/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.g.cs new file mode 100644 index 00000000000..6c21e60f001 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/GetQueryRulesetResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class GetQueryRulesetResponse : ElasticsearchResponse +{ + /// + /// Rules associated with the query ruleset + /// + [JsonInclude, JsonPropertyName("rules")] + public IReadOnlyCollection Rules { get; init; } + + /// + /// Query Ruleset unique identifier + /// + [JsonInclude, JsonPropertyName("ruleset_id")] + public string RulesetId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.g.cs new file mode 100644 index 00000000000..c2115d8a3e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.QueryRuleset; + +public sealed partial class ListRequestParameters : RequestParameters +{ + /// + /// Starting offset (default: 0) + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns summarized information about existing query rulesets. +/// +public sealed partial class ListRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetList; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.list"; + + /// + /// Starting offset (default: 0) + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns summarized information about existing query rulesets. +/// +public sealed partial class ListRequestDescriptor : RequestDescriptor +{ + internal ListRequestDescriptor(Action configure) => configure.Invoke(this); + + public ListRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetList; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "query_ruleset.list"; + + public ListRequestDescriptor From(int? from) => Qs("from", from); + public ListRequestDescriptor Size(int? size) => Qs("size", size); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.g.cs new file mode 100644 index 00000000000..be8e382517f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/ListResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class ListResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("results")] + public IReadOnlyCollection Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.g.cs new file mode 100644 index 00000000000..cd94a7006bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.QueryRuleset; + +public sealed partial class PutQueryRulesetRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a query ruleset. +/// +public sealed partial class PutQueryRulesetRequest : PlainRequest +{ + public PutQueryRulesetRequest(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetPut; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_ruleset.put"; + + [JsonInclude, JsonPropertyName("rules")] + public ICollection Rules { get; set; } +} + +/// +/// Creates or updates a query ruleset. +/// +public sealed partial class PutQueryRulesetRequestDescriptor : RequestDescriptor +{ + internal PutQueryRulesetRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutQueryRulesetRequestDescriptor(Elastic.Clients.Elasticsearch.Id rulesetId) : base(r => r.Required("ruleset_id", rulesetId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.QueryRulesetPut; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "query_ruleset.put"; + + public PutQueryRulesetRequestDescriptor RulesetId(Elastic.Clients.Elasticsearch.Id rulesetId) + { + RouteValues.Required("ruleset_id", rulesetId); + return Self; + } + + private ICollection RulesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor RulesDescriptor { get; set; } + private Action RulesDescriptorAction { get; set; } + private Action[] RulesDescriptorActions { get; set; } + + public PutQueryRulesetRequestDescriptor Rules(ICollection rules) + { + RulesDescriptor = null; + RulesDescriptorAction = null; + RulesDescriptorActions = null; + RulesValue = rules; + return Self; + } + + public PutQueryRulesetRequestDescriptor Rules(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor descriptor) + { + RulesValue = null; + RulesDescriptorAction = null; + RulesDescriptorActions = null; + RulesDescriptor = descriptor; + return Self; + } + + public PutQueryRulesetRequestDescriptor Rules(Action configure) + { + RulesValue = null; + RulesDescriptor = null; + RulesDescriptorActions = null; + RulesDescriptorAction = configure; + return Self; + } + + public PutQueryRulesetRequestDescriptor Rules(params Action[] configure) + { + RulesValue = null; + RulesDescriptor = null; + RulesDescriptorAction = null; + RulesDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (RulesDescriptor is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, RulesDescriptor, options); + writer.WriteEndArray(); + } + else if (RulesDescriptorAction is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor(RulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (RulesDescriptorActions is not null) + { + writer.WritePropertyName("rules"); + writer.WriteStartArray(); + foreach (var action in RulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("rules"); + JsonSerializer.Serialize(writer, RulesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs new file mode 100644 index 00000000000..441c7879a7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRuleset/PutQueryRulesetResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class PutQueryRulesetResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs index b11bad17b8d..c5a343c35d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs @@ -117,6 +117,10 @@ public sealed partial class RankEvalRequestDescriptor : RequestDescri { internal RankEvalRequestDescriptor(Action> configure) => configure.Invoke(this); + public RankEvalRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RankEvalRequestDescriptor() { } @@ -141,12 +145,12 @@ public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearc } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric? MetricValue { get; set; } - private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } - private Action MetricDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } 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.Core.RankEval.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action> RequestsDescriptorAction { get; set; } + private Action>[] RequestsDescriptorActions { get; set; } /// /// Definition of the evaluation metric to calculate. @@ -159,7 +163,7 @@ public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch return Self; } - public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor descriptor) { MetricValue = null; MetricDescriptorAction = null; @@ -167,7 +171,7 @@ public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricD return Self; } - public RankEvalRequestDescriptor Metric(Action configure) + public RankEvalRequestDescriptor Metric(Action configure) { MetricValue = null; MetricDescriptor = null; @@ -187,7 +191,7 @@ public RankEvalRequestDescriptor Requests(ICollection Requests(Core.RankEval.RankEvalRequestItemDescriptor descriptor) + public RankEvalRequestDescriptor Requests(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemDescriptor descriptor) { RequestsValue = null; RequestsDescriptorAction = null; @@ -196,7 +200,7 @@ public RankEvalRequestDescriptor Requests(Core.RankEval.RankEvalReque return Self; } - public RankEvalRequestDescriptor Requests(Action> configure) + public RankEvalRequestDescriptor Requests(Action> configure) { RequestsValue = null; RequestsDescriptor = null; @@ -205,7 +209,7 @@ public RankEvalRequestDescriptor Requests(Action Requests(params Action>[] configure) + public RankEvalRequestDescriptor Requests(params Action>[] configure) { RequestsValue = null; RequestsDescriptor = null; @@ -225,7 +229,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricDescriptorAction is not null) { writer.WritePropertyName("metric"); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); } else if (MetricValue is not null) { @@ -244,7 +248,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("requests"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); writer.WriteEndArray(); } else if (RequestsDescriptorActions is not null) @@ -253,7 +257,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RequestsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemDescriptor(action), options); } writer.WriteEndArray(); @@ -275,6 +279,10 @@ public sealed partial class RankEvalRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public RankEvalRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public RankEvalRequestDescriptor() { } @@ -299,12 +307,12 @@ public RankEvalRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric? MetricValue { get; set; } - private Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } - private Action MetricDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor MetricDescriptor { get; set; } + private Action MetricDescriptorAction { get; set; } 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.Core.RankEval.RankEvalRequestItemDescriptor RequestsDescriptor { get; set; } + private Action RequestsDescriptorAction { get; set; } + private Action[] RequestsDescriptorActions { get; set; } /// /// Definition of the evaluation metric to calculate. @@ -317,7 +325,7 @@ public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Core.RankE return Self; } - public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor descriptor) + public RankEvalRequestDescriptor Metric(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor descriptor) { MetricValue = null; MetricDescriptorAction = null; @@ -325,7 +333,7 @@ public RankEvalRequestDescriptor Metric(Core.RankEval.RankEvalMetricDescriptor d return Self; } - public RankEvalRequestDescriptor Metric(Action configure) + public RankEvalRequestDescriptor Metric(Action configure) { MetricValue = null; MetricDescriptor = null; @@ -345,7 +353,7 @@ public RankEvalRequestDescriptor Requests(ICollection configure) + public RankEvalRequestDescriptor Requests(Action configure) { RequestsValue = null; RequestsDescriptor = null; @@ -363,7 +371,7 @@ public RankEvalRequestDescriptor Requests(Action[] configure) + public RankEvalRequestDescriptor Requests(params Action[] configure) { RequestsValue = null; RequestsDescriptor = null; @@ -383,7 +391,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricDescriptorAction is not null) { writer.WritePropertyName("metric"); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDescriptor(MetricDescriptorAction), options); } else if (MetricValue is not null) { @@ -402,7 +410,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("requests"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemDescriptor(RequestsDescriptorAction), options); writer.WriteEndArray(); } else if (RequestsDescriptorActions is not null) @@ -411,7 +419,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RequestsDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.RankEval.RankEvalRequestItemDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs index 8d224db5a25..601af7c9338 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -31,7 +32,7 @@ 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; } + public IReadOnlyDictionary Details { get; init; } [JsonInclude, JsonPropertyName("failures")] public IReadOnlyDictionary Failures { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs index c5728b0e574..86c824f2749 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs @@ -196,14 +196,14 @@ public ReindexRequestDescriptor() private Elastic.Clients.Elasticsearch.Conflicts? ConflictsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.Destination DestValue { get; set; } - private Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } - private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private long? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.Source SourceValue { get; set; } - private Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } - private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } /// /// Set to proceed to continue reindexing even if there are conflicts. @@ -225,7 +225,7 @@ public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Co return Self; } - public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descriptor) + public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor descriptor) { DestValue = null; DestDescriptorAction = null; @@ -233,7 +233,7 @@ public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescript return Self; } - public ReindexRequestDescriptor Dest(Action configure) + public ReindexRequestDescriptor Dest(Action configure) { DestValue = null; DestDescriptor = null; @@ -276,7 +276,7 @@ public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch. return Self; } - public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) + public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -284,7 +284,7 @@ public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor< return Self; } - public ReindexRequestDescriptor Source(Action> configure) + public ReindexRequestDescriptor Source(Action> configure) { SourceValue = null; SourceDescriptor = null; @@ -309,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DestDescriptorAction is not null) { writer.WritePropertyName("dest"); - JsonSerializer.Serialize(writer, new Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); } else { @@ -343,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("source"); - JsonSerializer.Serialize(writer, new Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); } else { @@ -385,14 +385,14 @@ public ReindexRequestDescriptor() private Elastic.Clients.Elasticsearch.Conflicts? ConflictsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.Destination DestValue { get; set; } - private Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } - private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private long? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.Source SourceValue { get; set; } - private Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } /// /// Set to proceed to continue reindexing even if there are conflicts. @@ -414,7 +414,7 @@ public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Core.Reindex. return Self; } - public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descriptor) + public ReindexRequestDescriptor Dest(Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor descriptor) { DestValue = null; DestDescriptorAction = null; @@ -422,7 +422,7 @@ public ReindexRequestDescriptor Dest(Core.Reindex.DestinationDescriptor descript return Self; } - public ReindexRequestDescriptor Dest(Action configure) + public ReindexRequestDescriptor Dest(Action configure) { DestValue = null; DestDescriptor = null; @@ -465,7 +465,7 @@ public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Core.Reinde return Self; } - public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) + public ReindexRequestDescriptor Source(Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -473,7 +473,7 @@ public ReindexRequestDescriptor Source(Core.Reindex.SourceDescriptor descriptor) return Self; } - public ReindexRequestDescriptor Source(Action configure) + public ReindexRequestDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -498,7 +498,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DestDescriptorAction is not null) { writer.WritePropertyName("dest"); - JsonSerializer.Serialize(writer, new Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.DestinationDescriptor(DestDescriptorAction), options); } else { @@ -532,7 +532,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("source"); - JsonSerializer.Serialize(writer, new Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor(SourceDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs index 089b104826d..615f5821c06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs index f797cee2bc9..99e11b67139 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class ReindexRethrottleRequestParameters : RequestParamete /// public sealed partial class ReindexRethrottleRequest : PlainRequest { - public ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) + public ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class ReindexRethrottleRequestDescriptor : RequestDescript { internal ReindexRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public ReindexRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal ReindexRethrottleRequestDescriptor() + public ReindexRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal ReindexRethrottleRequestDescriptor() public ReindexRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public ReindexRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id task_id) + public ReindexRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs index 645bc2d3d38..eb0a0d689a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs index 46ef112bd64..0e9288b351b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs @@ -77,6 +77,10 @@ public sealed partial class RenderSearchTemplateRequestDescriptor : R { internal RenderSearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public RenderSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public RenderSearchTemplateRequestDescriptor() { } @@ -155,6 +159,10 @@ public sealed partial class RenderSearchTemplateRequestDescriptor : RequestDescr { internal RenderSearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public RenderSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + public RenderSearchTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs index d583cb4976b..9fba7ed830c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs new file mode 100644 index 00000000000..9a06a2f74e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class DeleteJobRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing rollup job. +/// +public sealed partial class DeleteJobRequest : PlainRequest +{ + public DeleteJobRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.delete_job"; +} + +/// +/// Deletes an existing rollup job. +/// +public sealed partial class DeleteJobRequestDescriptor : RequestDescriptor, DeleteJobRequestParameters> +{ + internal DeleteJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.delete_job"; + + public DeleteJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes an existing rollup job. +/// +public sealed partial class DeleteJobRequestDescriptor : RequestDescriptor +{ + internal DeleteJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupDeleteJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.delete_job"; + + public DeleteJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Rollup/DeleteJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs new file mode 100644 index 00000000000..ecf093b6b08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class DeleteJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("acknowledged")] + public bool Acknowledged { get; init; } + [JsonInclude, JsonPropertyName("task_failures")] + public IReadOnlyCollection? TaskFailures { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs new file mode 100644 index 00000000000..96e9bdbd2aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class GetJobsRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves the configuration, stats, and status of rollup jobs. +/// +public sealed partial class GetJobsRequest : PlainRequest +{ + public GetJobsRequest() + { + } + + public GetJobsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_jobs"; +} + +/// +/// Retrieves the configuration, stats, and status of rollup jobs. +/// +public sealed partial class GetJobsRequestDescriptor : RequestDescriptor, GetJobsRequestParameters> +{ + internal GetJobsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetJobsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetJobsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_jobs"; + + public GetJobsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves the configuration, stats, and status of rollup jobs. +/// +public sealed partial class GetJobsRequestDescriptor : RequestDescriptor +{ + internal GetJobsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetJobsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetJobsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetJobs; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_jobs"; + + public GetJobsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Rollup/GetJobsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs new file mode 100644 index 00000000000..94884fe565a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class GetJobsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs new file mode 100644 index 00000000000..d2d870f6b46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class GetRollupCapsRequestParameters : RequestParameters +{ +} + +/// +/// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. +/// +public sealed partial class GetRollupCapsRequest : PlainRequest +{ + public GetRollupCapsRequest() + { + } + + public GetRollupCapsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_caps"; +} + +/// +/// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. +/// +public sealed partial class GetRollupCapsRequestDescriptor : RequestDescriptor, GetRollupCapsRequestParameters> +{ + internal GetRollupCapsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetRollupCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetRollupCapsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_caps"; + + public GetRollupCapsRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + RouteValues.Optional("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. +/// +public sealed partial class GetRollupCapsRequestDescriptor : RequestDescriptor +{ + internal GetRollupCapsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRollupCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) + { + } + + public GetRollupCapsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_caps"; + + public GetRollupCapsRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs new file mode 100644 index 00000000000..1e293a90e10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class GetRollupCapsResponse : DictionaryResponse +{ + public GetRollupCapsResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetRollupCapsResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs new file mode 100644 index 00000000000..6c403eb36fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class GetRollupIndexCapsRequestParameters : RequestParameters +{ +} + +/// +/// Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). +/// +public sealed partial class GetRollupIndexCapsRequest : PlainRequest +{ + public GetRollupIndexCapsRequest(Elastic.Clients.Elasticsearch.Ids index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupIndexCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_index_caps"; +} + +/// +/// Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). +/// +public sealed partial class GetRollupIndexCapsRequestDescriptor : RequestDescriptor, GetRollupIndexCapsRequestParameters> +{ + internal GetRollupIndexCapsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetRollupIndexCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupIndexCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_index_caps"; + + public GetRollupIndexCapsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ids index) + { + RouteValues.Required("index", index); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). +/// +public sealed partial class GetRollupIndexCapsRequestDescriptor : RequestDescriptor +{ + internal GetRollupIndexCapsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRollupIndexCapsRequestDescriptor(Elastic.Clients.Elasticsearch.Ids index) : base(r => r.Required("index", index)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupGetRollupIndexCaps; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.get_rollup_index_caps"; + + public GetRollupIndexCapsRequestDescriptor Index(Elastic.Clients.Elasticsearch.Ids 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/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs new file mode 100644 index 00000000000..f333279bdc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class GetRollupIndexCapsResponse : DictionaryResponse +{ + public GetRollupIndexCapsResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetRollupIndexCapsResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs new file mode 100644 index 00000000000..64c4cddfd43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs @@ -0,0 +1,556 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class PutJobRequestParameters : RequestParameters +{ +} + +/// +/// Creates a rollup job. +/// +public sealed partial class PutJobRequest : PlainRequest +{ + public PutJobRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.put_job"; + + /// + /// A cron string which defines the intervals when the rollup job should be executed. When the interval
triggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated
to the time interval of the data being rolled up. For example, you may wish to create hourly rollups
of your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The
cron pattern is defined just like a Watcher cron schedule.
+ ///
+ [JsonInclude, JsonPropertyName("cron")] + public string Cron { get; set; } + + /// + /// Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be
available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of
the groups configuration as defining a set of tools that can later be used in aggregations to partition the
data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide
enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.
+ ///
+ [JsonInclude, JsonPropertyName("groups")] + public Elastic.Clients.Elasticsearch.Rollup.Groupings Groups { get; set; } + [JsonInclude, JsonPropertyName("headers")] + public IDictionary>>? Headers { get; set; } + + /// + /// The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to
rollup the entire index or index-pattern.
+ ///
+ [JsonInclude, JsonPropertyName("index_pattern")] + public string IndexPattern { get; set; } + + /// + /// Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each
group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined
on a per-field basis and for each field you configure which metric should be collected.
+ ///
+ [JsonInclude, JsonPropertyName("metrics")] + public ICollection? Metrics { get; set; } + + /// + /// The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends
to execute faster, but requires more memory during processing. This value has no effect on how the data is
rolled up; it is merely used for tweaking the speed or memory cost of the indexer.
+ ///
+ [JsonInclude, JsonPropertyName("page_size")] + public int PageSize { get; set; } + + /// + /// The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs. + /// + [JsonInclude, JsonPropertyName("rollup_index")] + public Elastic.Clients.Elasticsearch.IndexName RollupIndex { get; set; } + + /// + /// Time to wait for the request to complete. + /// + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +/// +/// Creates a rollup job. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor, PutJobRequestParameters> +{ + internal PutJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.put_job"; + + public PutJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private string CronValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.Groupings GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor GroupsDescriptor { get; set; } + private Action> GroupsDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private string IndexPatternValue { get; set; } + private ICollection? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor MetricsDescriptor { get; set; } + private Action> MetricsDescriptorAction { get; set; } + private Action>[] MetricsDescriptorActions { get; set; } + private int PageSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName RollupIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// A cron string which defines the intervals when the rollup job should be executed. When the interval
triggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated
to the time interval of the data being rolled up. For example, you may wish to create hourly rollups
of your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The
cron pattern is defined just like a Watcher cron schedule.
+ ///
+ public PutJobRequestDescriptor Cron(string cron) + { + CronValue = cron; + return Self; + } + + /// + /// Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be
available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of
the groups configuration as defining a set of tools that can later be used in aggregations to partition the
data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide
enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.
+ ///
+ public PutJobRequestDescriptor Groups(Elastic.Clients.Elasticsearch.Rollup.Groupings groups) + { + GroupsDescriptor = null; + GroupsDescriptorAction = null; + GroupsValue = groups; + return Self; + } + + public PutJobRequestDescriptor Groups(Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor descriptor) + { + GroupsValue = null; + GroupsDescriptorAction = null; + GroupsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor Groups(Action> configure) + { + GroupsValue = null; + GroupsDescriptor = null; + GroupsDescriptorAction = configure; + return Self; + } + + public PutJobRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to
rollup the entire index or index-pattern.
+ ///
+ public PutJobRequestDescriptor IndexPattern(string indexPattern) + { + IndexPatternValue = indexPattern; + return Self; + } + + /// + /// Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each
group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined
on a per-field basis and for each field you configure which metric should be collected.
+ ///
+ public PutJobRequestDescriptor Metrics(ICollection? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsValue = metrics; + return Self; + } + + public PutJobRequestDescriptor Metrics(Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor Metrics(Action> configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorActions = null; + MetricsDescriptorAction = configure; + return Self; + } + + public PutJobRequestDescriptor Metrics(params Action>[] configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = configure; + return Self; + } + + /// + /// The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends
to execute faster, but requires more memory during processing. This value has no effect on how the data is
rolled up; it is merely used for tweaking the speed or memory cost of the indexer.
+ ///
+ public PutJobRequestDescriptor PageSize(int pageSize) + { + PageSizeValue = pageSize; + return Self; + } + + /// + /// The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs. + /// + public PutJobRequestDescriptor RollupIndex(Elastic.Clients.Elasticsearch.IndexName rollupIndex) + { + RollupIndexValue = rollupIndex; + return Self; + } + + /// + /// Time to wait for the request to complete. + /// + public PutJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cron"); + writer.WriteStringValue(CronValue); + if (GroupsDescriptor is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsDescriptor, options); + } + else if (GroupsDescriptorAction is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor(GroupsDescriptorAction), options); + } + else + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + writer.WritePropertyName("index_pattern"); + writer.WriteStringValue(IndexPatternValue); + if (MetricsDescriptor is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, MetricsDescriptor, options); + writer.WriteEndArray(); + } + else if (MetricsDescriptorAction is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor(MetricsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (MetricsDescriptorActions is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + foreach (var action in MetricsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("page_size"); + writer.WriteNumberValue(PageSizeValue); + writer.WritePropertyName("rollup_index"); + JsonSerializer.Serialize(writer, RollupIndexValue, options); + if (TimeoutValue is not null) + { + writer.WritePropertyName("timeout"); + JsonSerializer.Serialize(writer, TimeoutValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates a rollup job. +/// +public sealed partial class PutJobRequestDescriptor : RequestDescriptor +{ + internal PutJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupPutJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.put_job"; + + public PutJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private string CronValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.Groupings GroupsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor GroupsDescriptor { get; set; } + private Action GroupsDescriptorAction { get; set; } + private IDictionary>>? HeadersValue { get; set; } + private string IndexPatternValue { get; set; } + private ICollection? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Action[] MetricsDescriptorActions { get; set; } + private int PageSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName RollupIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } + + /// + /// A cron string which defines the intervals when the rollup job should be executed. When the interval
triggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated
to the time interval of the data being rolled up. For example, you may wish to create hourly rollups
of your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The
cron pattern is defined just like a Watcher cron schedule.
+ ///
+ public PutJobRequestDescriptor Cron(string cron) + { + CronValue = cron; + return Self; + } + + /// + /// Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be
available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of
the groups configuration as defining a set of tools that can later be used in aggregations to partition the
data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide
enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.
+ ///
+ public PutJobRequestDescriptor Groups(Elastic.Clients.Elasticsearch.Rollup.Groupings groups) + { + GroupsDescriptor = null; + GroupsDescriptorAction = null; + GroupsValue = groups; + return Self; + } + + public PutJobRequestDescriptor Groups(Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor descriptor) + { + GroupsValue = null; + GroupsDescriptorAction = null; + GroupsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor Groups(Action configure) + { + GroupsValue = null; + GroupsDescriptor = null; + GroupsDescriptorAction = configure; + return Self; + } + + public PutJobRequestDescriptor Headers(Func>>, FluentDictionary>>> selector) + { + HeadersValue = selector?.Invoke(new FluentDictionary>>()); + return Self; + } + + /// + /// The index or index pattern to roll up. Supports wildcard-style patterns (`logstash-*`). The job attempts to
rollup the entire index or index-pattern.
+ ///
+ public PutJobRequestDescriptor IndexPattern(string indexPattern) + { + IndexPatternValue = indexPattern; + return Self; + } + + /// + /// Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each
group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined
on a per-field basis and for each field you configure which metric should be collected.
+ ///
+ public PutJobRequestDescriptor Metrics(ICollection? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsValue = metrics; + return Self; + } + + public PutJobRequestDescriptor Metrics(Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = null; + MetricsDescriptor = descriptor; + return Self; + } + + public PutJobRequestDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorActions = null; + MetricsDescriptorAction = configure; + return Self; + } + + public PutJobRequestDescriptor Metrics(params Action[] configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsDescriptorActions = configure; + return Self; + } + + /// + /// The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends
to execute faster, but requires more memory during processing. This value has no effect on how the data is
rolled up; it is merely used for tweaking the speed or memory cost of the indexer.
+ ///
+ public PutJobRequestDescriptor PageSize(int pageSize) + { + PageSizeValue = pageSize; + return Self; + } + + /// + /// The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs. + /// + public PutJobRequestDescriptor RollupIndex(Elastic.Clients.Elasticsearch.IndexName rollupIndex) + { + RollupIndexValue = rollupIndex; + return Self; + } + + /// + /// Time to wait for the request to complete. + /// + public PutJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) + { + TimeoutValue = timeout; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("cron"); + writer.WriteStringValue(CronValue); + if (GroupsDescriptor is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsDescriptor, options); + } + else if (GroupsDescriptorAction is not null) + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.GroupingsDescriptor(GroupsDescriptorAction), options); + } + else + { + writer.WritePropertyName("groups"); + JsonSerializer.Serialize(writer, GroupsValue, options); + } + + if (HeadersValue is not null) + { + writer.WritePropertyName("headers"); + JsonSerializer.Serialize(writer, HeadersValue, options); + } + + writer.WritePropertyName("index_pattern"); + writer.WriteStringValue(IndexPatternValue); + if (MetricsDescriptor is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, MetricsDescriptor, options); + writer.WriteEndArray(); + } + else if (MetricsDescriptorAction is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor(MetricsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (MetricsDescriptorActions is not null) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + foreach (var action in MetricsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.FieldMetricDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("page_size"); + writer.WriteNumberValue(PageSizeValue); + writer.WritePropertyName("rollup_index"); + JsonSerializer.Serialize(writer, RollupIndexValue, options); + 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/_Generated/Api/Rollup/PutJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs new file mode 100644 index 00000000000..f778e93dd3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class PutJobResponse : 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/_Generated/Api/Rollup/RollupSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs new file mode 100644 index 00000000000..4771dff470c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class RollupSearchRequestParameters : RequestParameters +{ + /// + /// 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); } +} + +internal sealed partial class RollupSearchRequestConverter : JsonConverter +{ + public override RollupSearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new RollupSearchRequest(); + 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 == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "size") + { + variant.Size = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, RollupSearchRequest value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.Size.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(value.Size.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Enables searching rolled-up data using the standard Query DSL. +/// +[JsonConverter(typeof(RollupSearchRequestConverter))] +public sealed partial class RollupSearchRequest : PlainRequest +{ + public RollupSearchRequest(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + public RollupSearchRequest() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupRollupSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.rollup_search"; + + /// + /// 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); } + + /// + /// Specifies aggregations. + /// + [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + + /// + /// Specifies a DSL query. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// Must be zero if set, as rollups work on pre-aggregated data. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } +} + +/// +/// Enables searching rolled-up data using the standard Query DSL. +/// +public sealed partial class RollupSearchRequestDescriptor : RequestDescriptor, RollupSearchRequestParameters> +{ + internal RollupSearchRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RollupSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupRollupSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.rollup_search"; + + public RollupSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public RollupSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public RollupSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private int? SizeValue { get; set; } + + /// + /// Specifies aggregations. + /// + public RollupSearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies a DSL query. + /// + public RollupSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RollupSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RollupSearchRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Must be zero if set, as rollups work on pre-aggregated data. + /// + public RollupSearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Enables searching rolled-up data using the standard Query DSL. +/// +public sealed partial class RollupSearchRequestDescriptor : RequestDescriptor +{ + internal RollupSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public RollupSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices) : base(r => r.Required("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupRollupSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "rollup.rollup_search"; + + public RollupSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt); + public RollupSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys); + + public RollupSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private int? SizeValue { get; set; } + + /// + /// Specifies aggregations. + /// + public RollupSearchRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies a DSL query. + /// + public RollupSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public RollupSearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public RollupSearchRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Must be zero if set, as rollups work on pre-aggregated data. + /// + public RollupSearchRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + 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/_Generated/Api/Rollup/RollupSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs new file mode 100644 index 00000000000..16d3e49bdad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupSearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Hits { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { 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/_Generated/Api/Rollup/StartJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs new file mode 100644 index 00000000000..ff99c271936 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class StartJobRequestParameters : RequestParameters +{ +} + +/// +/// Starts an existing, stopped rollup job. +/// +public sealed partial class StartJobRequest : PlainRequest +{ + public StartJobRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStartJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.start_job"; +} + +/// +/// Starts an existing, stopped rollup job. +/// +public sealed partial class StartJobRequestDescriptor : RequestDescriptor, StartJobRequestParameters> +{ + internal StartJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StartJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStartJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.start_job"; + + public StartJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Starts an existing, stopped rollup job. +/// +public sealed partial class StartJobRequestDescriptor : RequestDescriptor +{ + internal StartJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStartJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.start_job"; + + public StartJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Rollup/StartJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs new file mode 100644 index 00000000000..1d6d05f4ff7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class StartJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("started")] + public bool Started { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs new file mode 100644 index 00000000000..55ae700dddb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Rollup; + +public sealed partial class StopJobRequestParameters : RequestParameters +{ + /// + /// If `wait_for_completion` is `true`, the API blocks for (at maximum) the specified duration while waiting for the job to stop.
If more than `timeout` time has passed, the API throws a timeout exception.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If set to `true`, causes the API to block until the indexer state completely stops.
If set to `false`, the API returns immediately and the indexer is stopped asynchronously in the background.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops an existing, started rollup job. +/// +public sealed partial class StopJobRequest : PlainRequest +{ + public StopJobRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStopJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.stop_job"; + + /// + /// If `wait_for_completion` is `true`, the API blocks for (at maximum) the specified duration while waiting for the job to stop.
If more than `timeout` time has passed, the API throws a timeout exception.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If set to `true`, causes the API to block until the indexer state completely stops.
If set to `false`, the API returns immediately and the indexer is stopped asynchronously in the background.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops an existing, started rollup job. +/// +public sealed partial class StopJobRequestDescriptor : RequestDescriptor, StopJobRequestParameters> +{ + internal StopJobRequestDescriptor(Action> configure) => configure.Invoke(this); + + public StopJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStopJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.stop_job"; + + public StopJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public StopJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public StopJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Stops an existing, started rollup job. +/// +public sealed partial class StopJobRequestDescriptor : RequestDescriptor +{ + internal StopJobRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopJobRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.RollupStopJob; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "rollup.stop_job"; + + public StopJobRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public StopJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public StopJobRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Rollup/StopJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs new file mode 100644 index 00000000000..9f696d586bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class StopJobResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stopped")] + public bool Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs new file mode 100644 index 00000000000..dd66ccfba7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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; + +public sealed partial class ScriptsPainlessExecuteRequestParameters : RequestParameters +{ +} + +/// +/// Runs a script and returns a result. +/// +public sealed partial class ScriptsPainlessExecuteRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceScriptsPainlessExecute; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "scripts_painless_execute"; + + /// + /// The context that the script should run in. + /// + [JsonInclude, JsonPropertyName("context")] + public string? Context { get; set; } + + /// + /// Additional parameters for the `context`. + /// + [JsonInclude, JsonPropertyName("context_setup")] + public Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup? ContextSetup { get; set; } + + /// + /// The Painless script to execute. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.InlineScript? Script { get; set; } +} + +/// +/// Runs a script and returns a result. +/// +public sealed partial class ScriptsPainlessExecuteRequestDescriptor : RequestDescriptor, ScriptsPainlessExecuteRequestParameters> +{ + internal ScriptsPainlessExecuteRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptsPainlessExecuteRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceScriptsPainlessExecute; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "scripts_painless_execute"; + + private string? ContextValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup? ContextSetupValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor ContextSetupDescriptor { get; set; } + private Action> ContextSetupDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.InlineScript? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.InlineScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } + + /// + /// The context that the script should run in. + /// + public ScriptsPainlessExecuteRequestDescriptor Context(string? context) + { + ContextValue = context; + return Self; + } + + /// + /// Additional parameters for the `context`. + /// + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup? contextSetup) + { + ContextSetupDescriptor = null; + ContextSetupDescriptorAction = null; + ContextSetupValue = contextSetup; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor descriptor) + { + ContextSetupValue = null; + ContextSetupDescriptorAction = null; + ContextSetupDescriptor = descriptor; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Action> configure) + { + ContextSetupValue = null; + ContextSetupDescriptor = null; + ContextSetupDescriptorAction = configure; + return Self; + } + + /// + /// The Painless script to execute. + /// + public ScriptsPainlessExecuteRequestDescriptor Script(Elastic.Clients.Elasticsearch.InlineScript? script) + { + ScriptDescriptor = null; + ScriptDescriptorAction = null; + ScriptValue = script; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor Script(Elastic.Clients.Elasticsearch.InlineScriptDescriptor descriptor) + { + ScriptValue = null; + ScriptDescriptorAction = null; + ScriptDescriptor = descriptor; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor Script(Action configure) + { + ScriptValue = null; + ScriptDescriptor = null; + ScriptDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ContextValue)) + { + writer.WritePropertyName("context"); + writer.WriteStringValue(ContextValue); + } + + if (ContextSetupDescriptor is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, ContextSetupDescriptor, options); + } + else if (ContextSetupDescriptorAction is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor(ContextSetupDescriptorAction), options); + } + else if (ContextSetupValue is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, ContextSetupValue, options); + } + + 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 Elastic.Clients.Elasticsearch.InlineScriptDescriptor(ScriptDescriptorAction), options); + } + else if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Runs a script and returns a result. +/// +public sealed partial class ScriptsPainlessExecuteRequestDescriptor : RequestDescriptor +{ + internal ScriptsPainlessExecuteRequestDescriptor(Action configure) => configure.Invoke(this); + + public ScriptsPainlessExecuteRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceScriptsPainlessExecute; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "scripts_painless_execute"; + + private string? ContextValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup? ContextSetupValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor ContextSetupDescriptor { get; set; } + private Action ContextSetupDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.InlineScript? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.InlineScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } + + /// + /// The context that the script should run in. + /// + public ScriptsPainlessExecuteRequestDescriptor Context(string? context) + { + ContextValue = context; + return Self; + } + + /// + /// Additional parameters for the `context`. + /// + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup? contextSetup) + { + ContextSetupDescriptor = null; + ContextSetupDescriptorAction = null; + ContextSetupValue = contextSetup; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor descriptor) + { + ContextSetupValue = null; + ContextSetupDescriptorAction = null; + ContextSetupDescriptor = descriptor; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor ContextSetup(Action configure) + { + ContextSetupValue = null; + ContextSetupDescriptor = null; + ContextSetupDescriptorAction = configure; + return Self; + } + + /// + /// The Painless script to execute. + /// + public ScriptsPainlessExecuteRequestDescriptor Script(Elastic.Clients.Elasticsearch.InlineScript? script) + { + ScriptDescriptor = null; + ScriptDescriptorAction = null; + ScriptValue = script; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor Script(Elastic.Clients.Elasticsearch.InlineScriptDescriptor descriptor) + { + ScriptValue = null; + ScriptDescriptorAction = null; + ScriptDescriptor = descriptor; + return Self; + } + + public ScriptsPainlessExecuteRequestDescriptor Script(Action configure) + { + ScriptValue = null; + ScriptDescriptor = null; + ScriptDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ContextValue)) + { + writer.WritePropertyName("context"); + writer.WriteStringValue(ContextValue); + } + + if (ContextSetupDescriptor is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, ContextSetupDescriptor, options); + } + else if (ContextSetupDescriptorAction is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupDescriptor(ContextSetupDescriptorAction), options); + } + else if (ContextSetupValue is not null) + { + writer.WritePropertyName("context_setup"); + JsonSerializer.Serialize(writer, ContextSetupValue, options); + } + + 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 Elastic.Clients.Elasticsearch.InlineScriptDescriptor(ScriptDescriptorAction), options); + } + else 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/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs new file mode 100644 index 00000000000..2e5fd8e0c4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +public sealed partial class ScriptsPainlessExecuteResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("result")] + public TResult Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs index cb30ef729b4..056d1985d46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs new file mode 100644 index 00000000000..3c848aac01c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class DeleteBehavioralAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Delete a behavioral analytics collection. +/// +public sealed partial class DeleteBehavioralAnalyticsRequest : PlainRequest +{ + public DeleteBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationDeleteBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.delete_behavioral_analytics"; +} + +/// +/// Delete a behavioral analytics collection. +/// +public sealed partial class DeleteBehavioralAnalyticsRequestDescriptor : RequestDescriptor +{ + internal DeleteBehavioralAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteBehavioralAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationDeleteBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.delete_behavioral_analytics"; + + public DeleteBehavioralAnalyticsRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs new file mode 100644 index 00000000000..ab81d612daa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class DeleteBehavioralAnalyticsResponse : 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/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs new file mode 100644 index 00000000000..36f2af3b127 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class DeleteSearchApplicationRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a search application. +/// +public sealed partial class DeleteSearchApplicationRequest : PlainRequest +{ + public DeleteSearchApplicationRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.delete"; +} + +/// +/// Deletes a search application. +/// +public sealed partial class DeleteSearchApplicationRequestDescriptor : RequestDescriptor +{ + internal DeleteSearchApplicationRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSearchApplicationRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.delete"; + + public DeleteSearchApplicationRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs new file mode 100644 index 00000000000..37e399e3af8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class DeleteSearchApplicationResponse : 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/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs new file mode 100644 index 00000000000..ae62e903854 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class GetBehavioralAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Returns the existing behavioral analytics collections. +/// +public sealed partial class GetBehavioralAnalyticsRequest : PlainRequest +{ + public GetBehavioralAnalyticsRequest() + { + } + + public GetBehavioralAnalyticsRequest(IReadOnlyCollection? name) : base(r => r.Optional("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationGetBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.get_behavioral_analytics"; +} + +/// +/// Returns the existing behavioral analytics collections. +/// +public sealed partial class GetBehavioralAnalyticsRequestDescriptor : RequestDescriptor +{ + internal GetBehavioralAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetBehavioralAnalyticsRequestDescriptor(IReadOnlyCollection? name) : base(r => r.Optional("name", name)) + { + } + + public GetBehavioralAnalyticsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationGetBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.get_behavioral_analytics"; + + public GetBehavioralAnalyticsRequestDescriptor Name(IReadOnlyCollection? 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/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs new file mode 100644 index 00000000000..c6ce8351ec0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class GetBehavioralAnalyticsResponse : DictionaryResponse +{ + public GetBehavioralAnalyticsResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetBehavioralAnalyticsResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs new file mode 100644 index 00000000000..d6fb6079e1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class GetSearchApplicationRequestParameters : RequestParameters +{ +} + +/// +/// Returns the details about a search application +/// +public sealed partial class GetSearchApplicationRequest : PlainRequest +{ + public GetSearchApplicationRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.get"; +} + +/// +/// Returns the details about a search application +/// +public sealed partial class GetSearchApplicationRequestDescriptor : RequestDescriptor +{ + internal GetSearchApplicationRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSearchApplicationRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.get"; + + public GetSearchApplicationRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs new file mode 100644 index 00000000000..a5048354032 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class GetSearchApplicationResponse : ElasticsearchResponse +{ + /// + /// Analytics collection associated to the Search Application. + /// + [JsonInclude, JsonPropertyName("analytics_collection_name")] + public string? AnalyticsCollectionName { get; init; } + + /// + /// Indices that are part of the Search Application. + /// + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + + /// + /// Search Application name. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// Search template to use on search operations. + /// + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate? Template { get; init; } + + /// + /// Last time the Search Application was updated. + /// + [JsonInclude, JsonPropertyName("updated_at_millis")] + public long UpdatedAtMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs new file mode 100644 index 00000000000..5c9320ed8cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class ListRequestParameters : RequestParameters +{ + /// + /// Starting offset. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Query in the Lucene query string syntax. + /// + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// Specifies a max number of results to get. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns the existing search applications. +/// +public sealed partial class ListRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationList; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.list"; + + /// + /// Starting offset. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Query in the Lucene query string syntax. + /// + [JsonIgnore] + public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); } + + /// + /// Specifies a max number of results to get. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Returns the existing search applications. +/// +public sealed partial class ListRequestDescriptor : RequestDescriptor +{ + internal ListRequestDescriptor(Action configure) => configure.Invoke(this); + + public ListRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationList; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.list"; + + public ListRequestDescriptor From(int? from) => Qs("from", from); + public ListRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax); + public ListRequestDescriptor Size(int? size) => Qs("size", size); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs new file mode 100644 index 00000000000..634f03fc463 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class ListResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("results")] + public IReadOnlyCollection Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs new file mode 100644 index 00000000000..c2c08b2f4f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class PutBehavioralAnalyticsRequestParameters : RequestParameters +{ +} + +/// +/// Creates a behavioral analytics collection. +/// +public sealed partial class PutBehavioralAnalyticsRequest : PlainRequest +{ + public PutBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationPutBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.put_behavioral_analytics"; +} + +/// +/// Creates a behavioral analytics collection. +/// +public sealed partial class PutBehavioralAnalyticsRequestDescriptor : RequestDescriptor +{ + internal PutBehavioralAnalyticsRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutBehavioralAnalyticsRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationPutBehavioralAnalytics; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "search_application.put_behavioral_analytics"; + + public PutBehavioralAnalyticsRequestDescriptor Name(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs new file mode 100644 index 00000000000..fffbe4ac143 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class PutBehavioralAnalyticsResponse : 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; } + + /// + /// The name of the analytics collection created or updated + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs new file mode 100644 index 00000000000..35f69cb3acc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class PutSearchApplicationRequestParameters : RequestParameters +{ + /// + /// If `true`, this request cannot replace or update existing Search Applications. + /// + public bool? Create { get => Q("create"); set => Q("create", value); } +} + +/// +/// Creates or updates a search application. +/// +public sealed partial class PutSearchApplicationRequest : PlainRequest +{ + public PutSearchApplicationRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationPut; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_application.put"; + + /// + /// If `true`, this request cannot replace or update existing Search Applications. + /// + [JsonIgnore] + public bool? Create { get => Q("create"); set => Q("create", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication SearchApplication { get; set; } +} + +/// +/// Creates or updates a search application. +/// +public sealed partial class PutSearchApplicationRequestDescriptor : RequestDescriptor +{ + internal PutSearchApplicationRequestDescriptor(Action configure) => configure.Invoke(this); + public PutSearchApplicationRequestDescriptor(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication searchApplication, Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) => SearchApplicationValue = searchApplication; + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationPut; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_application.put"; + + public PutSearchApplicationRequestDescriptor Create(bool? create = true) => Qs("create", create); + + public PutSearchApplicationRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication SearchApplicationValue { get; set; } + private Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationDescriptor SearchApplicationDescriptor { get; set; } + private Action SearchApplicationDescriptorAction { get; set; } + + public PutSearchApplicationRequestDescriptor SearchApplication(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication searchApplication) + { + SearchApplicationDescriptor = null; + SearchApplicationDescriptorAction = null; + SearchApplicationValue = searchApplication; + return Self; + } + + public PutSearchApplicationRequestDescriptor SearchApplication(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationDescriptor descriptor) + { + SearchApplicationValue = null; + SearchApplicationDescriptorAction = null; + SearchApplicationDescriptor = descriptor; + return Self; + } + + public PutSearchApplicationRequestDescriptor SearchApplication(Action configure) + { + SearchApplicationValue = null; + SearchApplicationDescriptor = null; + SearchApplicationDescriptorAction = configure; + 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/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs new file mode 100644 index 00000000000..142ce716eb0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class PutSearchApplicationResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs new file mode 100644 index 00000000000..535d54c1d6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchApplication; + +public sealed partial class SearchApplicationSearchRequestParameters : RequestParameters +{ +} + +/// +/// Perform a search against a search application. +/// +public sealed partial class SearchApplicationSearchRequest : PlainRequest +{ + public SearchApplicationSearchRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_application.search"; + + /// + /// Query parameters specific to this request, which will override any defaults specified in the template. + /// + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } +} + +/// +/// Perform a search against a search application. +/// +public sealed partial class SearchApplicationSearchRequestDescriptor : RequestDescriptor +{ + internal SearchApplicationSearchRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchApplicationSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchApplicationSearch; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_application.search"; + + public SearchApplicationSearchRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("name", name); + return Self; + } + + private IDictionary? ParamsValue { get; set; } + + /// + /// Query parameters specific to this request, which will override any defaults specified in the template. + /// + public SearchApplicationSearchRequestDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + 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); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs new file mode 100644 index 00000000000..65205873d88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class SearchApplicationSearchResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("hits")] + public Elastic.Clients.Elasticsearch.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.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("suggest")] + public Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchMvtRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs new file mode 100644 index 00000000000..607e8d37d05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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; + +public sealed partial class SearchMvtRequestParameters : RequestParameters +{ +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequest : PlainRequest +{ + public SearchMvtRequest(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ [JsonInclude, JsonPropertyName("aggs")] + public IDictionary? Aggs { get; set; } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ [JsonInclude, JsonPropertyName("buffer")] + public int? Buffer { get; set; } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ [JsonInclude, JsonPropertyName("exact_bounds")] + public bool? ExactBounds { get; set; } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + [JsonInclude, JsonPropertyName("extent")] + public int? Extent { get; set; } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Fields? Fields { get; set; } + + /// + /// Aggregation used to create a grid for the `field`. + /// + [JsonInclude, JsonPropertyName("grid_agg")] + public Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? GridAgg { get; set; } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ [JsonInclude, JsonPropertyName("grid_precision")] + public int? GridPrecision { get; set; } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ [JsonInclude, JsonPropertyName("grid_type")] + public Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? GridType { get; set; } + + /// + /// Query DSL used to filter documents for the search. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { 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; } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] + public ICollection? Sort { 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.Core.Search.TrackHits? TrackTotalHits { get; set; } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ [JsonInclude, JsonPropertyName("with_labels")] + public bool? WithLabels { get; set; } +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequestDescriptor : RequestDescriptor, SearchMvtRequestParameters> +{ + internal SearchMvtRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SearchMvtRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + public SearchMvtRequestDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + RouteValues.Required("field", field); + return Self; + } + + public SearchMvtRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public SearchMvtRequestDescriptor x(int x) + { + RouteValues.Required("x", x); + return Self; + } + + public SearchMvtRequestDescriptor y(int y) + { + RouteValues.Required("y", y); + return Self; + } + + public SearchMvtRequestDescriptor Zoom(int zoom) + { + RouteValues.Required("zoom", zoom); + return Self; + } + + private IDictionary> AggsValue { get; set; } + private int? BufferValue { get; set; } + private bool? ExactBoundsValue { get; set; } + private int? ExtentValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? GridAggValue { get; set; } + private int? GridPrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? GridTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? WithLabelsValue { get; set; } + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ public SearchMvtRequestDescriptor Aggs(Func>, FluentDescriptorDictionary>> selector) + { + AggsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ public SearchMvtRequestDescriptor Buffer(int? buffer) + { + BufferValue = buffer; + return Self; + } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ public SearchMvtRequestDescriptor ExactBounds(bool? exactBounds = true) + { + ExactBoundsValue = exactBounds; + return Self; + } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + public SearchMvtRequestDescriptor Extent(int? extent) + { + ExtentValue = extent; + return Self; + } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ public SearchMvtRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Aggregation used to create a grid for the `field`. + /// + public SearchMvtRequestDescriptor GridAgg(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? gridAgg) + { + GridAggValue = gridAgg; + return Self; + } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ public SearchMvtRequestDescriptor GridPrecision(int? gridPrecision) + { + GridPrecisionValue = gridPrecision; + return Self; + } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ public SearchMvtRequestDescriptor GridType(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? gridType) + { + GridTypeValue = gridType; + return Self; + } + + /// + /// Query DSL used to filter documents for the search. + /// + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = 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 SearchMvtRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ public SearchMvtRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ public SearchMvtRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Action> configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchMvtRequestDescriptor Sort(params Action>[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + 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 SearchMvtRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ public SearchMvtRequestDescriptor WithLabels(bool? withLabels = true) + { + WithLabelsValue = withLabels; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggsValue is not null) + { + writer.WritePropertyName("aggs"); + JsonSerializer.Serialize(writer, AggsValue, options); + } + + if (BufferValue.HasValue) + { + writer.WritePropertyName("buffer"); + writer.WriteNumberValue(BufferValue.Value); + } + + if (ExactBoundsValue.HasValue) + { + writer.WritePropertyName("exact_bounds"); + writer.WriteBooleanValue(ExactBoundsValue.Value); + } + + if (ExtentValue.HasValue) + { + writer.WritePropertyName("extent"); + writer.WriteNumberValue(ExtentValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (GridAggValue is not null) + { + writer.WritePropertyName("grid_agg"); + JsonSerializer.Serialize(writer, GridAggValue, options); + } + + if (GridPrecisionValue.HasValue) + { + writer.WritePropertyName("grid_precision"); + writer.WriteNumberValue(GridPrecisionValue.Value); + } + + if (GridTypeValue is not null) + { + writer.WritePropertyName("grid_type"); + JsonSerializer.Serialize(writer, GridTypeValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (WithLabelsValue.HasValue) + { + writer.WritePropertyName("with_labels"); + writer.WriteBooleanValue(WithLabelsValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. +/// +public sealed partial class SearchMvtRequestDescriptor : RequestDescriptor +{ + internal SearchMvtRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchMvtRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y) : base(r => r.Required("index", indices).Required("field", field).Required("zoom", zoom).Required("x", x).Required("y", y)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceSearchMvt; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "search_mvt"; + + public SearchMvtRequestDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + RouteValues.Required("field", field); + return Self; + } + + public SearchMvtRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + RouteValues.Required("index", indices); + return Self; + } + + public SearchMvtRequestDescriptor x(int x) + { + RouteValues.Required("x", x); + return Self; + } + + public SearchMvtRequestDescriptor y(int y) + { + RouteValues.Required("y", y); + return Self; + } + + public SearchMvtRequestDescriptor Zoom(int zoom) + { + RouteValues.Required("zoom", zoom); + return Self; + } + + private IDictionary AggsValue { get; set; } + private int? BufferValue { get; set; } + private bool? ExactBoundsValue { get; set; } + private int? ExtentValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? GridAggValue { get; set; } + private int? GridPrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? GridTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private int? SizeValue { get; set; } + private ICollection? SortValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } + private bool? WithLabelsValue { get; set; } + + /// + /// Sub-aggregations for the geotile_grid. + /// Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
+ ///
+ public SearchMvtRequestDescriptor Aggs(Func, FluentDescriptorDictionary> selector) + { + AggsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Size, in pixels, of a clipping buffer outside the tile. This allows renderers
to avoid outline artifacts from geometries that extend past the extent of the tile.
+ ///
+ public SearchMvtRequestDescriptor Buffer(int? buffer) + { + BufferValue = buffer; + return Self; + } + + /// + /// If false, the meta layer’s feature is the bounding box of the tile.
If true, the meta layer’s feature is a bounding box resulting from a
geo_bounds aggregation. The aggregation runs on values that intersect
the // tile with wrap_longitude set to false. The resulting
bounding box may be larger than the vector tile.
+ ///
+ public SearchMvtRequestDescriptor ExactBounds(bool? exactBounds = true) + { + ExactBoundsValue = exactBounds; + return Self; + } + + /// + /// Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. + /// + public SearchMvtRequestDescriptor Extent(int? extent) + { + ExtentValue = extent; + return Self; + } + + /// + /// Fields to return in the `hits` layer. Supports wildcards (`*`).
This parameter does not support fields with array values. Fields with array
values may return inconsistent results.
+ ///
+ public SearchMvtRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// Aggregation used to create a grid for the `field`. + /// + public SearchMvtRequestDescriptor GridAgg(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? gridAgg) + { + GridAggValue = gridAgg; + return Self; + } + + /// + /// Additional zoom levels available through the aggs layer. For example, if is 7
and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
don’t include the aggs layer.
+ ///
+ public SearchMvtRequestDescriptor GridPrecision(int? gridPrecision) + { + GridPrecisionValue = gridPrecision; + return Self; + } + + /// + /// Determines the geometry type for features in the aggs layer. In the aggs layer,
each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
of the cells bounding box. If 'point' each feature is a Point that is the centroid
of the cell.
+ ///
+ public SearchMvtRequestDescriptor GridType(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? gridType) + { + GridTypeValue = gridType; + return Self; + } + + /// + /// Query DSL used to filter documents for the search. + /// + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SearchMvtRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = 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 SearchMvtRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Maximum number of features to return in the hits layer. Accepts 0-10000.
If 0, results don’t include the hits layer.
+ ///
+ public SearchMvtRequestDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Sorts features in the hits layer. By default, the API calculates a bounding
box for each feature. It sorts features based on this box’s diagonal length,
from longest to shortest.
+ ///
+ public SearchMvtRequestDescriptor Sort(ICollection? sort) + { + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortValue = sort; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) + { + SortValue = null; + SortDescriptorAction = null; + SortDescriptorActions = null; + SortDescriptor = descriptor; + return Self; + } + + public SearchMvtRequestDescriptor Sort(Action configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorActions = null; + SortDescriptorAction = configure; + return Self; + } + + public SearchMvtRequestDescriptor Sort(params Action[] configure) + { + SortValue = null; + SortDescriptor = null; + SortDescriptorAction = null; + SortDescriptorActions = configure; + 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 SearchMvtRequestDescriptor TrackTotalHits(Elastic.Clients.Elasticsearch.Core.Search.TrackHits? trackTotalHits) + { + TrackTotalHitsValue = trackTotalHits; + return Self; + } + + /// + /// If `true`, the hits and aggs layers will contain additional point features representing
suggested label positions for the original features.
+ ///
+ public SearchMvtRequestDescriptor WithLabels(bool? withLabels = true) + { + WithLabelsValue = withLabels; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggsValue is not null) + { + writer.WritePropertyName("aggs"); + JsonSerializer.Serialize(writer, AggsValue, options); + } + + if (BufferValue.HasValue) + { + writer.WritePropertyName("buffer"); + writer.WriteNumberValue(BufferValue.Value); + } + + if (ExactBoundsValue.HasValue) + { + writer.WritePropertyName("exact_bounds"); + writer.WriteBooleanValue(ExactBoundsValue.Value); + } + + if (ExtentValue.HasValue) + { + writer.WritePropertyName("extent"); + writer.WriteNumberValue(ExtentValue.Value); + } + + if (FieldsValue is not null) + { + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + } + + if (GridAggValue is not null) + { + writer.WritePropertyName("grid_agg"); + JsonSerializer.Serialize(writer, GridAggValue, options); + } + + if (GridPrecisionValue.HasValue) + { + writer.WritePropertyName("grid_precision"); + writer.WriteNumberValue(GridPrecisionValue.Value); + } + + if (GridTypeValue is not null) + { + writer.WritePropertyName("grid_type"); + JsonSerializer.Serialize(writer, GridTypeValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); + } + + if (SortDescriptorActions.Length > 1) + writer.WriteEndArray(); + } + else if (SortValue is not null) + { + writer.WritePropertyName("sort"); + SingleOrManySerializationHelper.Serialize(SortValue, writer, options); + } + + if (TrackTotalHitsValue is not null) + { + writer.WritePropertyName("track_total_hits"); + JsonSerializer.Serialize(writer, TrackTotalHitsValue, options); + } + + if (WithLabelsValue.HasValue) + { + writer.WritePropertyName("with_labels"); + writer.WriteBooleanValue(WithLabelsValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtResponse.g.cs new file mode 100644 index 00000000000..54056188e26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +public sealed partial class SearchMvtResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 39e0318846f..d870b94b26a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -191,7 +191,7 @@ public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -597,10 +597,10 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria } } -[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.
///
+[JsonConverter(typeof(SearchRequestConverter))] public partial class SearchRequest : PlainRequest { public SearchRequest() @@ -797,7 +797,7 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => /// Defines the aggregations that are run as part of the search request. ///
[JsonInclude, JsonPropertyName("aggregations")] - public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } + public IDictionary? Aggregations { get; set; } /// /// Collapses search results the values of the specified field. @@ -995,16 +995,6 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => public bool? Version { 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.
///
@@ -1012,11 +1002,11 @@ public sealed partial class SearchRequestDescriptor : RequestDescript { internal SearchRequestDescriptor(Action> configure) => configure.Invoke(this); - public SearchRequestDescriptor() : this(typeof(TDocument)) + public SearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) { } - public SearchRequestDescriptor(Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public SearchRequestDescriptor() { } @@ -1064,67 +1054,65 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. return Self; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } + private IDictionary> AggregationsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action> CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action> KnnDescriptorAction { get; set; } + private Action>[] KnnDescriptorActions { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action> PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action> PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Rank? RankValue { get; set; } - private RankDescriptor RankDescriptor { get; set; } - private Action RankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { 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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action> RescoreDescriptorAction { get; set; } + private Action>[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private ICollection? StatsValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Suggester? SuggestValue { get; set; } - private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } - private Action SuggestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } @@ -1134,27 +1122,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. /// /// Defines the aggregations that are run as part of the search request. /// - public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + public SearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SearchRequestDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -1169,7 +1139,7 @@ public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -1177,7 +1147,7 @@ public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDesc return Self; } - public SearchRequestDescriptor Collapse(Action> configure) + public SearchRequestDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -1197,7 +1167,7 @@ public SearchRequestDescriptor DocvalueFields(ICollection DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SearchRequestDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -1206,7 +1176,7 @@ public SearchRequestDescriptor DocvalueFields(QueryDsl.FieldAndFormat return Self; } - public SearchRequestDescriptor DocvalueFields(Action> configure) + public SearchRequestDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1215,7 +1185,7 @@ public SearchRequestDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public SearchRequestDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -1254,7 +1224,7 @@ public SearchRequestDescriptor Fields(ICollection Fields(QueryDsl.FieldAndFormatDescriptor descriptor) + public SearchRequestDescriptor Fields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { FieldsValue = null; FieldsDescriptorAction = null; @@ -1263,7 +1233,7 @@ public SearchRequestDescriptor Fields(QueryDsl.FieldAndFormatDescript return Self; } - public SearchRequestDescriptor Fields(Action> configure) + public SearchRequestDescriptor Fields(Action> configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1272,7 +1242,7 @@ public SearchRequestDescriptor Fields(Action Fields(params Action>[] configure) + public SearchRequestDescriptor Fields(params Action>[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -1301,7 +1271,7 @@ public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1309,7 +1279,7 @@ public SearchRequestDescriptor Highlight(Core.Search.HighlightDescrip return Self; } - public SearchRequestDescriptor Highlight(Action> configure) + public SearchRequestDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1338,7 +1308,7 @@ public SearchRequestDescriptor Knn(ICollection Knn(KnnQueryDescriptor descriptor) + public SearchRequestDescriptor Knn(Elastic.Clients.Elasticsearch.KnnQueryDescriptor descriptor) { KnnValue = null; KnnDescriptorAction = null; @@ -1347,7 +1317,7 @@ public SearchRequestDescriptor Knn(KnnQueryDescriptor desc return Self; } - public SearchRequestDescriptor Knn(Action> configure) + public SearchRequestDescriptor Knn(Action> configure) { KnnValue = null; KnnDescriptor = null; @@ -1356,7 +1326,7 @@ public SearchRequestDescriptor Knn(Action Knn(params Action>[] configure) + public SearchRequestDescriptor Knn(params Action>[] configure) { KnnValue = null; KnnDescriptor = null; @@ -1385,7 +1355,7 @@ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core return Self; } - public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -1393,7 +1363,7 @@ public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDe return Self; } - public SearchRequestDescriptor Pit(Action configure) + public SearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -1412,7 +1382,7 @@ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsear return Self; } - public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -1420,7 +1390,7 @@ public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor PostFilter(Action> configure) + public SearchRequestDescriptor PostFilter(Action> configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -1448,7 +1418,7 @@ public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.Qu return Self; } - public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -1456,7 +1426,7 @@ public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public SearchRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -1475,7 +1445,7 @@ public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Ran return Self; } - public SearchRequestDescriptor Rank(RankDescriptor descriptor) + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.RankDescriptor descriptor) { RankValue = null; RankDescriptorAction = null; @@ -1483,7 +1453,7 @@ public SearchRequestDescriptor Rank(RankDescriptor descriptor) return Self; } - public SearchRequestDescriptor Rank(Action configure) + public SearchRequestDescriptor Rank(Action configure) { RankValue = null; RankDescriptor = null; @@ -1503,7 +1473,7 @@ public SearchRequestDescriptor Rescore(ICollection Rescore(Core.Search.RescoreDescriptor descriptor) + public SearchRequestDescriptor Rescore(Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor descriptor) { RescoreValue = null; RescoreDescriptorAction = null; @@ -1512,7 +1482,7 @@ public SearchRequestDescriptor Rescore(Core.Search.RescoreDescriptor< return Self; } - public SearchRequestDescriptor Rescore(Action> configure) + public SearchRequestDescriptor Rescore(Action> configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1521,7 +1491,7 @@ public SearchRequestDescriptor Rescore(Action Rescore(params Action>[] configure) + public SearchRequestDescriptor Rescore(params Action>[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -1533,18 +1503,18 @@ public SearchRequestDescriptor Rescore(params Action /// 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) + public SearchRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -1586,7 +1556,7 @@ public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Sl return Self; } - public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -1594,7 +1564,7 @@ public SearchRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public SearchRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -1614,7 +1584,7 @@ public SearchRequestDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SearchRequestDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1623,7 +1593,7 @@ public SearchRequestDescriptor Sort(SortOptionsDescriptor return Self; } - public SearchRequestDescriptor Sort(Action> configure) + public SearchRequestDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1632,7 +1602,7 @@ public SearchRequestDescriptor Sort(Action Sort(params Action>[] configure) + public SearchRequestDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -1679,7 +1649,7 @@ public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch. return Self; } - public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -1687,7 +1657,7 @@ public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescripto return Self; } - public SearchRequestDescriptor Suggest(Action configure) + public SearchRequestDescriptor Suggest(Action> configure) { SuggestValue = null; SuggestDescriptor = null; @@ -1743,17 +1713,7 @@ public SearchRequestDescriptor Version(bool? version = true) 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.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -1767,7 +1727,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -1786,7 +1746,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -1795,7 +1755,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1829,7 +1789,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -1838,7 +1798,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -1863,7 +1823,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1885,7 +1845,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -1894,7 +1854,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -1920,7 +1880,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -1936,7 +1896,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -1958,7 +1918,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -1974,7 +1934,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RankDescriptorAction is not null) { writer.WritePropertyName("rank"); - JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.RankDescriptor(RankDescriptorAction), options); } else if (RankValue is not null) { @@ -1990,7 +1950,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -1999,7 +1959,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -2049,7 +2009,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -2065,7 +2025,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -2074,7 +2034,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -2112,7 +2072,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -2161,7 +2121,7 @@ public sealed partial class SearchRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); - public SearchRequestDescriptor(Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + public SearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) { } @@ -2213,67 +2173,65 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? in return Self; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } + private IDictionary AggregationsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private IDictionary? ExtValue { 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.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private ICollection>? IndicesBoostValue { 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.KnnQueryDescriptor KnnDescriptor { get; set; } + private Action KnnDescriptorAction { get; set; } + private Action[] KnnDescriptorActions { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } + private Action PitDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action PostFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } + private Action PostFilterDescriptorAction { get; set; } private bool? ProfileValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Rank? RankValue { get; set; } - private RankDescriptor RankDescriptor { get; set; } - private Action RankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.RankDescriptor RankDescriptor { get; set; } + private Action RankDescriptorAction { 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 IDictionary? RuntimeMappingsValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; } + private Action RescoreDescriptorAction { get; set; } + private Action[] RescoreDescriptorActions { 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 Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private ICollection? StatsValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Suggester? SuggestValue { get; set; } - private Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; } - private Action SuggestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } @@ -2283,27 +2241,9 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? in /// /// Defines the aggregations that are run as part of the search request. /// - public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SearchRequestDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public SearchRequestDescriptor Aggregations(Action configure) + public SearchRequestDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2318,7 +2258,7 @@ public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Searc return Self; } - public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor descriptor) + public SearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -2326,7 +2266,7 @@ public SearchRequestDescriptor Collapse(Core.Search.FieldCollapseDescriptor desc return Self; } - public SearchRequestDescriptor Collapse(Action configure) + public SearchRequestDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -2346,7 +2286,7 @@ public SearchRequestDescriptor DocvalueFields(ICollection configure) + public SearchRequestDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2364,7 +2304,7 @@ public SearchRequestDescriptor DocvalueFields(Action[] configure) + public SearchRequestDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -2403,7 +2343,7 @@ public SearchRequestDescriptor Fields(ICollection configure) + public SearchRequestDescriptor Fields(Action configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2421,7 +2361,7 @@ public SearchRequestDescriptor Fields(Action return Self; } - public SearchRequestDescriptor Fields(params Action[] configure) + public SearchRequestDescriptor Fields(params Action[] configure) { FieldsValue = null; FieldsDescriptor = null; @@ -2450,7 +2390,7 @@ public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Sear return Self; } - public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public SearchRequestDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2458,7 +2398,7 @@ public SearchRequestDescriptor Highlight(Core.Search.HighlightDescriptor descrip return Self; } - public SearchRequestDescriptor Highlight(Action configure) + public SearchRequestDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2487,7 +2427,7 @@ public SearchRequestDescriptor Knn(ICollection configure) + public SearchRequestDescriptor Knn(Action configure) { KnnValue = null; KnnDescriptor = null; @@ -2505,7 +2445,7 @@ public SearchRequestDescriptor Knn(Action configure) return Self; } - public SearchRequestDescriptor Knn(params Action[] configure) + public SearchRequestDescriptor Knn(params Action[] configure) { KnnValue = null; KnnDescriptor = null; @@ -2534,7 +2474,7 @@ public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core.Search.Poi return Self; } - public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor descriptor) + public SearchRequestDescriptor Pit(Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor descriptor) { PitValue = null; PitDescriptorAction = null; @@ -2542,7 +2482,7 @@ public SearchRequestDescriptor Pit(Core.Search.PointInTimeReferenceDescriptor de return Self; } - public SearchRequestDescriptor Pit(Action configure) + public SearchRequestDescriptor Pit(Action configure) { PitValue = null; PitDescriptor = null; @@ -2561,7 +2501,7 @@ public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.QueryDsl return Self; } - public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor PostFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PostFilterValue = null; PostFilterDescriptorAction = null; @@ -2569,7 +2509,7 @@ public SearchRequestDescriptor PostFilter(QueryDsl.QueryDescriptor descriptor) return Self; } - public SearchRequestDescriptor PostFilter(Action configure) + public SearchRequestDescriptor PostFilter(Action configure) { PostFilterValue = null; PostFilterDescriptor = null; @@ -2597,7 +2537,7 @@ public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Quer return Self; } - public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SearchRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -2605,7 +2545,7 @@ public SearchRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public SearchRequestDescriptor Query(Action configure) + public SearchRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -2624,7 +2564,7 @@ public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.Rank? rank) return Self; } - public SearchRequestDescriptor Rank(RankDescriptor descriptor) + public SearchRequestDescriptor Rank(Elastic.Clients.Elasticsearch.RankDescriptor descriptor) { RankValue = null; RankDescriptorAction = null; @@ -2632,7 +2572,7 @@ public SearchRequestDescriptor Rank(RankDescriptor descriptor) return Self; } - public SearchRequestDescriptor Rank(Action configure) + public SearchRequestDescriptor Rank(Action configure) { RankValue = null; RankDescriptor = null; @@ -2652,7 +2592,7 @@ public SearchRequestDescriptor Rescore(ICollection configure) + public SearchRequestDescriptor Rescore(Action configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2670,7 +2610,7 @@ public SearchRequestDescriptor Rescore(Action con return Self; } - public SearchRequestDescriptor Rescore(params Action[] configure) + public SearchRequestDescriptor Rescore(params Action[] configure) { RescoreValue = null; RescoreDescriptor = null; @@ -2682,18 +2622,18 @@ public SearchRequestDescriptor Rescore(params Action /// 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) + public SearchRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public SearchRequestDescriptor ScriptFields(Func, FluentDictionary> selector) + public SearchRequestDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -2735,7 +2675,7 @@ public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScroll? return Self; } - public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public SearchRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -2743,7 +2683,7 @@ public SearchRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public SearchRequestDescriptor Slice(Action configure) + public SearchRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -2763,7 +2703,7 @@ public SearchRequestDescriptor Sort(ICollection configure) + public SearchRequestDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -2781,7 +2721,7 @@ public SearchRequestDescriptor Sort(Action configure) return Self; } - public SearchRequestDescriptor Sort(params Action[] configure) + public SearchRequestDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -2828,7 +2768,7 @@ public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Core.Search return Self; } - public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descriptor) + public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor descriptor) { SuggestValue = null; SuggestDescriptorAction = null; @@ -2836,7 +2776,7 @@ public SearchRequestDescriptor Suggest(Core.Search.SuggesterDescriptor descripto return Self; } - public SearchRequestDescriptor Suggest(Action configure) + public SearchRequestDescriptor Suggest(Action configure) { SuggestValue = null; SuggestDescriptor = null; @@ -2892,17 +2832,7 @@ public SearchRequestDescriptor Version(bool? version = true) 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.Aggregations.AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + if (AggregationsValue is not null) { writer.WritePropertyName("aggregations"); JsonSerializer.Serialize(writer, AggregationsValue, options); @@ -2916,7 +2846,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -2935,7 +2865,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -2944,7 +2874,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -2978,7 +2908,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(FieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FieldsDescriptorActions is not null) @@ -2987,7 +2917,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -3012,7 +2942,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -3034,7 +2964,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (KnnDescriptorAction is not null) { writer.WritePropertyName("knn"); - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(KnnDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(KnnDescriptorAction), options); } else if (KnnDescriptorActions is not null) { @@ -3043,7 +2973,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in KnnDescriptorActions) { - JsonSerializer.Serialize(writer, new KnnQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.KnnQueryDescriptor(action), options); } if (KnnDescriptorActions.Length > 1) @@ -3069,7 +2999,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PitDescriptorAction is not null) { writer.WritePropertyName("pit"); - JsonSerializer.Serialize(writer, new Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor(PitDescriptorAction), options); } else if (PitValue is not null) { @@ -3085,7 +3015,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PostFilterDescriptorAction is not null) { writer.WritePropertyName("post_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PostFilterDescriptorAction), options); } else if (PostFilterValue is not null) { @@ -3107,7 +3037,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -3123,7 +3053,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RankDescriptorAction is not null) { writer.WritePropertyName("rank"); - JsonSerializer.Serialize(writer, new RankDescriptor(RankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.RankDescriptor(RankDescriptorAction), options); } else if (RankValue is not null) { @@ -3139,7 +3069,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RescoreDescriptorAction is not null) { writer.WritePropertyName("rescore"); - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(RescoreDescriptorAction), options); } else if (RescoreDescriptorActions is not null) { @@ -3148,7 +3078,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RescoreDescriptorActions) { - JsonSerializer.Serialize(writer, new Core.Search.RescoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor(action), options); } if (RescoreDescriptorActions.Length > 1) @@ -3198,7 +3128,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -3214,7 +3144,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -3223,7 +3153,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -3261,7 +3191,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SuggestDescriptorAction is not null) { writer.WritePropertyName("suggest"); - JsonSerializer.Serialize(writer, new Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor(SuggestDescriptorAction), options); } else if (SuggestValue is not null) { @@ -3301,4 +3231,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} \ No newline at end of file +} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs index a25dd8b35d5..2d2eba622c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs index 67babc69f20..409256a844f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs @@ -127,6 +127,10 @@ public sealed partial class SearchShardsRequestDescriptor : RequestDe { internal SearchShardsRequestDescriptor(Action> configure) => configure.Invoke(this); + public SearchShardsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchShardsRequestDescriptor() { } @@ -164,6 +168,10 @@ public sealed partial class SearchShardsRequestDescriptor : RequestDescriptor configure) => configure.Invoke(this); + public SearchShardsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchShardsRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs index e473ccd0c0e..ef95b045455 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs index 3faf3eea4dd..c75a96a6bb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs @@ -212,6 +212,10 @@ public sealed partial class SearchTemplateRequestDescriptor : Request { internal SearchTemplateRequestDescriptor(Action> configure) => configure.Invoke(this); + public SearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchTemplateRequestDescriptor() { } @@ -337,6 +341,10 @@ public sealed partial class SearchTemplateRequestDescriptor : RequestDescriptor< { internal SearchTemplateRequestDescriptor(Action configure) => configure.Invoke(this); + public SearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + public SearchTemplateRequestDescriptor() { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs index b15e534c33f..051c600694e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs new file mode 100644 index 00000000000..da503d32ac4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchableSnapshots; + +public sealed partial class CacheStatsRequestParameters : RequestParameters +{ + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieve node-level cache statistics about searchable snapshots. +/// +public sealed partial class CacheStatsRequest : PlainRequest +{ + public CacheStatsRequest() + { + } + + public CacheStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsCacheStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.cache_stats"; + + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Retrieve node-level cache statistics about searchable snapshots. +/// +public sealed partial class CacheStatsRequestDescriptor : RequestDescriptor +{ + internal CacheStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public CacheStatsRequestDescriptor(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) + { + } + + public CacheStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsCacheStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.cache_stats"; + + public CacheStatsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public CacheStatsRequestDescriptor NodeId(Elastic.Clients.Elasticsearch.NodeIds? nodeId) + { + RouteValues.Optional("node_id", nodeId); + 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/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs new file mode 100644 index 00000000000..6b810e01d41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class CacheStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs new file mode 100644 index 00000000000..1fc04bdccae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs @@ -0,0 +1,164 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchableSnapshots; + +public sealed partial class ClearCacheRequestParameters : 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); } + + /// + /// 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 indices should be ignored when unavailable (missing or closed) + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Clear the cache of searchable snapshots. +/// +public sealed partial class ClearCacheRequest : PlainRequest +{ + public ClearCacheRequest() + { + } + + public ClearCacheRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.clear_cache"; + + /// + /// 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); } + + /// + /// 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 indices should be ignored when unavailable (missing or closed) + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } +} + +/// +/// Clear the cache of searchable snapshots. +/// +public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor, ClearCacheRequestParameters> +{ + internal ClearCacheRequestDescriptor(Action> configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public ClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Clear the cache of searchable snapshots. +/// +public sealed partial class ClearCacheRequestDescriptor : RequestDescriptor +{ + internal ClearCacheRequestDescriptor(Action configure) => configure.Invoke(this); + + public ClearCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public ClearCacheRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsClearCache; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.clear_cache"; + + public ClearCacheRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); + public ClearCacheRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards); + public ClearCacheRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + + public ClearCacheRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs new file mode 100644 index 00000000000..7f383fe82ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class ClearCacheResponse : ElasticsearchResponse +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs new file mode 100644 index 00000000000..238698ea22e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchableSnapshots; + +public sealed partial class MountRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` + /// + public string? Storage { get => Q("storage"); set => Q("storage", value); } + + /// + /// Should this request wait until the operation has completed before returning + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Mount a snapshot as a searchable index. +/// +public sealed partial class MountRequest : PlainRequest +{ + public MountRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsMount; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "searchable_snapshots.mount"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` + /// + [JsonIgnore] + public string? Storage { get => Q("storage"); set => Q("storage", value); } + + /// + /// Should this request wait until the operation has completed before returning + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + [JsonInclude, JsonPropertyName("ignore_index_settings")] + public ICollection? IgnoreIndexSettings { get; set; } + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName Index { get; set; } + [JsonInclude, JsonPropertyName("index_settings")] + public IDictionary? IndexSettings { get; set; } + [JsonInclude, JsonPropertyName("renamed_index")] + public Elastic.Clients.Elasticsearch.IndexName? RenamedIndex { get; set; } +} + +/// +/// Mount a snapshot as a searchable index. +/// +public sealed partial class MountRequestDescriptor : RequestDescriptor +{ + internal MountRequestDescriptor(Action configure) => configure.Invoke(this); + + public MountRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsMount; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "searchable_snapshots.mount"; + + public MountRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public MountRequestDescriptor Storage(string? storage) => Qs("storage", storage); + public MountRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public MountRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public MountRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? IgnoreIndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private IDictionary? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? RenamedIndexValue { get; set; } + + public MountRequestDescriptor IgnoreIndexSettings(ICollection? ignoreIndexSettings) + { + IgnoreIndexSettingsValue = ignoreIndexSettings; + return Self; + } + + public MountRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + public MountRequestDescriptor IndexSettings(Func, FluentDictionary> selector) + { + IndexSettingsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MountRequestDescriptor RenamedIndex(Elastic.Clients.Elasticsearch.IndexName? renamedIndex) + { + RenamedIndexValue = renamedIndex; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IgnoreIndexSettingsValue is not null) + { + writer.WritePropertyName("ignore_index_settings"); + JsonSerializer.Serialize(writer, IgnoreIndexSettingsValue, options); + } + + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + + if (RenamedIndexValue is not null) + { + writer.WritePropertyName("renamed_index"); + JsonSerializer.Serialize(writer, RenamedIndexValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs new file mode 100644 index 00000000000..9ae28a8c3cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class MountResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshot")] + public Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs new file mode 100644 index 00000000000..d7306d64eca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SearchableSnapshots; + +public sealed partial class SearchableSnapshotsStatsRequestParameters : RequestParameters +{ + /// + /// Return stats aggregated at cluster, index or shard level + /// + public Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? Level { get => Q("level"); set => Q("level", value); } +} + +/// +/// Retrieve shard-level statistics about searchable snapshots. +/// +public sealed partial class SearchableSnapshotsStatsRequest : PlainRequest +{ + public SearchableSnapshotsStatsRequest() + { + } + + public SearchableSnapshotsStatsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.stats"; + + /// + /// Return stats aggregated at cluster, index or shard level + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? Level { get => Q("level"); set => Q("level", value); } +} + +/// +/// Retrieve shard-level statistics about searchable snapshots. +/// +public sealed partial class SearchableSnapshotsStatsRequestDescriptor : RequestDescriptor, SearchableSnapshotsStatsRequestParameters> +{ + internal SearchableSnapshotsStatsRequestDescriptor(Action> configure) => configure.Invoke(this); + + public SearchableSnapshotsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SearchableSnapshotsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.stats"; + + public SearchableSnapshotsStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? level) => Qs("level", level); + + public SearchableSnapshotsStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + RouteValues.Optional("index", indices); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieve shard-level statistics about searchable snapshots. +/// +public sealed partial class SearchableSnapshotsStatsRequestDescriptor : RequestDescriptor +{ + internal SearchableSnapshotsStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public SearchableSnapshotsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) + { + } + + public SearchableSnapshotsStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "searchable_snapshots.stats"; + + public SearchableSnapshotsStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? level) => Qs("level", level); + + public SearchableSnapshotsStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.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/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs new file mode 100644 index 00000000000..fc66cfe509e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class SearchableSnapshotsStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("stats")] + public object Stats { get; init; } + [JsonInclude, JsonPropertyName("total")] + public object Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs new file mode 100644 index 00000000000..952c3db565c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class CleanupRepositoryRequestParameters : RequestParameters +{ + /// + /// Period to wait for a connection to the master node. + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. +/// +public sealed partial class CleanupRepositoryRequest : PlainRequest +{ + public CleanupRepositoryRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCleanupRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.cleanup_repository"; + + /// + /// Period to wait for a connection to the master node. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Period to wait for a response. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. +/// +public sealed partial class CleanupRepositoryRequestDescriptor : RequestDescriptor +{ + internal CleanupRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public CleanupRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCleanupRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.cleanup_repository"; + + public CleanupRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CleanupRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public CleanupRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("repository", 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/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs new file mode 100644 index 00000000000..078e36a39c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CleanupRepositoryResponse : ElasticsearchResponse +{ + /// + /// Statistics for cleanup operations. + /// + [JsonInclude, JsonPropertyName("results")] + public Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs new file mode 100644 index 00000000000..85811837d4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class CloneSnapshotRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Clones indices from one snapshot into another snapshot in the same repository. +/// +public sealed partial class CloneSnapshotRequest : PlainRequest +{ + public CloneSnapshotRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Elastic.Clients.Elasticsearch.Name targetSnapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot).Required("target_snapshot", targetSnapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotClone; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.clone"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + [JsonInclude, JsonPropertyName("indices")] + public string Indices { get; set; } +} + +/// +/// Clones indices from one snapshot into another snapshot in the same repository. +/// +public sealed partial class CloneSnapshotRequestDescriptor : RequestDescriptor +{ + internal CloneSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public CloneSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Elastic.Clients.Elasticsearch.Name targetSnapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot).Required("target_snapshot", targetSnapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotClone; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.clone"; + + public CloneSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CloneSnapshotRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public CloneSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public CloneSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + public CloneSnapshotRequestDescriptor TargetSnapshot(Elastic.Clients.Elasticsearch.Name targetSnapshot) + { + RouteValues.Required("target_snapshot", targetSnapshot); + return Self; + } + + private string IndicesValue { get; set; } + + public CloneSnapshotRequestDescriptor Indices(string indices) + { + IndicesValue = indices; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("indices"); + writer.WriteStringValue(IndicesValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs new file mode 100644 index 00000000000..995423a2865 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CloneSnapshotResponse : 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/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs new file mode 100644 index 00000000000..462c9495473 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class CreateRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Whether to verify the repository after creation + /// + public bool? Verify { get => Q("verify"); set => Q("verify", value); } +} + +/// +/// Creates a repository. +/// +public sealed partial class CreateRepositoryRequest : PlainRequest +{ + public CreateRepositoryRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreateRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create_repository"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Whether to verify the repository after creation + /// + [JsonIgnore] + public bool? Verify { get => Q("verify"); set => Q("verify", value); } + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Snapshot.IRepository Repository { get; set; } +} + +/// +/// Creates a repository. +/// +public sealed partial class CreateRepositoryRequestDescriptor : RequestDescriptor +{ + internal CreateRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + public CreateRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Snapshot.IRepository repository, Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) => RepositoryValue = repository; + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreateRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create_repository"; + + public CreateRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public CreateRepositoryRequestDescriptor Verify(bool? verify = true) => Qs("verify", verify); + + public CreateRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("repository", name); + return Self; + } + + private Elastic.Clients.Elasticsearch.Snapshot.IRepository RepositoryValue { get; set; } + + public CreateRepositoryRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Snapshot.IRepository repository) + { + RepositoryValue = repository; + 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/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs new file mode 100644 index 00000000000..0f2b6b67437 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CreateRepositoryResponse : 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/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs new file mode 100644 index 00000000000..f8646a5110c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class CreateSnapshotRequestParameters : 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Creates a snapshot in a repository. +/// +public sealed partial class CreateSnapshotRequest : PlainRequest +{ + public CreateSnapshotRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + + /// + /// Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. + /// + [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + + /// + /// If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + + /// + /// If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`). + /// + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + + /// + /// Data streams and indices to include in the snapshot. Supports multi-target syntax. Includes all data streams and indices by default. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Indices? Indices { get; set; } + + /// + /// Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytes. This map is not automatically generated by Elasticsearch. + /// + [JsonInclude, JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + + /// + /// If `true`, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } +} + +/// +/// Creates a snapshot in a repository. +/// +public sealed partial class CreateSnapshotRequestDescriptor : RequestDescriptor +{ + internal CreateSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public CreateSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotCreate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.create"; + + public CreateSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public CreateSnapshotRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public CreateSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public CreateSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private IDictionary? MetadataValue { get; set; } + private bool? PartialValue { get; set; } + + /// + /// Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. + /// + public CreateSnapshotRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + /// + /// If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. + /// + public CreateSnapshotRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + /// + /// If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`). + /// + public CreateSnapshotRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + /// + /// Data streams and indices to include in the snapshot. Supports multi-target syntax. Includes all data streams and indices by default. + /// + public CreateSnapshotRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytes. This map is not automatically generated by Elasticsearch. + /// + public CreateSnapshotRequestDescriptor Metadata(Func, FluentDictionary> selector) + { + MetadataValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If `true`, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + public CreateSnapshotRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs new file mode 100644 index 00000000000..e528c91718c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CreateSnapshotResponse : ElasticsearchResponse +{ + /// + /// Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false` + /// + [JsonInclude, JsonPropertyName("accepted")] + public bool? Accepted { get; init; } + + /// + /// Snapshot information. Present when the request had `wait_for_completion` set to `true` + /// + [JsonInclude, JsonPropertyName("snapshot")] + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo? Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs new file mode 100644 index 00000000000..92a715ef386 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class DeleteRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a repository. +/// +public sealed partial class DeleteRepositoryRequest : PlainRequest +{ + public DeleteRepositoryRequest(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDeleteRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete_repository"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a repository. +/// +public sealed partial class DeleteRepositoryRequestDescriptor : RequestDescriptor +{ + internal DeleteRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Names name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDeleteRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete_repository"; + + public DeleteRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public DeleteRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names name) + { + RouteValues.Required("repository", 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/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs new file mode 100644 index 00000000000..e2c5db4a72a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class DeleteRepositoryResponse : 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/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs new file mode 100644 index 00000000000..088eaf4ccbf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class DeleteSnapshotRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Deletes one or more snapshots. +/// +public sealed partial class DeleteSnapshotRequest : PlainRequest +{ + public DeleteSnapshotRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Deletes one or more snapshots. +/// +public sealed partial class DeleteSnapshotRequestDescriptor : RequestDescriptor +{ + internal DeleteSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotDelete; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.delete"; + + public DeleteSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public DeleteSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public DeleteSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + 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/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs new file mode 100644 index 00000000000..b760579ca33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class DeleteSnapshotResponse : 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/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs new file mode 100644 index 00000000000..b01d869090a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class GetRepositoryRequestParameters : RequestParameters +{ + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about a repository. +/// +public sealed partial class GetRepositoryRequest : PlainRequest +{ + public GetRepositoryRequest() + { + } + + public GetRepositoryRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGetRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get_repository"; + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about a repository. +/// +public sealed partial class GetRepositoryRequestDescriptor : RequestDescriptor +{ + internal GetRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("repository", name)) + { + } + + public GetRepositoryRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGetRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get_repository"; + + public GetRepositoryRequestDescriptor Local(bool? local = true) => Qs("local", local); + public GetRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public GetRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Names? name) + { + RouteValues.Optional("repository", 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/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs new file mode 100644 index 00000000000..56a33d8b994 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class GetRepositoryResponse : DictionaryResponse +{ + public GetRepositoryResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetRepositoryResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs new file mode 100644 index 00000000000..2e6399db2b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs @@ -0,0 +1,244 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class GetSnapshotRequestParameters : RequestParameters +{ + /// + /// Offset identifier to start pagination from as returned by the next field in the response body. + /// + public string? After { get => Q("after"); set => Q("after", value); } + + /// + /// Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count. + /// + public string? FromSortValue { get => Q("from_sort_value"); set => Q("from_sort_value", value); } + + /// + /// If false, the request returns an error for any snapshots that are unavailable. + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, returns the repository name in each snapshot. + /// + public bool? IncludeRepository { get => Q("include_repository"); set => Q("include_repository", value); } + + /// + /// If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted. + /// + public bool? IndexDetails { get => Q("index_details"); set => Q("index_details", value); } + + /// + /// If true, returns the name of each index in each snapshot. + /// + public bool? IndexNames { get => Q("index_names"); set => Q("index_names", 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. + /// + public int? Offset { get => Q("offset"); set => Q("offset", value); } + + /// + /// Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order. + /// + public Elastic.Clients.Elasticsearch.SortOrder? Order { get => Q("order"); set => Q("order", value); } + + /// + /// Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit. + /// + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy. + /// + public Elastic.Clients.Elasticsearch.Name? SlmPolicyFilter { get => Q("slm_policy_filter"); set => Q("slm_policy_filter", value); } + + /// + /// Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp. + /// + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + /// + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns information about a snapshot. +/// +public sealed partial class GetSnapshotRequest : PlainRequest +{ + public GetSnapshotRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get"; + + /// + /// Offset identifier to start pagination from as returned by the next field in the response body. + /// + [JsonIgnore] + public string? After { get => Q("after"); set => Q("after", value); } + + /// + /// Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count. + /// + [JsonIgnore] + public string? FromSortValue { get => Q("from_sort_value"); set => Q("from_sort_value", value); } + + /// + /// If false, the request returns an error for any snapshots that are unavailable. + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// If true, returns the repository name in each snapshot. + /// + [JsonIgnore] + public bool? IncludeRepository { get => Q("include_repository"); set => Q("include_repository", value); } + + /// + /// If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted. + /// + [JsonIgnore] + public bool? IndexDetails { get => Q("index_details"); set => Q("index_details", value); } + + /// + /// If true, returns the name of each index in each snapshot. + /// + [JsonIgnore] + public bool? IndexNames { get => Q("index_names"); set => Q("index_names", 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. + /// + [JsonIgnore] + public int? Offset { get => Q("offset"); set => Q("offset", value); } + + /// + /// Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.SortOrder? Order { get => Q("order"); set => Q("order", value); } + + /// + /// Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Name? SlmPolicyFilter { get => Q("slm_policy_filter"); set => Q("slm_policy_filter", value); } + + /// + /// Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp. + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort? Sort { get => Q("sort"); set => Q("sort", value); } + + /// + /// If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + /// + [JsonIgnore] + public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } +} + +/// +/// Returns information about a snapshot. +/// +public sealed partial class GetSnapshotRequestDescriptor : RequestDescriptor +{ + internal GetSnapshotRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSnapshotRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotGet; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.get"; + + public GetSnapshotRequestDescriptor After(string? after) => Qs("after", after); + public GetSnapshotRequestDescriptor FromSortValue(string? fromSortValue) => Qs("from_sort_value", fromSortValue); + public GetSnapshotRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public GetSnapshotRequestDescriptor IncludeRepository(bool? includeRepository = true) => Qs("include_repository", includeRepository); + public GetSnapshotRequestDescriptor IndexDetails(bool? indexDetails = true) => Qs("index_details", indexDetails); + public GetSnapshotRequestDescriptor IndexNames(bool? indexNames = true) => Qs("index_names", indexNames); + public GetSnapshotRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public GetSnapshotRequestDescriptor Offset(int? offset) => Qs("offset", offset); + public GetSnapshotRequestDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) => Qs("order", order); + public GetSnapshotRequestDescriptor Size(int? size) => Qs("size", size); + public GetSnapshotRequestDescriptor SlmPolicyFilter(Elastic.Clients.Elasticsearch.Name? slmPolicyFilter) => Qs("slm_policy_filter", slmPolicyFilter); + public GetSnapshotRequestDescriptor Sort(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort? sort) => Qs("sort", sort); + public GetSnapshotRequestDescriptor Verbose(bool? verbose = true) => Qs("verbose", verbose); + + public GetSnapshotRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public GetSnapshotRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Names snapshot) + { + RouteValues.Required("snapshot", snapshot); + 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/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs new file mode 100644 index 00000000000..2534c13bb2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class GetSnapshotResponse : ElasticsearchResponse +{ + /// + /// The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the next field value. + /// + [JsonInclude, JsonPropertyName("remaining")] + public int Remaining { get; init; } + [JsonInclude, JsonPropertyName("responses")] + public IReadOnlyCollection? Responses { get; init; } + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection? Snapshots { get; init; } + + /// + /// The total number of snapshots that match the request when ignoring size limit or after query parameter. + /// + [JsonInclude, JsonPropertyName("total")] + public int Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs new file mode 100644 index 00000000000..d9561d27ac1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class RestoreRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Should this request wait until the operation has completed before returning + /// + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequest : PlainRequest +{ + public RestoreRequest(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Should this request wait until the operation has completed before returning + /// + [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } + [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + [JsonInclude, JsonPropertyName("ignore_index_settings")] + public ICollection? IgnoreIndexSettings { get; set; } + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + [JsonInclude, JsonPropertyName("include_aliases")] + public bool? IncludeAliases { get; set; } + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + [JsonInclude, JsonPropertyName("index_settings")] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? IndexSettings { get; set; } + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Indices? Indices { get; set; } + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } + [JsonInclude, JsonPropertyName("rename_pattern")] + public string? RenamePattern { get; set; } + [JsonInclude, JsonPropertyName("rename_replacement")] + public string? RenameReplacement { get; set; } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequestDescriptor : RequestDescriptor, RestoreRequestParameters> +{ + internal RestoreRequestDescriptor(Action> configure) => configure.Invoke(this); + + public RestoreRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + public RestoreRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RestoreRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public RestoreRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public RestoreRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private ICollection? IgnoreIndexSettingsValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeAliasesValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor IndexSettingsDescriptor { get; set; } + private Action> IndexSettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private bool? PartialValue { get; set; } + private string? RenamePatternValue { get; set; } + private string? RenameReplacementValue { get; set; } + + public RestoreRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + public RestoreRequestDescriptor IgnoreIndexSettings(ICollection? ignoreIndexSettings) + { + IgnoreIndexSettingsValue = ignoreIndexSettings; + return Self; + } + + public RestoreRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + public RestoreRequestDescriptor IncludeAliases(bool? includeAliases = true) + { + IncludeAliasesValue = includeAliases; + return Self; + } + + public RestoreRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? indexSettings) + { + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = null; + IndexSettingsValue = indexSettings; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + IndexSettingsValue = null; + IndexSettingsDescriptorAction = null; + IndexSettingsDescriptor = descriptor; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Action> configure) + { + IndexSettingsValue = null; + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = configure; + return Self; + } + + public RestoreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + public RestoreRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + public RestoreRequestDescriptor RenamePattern(string? renamePattern) + { + RenamePatternValue = renamePattern; + return Self; + } + + public RestoreRequestDescriptor RenameReplacement(string? renameReplacement) + { + RenameReplacementValue = renameReplacement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreIndexSettingsValue is not null) + { + writer.WritePropertyName("ignore_index_settings"); + JsonSerializer.Serialize(writer, IgnoreIndexSettingsValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeAliasesValue.HasValue) + { + writer.WritePropertyName("include_aliases"); + writer.WriteBooleanValue(IncludeAliasesValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndexSettingsDescriptor is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsDescriptor, options); + } + else if (IndexSettingsDescriptorAction is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(IndexSettingsDescriptorAction), options); + } + else if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + if (!string.IsNullOrEmpty(RenamePatternValue)) + { + writer.WritePropertyName("rename_pattern"); + writer.WriteStringValue(RenamePatternValue); + } + + if (!string.IsNullOrEmpty(RenameReplacementValue)) + { + writer.WritePropertyName("rename_replacement"); + writer.WriteStringValue(RenameReplacementValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Restores a snapshot. +/// +public sealed partial class RestoreRequestDescriptor : RequestDescriptor +{ + internal RestoreRequestDescriptor(Action configure) => configure.Invoke(this); + + public RestoreRequestDescriptor(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) : base(r => r.Required("repository", repository).Required("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotRestore; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "snapshot.restore"; + + public RestoreRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public RestoreRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public RestoreRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name repository) + { + RouteValues.Required("repository", repository); + return Self; + } + + public RestoreRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Name snapshot) + { + RouteValues.Required("snapshot", snapshot); + return Self; + } + + private ICollection? FeatureStatesValue { get; set; } + private ICollection? IgnoreIndexSettingsValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeAliasesValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor IndexSettingsDescriptor { get; set; } + private Action IndexSettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private bool? PartialValue { get; set; } + private string? RenamePatternValue { get; set; } + private string? RenameReplacementValue { get; set; } + + public RestoreRequestDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + public RestoreRequestDescriptor IgnoreIndexSettings(ICollection? ignoreIndexSettings) + { + IgnoreIndexSettingsValue = ignoreIndexSettings; + return Self; + } + + public RestoreRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + public RestoreRequestDescriptor IncludeAliases(bool? includeAliases = true) + { + IncludeAliasesValue = includeAliases; + return Self; + } + + public RestoreRequestDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? indexSettings) + { + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = null; + IndexSettingsValue = indexSettings; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + IndexSettingsValue = null; + IndexSettingsDescriptorAction = null; + IndexSettingsDescriptor = descriptor; + return Self; + } + + public RestoreRequestDescriptor IndexSettings(Action configure) + { + IndexSettingsValue = null; + IndexSettingsDescriptor = null; + IndexSettingsDescriptorAction = configure; + return Self; + } + + public RestoreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + public RestoreRequestDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + public RestoreRequestDescriptor RenamePattern(string? renamePattern) + { + RenamePatternValue = renamePattern; + return Self; + } + + public RestoreRequestDescriptor RenameReplacement(string? renameReplacement) + { + RenameReplacementValue = renameReplacement; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreIndexSettingsValue is not null) + { + writer.WritePropertyName("ignore_index_settings"); + JsonSerializer.Serialize(writer, IgnoreIndexSettingsValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeAliasesValue.HasValue) + { + writer.WritePropertyName("include_aliases"); + writer.WriteBooleanValue(IncludeAliasesValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndexSettingsDescriptor is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsDescriptor, options); + } + else if (IndexSettingsDescriptorAction is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(IndexSettingsDescriptorAction), options); + } + else if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + if (!string.IsNullOrEmpty(RenamePatternValue)) + { + writer.WritePropertyName("rename_pattern"); + writer.WriteStringValue(RenamePatternValue); + } + + if (!string.IsNullOrEmpty(RenameReplacementValue)) + { + writer.WritePropertyName("rename_replacement"); + writer.WriteStringValue(RenameReplacementValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs new file mode 100644 index 00000000000..6e81b6daa73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class RestoreResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshot")] + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs new file mode 100644 index 00000000000..f6226e8928e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class SnapshotStatusRequestParameters : RequestParameters +{ + /// + /// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + /// + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about the status of a snapshot. +/// +public sealed partial class SnapshotStatusRequest : PlainRequest +{ + public SnapshotStatusRequest() + { + } + + public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Name? repository) : base(r => r.Optional("repository", repository)) + { + } + + public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Name? repository, Elastic.Clients.Elasticsearch.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.status"; + + /// + /// Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + /// + [JsonIgnore] + public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// Returns information about the status of a snapshot. +/// +public sealed partial class SnapshotStatusRequestDescriptor : RequestDescriptor +{ + internal SnapshotStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public SnapshotStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Name? repository, Elastic.Clients.Elasticsearch.Names? snapshot) : base(r => r.Optional("repository", repository).Optional("snapshot", snapshot)) + { + } + + public SnapshotStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.status"; + + public SnapshotStatusRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); + public SnapshotStatusRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + + public SnapshotStatusRequestDescriptor Repository(Elastic.Clients.Elasticsearch.Name? repository) + { + RouteValues.Optional("repository", repository); + return Self; + } + + public SnapshotStatusRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.Names? snapshot) + { + RouteValues.Optional("snapshot", snapshot); + 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/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs new file mode 100644 index 00000000000..e77aa967106 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection Snapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs new file mode 100644 index 00000000000..b845d1fce53 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public sealed partial class VerifyRepositoryRequestParameters : RequestParameters +{ + /// + /// Explicit operation timeout for connection to master node + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Verifies a repository. +/// +public sealed partial class VerifyRepositoryRequest : PlainRequest +{ + public VerifyRepositoryRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotVerifyRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.verify_repository"; + + /// + /// Explicit operation timeout for connection to master node + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// Explicit operation timeout + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Verifies a repository. +/// +public sealed partial class VerifyRepositoryRequestDescriptor : RequestDescriptor +{ + internal VerifyRepositoryRequestDescriptor(Action configure) => configure.Invoke(this); + + public VerifyRepositoryRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("repository", name)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotVerifyRepository; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "snapshot.verify_repository"; + + public VerifyRepositoryRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public VerifyRepositoryRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public VerifyRepositoryRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + RouteValues.Required("repository", 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/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs new file mode 100644 index 00000000000..8ebe48523d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class VerifyRepositoryResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyDictionary Nodes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs new file mode 100644 index 00000000000..68f69c2b191 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class DeleteLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Deletes an existing snapshot lifecycle policy. +/// +public sealed partial class DeleteLifecycleRequest : PlainRequest +{ + public DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.delete_lifecycle"; +} + +/// +/// Deletes an existing snapshot lifecycle policy. +/// +public sealed partial class DeleteLifecycleRequestDescriptor : RequestDescriptor +{ + internal DeleteLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementDeleteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.delete_lifecycle"; + + public DeleteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Name policyId) + { + RouteValues.Required("policy_id", policyId); + 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/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs new file mode 100644 index 00000000000..b540cd23ed5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class DeleteLifecycleResponse : 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/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs new file mode 100644 index 00000000000..0c11cc3b6bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class ExecuteLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. +/// +public sealed partial class ExecuteLifecycleRequest : PlainRequest +{ + public ExecuteLifecycleRequest(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_lifecycle"; +} + +/// +/// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. +/// +public sealed partial class ExecuteLifecycleRequestDescriptor : RequestDescriptor +{ + internal ExecuteLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExecuteLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_lifecycle"; + + public ExecuteLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Name policyId) + { + RouteValues.Required("policy_id", policyId); + 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/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs new file mode 100644 index 00000000000..ef39b567457 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class ExecuteLifecycleResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("snapshot_name")] + public string SnapshotName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs new file mode 100644 index 00000000000..a605f8f3a73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class ExecuteRetentionRequestParameters : RequestParameters +{ +} + +/// +/// Deletes any snapshots that are expired according to the policy's retention rules. +/// +public sealed partial class ExecuteRetentionRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteRetention; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_retention"; +} + +/// +/// Deletes any snapshots that are expired according to the policy's retention rules. +/// +public sealed partial class ExecuteRetentionRequestDescriptor : RequestDescriptor +{ + internal ExecuteRetentionRequestDescriptor(Action configure) => configure.Invoke(this); + + public ExecuteRetentionRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementExecuteRetention; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.execute_retention"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs new file mode 100644 index 00000000000..e827287e1ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class ExecuteRetentionResponse : 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/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs new file mode 100644 index 00000000000..abdb7285eef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class GetLifecycleRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. +/// +public sealed partial class GetLifecycleRequest : PlainRequest +{ + public GetLifecycleRequest() + { + } + + public GetLifecycleRequest(Elastic.Clients.Elasticsearch.Names? policyId) : base(r => r.Optional("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_lifecycle"; +} + +/// +/// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. +/// +public sealed partial class GetLifecycleRequestDescriptor : RequestDescriptor +{ + internal GetLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Names? policyId) : base(r => r.Optional("policy_id", policyId)) + { + } + + public GetLifecycleRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_lifecycle"; + + public GetLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Names? policyId) + { + RouteValues.Optional("policy_id", policyId); + 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/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs new file mode 100644 index 00000000000..12cd808484b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class GetLifecycleResponse : DictionaryResponse +{ + public GetLifecycleResponse(IReadOnlyDictionary dictionary) : base(dictionary) + { + } + + public GetLifecycleResponse() : base() + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs new file mode 100644 index 00000000000..06c5c19cf36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class GetSlmStatusRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves the status of snapshot lifecycle management (SLM). +/// +public sealed partial class GetSlmStatusRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_status"; +} + +/// +/// Retrieves the status of snapshot lifecycle management (SLM). +/// +public sealed partial class GetSlmStatusRequestDescriptor : RequestDescriptor +{ + internal GetSlmStatusRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSlmStatusRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStatus; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_status"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs new file mode 100644 index 00000000000..c2cc6418284 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class GetSlmStatusResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("operation_mode")] + public Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs new file mode 100644 index 00000000000..47a23e1ec72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class GetStatsRequestParameters : RequestParameters +{ +} + +/// +/// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. +/// +public sealed partial class GetStatsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_stats"; +} + +/// +/// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. +/// +public sealed partial class GetStatsRequestDescriptor : RequestDescriptor +{ + internal GetStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetStatsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementGetStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.get_stats"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs new file mode 100644 index 00000000000..7174da48a8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class GetStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("policy_stats")] + public IReadOnlyCollection PolicyStats { get; init; } + [JsonInclude, JsonPropertyName("retention_deletion_time")] + public Elastic.Clients.Elasticsearch.Duration RetentionDeletionTime { get; init; } + [JsonInclude, JsonPropertyName("retention_deletion_time_millis")] + public long RetentionDeletionTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("retention_failed")] + public long RetentionFailed { get; init; } + [JsonInclude, JsonPropertyName("retention_runs")] + public long RetentionRuns { get; init; } + [JsonInclude, JsonPropertyName("retention_timed_out")] + public long RetentionTimedOut { get; init; } + [JsonInclude, JsonPropertyName("total_snapshot_deletion_failures")] + public long TotalSnapshotDeletionFailures { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_deleted")] + public long TotalSnapshotsDeleted { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_failed")] + public long TotalSnapshotsFailed { get; init; } + [JsonInclude, JsonPropertyName("total_snapshots_taken")] + public long TotalSnapshotsTaken { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs new file mode 100644 index 00000000000..911f794de86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs @@ -0,0 +1,279 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class PutLifecycleRequestParameters : 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Creates or updates a snapshot lifecycle policy. +/// +public sealed partial class PutLifecycleRequest : PlainRequest +{ + public PutLifecycleRequest(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "slm.put_lifecycle"; + + /// + /// 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.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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Configuration for each snapshot created by the policy. + /// + [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration? Config { get; set; } + + /// + /// Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name. + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Name? Name { get; set; } + + /// + /// Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. + /// + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; set; } + + /// + /// Retention rules used to retain and delete snapshots created by the policy. + /// + [JsonInclude, JsonPropertyName("retention")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention? Retention { get; set; } + + /// + /// Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. + /// + [JsonInclude, JsonPropertyName("schedule")] + public string? Schedule { get; set; } +} + +/// +/// Creates or updates a snapshot lifecycle policy. +/// +public sealed partial class PutLifecycleRequestDescriptor : RequestDescriptor +{ + internal PutLifecycleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policyId) : base(r => r.Required("policy_id", policyId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementPutLifecycle; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "slm.put_lifecycle"; + + public PutLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout); + public PutLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutLifecycleRequestDescriptor PolicyId(Elastic.Clients.Elasticsearch.Name policyId) + { + RouteValues.Required("policy_id", policyId); + return Self; + } + + private Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration? ConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfigurationDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } + private string? RepositoryValue { get; set; } + private Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention? RetentionValue { get; set; } + private Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.RetentionDescriptor RetentionDescriptor { get; set; } + private Action RetentionDescriptorAction { get; set; } + private string? ScheduleValue { get; set; } + + /// + /// Configuration for each snapshot created by the policy. + /// + public PutLifecycleRequestDescriptor Config(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration? config) + { + ConfigDescriptor = null; + ConfigDescriptorAction = null; + ConfigValue = config; + return Self; + } + + public PutLifecycleRequestDescriptor Config(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfigurationDescriptor descriptor) + { + ConfigValue = null; + ConfigDescriptorAction = null; + ConfigDescriptor = descriptor; + return Self; + } + + public PutLifecycleRequestDescriptor Config(Action configure) + { + ConfigValue = null; + ConfigDescriptor = null; + ConfigDescriptorAction = configure; + return Self; + } + + /// + /// Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name. + /// + public PutLifecycleRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) + { + NameValue = name; + return Self; + } + + /// + /// Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API. + /// + public PutLifecycleRequestDescriptor Repository(string? repository) + { + RepositoryValue = repository; + return Self; + } + + /// + /// Retention rules used to retain and delete snapshots created by the policy. + /// + public PutLifecycleRequestDescriptor Retention(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention? retention) + { + RetentionDescriptor = null; + RetentionDescriptorAction = null; + RetentionValue = retention; + return Self; + } + + public PutLifecycleRequestDescriptor Retention(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.RetentionDescriptor descriptor) + { + RetentionValue = null; + RetentionDescriptorAction = null; + RetentionDescriptor = descriptor; + return Self; + } + + public PutLifecycleRequestDescriptor Retention(Action configure) + { + RetentionValue = null; + RetentionDescriptor = null; + RetentionDescriptorAction = configure; + return Self; + } + + /// + /// Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately. + /// + public PutLifecycleRequestDescriptor Schedule(string? schedule) + { + ScheduleValue = schedule; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ConfigDescriptor is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigDescriptor, options); + } + else if (ConfigDescriptorAction is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfigurationDescriptor(ConfigDescriptorAction), options); + } + else if (ConfigValue is not null) + { + writer.WritePropertyName("config"); + JsonSerializer.Serialize(writer, ConfigValue, options); + } + + if (NameValue is not null) + { + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + } + + if (!string.IsNullOrEmpty(RepositoryValue)) + { + writer.WritePropertyName("repository"); + writer.WriteStringValue(RepositoryValue); + } + + 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 Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.RetentionDescriptor(RetentionDescriptorAction), options); + } + else if (RetentionValue is not null) + { + writer.WritePropertyName("retention"); + JsonSerializer.Serialize(writer, RetentionValue, options); + } + + if (!string.IsNullOrEmpty(ScheduleValue)) + { + writer.WritePropertyName("schedule"); + writer.WriteStringValue(ScheduleValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs new file mode 100644 index 00000000000..1d4b1704dda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class PutLifecycleResponse : 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/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs new file mode 100644 index 00000000000..5e8e0d3ce78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class StartSlmRequestParameters : RequestParameters +{ +} + +/// +/// Turns on snapshot lifecycle management (SLM). +/// +public sealed partial class StartSlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.start"; +} + +/// +/// Turns on snapshot lifecycle management (SLM). +/// +public sealed partial class StartSlmRequestDescriptor : RequestDescriptor +{ + internal StartSlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartSlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStart; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.start"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs new file mode 100644 index 00000000000..ab428155de2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class StartSlmResponse : 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/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs new file mode 100644 index 00000000000..4d236ed8087 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.SnapshotLifecycleManagement; + +public sealed partial class StopSlmRequestParameters : RequestParameters +{ +} + +/// +/// Turns off snapshot lifecycle management (SLM). +/// +public sealed partial class StopSlmRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.stop"; +} + +/// +/// Turns off snapshot lifecycle management (SLM). +/// +public sealed partial class StopSlmRequestDescriptor : RequestDescriptor +{ + internal StopSlmRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopSlmRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SnapshotLifecycleManagementStop; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "slm.stop"; + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs new file mode 100644 index 00000000000..a982f56ef95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class StopSlmResponse : 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/_Generated/Api/Sql/ClearCursorResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs index 0e45262a6b7..a57592eeeb5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs index 304f3dad4aa..d250f5c878b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs @@ -62,10 +62,6 @@ public DeleteAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base( { } - internal DeleteAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlDeleteAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; @@ -96,10 +92,6 @@ public DeleteAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base( { } - internal DeleteAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlDeleteAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs index eb45e0020a0..b92f1b8198a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs index 6c2e137c15a..9598caf649c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs @@ -105,10 +105,6 @@ public GetAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r = { } - internal GetAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -144,10 +140,6 @@ public GetAsyncRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r = { } - internal GetAsyncRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsync; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs index b24e925c088..af11f8ec195 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs index 6c438d4d86b..68c73225eb6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs @@ -62,10 +62,6 @@ public GetAsyncStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal GetAsyncStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsyncStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; @@ -96,10 +92,6 @@ public GetAsyncStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : ba { } - internal GetAsyncStatusRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.SqlGetAsyncStatus; protected override HttpMethod StaticHttpMethod => HttpMethod.GET; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs index 21d47b47c46..e303a6a947c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs index bcf9c6961bb..fc57aa8fe74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs @@ -31,6 +31,10 @@ namespace Elastic.Clients.Elasticsearch.Sql; public sealed partial class QueryRequestParameters : RequestParameters { + /// + /// Format for the response. + /// + public string? Format { get => Q("format"); set => Q("format", value); } } /// @@ -46,6 +50,12 @@ public sealed partial class QueryRequest : PlainRequest internal override string OperationName => "sql.query"; + /// + /// Format for the response. + /// + [JsonIgnore] + public string? Format { get => Q("format"); set => Q("format", value); } + /// /// Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. /// @@ -162,14 +172,16 @@ public QueryRequestDescriptor() internal override string OperationName => "sql.query"; + public QueryRequestDescriptor Format(string? format) => Qs("format", format); + private string? CatalogValue { get; set; } private bool? ColumnarValue { get; set; } private string? CursorValue { get; set; } private int? FetchSizeValue { get; set; } private bool? FieldMultiValueLeniencyValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private bool? IndexUsingFrozenValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } @@ -177,7 +189,7 @@ public QueryRequestDescriptor() private IDictionary? ParamsValue { get; set; } private string? QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? RequestTimeoutValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeoutValue { get; set; } @@ -237,7 +249,7 @@ public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Qu return Self; } - public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -245,7 +257,7 @@ public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public QueryRequestDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -319,9 +331,9 @@ public QueryRequestDescriptor RequestTimeout(Elastic.Clients.Elastics /// /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
///
- public QueryRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public QueryRequestDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -384,7 +396,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -440,10 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (WaitForCompletionTimeoutValue is not null) @@ -475,14 +487,16 @@ public QueryRequestDescriptor() internal override string OperationName => "sql.query"; + public QueryRequestDescriptor Format(string? format) => Qs("format", format); + private string? CatalogValue { get; set; } private bool? ColumnarValue { get; set; } private string? CursorValue { get; set; } private int? FetchSizeValue { get; set; } private bool? FieldMultiValueLeniencyValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private bool? IndexUsingFrozenValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? KeepAliveValue { get; set; } private bool? KeepOnCompletionValue { get; set; } @@ -490,7 +504,7 @@ public QueryRequestDescriptor() private IDictionary? ParamsValue { get; set; } private string? QueryValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? RequestTimeoutValue { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeoutValue { get; set; } @@ -550,7 +564,7 @@ public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Quer return Self; } - public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public QueryRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -558,7 +572,7 @@ public QueryRequestDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public QueryRequestDescriptor Filter(Action configure) + public QueryRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -632,9 +646,9 @@ public QueryRequestDescriptor RequestTimeout(Elastic.Clients.Elasticsearch.Durat /// /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
///
- public QueryRequestDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public QueryRequestDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -697,7 +711,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -753,10 +767,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (WaitForCompletionTimeoutValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs index aee3d91d37f..8641dce22c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs new file mode 100644 index 00000000000..faea2e2b47e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Sql; + +public sealed partial class TranslateRequestParameters : RequestParameters +{ +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + [JsonInclude, JsonPropertyName("fetch_size")] + public int? FetchSize { get; set; } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Filter { get; set; } + + /// + /// SQL query to run. + /// + [JsonInclude, JsonPropertyName("query")] + public string Query { get; set; } + + /// + /// ISO-8601 time zone ID for the search. + /// + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequestDescriptor : RequestDescriptor, TranslateRequestParameters> +{ + internal TranslateRequestDescriptor(Action> configure) => configure.Invoke(this); + + public TranslateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + private int? FetchSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private string QueryValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + public TranslateRequestDescriptor FetchSize(int? fetchSize) + { + FetchSizeValue = fetchSize; + return Self; + } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TranslateRequestDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// SQL query to run. + /// + public TranslateRequestDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// ISO-8601 time zone ID for the search. + /// + public TranslateRequestDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchSizeValue.HasValue) + { + writer.WritePropertyName("fetch_size"); + writer.WriteNumberValue(FetchSizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} + +/// +/// Translates SQL into Elasticsearch queries +/// +public sealed partial class TranslateRequestDescriptor : RequestDescriptor +{ + internal TranslateRequestDescriptor(Action configure) => configure.Invoke(this); + + public TranslateRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SqlTranslate; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "sql.translate"; + + private int? FetchSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private string QueryValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The maximum number of rows (or entries) to return in one response. + /// + public TranslateRequestDescriptor FetchSize(int? fetchSize) + { + FetchSizeValue = fetchSize; + return Self; + } + + /// + /// Elasticsearch query DSL for additional filtering. + /// + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public TranslateRequestDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public TranslateRequestDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// SQL query to run. + /// + public TranslateRequestDescriptor Query(string query) + { + QueryValue = query; + return Self; + } + + /// + /// ISO-8601 time zone ID for the search. + /// + public TranslateRequestDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FetchSizeValue.HasValue) + { + writer.WritePropertyName("fetch_size"); + writer.WriteNumberValue(FetchSizeValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + writer.WritePropertyName("query"); + writer.WriteStringValue(QueryValue); + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs new file mode 100644 index 00000000000..583441e33fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql; + +public sealed partial class TranslateResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyCollection? Fields { get; init; } + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long? Size { get; init; } + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] + public IReadOnlyCollection? Sort { get; init; } + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs new file mode 100644 index 00000000000..d59be417034 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class DeleteSynonymRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a synonym set +/// +public sealed partial class DeleteSynonymRequest : PlainRequest +{ + public DeleteSynonymRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; +} + +/// +/// Deletes a synonym set +/// +public sealed partial class DeleteSynonymRequestDescriptor : RequestDescriptor, DeleteSynonymRequestParameters> +{ + internal DeleteSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public DeleteSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; + + public DeleteSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Deletes a synonym set +/// +public sealed partial class DeleteSynonymRequestDescriptor : RequestDescriptor +{ + internal DeleteSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym"; + + public DeleteSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs new file mode 100644 index 00000000000..63dbf38a25e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class DeleteSynonymResponse : 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/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..dbd0ab64a88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class DeleteSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Deletes a synonym rule in a synonym set +/// +public sealed partial class DeleteSynonymRuleRequest : PlainRequest +{ + public DeleteSynonymRuleRequest(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym_rule"; +} + +/// +/// Deletes a synonym rule in a synonym set +/// +public sealed partial class DeleteSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal DeleteSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsDeleteSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.delete_synonym_rule"; + + public DeleteSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public DeleteSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Id setId) + { + RouteValues.Required("set_id", setId); + 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/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..a180ef0b680 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class DeleteSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Updating synonyms in a synonym set reloads the associated analyzers.
This is the analyzers reloading result
+ ///
+ [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult ReloadAnalyzersDetails { get; init; } + + /// + /// Update operation result + /// + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs new file mode 100644 index 00000000000..1ad8761eb80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class GetSynonymRequestParameters : RequestParameters +{ + /// + /// Starting offset for query rules to be retrieved + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of query rules to retrieve + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequest : PlainRequest +{ + public GetSynonymRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + /// + /// Starting offset for query rules to be retrieved + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of query rules to retrieve + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequestDescriptor : RequestDescriptor, GetSynonymRequestParameters> +{ + internal GetSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public GetSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + public GetSynonymRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymRequestDescriptor Size(int? size) => Qs("size", size); + + public GetSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} + +/// +/// Retrieves a synonym set +/// +public sealed partial class GetSynonymRequestDescriptor : RequestDescriptor +{ + internal GetSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym"; + + public GetSynonymRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymRequestDescriptor Size(int? size) => Qs("size", size); + + public GetSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.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/_Generated/Api/Synonyms/GetSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs new file mode 100644 index 00000000000..e61b17766d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class GetSynonymResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("synonyms_set")] + public IReadOnlyCollection SynonymsSet { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..8fb770837a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class GetSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Retrieves a synonym rule from a synonym set +/// +public sealed partial class GetSynonymRuleRequest : PlainRequest +{ + public GetSynonymRuleRequest(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym_rule"; +} + +/// +/// Retrieves a synonym rule from a synonym set +/// +public sealed partial class GetSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal GetSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonym_rule"; + + public GetSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public GetSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Id setId) + { + RouteValues.Required("set_id", setId); + 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/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..4f6d014c49a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class GetSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs new file mode 100644 index 00000000000..081be877899 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class GetSynonymsSetsRequestParameters : RequestParameters +{ + /// + /// Starting offset + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a summary of all defined synonym sets +/// +public sealed partial class GetSynonymsSetsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymsSets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonyms_sets"; + + /// + /// Starting offset + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// specifies a max number of results to get + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves a summary of all defined synonym sets +/// +public sealed partial class GetSynonymsSetsRequestDescriptor : RequestDescriptor +{ + internal GetSynonymsSetsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetSynonymsSetsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsGetSynonymsSets; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "synonyms.get_synonyms_sets"; + + public GetSynonymsSetsRequestDescriptor From(int? from) => Qs("from", from); + public GetSynonymsSetsRequestDescriptor Size(int? size) => Qs("size", size); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs new file mode 100644 index 00000000000..62143e3725b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class GetSynonymsSetsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("results")] + public IReadOnlyCollection Results { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs new file mode 100644 index 00000000000..bc245ea8753 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs @@ -0,0 +1,272 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class PutSynonymRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequest : PlainRequest +{ + public PutSynonymRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + /// + /// The synonym set information to update + /// + [JsonInclude, JsonPropertyName("synonyms_set")] + public ICollection SynonymsSet { get; set; } +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequestDescriptor : RequestDescriptor, PutSynonymRequestParameters> +{ + internal PutSynonymRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + public PutSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection SynonymsSetValue { get; set; } + private Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor SynonymsSetDescriptor { get; set; } + private Action SynonymsSetDescriptorAction { get; set; } + private Action[] SynonymsSetDescriptorActions { get; set; } + + /// + /// The synonym set information to update + /// + public PutSynonymRequestDescriptor SynonymsSet(ICollection synonymsSet) + { + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetValue = synonymsSet; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor descriptor) + { + SynonymsSetValue = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptor = descriptor; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Action configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptorAction = configure; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(params Action[] configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SynonymsSetDescriptor is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorAction is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorActions is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + foreach (var action in SynonymsSetDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("synonyms_set"); + JsonSerializer.Serialize(writer, SynonymsSetValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates or updates a synonym set. +/// +public sealed partial class PutSynonymRequestDescriptor : RequestDescriptor +{ + internal PutSynonymRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutSynonymRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonym; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym"; + + public PutSynonymRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + RouteValues.Required("id", id); + return Self; + } + + private ICollection SynonymsSetValue { get; set; } + private Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor SynonymsSetDescriptor { get; set; } + private Action SynonymsSetDescriptorAction { get; set; } + private Action[] SynonymsSetDescriptorActions { get; set; } + + /// + /// The synonym set information to update + /// + public PutSynonymRequestDescriptor SynonymsSet(ICollection synonymsSet) + { + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetValue = synonymsSet; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor descriptor) + { + SynonymsSetValue = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptor = descriptor; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(Action configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorActions = null; + SynonymsSetDescriptorAction = configure; + return Self; + } + + public PutSynonymRequestDescriptor SynonymsSet(params Action[] configure) + { + SynonymsSetValue = null; + SynonymsSetDescriptor = null; + SynonymsSetDescriptorAction = null; + SynonymsSetDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (SynonymsSetDescriptor is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, SynonymsSetDescriptor, options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorAction is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor(SynonymsSetDescriptorAction), options); + writer.WriteEndArray(); + } + else if (SynonymsSetDescriptorActions is not null) + { + writer.WritePropertyName("synonyms_set"); + writer.WriteStartArray(); + foreach (var action in SynonymsSetDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("synonyms_set"); + JsonSerializer.Serialize(writer, SynonymsSetValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs new file mode 100644 index 00000000000..8c513aa7074 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class PutSynonymResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails ReloadAnalyzersDetails { get; init; } + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs new file mode 100644 index 00000000000..ef7febbf7f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Synonyms; + +public sealed partial class PutSynonymRuleRequestParameters : RequestParameters +{ +} + +/// +/// Creates or updates a synonym rule in a synonym set +/// +public sealed partial class PutSynonymRuleRequest : PlainRequest +{ + public PutSynonymRuleRequest(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym_rule"; + + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; set; } +} + +/// +/// Creates or updates a synonym rule in a synonym set +/// +public sealed partial class PutSynonymRuleRequestDescriptor : RequestDescriptor +{ + internal PutSynonymRuleRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutSynonymRuleRequestDescriptor(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) : base(r => r.Required("set_id", setId).Required("rule_id", ruleId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.SynonymsPutSynonymRule; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "synonyms.put_synonym_rule"; + + public PutSynonymRuleRequestDescriptor RuleId(Elastic.Clients.Elasticsearch.Id ruleId) + { + RouteValues.Required("rule_id", ruleId); + return Self; + } + + public PutSynonymRuleRequestDescriptor SetId(Elastic.Clients.Elasticsearch.Id setId) + { + RouteValues.Required("set_id", setId); + return Self; + } + + private string SynonymsValue { get; set; } + + public PutSynonymRuleRequestDescriptor Synonyms(string synonyms) + { + SynonymsValue = synonyms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("synonyms"); + writer.WriteStringValue(SynonymsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs new file mode 100644 index 00000000000..2c225f8c9b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class PutSynonymRuleResponse : ElasticsearchResponse +{ + /// + /// Updating synonyms in a synonym set reloads the associated analyzers.
This is the analyzers reloading result
+ ///
+ [JsonInclude, JsonPropertyName("reload_analyzers_details")] + public Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult ReloadAnalyzersDetails { get; init; } + + /// + /// Update operation result + /// + [JsonInclude, JsonPropertyName("result")] + public Elastic.Clients.Elasticsearch.Result Result { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs index f50d0bbc7c2..6990d3b124b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs @@ -53,7 +53,6 @@ public sealed partial class CancelRequestParameters : RequestParameters } /// -/// 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. /// public sealed partial class CancelRequest : PlainRequest @@ -62,7 +61,7 @@ public CancelRequest() { } - public CancelRequest(Elastic.Clients.Elasticsearch.TaskId? task_id) : base(r => r.Optional("task_id", task_id)) + public CancelRequest(Elastic.Clients.Elasticsearch.TaskId? taskId) : base(r => r.Optional("task_id", taskId)) { } @@ -100,13 +99,16 @@ public CancelRequest(Elastic.Clients.Elasticsearch.TaskId? task_id) : base(r => } /// -/// 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. /// public sealed partial class CancelRequestDescriptor : RequestDescriptor { internal CancelRequestDescriptor(Action configure) => configure.Invoke(this); + public CancelRequestDescriptor(Elastic.Clients.Elasticsearch.TaskId? taskId) : base(r => r.Optional("task_id", taskId)) + { + } + public CancelRequestDescriptor() { } @@ -124,9 +126,9 @@ public CancelRequestDescriptor() public CancelRequestDescriptor ParentTaskId(string? parentTaskId) => Qs("parent_task_id", parentTaskId); public CancelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); - public CancelRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId? task_id) + public CancelRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId? taskId) { - RouteValues.Optional("task_id", task_id); + RouteValues.Optional("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs index 0d0066ac4de..b96926cb3b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs @@ -20,14 +20,12 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Tasks; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// public sealed partial class CancelResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("node_failures")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs index d2bf322d7b5..83e5bf8f093 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs @@ -43,12 +43,11 @@ public sealed partial class GetTasksRequestParameters : RequestParameters } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. /// public sealed partial class GetTasksRequest : PlainRequest { - public GetTasksRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) + public GetTasksRequest(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -74,18 +73,13 @@ public GetTasksRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.R } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Returns information about a task. /// public sealed partial class GetTasksRequestDescriptor : RequestDescriptor { internal GetTasksRequestDescriptor(Action configure) => configure.Invoke(this); - public GetTasksRequestDescriptor(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal GetTasksRequestDescriptor() + public GetTasksRequestDescriptor(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -100,9 +94,9 @@ internal GetTasksRequestDescriptor() public GetTasksRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); public GetTasksRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); - public GetTasksRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id task_id) + public GetTasksRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs index 07238c18312..cd9c953e47f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs @@ -20,18 +20,18 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Tasks; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// public sealed partial class GetTasksResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("completed")] public bool Completed { get; init; } + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } [JsonInclude, JsonPropertyName("response")] public object? Response { get; init; } [JsonInclude, JsonPropertyName("task")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs index 1807b9e9e03..2a195656e59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs @@ -73,7 +73,6 @@ public sealed partial class ListRequestParameters : RequestParameters } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// The task management API returns information about tasks currently executing on one or more nodes in the cluster. /// public sealed partial class ListRequest : PlainRequest @@ -136,7 +135,6 @@ public sealed partial class ListRequest : PlainRequest } /// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// The task management API returns information about tasks currently executing on one or more nodes in the cluster. /// public sealed partial class ListRequestDescriptor : RequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs index fbc0940ddbe..08bb3f2b16a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs @@ -20,14 +20,12 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Tasks; -/// -/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. -/// public sealed partial class ListResponse : ElasticsearchResponse { [JsonInclude, JsonPropertyName("node_failures")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs index a1d18ba06c6..93b65a90fb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs @@ -108,9 +108,6 @@ public TermVectorsRequest(Elastic.Clients.Elasticsearch.IndexName index) : base( internal override string OperationName => "termvectors"; - [JsonIgnore] - public TDocument Document { get; set; } - /// /// Comma-separated list or wildcard expressions of fields to include in the statistics.
Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
///
@@ -203,16 +200,7 @@ public sealed partial class TermVectorsRequestDescriptor : RequestDes { internal TermVectorsRequestDescriptor(Action> configure) => configure.Invoke(this); - internal TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", index).Optional("id", id)) - { - } - - public TermVectorsRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.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, Elasticsearch.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.IndexName index, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", index).Optional("id", id)) { } @@ -220,10 +208,6 @@ public TermVectorsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName inde { } - internal TermVectorsRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermvectors; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -258,10 +242,9 @@ public TermVectorsRequestDescriptor Index(Elastic.Clients.Elasticsear private TDocument? DocValue { get; set; } private Elastic.Clients.Elasticsearch.Core.TermVectors.Filter? FilterValue { get; set; } - private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } - private TDocument DocumentValue { get; set; } /// /// An artificial document (a document not present in the index) for which you want to retrieve term vectors. @@ -283,7 +266,7 @@ public TermVectorsRequestDescriptor Filter(Elastic.Clients.Elasticsea return Self; } - public TermVectorsRequestDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public TermVectorsRequestDescriptor Filter(Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -291,7 +274,7 @@ public TermVectorsRequestDescriptor Filter(Core.TermVectors.FilterDes return Self; } - public TermVectorsRequestDescriptor Filter(Action configure) + public TermVectorsRequestDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -325,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs index 3dd672db1f7..7efd6c3ad75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs index 5c9d45e5533..0520223c0dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs @@ -100,14 +100,6 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) { } - public TermsEnumRequestDescriptor(TDocument document) : this(typeof(TDocument)) - { - } - - internal TermsEnumRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -125,8 +117,8 @@ public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action> IndexFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action> IndexFilterDescriptorAction { get; set; } private string? SearchAfterValue { get; set; } private int? SizeValue { get; set; } private string? StringValue { get; set; } @@ -159,6 +151,15 @@ public TermsEnumRequestDescriptor Field(Expression + /// 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; + } + /// /// Allows to filter an index shard if the provided query rewrites to match_none. /// @@ -170,7 +171,7 @@ public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elastic return Self; } - public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -178,7 +179,7 @@ public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescripto return Self; } - public TermsEnumRequestDescriptor IndexFilter(Action> configure) + public TermsEnumRequestDescriptor IndexFilter(Action> configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -238,7 +239,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { @@ -285,10 +286,6 @@ public TermsEnumRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) { } - internal TermsEnumRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceTermsEnum; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -306,8 +303,8 @@ public TermsEnumRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? IndexFilterValue { get; set; } - private QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } - private Action IndexFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor IndexFilterDescriptor { get; set; } + private Action IndexFilterDescriptorAction { get; set; } private string? SearchAfterValue { get; set; } private int? SizeValue { get; set; } private string? StringValue { get; set; } @@ -360,7 +357,7 @@ public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.Quer return Self; } - public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descriptor) + public TermsEnumRequestDescriptor IndexFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { IndexFilterValue = null; IndexFilterDescriptorAction = null; @@ -368,7 +365,7 @@ public TermsEnumRequestDescriptor IndexFilter(QueryDsl.QueryDescriptor descripto return Self; } - public TermsEnumRequestDescriptor IndexFilter(Action configure) + public TermsEnumRequestDescriptor IndexFilter(Action configure) { IndexFilterValue = null; IndexFilterDescriptor = null; @@ -428,7 +425,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFilterDescriptorAction is not null) { writer.WritePropertyName("index_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(IndexFilterDescriptorAction), options); } else if (IndexFilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs index f83c8e7a875..0c18094311e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs new file mode 100644 index 00000000000..764ba1e5667 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TextStructure; + +public sealed partial class TestGrokPatternRequestParameters : RequestParameters +{ + /// + /// The mode of compatibility with ECS compliant Grok patterns (disabled or v1, default: disabled). + /// + public string? EcsCompatibility { get => Q("ecs_compatibility"); set => Q("ecs_compatibility", value); } +} + +/// +/// Tests a Grok pattern on some text. +/// +public sealed partial class TestGrokPatternRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.TextStructureTestGrokPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "text_structure.test_grok_pattern"; + + /// + /// The mode of compatibility with ECS compliant Grok patterns (disabled or v1, default: disabled). + /// + [JsonIgnore] + public string? EcsCompatibility { get => Q("ecs_compatibility"); set => Q("ecs_compatibility", value); } + + /// + /// Grok pattern to run on the text. + /// + [JsonInclude, JsonPropertyName("grok_pattern")] + public string GrokPattern { get; set; } + + /// + /// Lines of text to run the Grok pattern on. + /// + [JsonInclude, JsonPropertyName("text")] + public ICollection Text { get; set; } +} + +/// +/// Tests a Grok pattern on some text. +/// +public sealed partial class TestGrokPatternRequestDescriptor : RequestDescriptor +{ + internal TestGrokPatternRequestDescriptor(Action configure) => configure.Invoke(this); + + public TestGrokPatternRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TextStructureTestGrokPattern; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "text_structure.test_grok_pattern"; + + public TestGrokPatternRequestDescriptor EcsCompatibility(string? ecsCompatibility) => Qs("ecs_compatibility", ecsCompatibility); + + private string GrokPatternValue { get; set; } + private ICollection TextValue { get; set; } + + /// + /// Grok pattern to run on the text. + /// + public TestGrokPatternRequestDescriptor GrokPattern(string grokPattern) + { + GrokPatternValue = grokPattern; + return Self; + } + + /// + /// Lines of text to run the Grok pattern on. + /// + public TestGrokPatternRequestDescriptor Text(ICollection text) + { + TextValue = text; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("grok_pattern"); + writer.WriteStringValue(GrokPatternValue); + writer.WritePropertyName("text"); + JsonSerializer.Serialize(writer, TextValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs new file mode 100644 index 00000000000..50646b97f83 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +public sealed partial class TestGrokPatternResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("matches")] + public IReadOnlyCollection Matches { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs new file mode 100644 index 00000000000..20068ac91d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class DeleteTransformRequestParameters : RequestParameters +{ + /// + /// If this value is true, the destination index is deleted together with the transform. If false, the destination
index will not be deleted
+ ///
+ public bool? DeleteDestIndex { get => Q("delete_dest_index"); set => Q("delete_dest_index", value); } + + /// + /// If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
deleted regardless of its current state.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a transform. +/// +public sealed partial class DeleteTransformRequest : PlainRequest +{ + public DeleteTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementDeleteTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.delete_transform"; + + /// + /// If this value is true, the destination index is deleted together with the transform. If false, the destination
index will not be deleted
+ ///
+ [JsonIgnore] + public bool? DeleteDestIndex { get => Q("delete_dest_index"); set => Q("delete_dest_index", value); } + + /// + /// If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
deleted regardless of its current state.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Deletes a transform. +/// +public sealed partial class DeleteTransformRequestDescriptor : RequestDescriptor +{ + internal DeleteTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public DeleteTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementDeleteTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.delete_transform"; + + public DeleteTransformRequestDescriptor DeleteDestIndex(bool? deleteDestIndex = true) => Qs("delete_dest_index", deleteDestIndex); + public DeleteTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + public DeleteTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public DeleteTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs new file mode 100644 index 00000000000..55eaa25dd3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class DeleteTransformResponse : 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/_Generated/Api/TransformManagement/GetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs new file mode 100644 index 00000000000..1de91c3eeab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class GetTransformRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Excludes fields that were automatically added when creating the
transform. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of transforms. + /// + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for transforms. +/// +public sealed partial class GetTransformRequest : PlainRequest +{ + public GetTransformRequest() + { + } + + public GetTransformRequest(Elastic.Clients.Elasticsearch.Names? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Excludes fields that were automatically added when creating the
transform. This allows the configuration to be in an acceptable format to
be retrieved and then added to another cluster.
+ ///
+ [JsonIgnore] + public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } + + /// + /// Skips the specified number of transforms. + /// + [JsonIgnore] + public int? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + [JsonIgnore] + public int? Size { get => Q("size"); set => Q("size", value); } +} + +/// +/// Retrieves configuration information for transforms. +/// +public sealed partial class GetTransformRequestDescriptor : RequestDescriptor +{ + internal GetTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Names? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public GetTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform"; + + public GetTransformRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTransformRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); + public GetTransformRequestDescriptor From(int? from) => Qs("from", from); + public GetTransformRequestDescriptor Size(int? size) => Qs("size", size); + + public GetTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Names? transformId) + { + RouteValues.Optional("transform_id", transformId); + 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/_Generated/Api/TransformManagement/GetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs new file mode 100644 index 00000000000..a9ade3c0e06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class GetTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("transforms")] + public IReadOnlyCollection Transforms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs new file mode 100644 index 00000000000..ddb5ba3b8ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class GetTransformStatsRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of transforms. + /// + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + public long? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Controls the time to wait for the stats + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves usage information for transforms. +/// +public sealed partial class GetTransformStatsRequest : PlainRequest +{ + public GetTransformStatsRequest(Elastic.Clients.Elasticsearch.Names transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransformStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform_stats"; + + /// + /// Specifies what to do when the request: + /// 1. Contains wildcard expressions and there are no transforms that match.
2. Contains the _all string or no identifiers and there are no matches.
3. Contains wildcard expressions and there are only partial matches.
+ /// If this parameter is false, the request returns a 404 status code when
there are no matches or only partial matches.
+ ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// Skips the specified number of transforms. + /// + [JsonIgnore] + public long? From { get => Q("from"); set => Q("from", value); } + + /// + /// Specifies the maximum number of transforms to obtain. + /// + [JsonIgnore] + public long? Size { get => Q("size"); set => Q("size", value); } + + /// + /// Controls the time to wait for the stats + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Retrieves usage information for transforms. +/// +public sealed partial class GetTransformStatsRequestDescriptor : RequestDescriptor +{ + internal GetTransformStatsRequestDescriptor(Action configure) => configure.Invoke(this); + + public GetTransformStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Names transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementGetTransformStats; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.get_transform_stats"; + + public GetTransformStatsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public GetTransformStatsRequestDescriptor From(long? from) => Qs("from", from); + public GetTransformStatsRequestDescriptor Size(long? size) => Qs("size", size); + public GetTransformStatsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public GetTransformStatsRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Names transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs new file mode 100644 index 00000000000..463e3808c08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class GetTransformStatsResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("transforms")] + public IReadOnlyCollection Transforms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs new file mode 100644 index 00000000000..264df7d4c32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs @@ -0,0 +1,909 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class PreviewTransformRequestParameters : RequestParameters +{ + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequest : PlainRequest +{ + public PreviewTransformRequest() + { + } + + public PreviewTransformRequest(Elastic.Clients.Elasticsearch.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + /// + /// 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Destination? Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; set; } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.TransformManagement.Pivot? Pivot { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.TransformManagement.Source? Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequestDescriptor : RequestDescriptor, PreviewTransformRequestParameters> +{ + internal PreviewTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PreviewTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public PreviewTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + public PreviewTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PreviewTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id? transformId) + { + RouteValues.Optional("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action> LatestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action> PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PreviewTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public PreviewTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Action> configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Action> configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Previews a transform. +/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
generates a list of mappings and settings for the destination index. These values are determined based on the field
types of the source index and the transform aggregations.
+///
+public sealed partial class PreviewTransformRequestDescriptor : RequestDescriptor +{ + internal PreviewTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public PreviewTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id? transformId) : base(r => r.Optional("transform_id", transformId)) + { + } + + public PreviewTransformRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPreviewTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.preview_transform"; + + public PreviewTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PreviewTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id? transformId) + { + RouteValues.Optional("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action LatestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PreviewTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public PreviewTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for
each unique key.
+ ///
+ public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Latest(Action configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it.
These objects define the group by fields and the aggregation to reduce
the data.
+ ///
+ public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Pivot(Action configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PreviewTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs new file mode 100644 index 00000000000..3deeb3c40ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class PreviewTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("generated_dest_index")] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexState GeneratedDestIndex { get; init; } + [JsonInclude, JsonPropertyName("preview")] + public IReadOnlyCollection Preview { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs new file mode 100644 index 00000000000..bad4a9598be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs @@ -0,0 +1,957 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class PutTransformRequestParameters : RequestParameters +{ + /// + /// When the transform is created, a series of validations occur to ensure its success. For example, there is a
check for the existence of the source indices and a check that the destination index is not part of the source
index pattern. You can use this parameter to skip the checks, for example when the source index does not exist
until after the transform is created. The validations are always run when you start the transform, however, with
the exception of privilege checks.
+ ///
+ public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Creates a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequest : PlainRequest +{ + public PutTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + /// + /// When the transform is created, a series of validations occur to ensure its success. For example, there is a
check for the existence of the source indices and a check that the destination index is not part of the source
index pattern. You can use this parameter to skip the checks, for example when the source index does not exist
until after the transform is created. The validations are always run when you start the transform, however, with
the exception of privilege checks.
+ ///
+ [JsonIgnore] + public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Destination Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; set; } + + /// + /// Defines optional transform metadata. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.TransformManagement.Pivot? Pivot { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.TransformManagement.Source Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Creates a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequestDescriptor : RequestDescriptor, PutTransformRequestParameters> +{ + internal PutTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public PutTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + public PutTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public PutTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action> LatestDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action> PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PutTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ public PutTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Latest(Action> configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public PutTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Action> configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Creates a transform. +/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
unique row per entity.
+/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in
the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values
in the latest object.
+/// You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and
`view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the
transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
those roles do not have the required privileges on the source and destination indices, the transform fails when it
attempts unauthorized operations.
+/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
`.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not
give users any privileges on `.data-frame-internal*` indices.
+///
+public sealed partial class PutTransformRequestDescriptor : RequestDescriptor +{ + internal PutTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public PutTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementPutTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.put_transform"; + + public PutTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public PutTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public PutTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Latest? LatestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor LatestDescriptor { get; set; } + private Action LatestDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Pivot? PivotValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor PivotDescriptor { get; set; } + private Action PivotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public PutTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public PutTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the transform is running continuously. Also
determines the retry interval in the event of transient failures while the transform is searching or indexing.
The minimum value is `1s` and the maximum is `1h`.
+ ///
+ public PutTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// The latest method transforms the data by finding the latest document for each unique key. + /// + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.Latest? latest) + { + LatestDescriptor = null; + LatestDescriptorAction = null; + LatestValue = latest; + return Self; + } + + public PutTransformRequestDescriptor Latest(Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor descriptor) + { + LatestValue = null; + LatestDescriptorAction = null; + LatestDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Latest(Action configure) + { + LatestValue = null; + LatestDescriptor = null; + LatestDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public PutTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields
and the aggregation to reduce the data.
+ ///
+ public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.Pivot? pivot) + { + PivotDescriptor = null; + PivotDescriptorAction = null; + PivotValue = pivot; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor descriptor) + { + PivotValue = null; + PivotDescriptorAction = null; + PivotDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Pivot(Action configure) + { + PivotValue = null; + PivotDescriptor = null; + PivotDescriptorAction = configure; + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the
destination index.
+ ///
+ public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public PutTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public PutTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public PutTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public PutTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (LatestDescriptor is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestDescriptor, options); + } + else if (LatestDescriptorAction is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.LatestDescriptor(LatestDescriptorAction), options); + } + else if (LatestValue is not null) + { + writer.WritePropertyName("latest"); + JsonSerializer.Serialize(writer, LatestValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PivotDescriptor is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotDescriptor, options); + } + else if (PivotDescriptorAction is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.PivotDescriptor(PivotDescriptorAction), options); + } + else if (PivotValue is not null) + { + writer.WritePropertyName("pivot"); + JsonSerializer.Serialize(writer, PivotValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs new file mode 100644 index 00000000000..c14b5e365a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class PutTransformResponse : 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/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs new file mode 100644 index 00000000000..323465bf627 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class ResetTransformRequestParameters : RequestParameters +{ + /// + /// If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform
must be stopped before it can be reset.
+ ///
+ public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Resets a transform.
Before you can reset it, you must stop it; alternatively, use the `force` query parameter.
If the destination index was created by the transform, it is deleted.
+///
+public sealed partial class ResetTransformRequest : PlainRequest +{ + public ResetTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementResetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.reset_transform"; + + /// + /// If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform
must be stopped before it can be reset.
+ ///
+ [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } +} + +/// +/// Resets a transform.
Before you can reset it, you must stop it; alternatively, use the `force` query parameter.
If the destination index was created by the transform, it is deleted.
+///
+public sealed partial class ResetTransformRequestDescriptor : RequestDescriptor +{ + internal ResetTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public ResetTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementResetTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.reset_transform"; + + public ResetTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + + public ResetTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs new file mode 100644 index 00000000000..4d3024e377a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class ResetTransformResponse : 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/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs new file mode 100644 index 00000000000..d35e53232b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class ScheduleNowTransformRequestParameters : RequestParameters +{ + /// + /// Controls the time to wait for the scheduling to take place + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Schedules now a transform. +/// If you _schedule_now a transform, it will process the new data instantly,
without waiting for the configured frequency interval. After _schedule_now API is called,
the transform will be processed again at now + frequency unless _schedule_now API
is called again in the meantime.
+///
+public sealed partial class ScheduleNowTransformRequest : PlainRequest +{ + public ScheduleNowTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementScheduleNowTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.schedule_now_transform"; + + /// + /// Controls the time to wait for the scheduling to take place + /// + [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Schedules now a transform. +/// If you _schedule_now a transform, it will process the new data instantly,
without waiting for the configured frequency interval. After _schedule_now API is called,
the transform will be processed again at now + frequency unless _schedule_now API
is called again in the meantime.
+///
+public sealed partial class ScheduleNowTransformRequestDescriptor : RequestDescriptor +{ + internal ScheduleNowTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public ScheduleNowTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementScheduleNowTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.schedule_now_transform"; + + public ScheduleNowTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public ScheduleNowTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs new file mode 100644 index 00000000000..60eaffa0acb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class ScheduleNowTransformResponse : 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/_Generated/Api/TransformManagement/StartTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs new file mode 100644 index 00000000000..0c43505cbe7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class StartTransformRequestParameters : RequestParameters +{ + /// + /// Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. + /// + public string? From { get => Q("from"); set => Q("from", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a transform. +/// When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is
set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping
definitions for the destination index from the source indices and the transform aggregations. If fields in the
destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations),
the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
in a pivot transform.
+/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
created the transform, they occur when you start the transform—​with the exception of privilege checks. When
Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
time of creation and uses those same roles. If those roles do not have the required privileges on the source and
destination indices, the transform fails when it attempts unauthorized operations.
+///
+public sealed partial class StartTransformRequest : PlainRequest +{ + public StartTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStartTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.start_transform"; + + /// + /// Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. + /// + [JsonIgnore] + public string? From { get => Q("from"); set => Q("from", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Starts a transform. +/// When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is
set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping
definitions for the destination index from the source indices and the transform aggregations. If fields in the
destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations),
the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
in a pivot transform.
+/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
created the transform, they occur when you start the transform—​with the exception of privilege checks. When
Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
time of creation and uses those same roles. If those roles do not have the required privileges on the source and
destination indices, the transform fails when it attempts unauthorized operations.
+///
+public sealed partial class StartTransformRequestDescriptor : RequestDescriptor +{ + internal StartTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public StartTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStartTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.start_transform"; + + public StartTransformRequestDescriptor From(string? from) => Qs("from", from); + public StartTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public StartTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/StartTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs new file mode 100644 index 00000000000..207d6084148 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class StartTransformResponse : 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/_Generated/Api/TransformManagement/StopTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs new file mode 100644 index 00000000000..2f57ac45bfd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs @@ -0,0 +1,146 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class StopTransformRequestParameters : RequestParameters +{ + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;
contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there
are only partial matches.
+ /// If it is true, the API returns a successful acknowledgement message when there are no matches. When there are
only partial matches, the API stops the appropriate transforms.
+ /// If it is false, the request returns a 404 status code when there are no matches or only partial matches. + ///
+ public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If it is true, the API forcefully stops the transforms. + /// + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the
timeout expires, the request returns a timeout exception. However, the request continues processing and
eventually moves the transform to a STOPPED state.
+ ///
+ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,
the transform stops as soon as possible.
+ ///
+ public bool? WaitForCheckpoint { get => Q("wait_for_checkpoint"); set => Q("wait_for_checkpoint", value); } + + /// + /// If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns
immediately and the indexer is stopped asynchronously in the background.
+ ///
+ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops one or more transforms. +/// +public sealed partial class StopTransformRequest : PlainRequest +{ + public StopTransformRequest(Elastic.Clients.Elasticsearch.Name transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStopTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.stop_transform"; + + /// + /// Specifies what to do when the request: contains wildcard expressions and there are no transforms that match;
contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there
are only partial matches.
+ /// If it is true, the API returns a successful acknowledgement message when there are no matches. When there are
only partial matches, the API stops the appropriate transforms.
+ /// If it is false, the request returns a 404 status code when there are no matches or only partial matches. + ///
+ [JsonIgnore] + public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } + + /// + /// If it is true, the API forcefully stops the transforms. + /// + [JsonIgnore] + public bool? Force { get => Q("force"); set => Q("force", value); } + + /// + /// Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the
timeout expires, the request returns a timeout exception. However, the request continues processing and
eventually moves the transform to a STOPPED state.
+ ///
+ [JsonIgnore] + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false,
the transform stops as soon as possible.
+ ///
+ [JsonIgnore] + public bool? WaitForCheckpoint { get => Q("wait_for_checkpoint"); set => Q("wait_for_checkpoint", value); } + + /// + /// If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns
immediately and the indexer is stopped asynchronously in the background.
+ ///
+ [JsonIgnore] + public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } +} + +/// +/// Stops one or more transforms. +/// +public sealed partial class StopTransformRequestDescriptor : RequestDescriptor +{ + internal StopTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public StopTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Name transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementStopTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.stop_transform"; + + public StopTransformRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); + public StopTransformRequestDescriptor Force(bool? force = true) => Qs("force", force); + public StopTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + public StopTransformRequestDescriptor WaitForCheckpoint(bool? waitForCheckpoint = true) => Qs("wait_for_checkpoint", waitForCheckpoint); + public StopTransformRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion); + + public StopTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Name transformId) + { + RouteValues.Required("transform_id", transformId); + 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/_Generated/Api/TransformManagement/StopTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs new file mode 100644 index 00000000000..9bfe1cbfb90 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class StopTransformResponse : 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/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs new file mode 100644 index 00000000000..581f983c501 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs @@ -0,0 +1,752 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class UpdateTransformRequestParameters : RequestParameters +{ + /// + /// When true, deferrable validations are not run. This behavior may be
desired if the source index does not exist until after the transform is
created.
+ ///
+ public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequest : PlainRequest +{ + public UpdateTransformRequest(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + /// + /// When true, deferrable validations are not run. This behavior may be
desired if the source index does not exist until after the transform is
created.
+ ///
+ [JsonIgnore] + public bool? DeferValidation { get => Q("defer_validation"); set => Q("defer_validation", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Destination? Dest { get; set; } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + + /// + /// Defines optional transform metadata. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.TransformManagement.Settings? Settings { get; set; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.TransformManagement.Source? Source { get; set; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; set; } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequestDescriptor : RequestDescriptor, UpdateTransformRequestParameters> +{ + internal UpdateTransformRequestDescriptor(Action> configure) => configure.Invoke(this); + + public UpdateTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + public UpdateTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public UpdateTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public UpdateTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action> RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action> SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public UpdateTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public UpdateTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public UpdateTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Action> configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Action> configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} + +/// +/// Updates certain properties of a transform. +/// All updated properties except `description` do not take effect until after the transform starts the next checkpoint,
thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata`
privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When
Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
time of update and runs with those privileges.
+///
+public sealed partial class UpdateTransformRequestDescriptor : RequestDescriptor +{ + internal UpdateTransformRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpdateTransformRequestDescriptor(Elastic.Clients.Elasticsearch.Id transformId) : base(r => r.Required("transform_id", transformId)) + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpdateTransform; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => true; + + internal override string OperationName => "transform.update_transform"; + + public UpdateTransformRequestDescriptor DeferValidation(bool? deferValidation = true) => Qs("defer_validation", deferValidation); + public UpdateTransformRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout); + + public UpdateTransformRequestDescriptor TransformId(Elastic.Clients.Elasticsearch.Id transformId) + { + RouteValues.Required("transform_id", transformId); + return Self; + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Destination? DestValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor DestDescriptor { get; set; } + private Action DestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicyValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor RetentionPolicyDescriptor { get; set; } + private Action RetentionPolicyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Settings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Source? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.Sync? SyncValue { get; set; } + private Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor SyncDescriptor { get; set; } + private Action SyncDescriptorAction { get; set; } + + /// + /// Free text description of the transform. + /// + public UpdateTransformRequestDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The destination for the transform. + /// + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.Destination? dest) + { + DestDescriptor = null; + DestDescriptorAction = null; + DestValue = dest; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor descriptor) + { + DestValue = null; + DestDescriptorAction = null; + DestDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Dest(Action configure) + { + DestValue = null; + DestDescriptor = null; + DestDescriptorAction = configure; + return Self; + } + + /// + /// The interval between checks for changes in the source indices when the
transform is running continuously. Also determines the retry interval in
the event of transient failures while the transform is searching or
indexing. The minimum value is 1s and the maximum is 1h.
+ ///
+ public UpdateTransformRequestDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// Defines optional transform metadata. + /// + public UpdateTransformRequestDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Defines a retention policy for the transform. Data that meets the defined
criteria is deleted from the destination index.
+ ///
+ public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? retentionPolicy) + { + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyValue = retentionPolicy; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor descriptor) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptorAction = null; + RetentionPolicyDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor RetentionPolicy(Action configure) + { + RetentionPolicyValue = null; + RetentionPolicyDescriptor = null; + RetentionPolicyDescriptorAction = configure; + return Self; + } + + /// + /// Defines optional transform settings. + /// + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.Settings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + /// + /// The source of the data for the transform. + /// + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.Source? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + /// + /// Defines the properties transforms require to run continuously. + /// + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.Sync? sync) + { + SyncDescriptor = null; + SyncDescriptorAction = null; + SyncValue = sync; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor descriptor) + { + SyncValue = null; + SyncDescriptorAction = null; + SyncDescriptor = descriptor; + return Self; + } + + public UpdateTransformRequestDescriptor Sync(Action configure) + { + SyncValue = null; + SyncDescriptor = null; + SyncDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (DestDescriptor is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestDescriptor, options); + } + else if (DestDescriptorAction is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.DestinationDescriptor(DestDescriptorAction), options); + } + else if (DestValue is not null) + { + writer.WritePropertyName("dest"); + JsonSerializer.Serialize(writer, DestValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (RetentionPolicyDescriptor is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyDescriptor, options); + } + else if (RetentionPolicyDescriptorAction is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyDescriptor(RetentionPolicyDescriptorAction), options); + } + else if (RetentionPolicyValue is not null) + { + writer.WritePropertyName("retention_policy"); + JsonSerializer.Serialize(writer, RetentionPolicyValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, 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 Elastic.Clients.Elasticsearch.TransformManagement.SourceDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (SyncDescriptor is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncDescriptor, options); + } + else if (SyncDescriptorAction is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.TransformManagement.SyncDescriptor(SyncDescriptorAction), options); + } + else if (SyncValue is not null) + { + writer.WritePropertyName("sync"); + JsonSerializer.Serialize(writer, SyncValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs new file mode 100644 index 00000000000..0dda6e4d96f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class UpdateTransformResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Core.Reindex.Destination Dest { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.TransformManagement.Pivot? Pivot { get; init; } + [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.TransformManagement.Settings Settings { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.Core.Reindex.Source Source { get; init; } + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs new file mode 100644 index 00000000000..fa141d83fd9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.TransformManagement; + +public sealed partial class UpgradeTransformsRequestParameters : RequestParameters +{ + /// + /// When true, the request checks for updates but does not run them. + /// + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Upgrades all transforms.
This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
Elasticsearch security features are enabled; the role used to read source data and write to the destination index
remains unchanged.
+///
+public sealed partial class UpgradeTransformsRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpgradeTransforms; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.upgrade_transforms"; + + /// + /// When true, the request checks for updates but does not run them. + /// + [JsonIgnore] + public bool? DryRun { get => Q("dry_run"); set => Q("dry_run", 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.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// Upgrades all transforms.
This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
Elasticsearch security features are enabled; the role used to read source data and write to the destination index
remains unchanged.
+///
+public sealed partial class UpgradeTransformsRequestDescriptor : RequestDescriptor +{ + internal UpgradeTransformsRequestDescriptor(Action configure) => configure.Invoke(this); + + public UpgradeTransformsRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.TransformManagementUpgradeTransforms; + + protected override HttpMethod StaticHttpMethod => HttpMethod.POST; + + internal override bool SupportsBody => false; + + internal override string OperationName => "transform.upgrade_transforms"; + + public UpgradeTransformsRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun); + public UpgradeTransformsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs new file mode 100644 index 00000000000..3e4d9644b00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class UpgradeTransformsResponse : ElasticsearchResponse +{ + /// + /// The number of transforms that need to be upgraded. + /// + [JsonInclude, JsonPropertyName("needs_update")] + public int NeedsUpdate { get; init; } + + /// + /// The number of transforms that don’t require upgrading. + /// + [JsonInclude, JsonPropertyName("no_action")] + public int NoAction { get; init; } + + /// + /// The number of transforms that have been upgraded. + /// + [JsonInclude, JsonPropertyName("updated")] + public int Updated { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs index 69e18c56b94..0add8f4725b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs @@ -399,10 +399,6 @@ public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indi { } - internal UpdateByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -449,12 +445,12 @@ public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elastic private Elastic.Clients.Elasticsearch.Conflicts? ConflictsValue { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action> SliceDescriptorAction { get; set; } /// /// What to do if update by query hits version conflicts: `abort` or `proceed`. @@ -485,7 +481,7 @@ public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticse return Self; } - public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -493,7 +489,7 @@ public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor< return Self; } - public UpdateByQueryRequestDescriptor Query(Action> configure) + public UpdateByQueryRequestDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -521,7 +517,7 @@ public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticse return Self; } - public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -529,7 +525,7 @@ public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor Slice(Action> configure) + public UpdateByQueryRequestDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -560,7 +556,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -582,7 +578,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -605,10 +601,6 @@ public UpdateByQueryRequestDescriptor(Elastic.Clients.Elasticsearch.Indices indi { } - internal UpdateByQueryRequestDescriptor() - { - } - internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceUpdateByQuery; protected override HttpMethod StaticHttpMethod => HttpMethod.POST; @@ -655,12 +647,12 @@ public UpdateByQueryRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indi private Elastic.Clients.Elasticsearch.Conflicts? ConflictsValue { get; set; } private long? MaxDocsValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.SlicedScrollDescriptor SliceDescriptor { get; set; } + private Action SliceDescriptorAction { get; set; } /// /// What to do if update by query hits version conflicts: `abort` or `proceed`. @@ -691,7 +683,7 @@ public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryD return Self; } - public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public UpdateByQueryRequestDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -699,7 +691,7 @@ public UpdateByQueryRequestDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public UpdateByQueryRequestDescriptor Query(Action configure) + public UpdateByQueryRequestDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -727,7 +719,7 @@ public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.Sliced return Self; } - public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) + public UpdateByQueryRequestDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -735,7 +727,7 @@ public UpdateByQueryRequestDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public UpdateByQueryRequestDescriptor Slice(Action configure) + public UpdateByQueryRequestDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -766,7 +758,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -788,7 +780,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs index 4982ab7dc2f..c08f04aa435 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs index 6d633b77ad2..947e1dbb817 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class UpdateByQueryRethrottleRequestParameters : RequestPa /// public sealed partial class UpdateByQueryRethrottleRequest : PlainRequest { - public UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) + public UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -68,11 +68,7 @@ public sealed partial class UpdateByQueryRethrottleRequestDescriptor : RequestDe { internal UpdateByQueryRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public UpdateByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) - { - } - - internal UpdateByQueryRethrottleRequestDescriptor() + public UpdateByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Id taskId) : base(r => r.Required("task_id", taskId)) { } @@ -86,9 +82,9 @@ internal UpdateByQueryRethrottleRequestDescriptor() public UpdateByQueryRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public UpdateByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id task_id) + public UpdateByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id taskId) { - RouteValues.Required("task_id", task_id); + RouteValues.Required("task_id", taskId); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs index 1847b54c448..ed940ed3d73 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs index 1b0deeb769e..a94f1a0b685 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs @@ -180,7 +180,6 @@ public UpdateRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clie /// A partial update to an existing document. /// [JsonInclude, JsonPropertyName("doc")] - [SourceConverter] public TPartialDocument? Doc { get; set; } /// @@ -211,7 +210,6 @@ public UpdateRequest(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clie /// 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; } } @@ -226,30 +224,6 @@ public UpdateRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El { } - public UpdateRequestDescriptor(TDocument document) : this(typeof(TDocument), Elasticsearch.Id.From(document)) - { - } - - public UpdateRequestDescriptor(TDocument document, IndexName index, Id id) : this(index, id) - { - } - - public UpdateRequestDescriptor(TDocument document, IndexName index) : this(index, Elasticsearch.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; @@ -365,7 +339,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (DocValue is not null) { writer.WritePropertyName("doc"); - SourceSerialization.Serialize(DocValue, writer, settings); + JsonSerializer.Serialize(writer, DocValue, options); } if (DocAsUpsertValue.HasValue) @@ -395,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (UpsertValue is not null) { writer.WritePropertyName("upsert"); - SourceSerialization.Serialize(UpsertValue, writer, settings); + JsonSerializer.Serialize(writer, UpsertValue, options); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs index 1ce9e98353b..8c65132ab5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs @@ -20,6 +20,7 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; using Elastic.Transport.Products.Elasticsearch; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs new file mode 100644 index 00000000000..28dd6858af4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Xpack; + +public sealed partial class XpackInfoRequestParameters : RequestParameters +{ + /// + /// If this param is used it must be set to true + /// + public bool? AcceptEnterprise { get => Q("accept_enterprise"); set => Q("accept_enterprise", value); } + + /// + /// A comma-separated list of the information categories to include in the response. For example, `build,license,features`. + /// + public ICollection? Categories { get => Q?>("categories"); set => Q("categories", value); } +} + +/// +/// Provides general information about the installed X-Pack features. +/// +public sealed partial class XpackInfoRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.info"; + + /// + /// If this param is used it must be set to true + /// + [JsonIgnore] + public bool? AcceptEnterprise { get => Q("accept_enterprise"); set => Q("accept_enterprise", value); } + + /// + /// A comma-separated list of the information categories to include in the response. For example, `build,license,features`. + /// + [JsonIgnore] + public ICollection? Categories { get => Q?>("categories"); set => Q("categories", value); } +} + +/// +/// Provides general information about the installed X-Pack features. +/// +public sealed partial class XpackInfoRequestDescriptor : RequestDescriptor +{ + internal XpackInfoRequestDescriptor(Action configure) => configure.Invoke(this); + + public XpackInfoRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackInfo; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.info"; + + public XpackInfoRequestDescriptor AcceptEnterprise(bool? acceptEnterprise = true) => Qs("accept_enterprise", acceptEnterprise); + public XpackInfoRequestDescriptor Categories(ICollection? categories) => Qs("categories", categories); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs new file mode 100644 index 00000000000..6b636e1191f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class XpackInfoResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("build")] + public Elastic.Clients.Elasticsearch.Xpack.BuildInformation Build { get; init; } + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Xpack.Features Features { get; init; } + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation License { get; init; } + [JsonInclude, JsonPropertyName("tagline")] + public string Tagline { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs new file mode 100644 index 00000000000..1bda14f4162 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.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.Fluent; +using Elastic.Clients.Elasticsearch.Requests; +using Elastic.Clients.Elasticsearch.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.Xpack; + +public sealed partial class XpackUsageRequestParameters : 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// This API provides information about which features are currently enabled and available under the current license and some usage statistics. +/// +public sealed partial class XpackUsageRequest : PlainRequest +{ + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.usage"; + + /// + /// 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.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } +} + +/// +/// This API provides information about which features are currently enabled and available under the current license and some usage statistics. +/// +public sealed partial class XpackUsageRequestDescriptor : RequestDescriptor +{ + internal XpackUsageRequestDescriptor(Action configure) => configure.Invoke(this); + + public XpackUsageRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlLookup.XpackUsage; + + protected override HttpMethod StaticHttpMethod => HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "xpack.usage"; + + public XpackUsageRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.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/_Generated/Api/Xpack/XpackUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs new file mode 100644 index 00000000000..347789ed115 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport.Products.Elasticsearch; +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class XpackUsageResponse : ElasticsearchResponse +{ + [JsonInclude, JsonPropertyName("aggregate_metric")] + public Elastic.Clients.Elasticsearch.Xpack.Base AggregateMetric { get; init; } + [JsonInclude, JsonPropertyName("analytics")] + public Elastic.Clients.Elasticsearch.Xpack.Analytics Analytics { get; init; } + [JsonInclude, JsonPropertyName("archive")] + public Elastic.Clients.Elasticsearch.Xpack.Archive Archive { get; init; } + [JsonInclude, JsonPropertyName("ccr")] + public Elastic.Clients.Elasticsearch.Xpack.Ccr Ccr { get; init; } + [JsonInclude, JsonPropertyName("data_frame")] + public Elastic.Clients.Elasticsearch.Xpack.Base? DataFrame { get; init; } + [JsonInclude, JsonPropertyName("data_science")] + public Elastic.Clients.Elasticsearch.Xpack.Base? DataScience { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public Elastic.Clients.Elasticsearch.Xpack.DataStreams? DataStreams { get; init; } + [JsonInclude, JsonPropertyName("data_tiers")] + public Elastic.Clients.Elasticsearch.Xpack.DataTiers DataTiers { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Xpack.Base? Enrich { get; init; } + [JsonInclude, JsonPropertyName("eql")] + public Elastic.Clients.Elasticsearch.Xpack.Eql Eql { get; init; } + [JsonInclude, JsonPropertyName("flattened")] + public Elastic.Clients.Elasticsearch.Xpack.Flattened? Flattened { get; init; } + [JsonInclude, JsonPropertyName("frozen_indices")] + public Elastic.Clients.Elasticsearch.Xpack.FrozenIndices FrozenIndices { get; init; } + [JsonInclude, JsonPropertyName("graph")] + public Elastic.Clients.Elasticsearch.Xpack.Base Graph { get; init; } + [JsonInclude, JsonPropertyName("health_api")] + public Elastic.Clients.Elasticsearch.Xpack.HealthStatistics? HealthApi { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Xpack.Ilm Ilm { get; init; } + [JsonInclude, JsonPropertyName("logstash")] + public Elastic.Clients.Elasticsearch.Xpack.Base Logstash { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Xpack.MachineLearning Ml { get; init; } + [JsonInclude, JsonPropertyName("monitoring")] + public Elastic.Clients.Elasticsearch.Xpack.Monitoring Monitoring { get; init; } + [JsonInclude, JsonPropertyName("rollup")] + public Elastic.Clients.Elasticsearch.Xpack.Base Rollup { get; init; } + [JsonInclude, JsonPropertyName("runtime_fields")] + public Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes? RuntimeFields { get; init; } + [JsonInclude, JsonPropertyName("searchable_snapshots")] + public Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots SearchableSnapshots { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Xpack.Security Security { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Xpack.Slm Slm { get; init; } + [JsonInclude, JsonPropertyName("spatial")] + public Elastic.Clients.Elasticsearch.Xpack.Base Spatial { get; init; } + [JsonInclude, JsonPropertyName("sql")] + public Elastic.Clients.Elasticsearch.Xpack.Sql Sql { get; init; } + [JsonInclude, JsonPropertyName("transform")] + public Elastic.Clients.Elasticsearch.Xpack.Base Transform { get; init; } + [JsonInclude, JsonPropertyName("vectors")] + public Elastic.Clients.Elasticsearch.Xpack.Vector? Vectors { get; init; } + [JsonInclude, JsonPropertyName("voting_only")] + public Elastic.Clients.Elasticsearch.Xpack.Base VotingOnly { get; init; } + [JsonInclude, JsonPropertyName("watcher")] + public Elastic.Clients.Elasticsearch.Xpack.Watcher Watcher { get; init; } +} \ No newline at end of file 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 8037576218a..c17b3917b2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch; public partial class AsyncSearchNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected AsyncSearchNamespacedClient() : base() { @@ -36,139 +37,9 @@ 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.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.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.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.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.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.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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request) { @@ -178,7 +49,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,8 +59,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new DeleteAsyncSearchRequestDescriptor(id); @@ -199,8 +71,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -209,8 +82,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new DeleteAsyncSearchRequestDescriptor(id); @@ -221,29 +95,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. - /// - 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.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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { @@ -254,7 +106,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 +116,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) { @@ -274,31 +126,9 @@ public virtual Task DeleteAsync(Elastic.Clients.Elast 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.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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequest request) { @@ -308,7 +138,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,8 +148,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new GetAsyncSearchRequestDescriptor(id); @@ -329,8 +160,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -339,8 +171,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new GetAsyncSearchRequestDescriptor(id); @@ -351,7 +184,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 +195,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 +205,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) { @@ -382,9 +215,98 @@ public virtual Task> GetAsync(Elast return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(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 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.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 Task StatusAsync(Elastic.Clients.Elasticsearch.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.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new AsyncSearchStatusRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + /// /// 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 +316,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,8 +326,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SubmitAsyncSearchResponse Submit() { var descriptor = new SubmitAsyncSearchRequestDescriptor(); @@ -415,8 +338,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SubmitAsyncSearchResponse Submit(SubmitAsyncSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -425,8 +349,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SubmitAsyncSearchResponse Submit(Action> configureRequest) { var descriptor = new SubmitAsyncSearchRequestDescriptor(); @@ -437,7 +362,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 +373,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 +383,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.Ccr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs new file mode 100644 index 00000000000..cf6213e9768 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ccr.g.cs @@ -0,0 +1,1127 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public partial class CrossClusterReplicationNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected CrossClusterReplicationNamespacedClient() : base() + { + } + + internal CrossClusterReplicationNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteAutoFollowPatternResponse DeleteAutoFollowPattern(DeleteAutoFollowPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAutoFollowPatternAsync(DeleteAutoFollowPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAutoFollowPatternResponse DeleteAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new DeleteAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAutoFollowPatternResponse DeleteAutoFollowPattern(DeleteAutoFollowPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAutoFollowPatternResponse DeleteAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new DeleteAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAutoFollowPatternAsync(DeleteAutoFollowPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes auto-follow patterns. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FollowResponse Follow(FollowRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowAsync(FollowRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowResponse Follow(FollowRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowResponse Follow(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new FollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowAsync(FollowRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new follower index configured to follow the referenced leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FollowInfoResponse FollowInfo(FollowInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowInfoAsync(FollowInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowInfoResponse FollowInfo(Elastic.Clients.Elasticsearch.Indices indices) + { + var descriptor = new FollowInfoRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowInfoResponse FollowInfo(FollowInfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowInfoResponse FollowInfo(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + { + var descriptor = new FollowInfoRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowInfoAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new FollowInfoRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowInfoAsync(FollowInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about all follower indices, including parameters and status for each follower index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowInfoAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FollowInfoRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FollowStatsResponse FollowStats(FollowStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowStatsAsync(FollowStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowStatsResponse FollowStats(Elastic.Clients.Elasticsearch.Indices indices) + { + var descriptor = new FollowStatsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowStatsResponse FollowStats(FollowStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FollowStatsResponse FollowStats(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + { + var descriptor = new FollowStatsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowStatsAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new FollowStatsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowStatsAsync(FollowStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FollowStatsAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FollowStatsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ForgetFollowerResponse ForgetFollower(ForgetFollowerRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForgetFollowerAsync(ForgetFollowerRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForgetFollowerResponse ForgetFollower(ForgetFollowerRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForgetFollowerResponse ForgetFollower(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new ForgetFollowerRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForgetFollowerAsync(ForgetFollowerRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the follower retention leases from the leader. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForgetFollowerAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ForgetFollowerRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetAutoFollowPatternResponse GetAutoFollowPattern(GetAutoFollowPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAutoFollowPatternAsync(GetAutoFollowPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAutoFollowPatternResponse GetAutoFollowPattern() + { + var descriptor = new GetAutoFollowPatternRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAutoFollowPatternResponse GetAutoFollowPattern(GetAutoFollowPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAutoFollowPatternResponse GetAutoFollowPattern(Action configureRequest) + { + var descriptor = new GetAutoFollowPatternRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAutoFollowPatternAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetAutoFollowPatternRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAutoFollowPatternAsync(GetAutoFollowPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAutoFollowPatternAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetAutoFollowPatternRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PauseAutoFollowPatternResponse PauseAutoFollowPattern(PauseAutoFollowPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseAutoFollowPatternAsync(PauseAutoFollowPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseAutoFollowPatternResponse PauseAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new PauseAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseAutoFollowPatternResponse PauseAutoFollowPattern(PauseAutoFollowPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseAutoFollowPatternResponse PauseAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PauseAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new PauseAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseAutoFollowPatternAsync(PauseAutoFollowPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses an auto-follow pattern + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PauseAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PauseFollowResponse PauseFollow(PauseFollowRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(PauseFollowRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseFollowResponse PauseFollow(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new PauseFollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseFollowResponse PauseFollow(PauseFollowRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PauseFollowResponse PauseFollow(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new PauseFollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new PauseFollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(PauseFollowRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PauseFollowAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PauseFollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutAutoFollowPatternResponse PutAutoFollowPattern(PutAutoFollowPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAutoFollowPatternAsync(PutAutoFollowPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAutoFollowPatternResponse PutAutoFollowPattern(PutAutoFollowPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAutoFollowPatternResponse PutAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PutAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAutoFollowPatternAsync(PutAutoFollowPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResumeAutoFollowPatternResponse ResumeAutoFollowPattern(ResumeAutoFollowPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeAutoFollowPatternAsync(ResumeAutoFollowPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeAutoFollowPatternResponse ResumeAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new ResumeAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeAutoFollowPatternResponse ResumeAutoFollowPattern(ResumeAutoFollowPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeAutoFollowPatternResponse ResumeAutoFollowPattern(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new ResumeAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new ResumeAutoFollowPatternRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeAutoFollowPatternAsync(ResumeAutoFollowPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes an auto-follow pattern that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeAutoFollowPatternAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResumeAutoFollowPatternRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResumeFollowResponse ResumeFollow(ResumeFollowRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(ResumeFollowRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeFollowResponse ResumeFollow(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new ResumeFollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeFollowResponse ResumeFollow(ResumeFollowRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResumeFollowResponse ResumeFollow(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new ResumeFollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new ResumeFollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(ResumeFollowRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resumes a follower index that has been paused + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResumeFollowAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResumeFollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CcrStatsResponse Stats(CcrStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CcrStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CcrStatsResponse Stats() + { + var descriptor = new CcrStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CcrStatsResponse Stats(CcrStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CcrStatsResponse Stats(Action configureRequest) + { + var descriptor = new CcrStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CcrStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CcrStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets all stats related to cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CcrStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UnfollowResponse Unfollow(UnfollowRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(UnfollowRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UnfollowResponse Unfollow(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new UnfollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UnfollowResponse Unfollow(UnfollowRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UnfollowResponse Unfollow(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new UnfollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new UnfollowRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(UnfollowRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UnfollowAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UnfollowRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file 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 a56c4e064b3..287a48378ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; public partial class ClusterNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected ClusterNamespacedClient() : base() { @@ -38,7 +39,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 +49,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,8 +59,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual AllocationExplainResponse AllocationExplain() { var descriptor = new AllocationExplainRequestDescriptor(); @@ -69,8 +71,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual AllocationExplainResponse AllocationExplain(AllocationExplainRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -79,8 +82,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual AllocationExplainResponse AllocationExplain(Action configureRequest) { var descriptor = new AllocationExplainRequestDescriptor(); @@ -91,7 +95,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 +106,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 +116,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) { @@ -123,94 +127,364 @@ public virtual Task AllocationExplainAsync(Action - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual ClusterStatsResponse Stats(ClusterStatsRequest request) + public virtual DeleteComponentTemplateResponse DeleteComponentTemplate(DeleteComponentTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(ClusterStatsRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(DeleteComponentTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteComponentTemplateResponse DeleteComponentTemplate(Elastic.Clients.Elasticsearch.Names name) { - var descriptor = new ClusterStatsRequestDescriptor(); + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats(ClusterStatsRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteComponentTemplateResponse DeleteComponentTemplate(DeleteComponentTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ClusterStatsResponse Stats(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteComponentTemplateResponse DeleteComponentTemplate(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new ClusterStatsRequestDescriptor(); + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(ClusterStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(DeleteComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns high-level overview of cluster statistics. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a component template + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteComponentTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ClusterStatsRequestDescriptor(); + var descriptor = new DeleteComponentTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions(DeleteVotingConfigExclusionsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteVotingConfigExclusionsAsync(DeleteVotingConfigExclusionsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions() + { + var descriptor = new DeleteVotingConfigExclusionsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions(DeleteVotingConfigExclusionsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteVotingConfigExclusionsResponse DeleteVotingConfigExclusions(Action configureRequest) + { + var descriptor = new DeleteVotingConfigExclusionsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteVotingConfigExclusionsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new DeleteVotingConfigExclusionsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteVotingConfigExclusionsAsync(DeleteVotingConfigExclusionsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clears cluster voting config exclusions. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteVotingConfigExclusionsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteVotingConfigExclusionsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExistsComponentTemplateResponse ExistsComponentTemplate(ExistsComponentTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsComponentTemplateAsync(ExistsComponentTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsComponentTemplateResponse ExistsComponentTemplate(Elastic.Clients.Elasticsearch.Names name) + { + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsComponentTemplateResponse ExistsComponentTemplate(ExistsComponentTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsComponentTemplateResponse ExistsComponentTemplate(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) + { + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsComponentTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsComponentTemplateAsync(ExistsComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about whether a particular component template exist + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExistsComponentTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExistsComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetComponentTemplateResponse GetComponentTemplate(GetComponentTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetComponentTemplateAsync(GetComponentTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetComponentTemplateResponse GetComponentTemplate() + { + var descriptor = new GetComponentTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetComponentTemplateResponse GetComponentTemplate(GetComponentTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetComponentTemplateResponse GetComponentTemplate(Action configureRequest) + { + var descriptor = new GetComponentTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetComponentTemplateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetComponentTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetComponentTemplateAsync(GetComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns one or more component templates + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetComponentTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetComponentTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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 +494,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,8 +504,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetClusterSettingsResponse GetSettings() { var descriptor = new GetClusterSettingsRequestDescriptor(); @@ -241,8 +516,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetClusterSettingsResponse GetSettings(GetClusterSettingsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -251,8 +527,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetClusterSettingsResponse GetSettings(Action configureRequest) { var descriptor = new GetClusterSettingsRequestDescriptor(); @@ -263,7 +540,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 +551,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 +561,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 +573,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 +583,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,8 +593,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual HealthResponse Health() { var descriptor = new HealthRequestDescriptor(); @@ -327,8 +605,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual HealthResponse Health(HealthRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -337,8 +616,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual HealthResponse Health(Action configureRequest) { var descriptor = new HealthRequestDescriptor(); @@ -349,84 +629,129 @@ 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) + public virtual Task HealthAsync(CancellationToken cancellationToken = default) { + var descriptor = new HealthRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, HealthResponse, HealthRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + 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. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual ClusterInfoResponse Info(ClusterInfoRequest request) { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(ClusterInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClusterInfoResponse Info(IReadOnlyCollection target) + { + var descriptor = new ClusterInfoRequestDescriptor(target); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClusterInfoResponse Info(ClusterInfoRequestDescriptor descriptor) { - var descriptor = new HealthRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClusterInfoResponse Info(IReadOnlyCollection target, Action configureRequest) + { + var descriptor = new ClusterInfoRequestDescriptor(target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(HealthRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(IReadOnlyCollection target, CancellationToken cancellationToken = default) { + var descriptor = new ClusterInfoRequestDescriptor(target); descriptor.BeforeRequest(); - return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns basic information about the health of the cluster. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(ClusterInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns different information about the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task HealthAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task InfoAsync(IReadOnlyCollection target, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new HealthRequestDescriptor(); + var descriptor = new ClusterInfoRequestDescriptor(target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, HealthResponse, HealthRequestParameters>(descriptor, cancellationToken); + 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. + /// Learn more about this API in the Elasticsearch documentation. ///
public virtual PendingTasksResponse PendingTasks(PendingTasksRequest request) { @@ -436,7 +761,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,8 +771,9 @@ 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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PendingTasksResponse PendingTasks() { var descriptor = new PendingTasksRequestDescriptor(); @@ -457,8 +783,9 @@ 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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PendingTasksResponse PendingTasks(PendingTasksRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -467,8 +794,9 @@ 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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PendingTasksResponse PendingTasks(Action configureRequest) { var descriptor = new PendingTasksRequestDescriptor(); @@ -479,7 +807,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 +818,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 +828,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) { @@ -509,4 +837,294 @@ public virtual Task PendingTasksAsync(Action(descriptor, cancellationToken); } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostVotingConfigExclusionsResponse PostVotingConfigExclusions(PostVotingConfigExclusionsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostVotingConfigExclusionsAsync(PostVotingConfigExclusionsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostVotingConfigExclusionsResponse PostVotingConfigExclusions() + { + var descriptor = new PostVotingConfigExclusionsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostVotingConfigExclusionsResponse PostVotingConfigExclusions(PostVotingConfigExclusionsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostVotingConfigExclusionsResponse PostVotingConfigExclusions(Action configureRequest) + { + var descriptor = new PostVotingConfigExclusionsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostVotingConfigExclusionsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PostVotingConfigExclusionsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostVotingConfigExclusionsAsync(PostVotingConfigExclusionsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the cluster voting config exclusions by node ids or node names. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostVotingConfigExclusionsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostVotingConfigExclusionsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutComponentTemplateResponse PutComponentTemplate(PutComponentTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutComponentTemplateResponse PutComponentTemplate(PutComponentTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutComponentTemplateResponse PutComponentTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PutComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutComponentTemplateResponse PutComponentTemplate(PutComponentTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(descriptor); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutComponentTemplateResponse PutComponentTemplate(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) + { + var descriptor = new PutComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(descriptor); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(PutComponentTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates or updates a component template + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutComponentTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutComponentTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutComponentTemplateResponse, PutComponentTemplateRequestParameters>(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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.DanglingIndices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.DanglingIndices.g.cs index 32a1890e057..1dd16b3e447 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.DanglingIndices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.DanglingIndices.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.DanglingIndices; public partial class DanglingIndicesNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected DanglingIndicesNamespacedClient() : base() { @@ -60,6 +61,7 @@ public virtual Task ListDanglingIndicesAsync(ListDa /// Returns all dangling indices. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListDanglingIndicesResponse ListDanglingIndices() { var descriptor = new ListDanglingIndicesRequestDescriptor(); @@ -71,6 +73,7 @@ public virtual ListDanglingIndicesResponse ListDanglingIndices() /// Returns all dangling indices. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListDanglingIndicesResponse ListDanglingIndices(ListDanglingIndicesRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -81,6 +84,7 @@ public virtual ListDanglingIndicesResponse ListDanglingIndices(ListDanglingIndic /// Returns all dangling indices. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListDanglingIndicesResponse ListDanglingIndices(Action configureRequest) { var descriptor = new ListDanglingIndicesRequestDescriptor(); 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 6deac0bcbcb..b90f012790a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Enrich.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; public partial class EnrichNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected EnrichNamespacedClient() : base() { @@ -60,6 +61,7 @@ public virtual Task DeletePolicyAsync(DeletePolicyRequest /// Deletes an existing enrich policy and its enrich index. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.Name name) { var descriptor = new DeletePolicyRequestDescriptor(name); @@ -71,6 +73,7 @@ public virtual DeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.N /// Deletes an existing enrich policy and its enrich index. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePolicyResponse DeletePolicy(DeletePolicyRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -81,6 +84,7 @@ public virtual DeletePolicyResponse DeletePolicy(DeletePolicyRequestDescriptor d /// Deletes an existing enrich policy and its enrich index. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePolicyResponse DeletePolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { var descriptor = new DeletePolicyRequestDescriptor(name); @@ -122,95 +126,9 @@ public virtual Task DeletePolicyAsync(Elastic.Clients.Elas 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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequest request) { @@ -220,7 +138,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,8 +148,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Name name) { var descriptor = new ExecutePolicyRequestDescriptor(name); @@ -241,8 +160,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExecutePolicyResponse ExecutePolicy(ExecutePolicyRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -251,8 +171,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExecutePolicyResponse ExecutePolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { var descriptor = new ExecutePolicyRequestDescriptor(name); @@ -263,7 +184,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 +195,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 +205,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) { @@ -318,6 +239,7 @@ public virtual Task GetPolicyAsync(GetPolicyRequest request, /// Gets information about an enrich policy. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPolicyResponse GetPolicy() { var descriptor = new GetPolicyRequestDescriptor(); @@ -329,6 +251,7 @@ public virtual GetPolicyResponse GetPolicy() /// Gets information about an enrich policy. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPolicyResponse GetPolicy(GetPolicyRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -339,6 +262,7 @@ public virtual GetPolicyResponse GetPolicy(GetPolicyRequestDescriptor descriptor /// Gets information about an enrich policy. /// Learn more about this API in the Elasticsearch documentation. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPolicyResponse GetPolicy(Action configureRequest) { var descriptor = new GetPolicyRequestDescriptor(); @@ -382,7 +306,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 +316,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,8 +326,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -412,8 +337,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { var descriptor = new PutPolicyRequestDescriptor(name); @@ -424,8 +350,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPolicyResponse PutPolicy(PutPolicyRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -434,8 +361,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPolicyResponse PutPolicy(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { var descriptor = new PutPolicyRequestDescriptor(name); @@ -446,7 +374,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 +384,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 +396,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 +406,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) { @@ -487,4 +415,93 @@ public virtual Task PutPolicyAsync(Elastic.Clients descriptor.BeforeRequest(); return DoRequestAsync, PutPolicyResponse, PutPolicyRequestParameters>(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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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); + } } \ No newline at end of file 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 98018d2f274..aca0b116fa9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Eql.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; public partial class EqlNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected EqlNamespacedClient() : base() { @@ -60,6 +61,7 @@ public virtual Task DeleteAsync(EqlDeleteRequest request, Can /// Deletes an async EQL 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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new EqlDeleteRequestDescriptor(id); @@ -71,6 +73,7 @@ public virtual EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id) /// Deletes an async EQL 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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlDeleteResponse Delete(EqlDeleteRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -81,6 +84,7 @@ public virtual EqlDeleteResponse Delete(EqlDeleteRequestDescriptor descriptor) /// Deletes an async EQL 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new EqlDeleteRequestDescriptor(id); @@ -89,28 +93,6 @@ public virtual EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id, Act return DoRequest(descriptor); } - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(EqlDeleteRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor); - } - - /// - /// Deletes an async EQL 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 EqlDeleteResponse Delete(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) - { - var descriptor = new EqlDeleteRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor); - } - /// /// Deletes an async EQL 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. @@ -144,31 +126,9 @@ public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Deletes an async EQL 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(EqlDeleteRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Deletes an async EQL 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.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new EqlDeleteRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, EqlDeleteResponse, EqlDeleteRequestParameters>(descriptor, cancellationToken); - } - /// /// 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 +138,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,8 +148,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new EqlGetRequestDescriptor(id); @@ -199,8 +160,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlGetResponse Get(EqlGetRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -209,8 +171,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EqlGetResponse Get(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new EqlGetRequestDescriptor(id); @@ -221,7 +184,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 +195,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 +205,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) { @@ -253,218 +216,180 @@ public virtual Task> GetAsync(Elastic.Clients.Ela } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual EqlSearchResponse Search(EqlSearchRequest request) + public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequest request) { request.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(request); + return DoRequest(request); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(EqlSearchRequest request, CancellationToken cancellationToken = default) + public virtual Task GetStatusAsync(GetEqlStatusRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Indices indices) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new EqlSearchRequestDescriptor(indices); + var descriptor = new GetEqlStatusRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual EqlSearchResponse Search(EqlSearchRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { - var descriptor = new EqlSearchRequestDescriptor(indices); + var descriptor = new GetEqlStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, EqlSearchRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new EqlSearchRequestDescriptor(indices); + var descriptor = new GetEqlStatusRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(EqlSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns results matching a query expressed in Event Query Language (EQL) - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new EqlSearchRequestDescriptor(indices); + var descriptor = new GetEqlStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, EqlSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequest request) + public virtual EqlSearchResponse Search(EqlSearchRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest, EqlSearchRequestParameters>(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. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(GetEqlStatusRequest request, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(EqlSearchRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id) - { - var descriptor = new GetEqlStatusRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, EqlSearchRequestParameters>(request, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Indices indices) { - var descriptor = new GetEqlStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); + var descriptor = new EqlSearchRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, EqlSearchResponse, EqlSearchRequestParameters>(descriptor); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetEqlStatusResponse GetStatus(GetEqlStatusRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EqlSearchResponse Search(EqlSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor); + return DoRequest, EqlSearchResponse, EqlSearchRequestParameters>(descriptor); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetEqlStatusResponse GetStatus(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EqlSearchResponse Search(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { - var descriptor = new GetEqlStatusRequestDescriptor(id); + var descriptor = new EqlSearchRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor); + return DoRequest, EqlSearchResponse, EqlSearchRequestParameters>(descriptor); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) - { - var descriptor = new GetEqlStatusRequestDescriptor(id); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new GetEqlStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); + var descriptor = new EqlSearchRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(GetEqlStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(EqlSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(descriptor, cancellationToken); } /// - /// Returns the status of a previously submitted async or stored Event Query Language (EQL) search - /// Learn more about this API in the Elasticsearch documentation. + /// Returns results matching a query expressed in Event Query Language (EQL) + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetEqlStatusRequestDescriptor(id); + var descriptor = new EqlSearchRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetEqlStatusResponse, GetEqlStatusRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, EqlSearchResponse, EqlSearchRequestParameters>(descriptor, cancellationToken); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs index 5d1ca4cfd0a..5eea5a7a3d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Esql; public partial class EsqlNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected EsqlNamespacedClient() : base() { @@ -37,9 +38,8 @@ internal EsqlNamespacedClient(ElasticsearchClient client) : base(client) } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual EsqlQueryResponse Query(EsqlQueryRequest request) { @@ -48,9 +48,8 @@ public virtual EsqlQueryResponse Query(EsqlQueryRequest request) } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task QueryAsync(EsqlQueryRequest request, CancellationToken cancellationToken = default) { @@ -59,10 +58,10 @@ public virtual Task QueryAsync(EsqlQueryRequest request, Canc } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EsqlQueryResponse Query(EsqlQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -70,10 +69,10 @@ public virtual EsqlQueryResponse Query(EsqlQueryRequestDescriptor descriptor) } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EsqlQueryResponse Query(Action configureRequest) { var descriptor = new EsqlQueryRequestDescriptor(); @@ -83,10 +82,10 @@ public virtual EsqlQueryResponse Query(Action config } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EsqlQueryResponse Query(EsqlQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -94,10 +93,10 @@ public virtual EsqlQueryResponse Query(EsqlQueryRequestDescriptor - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual EsqlQueryResponse Query(Action> configureRequest) { var descriptor = new EsqlQueryRequestDescriptor(); @@ -107,9 +106,8 @@ public virtual EsqlQueryResponse Query(Action - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task QueryAsync(EsqlQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -118,9 +116,8 @@ public virtual Task QueryAsync(EsqlQueryRequestDescriptor des } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task QueryAsync(Action configureRequest, CancellationToken cancellationToken = default) { @@ -131,9 +128,8 @@ public virtual Task QueryAsync(Action - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task QueryAsync(EsqlQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { @@ -142,9 +138,8 @@ public virtual Task QueryAsync(EsqlQueryRequestDes } /// - /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely. /// Executes an ESQL request - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task QueryAsync(Action> configureRequest, CancellationToken cancellationToken = default) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs new file mode 100644 index 00000000000..a0c51da613c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs @@ -0,0 +1,217 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Features; + +public partial class FeaturesNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected FeaturesNamespacedClient() : base() + { + } + + internal FeaturesNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetFeaturesResponse GetFeatures(GetFeaturesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFeaturesAsync(GetFeaturesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFeaturesResponse GetFeatures() + { + var descriptor = new GetFeaturesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFeaturesResponse GetFeatures(GetFeaturesRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFeaturesResponse GetFeatures(Action configureRequest) + { + var descriptor = new GetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFeaturesAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetFeaturesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFeaturesAsync(GetFeaturesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFeaturesAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResetFeaturesResponse ResetFeatures(ResetFeaturesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetFeaturesAsync(ResetFeaturesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetFeaturesResponse ResetFeatures() + { + var descriptor = new ResetFeaturesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetFeaturesResponse ResetFeatures(ResetFeaturesRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetFeaturesResponse ResetFeatures(Action configureRequest) + { + var descriptor = new ResetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetFeaturesAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ResetFeaturesRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetFeaturesAsync(ResetFeaturesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets the internal state of features, usually by deleting system indices + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetFeaturesAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file 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 96181175550..c9455befd31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Graph.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; public partial class GraphNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected GraphNamespacedClient() : base() { @@ -38,7 +39,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 +49,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,8 +59,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices) { var descriptor = new ExploreRequestDescriptor(indices); @@ -69,8 +71,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -79,8 +82,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new ExploreRequestDescriptor(indices); @@ -91,8 +95,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExploreResponse Explore(ExploreRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -101,8 +106,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExploreResponse Explore(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { var descriptor = new ExploreRequestDescriptor(indices); @@ -113,7 +119,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 +130,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 +140,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 +152,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 +162,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.Ilm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs new file mode 100644 index 00000000000..b2706895863 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ilm.g.cs @@ -0,0 +1,929 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public partial class IndexLifecycleManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected IndexLifecycleManagementNamespacedClient() : base() + { + } + + internal IndexLifecycleManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteLifecycleResponse DeleteLifecycle(DeleteLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new DeleteLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(DeleteLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new DeleteLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetLifecycleResponse GetLifecycle(GetLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle() + { + var descriptor = new GetLifecycleRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle(GetLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle(Action configureRequest) + { + var descriptor = new GetLifecycleRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the specified policy definition. Includes the policy version and last modified date. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetIlmStatusResponse GetStatus(GetIlmStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetIlmStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIlmStatusResponse GetStatus() + { + var descriptor = new GetIlmStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIlmStatusResponse GetStatus(GetIlmStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIlmStatusResponse GetStatus(Action configureRequest) + { + var descriptor = new GetIlmStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetIlmStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetIlmStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the current index lifecycle management (ILM) status. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetIlmStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MigrateToDataTiersResponse MigrateToDataTiers(MigrateToDataTiersRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataTiersAsync(MigrateToDataTiersRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataTiersResponse MigrateToDataTiers() + { + var descriptor = new MigrateToDataTiersRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataTiersResponse MigrateToDataTiers(MigrateToDataTiersRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataTiersResponse MigrateToDataTiers(Action configureRequest) + { + var descriptor = new MigrateToDataTiersRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataTiersAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MigrateToDataTiersRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataTiersAsync(MigrateToDataTiersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MigrateToDataTiersAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MigrateToDataTiersRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MoveToStepResponse MoveToStep(MoveToStepRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(MoveToStepRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MoveToStepResponse MoveToStep(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new MoveToStepRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MoveToStepResponse MoveToStep(MoveToStepRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MoveToStepResponse MoveToStep(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new MoveToStepRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new MoveToStepRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(MoveToStepRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Manually moves an index into the specified step and executes that step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MoveToStepAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MoveToStepRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutLifecycleResponse PutLifecycle(PutLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new PutLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(PutLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PutLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a lifecycle policy + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RemovePolicyResponse RemovePolicy(RemovePolicyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(RemovePolicyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RemovePolicyResponse RemovePolicy(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new RemovePolicyRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RemovePolicyResponse RemovePolicy(RemovePolicyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RemovePolicyResponse RemovePolicy(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new RemovePolicyRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new RemovePolicyRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(RemovePolicyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the assigned lifecycle policy and stops managing the specified index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RemovePolicyAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RemovePolicyRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RetryResponse Retry(RetryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(RetryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RetryResponse Retry(Elastic.Clients.Elasticsearch.IndexName index) + { + var descriptor = new RetryRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RetryResponse Retry(RetryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RetryResponse Retry(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + { + var descriptor = new RetryRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) + { + var descriptor = new RetryRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(RetryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retries executing the policy for an index that is in the ERROR step. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RetryAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RetryRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartIlmResponse Start(StartIlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartIlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartIlmResponse Start() + { + var descriptor = new StartIlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartIlmResponse Start(StartIlmRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartIlmResponse Start(Action configureRequest) + { + var descriptor = new StartIlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StartIlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartIlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start the index lifecycle management (ILM) plugin. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartIlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopIlmResponse Stop(StopIlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopIlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopIlmResponse Stop() + { + var descriptor = new StopIlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopIlmResponse Stop(StopIlmRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopIlmResponse Stop(Action configureRequest) + { + var descriptor = new StopIlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StopIlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopIlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopIlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file 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 fee864b6c92..9ac2c1e8bbb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public partial class IndicesNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected IndicesNamespacedClient() : base() { @@ -37,1391 +38,1499 @@ internal IndicesNamespacedClient(ElasticsearchClient client) : base(client) } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(CloneIndexRequest request) + public virtual AnalyzeIndexResponse Analyze(AnalyzeIndexRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(CloneIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task AnalyzeAsync(AnalyzeIndexRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AnalyzeIndexResponse Analyze() { - var descriptor = new CloneIndexRequestDescriptor(index, target); + var descriptor = new AnalyzeIndexRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(CloneIndexRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AnalyzeIndexResponse Analyze(AnalyzeIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AnalyzeIndexResponse Analyze(Action configureRequest) { - var descriptor = new CloneIndexRequestDescriptor(index, target); + var descriptor = new AnalyzeIndexRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.Name target) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AnalyzeIndexResponse Analyze(AnalyzeIndexRequestDescriptor descriptor) { - var descriptor = new CloneIndexRequestDescriptor(typeof(TDocument), target); descriptor.BeforeRequest(); - return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + return DoRequest, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.Name target, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual AnalyzeIndexResponse Analyze(Action> configureRequest) { - var descriptor = new CloneIndexRequestDescriptor(typeof(TDocument), target); + var descriptor = new AnalyzeIndexRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + return DoRequest, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(CloneIndexRequestDescriptor descriptor) + public virtual Task AnalyzeAsync(CancellationToken cancellationToken = default) { + var descriptor = new AnalyzeIndexRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action> configureRequest) + public virtual Task AnalyzeAsync(AnalyzeIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CloneIndexRequestDescriptor(index, target); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, CancellationToken cancellationToken = default) + public virtual Task AnalyzeAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloneIndexRequestDescriptor(index, target); + var descriptor = new AnalyzeIndexRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(CloneIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task AnalyzeAsync(AnalyzeIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the analysis process on a text and return the tokens breakdown of the text. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task AnalyzeAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloneIndexRequestDescriptor(index, target); + var descriptor = new AnalyzeIndexRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, AnalyzeIndexResponse, AnalyzeIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Name target, CancellationToken cancellationToken = default) + public virtual ClearCacheResponse ClearCache(ClearCacheRequest request) { - var descriptor = new CloneIndexRequestDescriptor(typeof(TDocument), target); - descriptor.BeforeRequest(); - return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Name target, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(ClearCacheRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CloneIndexRequestDescriptor(typeof(TDocument), target); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(CloneIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache() { + var descriptor = new ClearCacheRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Clones an index - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(ClearCacheRequestDescriptor descriptor) { - var descriptor = new CloneIndexRequestDescriptor(index, target); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequest request) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(Action configureRequest) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(ClearCacheRequestDescriptor descriptor) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequest, ClearCacheResponse, ClearCacheRequestParameters>(descriptor); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(Action> configureRequest) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, ClearCacheResponse, ClearCacheRequestParameters>(descriptor); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + public virtual Task ClearCacheAsync(CancellationToken cancellationToken = default) { + var descriptor = new ClearCacheRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + public virtual Task ClearCacheAsync(ClearCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) + public virtual Task ClearCacheAsync(Action configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + public virtual Task ClearCacheAsync(ClearCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CloseIndexResponse, CloseIndexRequestParameters>(descriptor); + return DoRequestAsync, ClearCacheResponse, ClearCacheRequestParameters>(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clears all or specific caches for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + public virtual Task ClearCacheAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, ClearCacheResponse, ClearCacheRequestParameters>(descriptor, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual CloneIndexResponse Clone(CloneIndexRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task CloneAsync(CloneIndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CloseIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(CloseIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target) { + var descriptor = new CloneIndexRequestDescriptor(index, target); descriptor.BeforeRequest(); - return DoRequestAsync, CloseIndexResponse, CloseIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Closes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(CloneIndexRequestDescriptor descriptor) { - var descriptor = new CloseIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CloseIndexResponse, CloseIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequest request) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action configureRequest) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new CloneIndexRequestDescriptor(index, target); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(CreateDataStreamRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(CloneIndexRequestDescriptor descriptor) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.DataStreamName name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneIndexResponse Clone(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action> configureRequest) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new CloneIndexRequestDescriptor(index, target); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, CloneIndexResponse, CloneIndexRequestParameters>(descriptor); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequestDescriptor descriptor) + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, CancellationToken cancellationToken = default) { + var descriptor = new CloneIndexRequestDescriptor(index, target); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.DataStreamName name, Action configureRequest) + public virtual Task CloneAsync(CloneIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamName name, CancellationToken cancellationToken = default) + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new CloneIndexRequestDescriptor(index, target); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(CreateDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task CloneAsync(CloneIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Creates a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Clones an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamName name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Name target, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateDataStreamRequestDescriptor(name); + var descriptor = new CloneIndexRequestDescriptor(index, target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, CloneIndexResponse, CloneIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(CreateIndexRequest request) + public virtual CloseIndexResponse Close(CloseIndexRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(CreateIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task CloseAsync(CloseIndexRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices) { - var descriptor = new CreateIndexRequestDescriptor(index); + var descriptor = new CloseIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseIndexResponse Close(CloseIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseIndexResponse Close(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { - var descriptor = new CreateIndexRequestDescriptor(index); + var descriptor = new CloseIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Closes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual CreateIndexResponse Create() + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + var descriptor = new CloseIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates an index with optional settings and mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 CreateIndexResponse Create(Action> configureRequest) + public virtual Task CloseAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + var descriptor = new CloseIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual CreateIndexResponse Create(CreateIndexRequest request) { - descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(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, Action> configureRequest) + public virtual Task CreateAsync(CreateIndexRequest request, CancellationToken cancellationToken = default) { - var descriptor = new CreateIndexRequestDescriptor(index); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index) { var descriptor = new CreateIndexRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) { var descriptor = new CreateIndexRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(CreateIndexRequestDescriptor descriptor) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); } /// /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateIndexResponse Create(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { - var descriptor = new CreateIndexRequestDescriptor(typeof(TDocument)); + var descriptor = new CreateIndexRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest, CreateIndexResponse, CreateIndexRequestParameters>(descriptor); } /// /// 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) + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { + var descriptor = new CreateIndexRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, 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); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(DeleteAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name) + public virtual Task CreateAsync(CreateIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates an index with optional settings and mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new CreateIndexRequestDescriptor(index); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, CreateIndexResponse, CreateIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action configureRequest) + public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequest request) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) + public virtual Task CreateDataStreamAsync(CreateDataStreamRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.DataStreamName name) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); + var descriptor = new CreateDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateDataStreamResponse CreateDataStream(CreateDataStreamRequestDescriptor descriptor) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(DeleteAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateDataStreamResponse CreateDataStream(Elastic.Clients.Elasticsearch.DataStreamName name, Action configureRequest) { + var descriptor = new CreateDataStreamRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamName name, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); + var descriptor = new CreateDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(DeleteAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(CreateDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task CreateDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamName name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteAliasRequestDescriptor(indices, name); + var descriptor = new CreateDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAliasResponse, DeleteAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequest request) + public virtual DataStreamsStatsResponse DataStreamsStats(DataStreamsStatsRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequest request, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(DataStreamsStatsRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DataStreamsStatsResponse DataStreamsStats() { - var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + var descriptor = new DataStreamsStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DataStreamsStatsResponse DataStreamsStats(DataStreamsStatsRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DataStreamsStatsResponse DataStreamsStats(Action configureRequest) { - var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + var descriptor = new DataStreamsStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(CancellationToken cancellationToken = default) { - var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + var descriptor = new DataStreamsStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(DeleteDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(DataStreamsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides statistics on operations happening in a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DataStreamsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteDataLifecycleRequestDescriptor(name); + var descriptor = new DataStreamsStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequest request) + public virtual DeleteIndexResponse Delete(DeleteIndexRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(DeleteIndexRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.DataStreamNames name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Indices indices) { - var descriptor = new DeleteDataStreamRequestDescriptor(name); + var descriptor = new DeleteIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexResponse Delete(DeleteIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { - var descriptor = new DeleteDataStreamRequestDescriptor(name); + var descriptor = new DeleteIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new DeleteDataStreamRequestDescriptor(name); + var descriptor = new DeleteIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes a data stream. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteDataStreamRequestDescriptor(name); + var descriptor = new DeleteIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexResponse Delete(DeleteIndexRequest request) + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAliasAsync(DeleteAliasRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Indices indices) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + var descriptor = new DeleteAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexResponse Delete(DeleteIndexRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAliasResponse DeleteAlias(DeleteAliasRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAliasResponse DeleteAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + var descriptor = new DeleteAliasRequestDescriptor(indices, name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexResponse Delete(DeleteIndexRequestDescriptor descriptor) + public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) { + var descriptor = new DeleteAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequest, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 DeleteIndexResponse Delete(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + public virtual Task DeleteAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + var descriptor = new DeleteAliasRequestDescriptor(indices, name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequest request) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes the data stream 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); + } + + /// + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) + { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(DeleteDataLifecycleRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataLifecycleResponse DeleteDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(DeleteIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) { + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes the data stream 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); + } + + /// + /// Deletes the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteIndexRequestDescriptor(indices); + var descriptor = new DeleteDataLifecycleRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, DeleteIndexResponse, DeleteIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequest request) + public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Names name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.DataStreamNames name) { - var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + var descriptor = new DeleteDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataStreamResponse DeleteDataStream(DeleteDataStreamRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataStreamResponse DeleteDataStream(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) { - var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + var descriptor = new DeleteDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) + public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) { - var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + var descriptor = new DeleteDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteDataStreamAsync(DeleteDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes a data stream. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteDataStreamAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteIndexTemplateRequestDescriptor(name); + var descriptor = new DeleteDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequest request) + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteTemplateAsync(DeleteTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Name name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Names name) { - var descriptor = new DeleteTemplateRequestDescriptor(name); + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(DeleteIndexTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteIndexTemplateResponse DeleteIndexTemplate(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new DeleteTemplateRequestDescriptor(name); + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) { - var descriptor = new DeleteTemplateRequestDescriptor(name); + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteTemplateAsync(DeleteTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteIndexTemplateAsync(DeleteIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Deletes an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteIndexTemplateAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteTemplateRequestDescriptor(name); + var descriptor = new DeleteIndexTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequest request) + public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(ExistsAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteTemplateAsync(DeleteTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Names name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Name name) { - var descriptor = new ExistsAliasRequestDescriptor(name); + var descriptor = new DeleteTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTemplateResponse DeleteTemplate(DeleteTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTemplateResponse DeleteTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { - var descriptor = new ExistsAliasRequestDescriptor(name); + var descriptor = new DeleteTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequestDescriptor descriptor) + public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) { + var descriptor = new DeleteTemplateRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Names name, Action> configureRequest) + public virtual Task DeleteTemplateAsync(DeleteTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ExistsAliasRequestDescriptor(name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Deletes an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) + public virtual Task DeleteTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsAliasRequestDescriptor(name); + var descriptor = new DeleteTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(ExistsAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual DiskUsageResponse DiskUsage(DiskUsageRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DiskUsageAsync(DiskUsageRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExistsAliasRequestDescriptor(name); - configureRequest?.Invoke(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DiskUsageResponse DiskUsage(Elastic.Clients.Elasticsearch.Indices indices) + { + var descriptor = new DiskUsageRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(ExistsAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DiskUsageResponse DiskUsage(DiskUsageRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular alias exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.Names name, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DiskUsageResponse DiskUsage(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { - var descriptor = new ExistsAliasRequestDescriptor(name); + var descriptor = new DiskUsageRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExistsAliasResponse, ExistsAliasRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(ExistsIndexTemplateRequest request) + public virtual Task DiskUsageAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new DiskUsageRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task DiskUsageAsync(DiskUsageRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Analyzes the disk usage of each field of an index or data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.Name name) + public virtual Task DiskUsageAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + var descriptor = new DiskUsageRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(ExistsIndexTemplateRequestDescriptor descriptor) + public virtual DownsampleResponse Downsample(DownsampleRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + public virtual Task DownsampleAsync(DownsampleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DownsampleResponse Downsample(DownsampleRequestDescriptor descriptor) { - var descriptor = new ExistsIndexTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DownsampleResponse Downsample(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName targetIndex, Action configureRequest) { - var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + var descriptor = new DownsampleRequestDescriptor(config, index, targetIndex); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsIndexTemplateAsync(ExistsIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DownsampleAsync(DownsampleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Downsample an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DownsampleAsync(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig config, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName targetIndex, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExistsIndexTemplateRequestDescriptor(name); + var descriptor = new DownsampleRequestDescriptor(config, index, targetIndex); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -1448,6 +1557,7 @@ public virtual Task ExistsAsync(ExistsRequest request, Cancellat /// Returns information about whether a particular index exists. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Indices indices) { var descriptor = new ExistsRequestDescriptor(indices); @@ -1459,6 +1569,7 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Indices indic /// Returns information about whether a particular index exists. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1469,6 +1580,7 @@ public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) /// Returns information about whether a particular index exists. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new ExistsRequestDescriptor(indices); @@ -1477,28 +1589,6 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.Indices indic 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.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. @@ -1533,62 +1623,220 @@ public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.In } /// - /// Returns information about whether a particular index exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(ExistsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about whether a particular index exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ExistsAliasAsync(ExistsAliasRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ExistsRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, ExistsResponse, ExistsRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequest request) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Names name) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new ExistsAliasRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExistsTemplateAsync(ExistsTemplateRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsAliasResponse ExistsAlias(ExistsAliasRequestDescriptor descriptor) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsearch.Names name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsAliasResponse ExistsAlias(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new ExistsTemplateRequestDescriptor(name); + var descriptor = new ExistsAliasRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns information about whether a particular index template exists. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about whether a particular alias exists. + /// Learn more about this API in the Elasticsearch documentation. /// + public virtual Task ExistsAliasAsync(Elastic.Clients.Elasticsearch.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.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 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsIndexTemplateResponse ExistsIndexTemplate(Elastic.Clients.Elasticsearch.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.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.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 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1599,6 +1847,7 @@ public virtual ExistsTemplateResponse ExistsTemplate(ExistsTemplateRequestDescri /// Returns information about whether a particular index template exists. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsTemplateResponse ExistsTemplate(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { var descriptor = new ExistsTemplateRequestDescriptor(name); @@ -1664,6 +1913,7 @@ public virtual Task ExplainDataLifecycleAsync(Expl /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients.Elasticsearch.Indices indices) { var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); @@ -1675,6 +1925,7 @@ public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLifecycleRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1685,6 +1936,7 @@ public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(ExplainDataLife /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); @@ -1697,2264 +1949,2961 @@ public virtual ExplainDataLifecycleResponse ExplainDataLifecycle(Elastic.Clients /// Retrieves information about the index's current data stream 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) + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { + var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Retrieves information about the index's current data stream 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.Indices indices, Action> configureRequest) + public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// Retrieves information about the index's current data stream 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.Indices indices, CancellationToken cancellationToken = default) + public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } /// - /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual FieldUsageStatsResponse FieldUsageStats(FieldUsageStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(FieldUsageStatsRequest request, CancellationToken cancellationToken = default) { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FieldUsageStatsResponse FieldUsageStats(Elastic.Clients.Elasticsearch.Indices indices) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FieldUsageStatsResponse FieldUsageStats(FieldUsageStatsRequestDescriptor descriptor) { - var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FieldUsageStatsResponse FieldUsageStats(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ExplainDataLifecycleAsync(ExplainDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FieldUsageStatsResponse FieldUsageStats(FieldUsageStatsRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor, cancellationToken); + return DoRequest, FieldUsageStatsResponse, FieldUsageStatsRequestParameters>(descriptor); } /// - /// Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FieldUsageStatsResponse FieldUsageStats(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, FieldUsageStatsResponse, FieldUsageStatsRequestParameters>(descriptor); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(FieldUsageStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(FieldUsageStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, FieldUsageStatsResponse, FieldUsageStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns the field usage stats for each field of an index + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FieldUsageStatsAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FieldUsageStatsRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, FieldUsageStatsResponse, FieldUsageStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FlushResponse Flush(FlushRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushAsync(FlushRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushResponse Flush() + { + var descriptor = new FlushRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushResponse Flush(Action configureRequest) + { + var descriptor = new FlushRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushAsync(CancellationToken cancellationToken = default) + { + var descriptor = new FlushRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs the flush operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FlushRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ForcemergeResponse Forcemerge(ForcemergeRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForcemergeAsync(ForcemergeRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForcemergeResponse Forcemerge() + { + var descriptor = new ForcemergeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForcemergeResponse Forcemerge(ForcemergeRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForcemergeResponse Forcemerge(Action configureRequest) + { + var descriptor = new ForcemergeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForcemergeAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ForcemergeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Performs the force merge operation on one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForcemergeAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ForcemergeRequestDescriptor(); + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.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 Task GetAsync(Elastic.Clients.Elasticsearch.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.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetIndexRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns an alias. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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 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 the data stream 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); + } + + /// + /// Returns the data stream 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); + } + + /// + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataLifecycleRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the data stream 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); + } + + /// + /// Returns the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns data streams. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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 ExplainDataLifecycleAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainDataLifecycleRequestDescriptor(indices); + var descriptor = new GetDataStreamRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ExplainDataLifecycleResponse, ExplainDataLifecycleRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush(FlushRequest request) + public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(FlushRequest request, CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(GetFieldMappingRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields, Action configureRequest) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush(FlushRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, FlushResponse, FlushRequestParameters>(descriptor); + return DoRequest, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual FlushResponse Flush(Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields, Action> configureRequest) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, FlushResponse, FlushRequestParameters>(descriptor); + return DoRequest, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, CancellationToken cancellationToken = default) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(GetFieldMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(FlushRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(GetFieldMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, FlushResponse, FlushRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor, cancellationToken); } /// - /// Performs the flush operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mapping for one or more fields. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task FlushAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new FlushRequestDescriptor(); + var descriptor = new GetFieldMappingRequestDescriptor(fields); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, FlushResponse, FlushRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequest request) + public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(ForcemergeRequest request, CancellationToken cancellationToken = default) + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndexTemplateResponse GetIndexTemplate() { - var descriptor = new ForcemergeRequestDescriptor(); + var descriptor = new GetIndexTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndexTemplateResponse GetIndexTemplate(Action configureRequest) { - var descriptor = new ForcemergeRequestDescriptor(); + var descriptor = new GetIndexTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge(ForcemergeRequestDescriptor descriptor) + public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) { + var descriptor = new GetIndexTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, ForcemergeResponse, ForcemergeRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ForcemergeResponse Forcemerge(Action> configureRequest) + public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, ForcemergeResponse, ForcemergeRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(CancellationToken cancellationToken = default) + public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ForcemergeRequestDescriptor(); + var descriptor = new GetIndexTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual GetMappingResponse GetMapping(GetMappingRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetMappingAsync(GetMappingRequest request, CancellationToken cancellationToken = default) { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(ForcemergeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMappingResponse GetMapping() { + var descriptor = new GetMappingRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, ForcemergeResponse, ForcemergeRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Performs the force merge operation on one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ForcemergeAsync(Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) { - var descriptor = new ForcemergeRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ForcemergeResponse, ForcemergeRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequest request) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMappingResponse GetMapping(Action configureRequest) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task GetMappingAsync(CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new GetMappingRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias() + public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns mappings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + public virtual Task GetMappingAsync(Action configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new GetMappingRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(Action configureRequest) + public virtual GetIndicesSettingsResponse GetSettings(GetIndicesSettingsRequest request) { - var descriptor = new GetAliasRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(GetAliasRequestDescriptor descriptor) + public virtual Task GetSettingsAsync(GetIndicesSettingsRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAliasResponse GetAlias(Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndicesSettingsResponse GetSettings() { - var descriptor = new GetAliasRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new GetIndicesSettingsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, GetAliasResponse, GetAliasRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndicesSettingsResponse GetSettings(GetIndicesSettingsRequestDescriptor descriptor) { - var descriptor = new GetAliasRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetIndicesSettingsResponse GetSettings(Action configureRequest) { + var descriptor = new GetIndicesSettingsRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new GetIndicesSettingsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(GetAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(GetIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns settings for one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAliasAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetSettingsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAliasRequestDescriptor(); + var descriptor = new GetIndicesSettingsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetAliasResponse, GetAliasRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequest request) + public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequest request, CancellationToken cancellationToken = default) + public virtual Task GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTemplateResponse GetTemplate() { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new GetTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(GetDataLifecycleRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTemplateResponse GetTemplate(GetTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataLifecycleResponse GetDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTemplateResponse GetTemplate(Action configureRequest) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new GetTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) + public virtual Task GetTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new GetTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(GetDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetTemplateAsync(GetTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetDataLifecycleRequestDescriptor(name); + var descriptor = new GetTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequest request) + public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(GetDataStreamRequest request, CancellationToken cancellationToken = default) + public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.IndexName name) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new MigrateToDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream(GetDataStreamRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetDataStreamResponse GetDataStream(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new MigrateToDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(CancellationToken cancellationToken = default) + public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new MigrateToDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(GetDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns data streams. + /// Migrates an alias to a data stream /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetDataStreamRequestDescriptor(); + var descriptor = new MigrateToDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequest request) + public virtual ModifyDataStreamResponse ModifyDataStream(ModifyDataStreamRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(GetFieldMappingRequest request, CancellationToken cancellationToken = default) + public virtual Task ModifyDataStreamAsync(ModifyDataStreamRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields) - { - var descriptor = new GetFieldMappingRequestDescriptor(fields); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ModifyDataStreamResponse ModifyDataStream(ModifyDataStreamRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ModifyDataStreamResponse ModifyDataStream(Action configureRequest) { - var descriptor = new GetFieldMappingRequestDescriptor(fields); + var descriptor = new ModifyDataStreamRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetFieldMappingResponse GetFieldMapping(GetFieldMappingRequestDescriptor descriptor) + public virtual Task ModifyDataStreamAsync(ModifyDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Modifies a data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetFieldMappingResponse GetFieldMapping(Elastic.Clients.Elasticsearch.Fields fields, Action> configureRequest) + public virtual Task ModifyDataStreamAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetFieldMappingRequestDescriptor(fields); + var descriptor = new ModifyDataStreamRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, CancellationToken cancellationToken = default) + public virtual OpenIndexResponse Open(OpenIndexRequest request) { - var descriptor = new GetFieldMappingRequestDescriptor(fields); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(GetFieldMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task OpenAsync(OpenIndexRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Indices indices) { - var descriptor = new GetFieldMappingRequestDescriptor(fields); - configureRequest?.Invoke(descriptor); + var descriptor = new OpenIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(GetFieldMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, GetFieldMappingResponse, GetFieldMappingRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns mapping for one or more fields. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetFieldMappingAsync(Elastic.Clients.Elasticsearch.Fields fields, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { - var descriptor = new GetFieldMappingRequestDescriptor(fields); + var descriptor = new OpenIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetFieldMappingResponse, GetFieldMappingRequestParameters>(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); + return DoRequest(descriptor); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Indices indices) + public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new OpenIndexRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + public virtual Task OpenAsync(OpenIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Opens an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new OpenIndexRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(GetIndexRequestDescriptor descriptor) + public virtual PromoteDataStreamResponse PromoteDataStream(PromoteDataStreamRequest request) { - descriptor.BeforeRequest(); - return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexResponse Get(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + public virtual Task PromoteDataStreamAsync(PromoteDataStreamRequest request, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetIndexResponse, GetIndexRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PromoteDataStreamResponse PromoteDataStream(Elastic.Clients.Elasticsearch.IndexName name) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new PromoteDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PromoteDataStreamResponse PromoteDataStream(PromoteDataStreamRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PromoteDataStreamResponse PromoteDataStream(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new PromoteDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(GetIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PromoteDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, CancellationToken cancellationToken = default) { + var descriptor = new PromoteDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns information about one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PromoteDataStreamAsync(PromoteDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PromoteDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexRequestDescriptor(indices); + var descriptor = new PromoteDataStreamRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetIndexResponse, GetIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequest request) + public virtual PutAliasResponse PutAlias(PutAliasRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task PutAliasAsync(PutAliasRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name) { - var descriptor = new GetIndexTemplateRequestDescriptor(); + var descriptor = new PutAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(GetIndexTemplateRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetIndexTemplateResponse GetIndexTemplate(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { - var descriptor = new GetIndexTemplateRequestDescriptor(); + var descriptor = new PutAliasRequestDescriptor(indices, name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) { - var descriptor = new GetIndexTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(GetIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetIndexTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) { - var descriptor = new GetIndexTemplateRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new PutAliasRequestDescriptor(indices, name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequest request) + public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(GetMappingRequest request, CancellationToken cancellationToken = default) + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new PutAliasRequestDescriptor(indices, name); + 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. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping() + public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an alias. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new PutAliasRequestDescriptor(indices, name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(Action configureRequest) + public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequest request) { - var descriptor = new GetMappingRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(GetMappingRequestDescriptor descriptor) + public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetMappingResponse GetMapping(Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) { - var descriptor = new GetMappingRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new PutDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest, GetMappingResponse, GetMappingRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequestDescriptor descriptor) { - var descriptor = new GetMappingRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) { + var descriptor = new PutDataLifecycleRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new PutDataLifecycleRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(GetMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns mappings for one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the data stream lifecycle of the selected data streams. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetMappingAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetMappingRequestDescriptor(); + var descriptor = new PutDataLifecycleRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetMappingResponse, GetMappingRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request) + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetTemplateResponse GetTemplate() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) { - var descriptor = new GetTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetTemplateResponse GetTemplate(GetTemplateRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetTemplateResponse GetTemplate(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) { - var descriptor = new GetTemplateRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetTemplateAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { - var descriptor = new GetTemplateRequestDescriptor(); + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetTemplateAsync(GetTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetTemplateRequestDescriptor(); + var descriptor = new PutIndexTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(IndicesStatsRequest request) + public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(IndicesStatsRequest request, CancellationToken cancellationToken = default) + public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new PutIndexTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats() + public virtual PutMappingResponse PutMapping(PutMappingRequest request) { - var descriptor = new IndicesStatsRequestDescriptor(); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) + public virtual Task PutMappingAsync(PutMappingRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) { - var descriptor = new IndicesStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual IndicesStatsResponse Stats(Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) { - var descriptor = new IndicesStatsRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor); + return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { - var descriptor = new IndicesStatsRequestDescriptor(); + var descriptor = new PutMappingRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new IndicesStatsRequestDescriptor(); + var descriptor = new PutMappingRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(IndicesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); } /// - /// Provides statistics on operations happening in an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index mappings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task StatsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new IndicesStatsRequestDescriptor(); + var descriptor = new PutMappingRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, IndicesStatsResponse, IndicesStatsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequest request) + public virtual PutIndicesSettingsResponse PutSettings(PutIndicesSettingsRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequest request, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.IndexName name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndicesSettingsResponse PutSettings(PutIndicesSettingsRequestDescriptor descriptor) { - var descriptor = new MigrateToDataStreamRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual MigrateToDataStreamResponse MigrateToDataStream(MigrateToDataStreamRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndicesSettingsResponse PutSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Action configureRequest) { + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual MigrateToDataStreamResponse MigrateToDataStream(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndicesSettingsResponse PutSettings(PutIndicesSettingsRequestDescriptor descriptor) { - var descriptor = new MigrateToDataStreamRequestDescriptor(name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutIndicesSettingsResponse PutSettings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Action> configureRequest) { - var descriptor = new MigrateToDataStreamRequestDescriptor(name); + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MigrateToDataStreamAsync(MigrateToDataStreamRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Migrates an alias to a data stream - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MigrateToDataStreamAsync(Elastic.Clients.Elasticsearch.IndexName name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new MigrateToDataStreamRequestDescriptor(name); + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequest request) + public virtual Task PutSettingsAsync(PutIndicesSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates the index settings. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(OpenIndexRequest request, CancellationToken cancellationToken = default) + public virtual Task PutSettingsAsync(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings settings, Action> configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new PutIndicesSettingsRequestDescriptor(settings); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutIndicesSettingsResponse, PutIndicesSettingsRequestParameters>(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Indices indices) - { - var descriptor = new OpenIndexRequestDescriptor(indices); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + public virtual PutTemplateResponse PutTemplate(PutTemplateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + public virtual Task PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor descriptor) { - var descriptor = new OpenIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(OpenIndexRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { + var descriptor = new PutTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual OpenIndexResponse Open(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor descriptor) { - var descriptor = new OpenIndexRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, OpenIndexResponse, OpenIndexRequestParameters>(descriptor); + return DoRequest, PutTemplateResponse, PutTemplateRequestParameters>(descriptor); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { - var descriptor = new OpenIndexRequestDescriptor(indices); + var descriptor = new PutTemplateRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, PutTemplateResponse, PutTemplateRequestParameters>(descriptor); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(OpenIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new OpenIndexRequestDescriptor(indices); + var descriptor = new PutTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(OpenIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, OpenIndexResponse, OpenIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Opens an index. - /// Learn more about this API in the Elasticsearch documentation. + /// Creates or updates an index template. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task OpenAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new OpenIndexRequestDescriptor(indices); + var descriptor = new PutTemplateRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, OpenIndexResponse, OpenIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, PutTemplateResponse, PutTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(PutAliasRequest request) + public virtual RecoveryResponse Recovery(RecoveryRequest request) { request.BeforeRequest(); - return DoRequest(request); + return DoRequest(request); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(PutAliasRequest request, CancellationToken cancellationToken = default) + public virtual Task RecoveryAsync(RecoveryRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RecoveryResponse Recovery() { - var descriptor = new PutAliasRequestDescriptor(indices, name); + var descriptor = new RecoveryRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RecoveryResponse Recovery(RecoveryRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RecoveryResponse Recovery(Action configureRequest) { - var descriptor = new PutAliasRequestDescriptor(indices, name); + var descriptor = new RecoveryRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(PutAliasRequestDescriptor descriptor) + public virtual Task RecoveryAsync(CancellationToken cancellationToken = default) { + var descriptor = new RecoveryRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutAliasResponse PutAlias(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) + public virtual Task RecoveryAsync(RecoveryRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new PutAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, PutAliasResponse, PutAliasRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about ongoing index shard recoveries. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + public virtual Task RecoveryAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutAliasRequestDescriptor(indices, name); + var descriptor = new RecoveryRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual RefreshResponse Refresh(RefreshRequest request) { - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task RefreshAsync(RefreshRequest request, CancellationToken cancellationToken = default) { - var descriptor = new PutAliasRequestDescriptor(indices, name); - configureRequest?.Invoke(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RefreshResponse Refresh() + { + var descriptor = new RefreshRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(PutAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RefreshResponse Refresh(RefreshRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates or updates an alias. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutAliasAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RefreshResponse Refresh(Action configureRequest) { - var descriptor = new PutAliasRequestDescriptor(indices, name); + var descriptor = new RefreshRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, PutAliasResponse, PutAliasRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequest request) + public virtual Task RefreshAsync(CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new RefreshRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequest request, CancellationToken cancellationToken = default) + public virtual Task RefreshAsync(RefreshRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Performs the refresh operation in one or more indices. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name) + public virtual Task RefreshAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new PutDataLifecycleRequestDescriptor(name); + var descriptor = new RefreshRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutDataLifecycleResponse PutDataLifecycle(PutDataLifecycleRequestDescriptor descriptor) + public virtual ReloadSearchAnalyzersResponse ReloadSearchAnalyzers(ReloadSearchAnalyzersRequest request) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutDataLifecycleResponse PutDataLifecycle(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest) + public virtual Task ReloadSearchAnalyzersAsync(ReloadSearchAnalyzersRequest request, CancellationToken cancellationToken = default) { - var descriptor = new PutDataLifecycleRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSearchAnalyzersResponse ReloadSearchAnalyzers(Elastic.Clients.Elasticsearch.Indices indices) { - var descriptor = new PutDataLifecycleRequestDescriptor(name); + var descriptor = new ReloadSearchAnalyzersRequestDescriptor(indices); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutDataLifecycleAsync(PutDataLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSearchAnalyzersResponse ReloadSearchAnalyzers(ReloadSearchAnalyzersRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Updates the data stream lifecycle of the selected data streams. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutDataLifecycleAsync(Elastic.Clients.Elasticsearch.DataStreamNames name, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSearchAnalyzersResponse ReloadSearchAnalyzers(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { - var descriptor = new PutDataLifecycleRequestDescriptor(name); + var descriptor = new ReloadSearchAnalyzersRequestDescriptor(indices); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequest request) + public virtual Task ReloadSearchAnalyzersAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new ReloadSearchAnalyzersRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequest request, CancellationToken cancellationToken = default) + public virtual Task ReloadSearchAnalyzersAsync(ReloadSearchAnalyzersRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Reloads an index's search analyzers and their resources. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) + public virtual Task ReloadSearchAnalyzersAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new ReloadSearchAnalyzersRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + public virtual ResolveClusterResponse ResolveCluster(ResolveClusterRequest request) { - var descriptor = new PutIndexTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutIndexTemplateResponse PutIndexTemplate(PutIndexTemplateRequestDescriptor descriptor) + public virtual Task ResolveClusterAsync(ResolveClusterRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutIndexTemplateResponse PutIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveClusterResponse ResolveCluster(Elastic.Clients.Elasticsearch.Names name) { - var descriptor = new PutIndexTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); + var descriptor = new ResolveClusterRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveClusterResponse ResolveCluster(ResolveClusterRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveClusterResponse ResolveCluster(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new PutIndexTemplateRequestDescriptor(name); + var descriptor = new ResolveClusterRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutIndexTemplateAsync(PutIndexTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ResolveClusterAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) { + var descriptor = new ResolveClusterRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutIndexTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task ResolveClusterAsync(ResolveClusterRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new PutIndexTemplateRequestDescriptor(name); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, PutIndexTemplateResponse, PutIndexTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(PutMappingRequest request) + public virtual Task ResolveClusterAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new ResolveClusterRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(PutMappingRequest request, CancellationToken cancellationToken = default) + public virtual ResolveIndexResponse ResolveIndex(ResolveIndexRequest request) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + return DoRequest(request); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + public virtual Task ResolveIndexAsync(ResolveIndexRequest request, CancellationToken cancellationToken = default) { - descriptor.BeforeRequest(); - return DoRequest(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveIndexResponse ResolveIndex(Elastic.Clients.Elasticsearch.Names name) { - var descriptor = new PutMappingRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); + var descriptor = new ResolveIndexRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(PutMappingRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveIndexResponse ResolveIndex(ResolveIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual PutMappingResponse PutMapping(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResolveIndexResponse ResolveIndex(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) { - var descriptor = new PutMappingRequestDescriptor(indices); + var descriptor = new ResolveIndexRequestDescriptor(name); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, PutMappingResponse, PutMappingRequestParameters>(descriptor); + return DoRequest(descriptor); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ResolveIndexAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) { + var descriptor = new ResolveIndexRequestDescriptor(name); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ResolveIndexAsync(ResolveIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new PutMappingRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns information about any matching indices, aliases, and data streams + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task PutMappingAsync(PutMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ResolveIndexAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) { + var descriptor = new ResolveIndexRequestDescriptor(name); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Updates the index mappings. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutMappingAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual RolloverResponse Rollover(RolloverRequest request) { - var descriptor = new PutMappingRequestDescriptor(indices); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, PutMappingResponse, PutMappingRequestParameters>(descriptor, cancellationToken); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateResponse PutTemplate(PutTemplateRequest request) + public virtual Task RolloverAsync(RolloverRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequest(request); + return DoRequestAsync(request, cancellationToken); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateAsync(PutTemplateRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + var descriptor = new RolloverRequestDescriptor(alias); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateResponse PutTemplate(PutTemplateRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateResponse PutTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest) { - var descriptor = new PutTemplateRequestDescriptor(name); + var descriptor = new RolloverRequestDescriptor(alias); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequest(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateAsync(PutTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, RolloverResponse, RolloverRequestParameters>(descriptor); } /// - /// Creates or updates an index template. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 PutTemplateAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias, Action> configureRequest) { - var descriptor = new PutTemplateRequestDescriptor(name); + var descriptor = new RolloverRequestDescriptor(alias); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, RolloverResponse, RolloverRequestParameters>(descriptor); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 RefreshResponse Refresh(RefreshRequest request) + public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequest(request); + var descriptor = new RolloverRequestDescriptor(alias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 RefreshAsync(RefreshRequest request, CancellationToken cancellationToken = default) + public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 RefreshResponse Refresh() + public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new RolloverRequestDescriptor(alias); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 RefreshResponse Refresh(RefreshRequestDescriptor descriptor) + public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, RolloverResponse, RolloverRequestParameters>(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 RefreshResponse Refresh(Action configureRequest) + public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new RolloverRequestDescriptor(alias); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + return DoRequestAsync, RolloverResponse, RolloverRequestParameters>(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(RefreshRequestDescriptor descriptor) + public virtual SegmentsResponse Segments(SegmentsRequest request) { - descriptor.BeforeRequest(); - return DoRequest, RefreshResponse, RefreshRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequest(request); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual RefreshResponse Refresh(Action> configureRequest) + public virtual Task SegmentsAsync(SegmentsRequest request, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, RefreshResponse, RefreshRequestParameters>(descriptor); + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SegmentsResponse Segments() { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new SegmentsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(RefreshRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SegmentsResponse Segments(SegmentsRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SegmentsResponse Segments(Action configureRequest) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new SegmentsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(RefreshRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task SegmentsAsync(CancellationToken cancellationToken = default) { + var descriptor = new SegmentsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, RefreshResponse, RefreshRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Performs the refresh operation in one or more indices. - /// Learn more about this API in the Elasticsearch documentation. + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SegmentsAsync(SegmentsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Provides low-level information about segments in a Lucene index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RefreshAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task SegmentsAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RefreshRequestDescriptor(); + var descriptor = new SegmentsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, RefreshResponse, RefreshRequestParameters>(descriptor, cancellationToken); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(RolloverRequest request) + public virtual ShardStoresResponse ShardStores(ShardStoresRequest request) { request.BeforeRequest(); - return DoRequest(request); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(RolloverRequest request, CancellationToken cancellationToken = default) + public virtual Task ShardStoresAsync(ShardStoresRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ShardStoresResponse ShardStores() { - var descriptor = new RolloverRequestDescriptor(alias); + var descriptor = new ShardStoresRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(RolloverRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ShardStoresResponse ShardStores(ShardStoresRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual RolloverResponse Rollover(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ShardStoresResponse ShardStores(Action configureRequest) { - var descriptor = new RolloverRequestDescriptor(alias); + var descriptor = new ShardStoresRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest(descriptor); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, CancellationToken cancellationToken = default) + public virtual Task ShardStoresAsync(CancellationToken cancellationToken = default) { - var descriptor = new RolloverRequestDescriptor(alias); + var descriptor = new ShardStoresRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(RolloverRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task ShardStoresAsync(ShardStoresRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + 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. + /// Provides store information for shard copies of indices. + /// Learn more about this API in the Elasticsearch documentation. ///
- public virtual Task RolloverAsync(Elastic.Clients.Elasticsearch.IndexAlias alias, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ShardStoresAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RolloverRequestDescriptor(alias); + var descriptor = new ShardStoresRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) { @@ -3964,7 +4913,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) { @@ -3974,8 +4923,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target) { var descriptor = new ShrinkIndexRequestDescriptor(index, target); @@ -3985,8 +4935,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3995,8 +4946,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest) { var descriptor = new ShrinkIndexRequestDescriptor(index, target); @@ -4007,31 +4959,9 @@ 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. - /// - public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName target) - { - var descriptor = new ShrinkIndexRequestDescriptor(typeof(TDocument), target); - descriptor.BeforeRequest(); - return DoRequest, ShrinkIndexResponse, ShrinkIndexRequestParameters>(descriptor); - } - - /// - /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) - { - var descriptor = new ShrinkIndexRequestDescriptor(typeof(TDocument), target); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ShrinkIndexResponse, ShrinkIndexRequestParameters>(descriptor); - } - - /// - /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ShrinkIndexResponse Shrink(ShrinkIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4040,8 +4970,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ShrinkIndexResponse Shrink(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { var descriptor = new ShrinkIndexRequestDescriptor(index, target); @@ -4052,7 +4983,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) { @@ -4063,7 +4994,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) { @@ -4073,42 +5004,19 @@ 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. - /// - public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new ShrinkIndexRequestDescriptor(index, target); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); - } - - /// - /// Allow to shrink an existing index into a new index with fewer primary shards. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) - { - var descriptor = new ShrinkIndexRequestDescriptor(typeof(TDocument), target); - descriptor.BeforeRequest(); - return DoRequestAsync, ShrinkIndexResponse, ShrinkIndexRequestParameters>(descriptor, cancellationToken); - } - - /// - /// 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) + public virtual Task ShrinkAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ShrinkIndexRequestDescriptor(typeof(TDocument), target); + var descriptor = new ShrinkIndexRequestDescriptor(index, target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ShrinkIndexResponse, ShrinkIndexRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) { @@ -4118,7 +5026,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) { @@ -4152,6 +5060,7 @@ public virtual Task SimulateIndexTemplateAsync(Si /// Simulate matching the given index name against the index templates in the system /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Name name) { var descriptor = new SimulateIndexTemplateRequestDescriptor(name); @@ -4163,6 +5072,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clien /// Simulate matching the given index name against the index templates in the system /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4173,6 +5083,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndex /// Simulate matching the given index name against the index templates in the system /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) { var descriptor = new SimulateIndexTemplateRequestDescriptor(name); @@ -4185,6 +5096,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clien /// Simulate matching the given index name against the index templates in the system /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(SimulateIndexTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4195,6 +5107,7 @@ public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Si /// Simulate matching the given index name against the index templates in the system /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateIndexTemplateResponse SimulateIndexTemplate(Elastic.Clients.Elasticsearch.Name name, Action> configureRequest) { var descriptor = new SimulateIndexTemplateRequestDescriptor(name); @@ -4282,6 +5195,7 @@ public virtual Task SimulateTemplateAsync(SimulateTemp /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateTemplateResponse SimulateTemplate() { var descriptor = new SimulateTemplateRequestDescriptor(); @@ -4293,6 +5207,7 @@ public virtual SimulateTemplateResponse SimulateTemplate() /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4303,6 +5218,7 @@ public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequest /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateTemplateResponse SimulateTemplate(Action configureRequest) { var descriptor = new SimulateTemplateRequestDescriptor(); @@ -4311,6 +5227,30 @@ public virtual SimulateTemplateResponse SimulateTemplate(Action(descriptor); } + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SimulateTemplateResponse SimulateTemplate(SimulateTemplateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SimulateTemplateResponse, SimulateTemplateRequestParameters>(descriptor); + } + + /// + /// Simulate resolving the given template name or body + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SimulateTemplateResponse SimulateTemplate(Action> configureRequest) + { + var descriptor = new SimulateTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SimulateTemplateResponse, SimulateTemplateRequestParameters>(descriptor); + } + /// /// Simulate resolving the given template name or body /// Learn more about this API in the Elasticsearch documentation. @@ -4344,9 +5284,31 @@ public virtual Task SimulateTemplateAsync(Action(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, SimulateTemplateResponse, SimulateTemplateRequestParameters>(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, SimulateTemplateResponse, SimulateTemplateRequestParameters>(descriptor, cancellationToken); + } + /// /// 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) { @@ -4356,7 +5318,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) { @@ -4366,8 +5328,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target) { var descriptor = new SplitIndexRequestDescriptor(index, target); @@ -4377,8 +5340,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4387,8 +5351,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest) { var descriptor = new SplitIndexRequestDescriptor(index, target); @@ -4399,22 +5364,23 @@ 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SplitIndexResponse Split(SplitIndexRequestDescriptor descriptor) { - var descriptor = new SplitIndexRequestDescriptor(typeof(TDocument), target); descriptor.BeforeRequest(); return DoRequest, SplitIndexResponse, SplitIndexRequestParameters>(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 target, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SplitIndexResponse Split(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest) { - var descriptor = new SplitIndexRequestDescriptor(typeof(TDocument), target); + var descriptor = new SplitIndexRequestDescriptor(index, target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest, SplitIndexResponse, SplitIndexRequestParameters>(descriptor); @@ -4422,102 +5388,192 @@ 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) + public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) { + var descriptor = new SplitIndexRequestDescriptor(index, target); descriptor.BeforeRequest(); - return DoRequest, SplitIndexResponse, SplitIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task SplitAsync(SplitIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new SplitIndexRequestDescriptor(index, target); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, SplitIndexResponse, SplitIndexRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new SplitIndexRequestDescriptor(index, target); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } /// /// 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) + public virtual Task SplitAsync(SplitIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); } /// /// 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) + public virtual Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SplitIndexRequestDescriptor(index, target); + var descriptor = new SplitIndexRequestDescriptor(index, target); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); } /// - /// Allows you to split an existing index into a new index with more primary shards. - /// Learn more about this API in the Elasticsearch documentation. + /// 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 Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName target, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual IndicesStatsResponse Stats() { - var descriptor = new SplitIndexRequestDescriptor(typeof(TDocument), target); + var descriptor = new IndicesStatsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(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. + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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 Task SplitAsync(Elastic.Clients.Elasticsearch.IndexName target, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual IndicesStatsResponse Stats(Action configureRequest) { - var descriptor = new SplitIndexRequestDescriptor(typeof(TDocument), target); + var descriptor = new IndicesStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest(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. + /// Provides statistics on operations happening in an index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task SplitAsync(SplitIndexRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual IndicesStatsResponse Stats(IndicesStatsRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); + return DoRequest, IndicesStatsResponse, IndicesStatsRequestParameters>(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. + /// Provides statistics on operations happening in an index. + /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual IndicesStatsResponse Stats(Action> configureRequest) { - var descriptor = new SplitIndexRequestDescriptor(index, target); + var descriptor = new IndicesStatsRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, SplitIndexResponse, SplitIndexRequestParameters>(descriptor, cancellationToken); + 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); } /// @@ -4544,6 +5600,7 @@ public virtual Task UpdateAliasesAsync(UpdateAliasesReque /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4554,6 +5611,7 @@ public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescripto /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateAliasesResponse UpdateAliases(Action configureRequest) { var descriptor = new UpdateAliasesRequestDescriptor(); @@ -4566,6 +5624,7 @@ public virtual UpdateAliasesResponse UpdateAliases(ActionUpdates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4576,6 +5635,7 @@ public virtual UpdateAliasesResponse UpdateAliases(UpdateAliasesReque /// Updates index aliases. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateAliasesResponse UpdateAliases(Action> configureRequest) { var descriptor = new UpdateAliasesRequestDescriptor(); @@ -4627,4 +5687,139 @@ public virtual Task UpdateAliasesAsync(Action< descriptor.BeforeRequest(); return DoRequestAsync, UpdateAliasesResponse, UpdateAliasesRequestParameters>(descriptor, cancellationToken); } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ValidateQueryResponse ValidateQuery(ValidateQueryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(ValidateQueryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateQueryResponse ValidateQuery() + { + var descriptor = new ValidateQueryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateQueryResponse ValidateQuery(ValidateQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateQueryResponse ValidateQuery(Action configureRequest) + { + var descriptor = new ValidateQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateQueryResponse ValidateQuery(ValidateQueryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ValidateQueryResponse, ValidateQueryRequestParameters>(descriptor); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateQueryResponse ValidateQuery(Action> configureRequest) + { + var descriptor = new ValidateQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ValidateQueryResponse, ValidateQueryRequestParameters>(descriptor); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ValidateQueryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(ValidateQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(ValidateQueryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateQueryResponse, ValidateQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows a user to validate a potentially expensive query without executing it. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateQueryAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateQueryResponse, ValidateQueryRequestParameters>(descriptor, cancellationToken); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs new file mode 100644 index 00000000000..a19b9841c29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs @@ -0,0 +1,372 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Inference; + +public partial class InferenceNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected InferenceNamespacedClient() : base() + { + } + + internal InferenceNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteModelResponse DeleteModel(DeleteModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelAsync(DeleteModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelResponse DeleteModel(Elastic.Clients.Elasticsearch.Id inferenceId) + { + var descriptor = new DeleteModelRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelResponse DeleteModel(DeleteModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelResponse DeleteModel(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + { + var descriptor = new DeleteModelRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelAsync(DeleteModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Delete model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetModelResponse GetModel(GetModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelAsync(GetModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Id inferenceId) + { + var descriptor = new GetModelRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelResponse GetModel(GetModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelResponse GetModel(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + { + var descriptor = new GetModelRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelAsync(GetModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Get a model in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelAsync(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InferenceResponse Inference(InferenceRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferenceAsync(InferenceRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferenceResponse Inference(Elastic.Clients.Elasticsearch.Id inferenceId) + { + var descriptor = new InferenceRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferenceResponse Inference(InferenceRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferenceResponse Inference(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + { + var descriptor = new InferenceRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferenceAsync(Elastic.Clients.Elasticsearch.Id inferenceId, CancellationToken cancellationToken = default) + { + var descriptor = new InferenceRequestDescriptor(inferenceId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferenceAsync(InferenceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Perform inference on a model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferenceAsync(Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InferenceRequestDescriptor(inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutModelResponse PutModel(PutModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutModelAsync(PutModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutModelResponse PutModel(PutModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutModelResponse PutModel(Elastic.Clients.Elasticsearch.Inference.ModelConfig modelConfig, Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest) + { + var descriptor = new PutModelRequestDescriptor(modelConfig, inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutModelAsync(PutModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Configure a model for use in the Inference API + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutModelAsync(Elastic.Clients.Elasticsearch.Inference.ModelConfig modelConfig, Elastic.Clients.Elasticsearch.Id inferenceId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutModelRequestDescriptor(modelConfig, inferenceId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file 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 9a244cf31b9..7e9dd991411 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ingest.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public partial class IngestNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected IngestNamespacedClient() : base() { @@ -60,6 +61,7 @@ public virtual Task DeletePipelineAsync(DeletePipelineRe /// Deletes a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new DeletePipelineRequestDescriptor(id); @@ -71,6 +73,7 @@ public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsear /// Deletes a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePipelineResponse DeletePipeline(DeletePipelineRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -81,6 +84,7 @@ public virtual DeletePipelineResponse DeletePipeline(DeletePipelineRequestDescri /// Deletes a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new DeletePipelineRequestDescriptor(id); @@ -89,28 +93,6 @@ public virtual DeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsear 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.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. @@ -144,31 +126,9 @@ public virtual Task DeletePipelineAsync(Elastic.Clients. 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.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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequest request) { @@ -178,7 +138,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,8 +148,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GeoIpStatsResponse GeoIpStats() { var descriptor = new GeoIpStatsRequestDescriptor(); @@ -199,8 +160,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GeoIpStatsResponse GeoIpStats(GeoIpStatsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -209,8 +171,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GeoIpStatsResponse GeoIpStats(Action configureRequest) { var descriptor = new GeoIpStatsRequestDescriptor(); @@ -221,7 +184,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 +195,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 +205,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) { @@ -276,6 +239,7 @@ public virtual Task GetPipelineAsync(GetPipelineRequest req /// Returns a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPipelineResponse GetPipeline() { var descriptor = new GetPipelineRequestDescriptor(); @@ -287,6 +251,7 @@ public virtual GetPipelineResponse GetPipeline() /// Returns a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPipelineResponse GetPipeline(GetPipelineRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -297,6 +262,7 @@ public virtual GetPipelineResponse GetPipeline(GetPipelineRequestDescriptor desc /// Returns a pipeline. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetPipelineResponse GetPipeline(Action configureRequest) { var descriptor = new GetPipelineRequestDescriptor(); @@ -305,28 +271,6 @@ public virtual GetPipelineResponse GetPipeline(Action(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. @@ -360,31 +304,9 @@ public virtual Task GetPipelineAsync(Action(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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequest request) { @@ -394,7 +316,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,8 +326,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ProcessorGrokResponse ProcessorGrok() { var descriptor = new ProcessorGrokRequestDescriptor(); @@ -415,8 +338,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ProcessorGrokResponse ProcessorGrok(ProcessorGrokRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -425,8 +349,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ProcessorGrokResponse ProcessorGrok(Action configureRequest) { var descriptor = new ProcessorGrokRequestDescriptor(); @@ -437,7 +362,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 +373,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 +383,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 +395,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 +405,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,8 +415,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -500,8 +426,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new PutPipelineRequestDescriptor(id); @@ -512,8 +439,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPipelineResponse PutPipeline(PutPipelineRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -522,8 +450,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new PutPipelineRequestDescriptor(id); @@ -534,7 +463,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 +473,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 +485,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 +495,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) { @@ -600,6 +529,7 @@ public virtual Task SimulateAsync(SimulateRequest request, Can /// Allows to simulate a pipeline with example documents. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateResponse Simulate() { var descriptor = new SimulateRequestDescriptor(); @@ -611,6 +541,7 @@ public virtual SimulateResponse Simulate() /// Allows to simulate a pipeline with example documents. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateResponse Simulate(SimulateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -621,6 +552,7 @@ public virtual SimulateResponse Simulate(SimulateRequestDescriptor descriptor) /// Allows to simulate a pipeline with example documents. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateResponse Simulate(Action configureRequest) { var descriptor = new SimulateRequestDescriptor(); @@ -633,6 +565,7 @@ public virtual SimulateResponse Simulate(Action confi /// Allows to simulate a pipeline with example documents. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateResponse Simulate(SimulateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -643,6 +576,7 @@ public virtual SimulateResponse Simulate(SimulateRequestDescriptorAllows to simulate a pipeline with example documents. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SimulateResponse Simulate(Action> configureRequest) { var descriptor = new SimulateRequestDescriptor(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.License.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.License.g.cs new file mode 100644 index 00000000000..0208284f131 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.License.g.cs @@ -0,0 +1,662 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public partial class LicenseManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected LicenseManagementNamespacedClient() : base() + { + } + + internal LicenseManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteLicenseResponse Delete(DeleteLicenseRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteLicenseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLicenseResponse Delete() + { + var descriptor = new DeleteLicenseRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLicenseResponse Delete(DeleteLicenseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLicenseResponse Delete(Action configureRequest) + { + var descriptor = new DeleteLicenseRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLicenseRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteLicenseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLicenseRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetLicenseResponse Get(GetLicenseRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetLicenseRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLicenseResponse Get() + { + var descriptor = new GetLicenseRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLicenseResponse Get(GetLicenseRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLicenseResponse Get(Action configureRequest) + { + var descriptor = new GetLicenseRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetLicenseRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetLicenseRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves licensing information for the cluster + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetLicenseRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetBasicStatusResponse GetBasicStatus(GetBasicStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBasicStatusAsync(GetBasicStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBasicStatusResponse GetBasicStatus() + { + var descriptor = new GetBasicStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBasicStatusResponse GetBasicStatus(GetBasicStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBasicStatusResponse GetBasicStatus(Action configureRequest) + { + var descriptor = new GetBasicStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBasicStatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetBasicStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBasicStatusAsync(GetBasicStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBasicStatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBasicStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTrialStatusResponse GetTrialStatus(GetTrialStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrialStatusAsync(GetTrialStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrialStatusResponse GetTrialStatus() + { + var descriptor = new GetTrialStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrialStatusResponse GetTrialStatus(GetTrialStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrialStatusResponse GetTrialStatus(Action configureRequest) + { + var descriptor = new GetTrialStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrialStatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTrialStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrialStatusAsync(GetTrialStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the status of the trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrialStatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTrialStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostResponse Post(PostRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostAsync(PostRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostResponse Post() + { + var descriptor = new PostRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostResponse Post(PostRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostResponse Post(Action configureRequest) + { + var descriptor = new PostRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PostRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostAsync(PostRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the license for the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostStartBasicResponse PostStartBasic(PostStartBasicRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartBasicAsync(PostStartBasicRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartBasicResponse PostStartBasic() + { + var descriptor = new PostStartBasicRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartBasicResponse PostStartBasic(PostStartBasicRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartBasicResponse PostStartBasic(Action configureRequest) + { + var descriptor = new PostStartBasicRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartBasicAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PostStartBasicRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartBasicAsync(PostStartBasicRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts an indefinite basic license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartBasicAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostStartBasicRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostStartTrialResponse PostStartTrial(PostStartTrialRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartTrialAsync(PostStartTrialRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartTrialResponse PostStartTrial() + { + var descriptor = new PostStartTrialRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartTrialResponse PostStartTrial(PostStartTrialRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostStartTrialResponse PostStartTrial(Action configureRequest) + { + var descriptor = new PostStartTrialRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartTrialAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PostStartTrialRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartTrialAsync(PostStartTrialRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// starts a limited time trial license. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostStartTrialAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostStartTrialRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs new file mode 100644 index 00000000000..6c0850f7799 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs @@ -0,0 +1,6637 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public partial class MachineLearningNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected MachineLearningNamespacedClient() : base() + { + } + + internal MachineLearningNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearTrainedModelDeploymentCacheResponse ClearTrainedModelDeploymentCache(ClearTrainedModelDeploymentCacheRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(ClearTrainedModelDeploymentCacheRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearTrainedModelDeploymentCacheResponse ClearTrainedModelDeploymentCache(Elastic.Clients.Elasticsearch.Id modelId) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearTrainedModelDeploymentCacheResponse ClearTrainedModelDeploymentCache(ClearTrainedModelDeploymentCacheRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearTrainedModelDeploymentCacheResponse ClearTrainedModelDeploymentCache(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(Elastic.Clients.Elasticsearch.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(ClearTrainedModelDeploymentCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cached results from a trained model deployment + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearTrainedModelDeploymentCacheAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClearTrainedModelDeploymentCacheRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloseJobResponse CloseJob(CloseJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(CloseJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseJobResponse CloseJob(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseJobResponse CloseJob(CloseJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloseJobResponse CloseJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(CloseJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloseJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloseJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarResponse DeleteCalendar(DeleteCalendarRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(DeleteCalendarRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarResponse DeleteCalendar(Elastic.Clients.Elasticsearch.Id calendarId) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarResponse DeleteCalendar(DeleteCalendarRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarResponse DeleteCalendar(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(Elastic.Clients.Elasticsearch.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(DeleteCalendarRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarAsync(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarEventResponse DeleteCalendarEvent(DeleteCalendarEventRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(DeleteCalendarEventRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarEventResponse DeleteCalendarEvent(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarEventResponse DeleteCalendarEvent(DeleteCalendarEventRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarEventResponse DeleteCalendarEvent(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId, Action configureRequest) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(DeleteCalendarEventRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes scheduled events from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarEventAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id eventId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarEventRequestDescriptor(calendarId, eventId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteCalendarJobResponse DeleteCalendarJob(DeleteCalendarJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(DeleteCalendarJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarJobResponse DeleteCalendarJob(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarJobResponse DeleteCalendarJob(DeleteCalendarJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteCalendarJobResponse DeleteCalendarJob(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId, Action configureRequest) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(DeleteCalendarJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes anomaly detection jobs from a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteCalendarJobAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Ids jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDatafeedResponse DeleteDatafeed(DeleteDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(DeleteDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDatafeedResponse DeleteDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDatafeedResponse DeleteDatafeed(DeleteDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDatafeedResponse DeleteDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(DeleteDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteDataFrameAnalyticsResponse DeleteDataFrameAnalytics(DeleteDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(DeleteDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataFrameAnalyticsResponse DeleteDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataFrameAnalyticsResponse DeleteDataFrameAnalytics(DeleteDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteDataFrameAnalyticsResponse DeleteDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(DeleteDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteExpiredDataResponse DeleteExpiredData(DeleteExpiredDataRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(DeleteExpiredDataRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteExpiredDataResponse DeleteExpiredData() + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteExpiredDataResponse DeleteExpiredData(DeleteExpiredDataRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteExpiredDataResponse DeleteExpiredData(Action configureRequest) + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(CancellationToken cancellationToken = default) + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(DeleteExpiredDataRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes expired and unused machine learning data. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteExpiredDataAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteExpiredDataRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteFilterResponse DeleteFilter(DeleteFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(DeleteFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteFilterResponse DeleteFilter(Elastic.Clients.Elasticsearch.Id filterId) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteFilterResponse DeleteFilter(DeleteFilterRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteFilterResponse DeleteFilter(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(Elastic.Clients.Elasticsearch.Id filterId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(DeleteFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteFilterAsync(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteForecastResponse DeleteForecast(DeleteForecastRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(DeleteForecastRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteForecastResponse DeleteForecast(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteForecastResponse DeleteForecast(DeleteForecastRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteForecastResponse DeleteForecast(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(DeleteForecastRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes forecasts from a machine learning job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteForecastAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteJobResponse DeleteJob(DeleteJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(DeleteJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteModelSnapshotResponse DeleteModelSnapshot(DeleteModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(DeleteModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelSnapshotResponse DeleteModelSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelSnapshotResponse DeleteModelSnapshot(DeleteModelSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteModelSnapshotResponse DeleteModelSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(DeleteModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing model snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteModelSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTrainedModelResponse DeleteTrainedModel(DeleteTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(DeleteTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelResponse DeleteTrainedModel(Elastic.Clients.Elasticsearch.Id modelId) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelResponse DeleteTrainedModel(DeleteTrainedModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelResponse DeleteTrainedModel(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(DeleteTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTrainedModelAliasResponse DeleteTrainedModelAlias(DeleteTrainedModelAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(DeleteTrainedModelAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelAliasResponse DeleteTrainedModelAlias(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelAliasResponse DeleteTrainedModelAlias(DeleteTrainedModelAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTrainedModelAliasResponse DeleteTrainedModelAlias(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, Action configureRequest) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(DeleteTrainedModelAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a model alias that refers to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EstimateModelMemoryResponse EstimateModelMemory(EstimateModelMemoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EstimateModelMemoryResponse EstimateModelMemory(EstimateModelMemoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EstimateModelMemoryResponse EstimateModelMemory(Action configureRequest) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EstimateModelMemoryResponse EstimateModelMemory(EstimateModelMemoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EstimateModelMemoryResponse EstimateModelMemory(Action> configureRequest) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(EstimateModelMemoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Estimates the model memory + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EstimateModelMemoryAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EstimateModelMemoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, EstimateModelMemoryResponse, EstimateModelMemoryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual EvaluateDataFrameResponse EvaluateDataFrame(EvaluateDataFrameRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EvaluateDataFrameResponse EvaluateDataFrame(EvaluateDataFrameRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EvaluateDataFrameResponse EvaluateDataFrame(Action configureRequest) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EvaluateDataFrameResponse EvaluateDataFrame(EvaluateDataFrameRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual EvaluateDataFrameResponse EvaluateDataFrame(Action> configureRequest) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(EvaluateDataFrameRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluates the data frame analytics for an annotated index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task EvaluateDataFrameAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new EvaluateDataFrameRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, EvaluateDataFrameResponse, EvaluateDataFrameRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(ExplainDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics() + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(ExplainDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(Action configureRequest) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(ExplainDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExplainDataFrameAnalyticsResponse ExplainDataFrameAnalytics(Action> configureRequest) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(ExplainDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Explains a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExplainDataFrameAnalyticsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExplainDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ExplainDataFrameAnalyticsResponse, ExplainDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual FlushJobResponse FlushJob(FlushJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(FlushJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushJobResponse FlushJob(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushJobResponse FlushJob(FlushJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual FlushJobResponse FlushJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(FlushJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Forces any buffered data to be processed by the job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task FlushJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new FlushJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ForecastResponse Forecast(ForecastRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(ForecastRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForecastResponse Forecast(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new ForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForecastResponse Forecast(ForecastRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ForecastResponse Forecast(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new ForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new ForecastRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(ForecastRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Predicts the future behavior of a time series by using its historical behavior. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ForecastAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ForecastRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetBucketsResponse GetBuckets(GetBucketsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBucketsResponse GetBuckets(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBucketsResponse GetBuckets(GetBucketsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBucketsResponse GetBuckets(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBucketsResponse GetBuckets(GetBucketsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetBucketsResponse, GetBucketsRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBucketsResponse GetBuckets(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetBucketsResponse, GetBucketsRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(GetBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetBucketsResponse, GetBucketsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more buckets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBucketsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetBucketsResponse, GetBucketsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCalendarEventsResponse GetCalendarEvents(GetCalendarEventsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(GetCalendarEventsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarEventsResponse GetCalendarEvents(Elastic.Clients.Elasticsearch.Id calendarId) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarEventsResponse GetCalendarEvents(GetCalendarEventsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarEventsResponse GetCalendarEvents(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(Elastic.Clients.Elasticsearch.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(GetCalendarEventsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the scheduled events in calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarEventsAsync(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCalendarsResponse GetCalendars(GetCalendarsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(GetCalendarsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarsResponse GetCalendars() + { + var descriptor = new GetCalendarsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarsResponse GetCalendars(GetCalendarsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCalendarsResponse GetCalendars(Action configureRequest) + { + var descriptor = new GetCalendarsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(GetCalendarsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for calendars. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCalendarsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCalendarsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetCategoriesResponse GetCategories(GetCategoriesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(GetCategoriesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCategoriesResponse GetCategories(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCategoriesResponse GetCategories(GetCategoriesRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetCategoriesResponse GetCategories(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(GetCategoriesRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more categories. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetCategoriesAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetCategoriesRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDatafeedsResponse GetDatafeeds(GetDatafeedsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(GetDatafeedsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedsResponse GetDatafeeds() + { + var descriptor = new GetDatafeedsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedsResponse GetDatafeeds(GetDatafeedsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedsResponse GetDatafeeds(Action configureRequest) + { + var descriptor = new GetDatafeedsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(GetDatafeedsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDatafeedStatsResponse GetDatafeedStats(GetDatafeedStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(GetDatafeedStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedStatsResponse GetDatafeedStats() + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedStatsResponse GetDatafeedStats(GetDatafeedStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDatafeedStatsResponse GetDatafeedStats(Action configureRequest) + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(GetDatafeedStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDatafeedStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDatafeedStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataFrameAnalyticsResponse GetDataFrameAnalytics(GetDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(GetDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsResponse GetDataFrameAnalytics() + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsResponse GetDataFrameAnalytics(GetDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsResponse GetDataFrameAnalytics(Action configureRequest) + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(GetDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetDataFrameAnalyticsStatsResponse GetDataFrameAnalyticsStats(GetDataFrameAnalyticsStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(GetDataFrameAnalyticsStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsStatsResponse GetDataFrameAnalyticsStats() + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsStatsResponse GetDataFrameAnalyticsStats(GetDataFrameAnalyticsStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetDataFrameAnalyticsStatsResponse GetDataFrameAnalyticsStats(Action configureRequest) + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(GetDataFrameAnalyticsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetDataFrameAnalyticsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetDataFrameAnalyticsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetFiltersResponse GetFilters(GetFiltersRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(GetFiltersRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFiltersResponse GetFilters() + { + var descriptor = new GetFiltersRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFiltersResponse GetFilters(GetFiltersRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetFiltersResponse GetFilters(Action configureRequest) + { + var descriptor = new GetFiltersRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetFiltersRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(GetFiltersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves filters. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetFiltersAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetFiltersRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetInfluencersResponse GetInfluencers(GetInfluencersRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetInfluencersResponse GetInfluencers(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetInfluencersResponse GetInfluencers(GetInfluencersRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetInfluencersResponse GetInfluencers(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetInfluencersResponse GetInfluencers(GetInfluencersRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetInfluencersResponse GetInfluencers(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(GetInfluencersRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly detection job results for one or more influencers. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetInfluencersAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetInfluencersRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetInfluencersResponse, GetInfluencersRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetJobsResponse GetJobs(GetJobsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs() + { + var descriptor = new GetJobsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs(GetJobsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs(Action configureRequest) + { + var descriptor = new GetJobsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetJobStatsResponse GetJobStats(GetJobStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(GetJobStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobStatsResponse GetJobStats() + { + var descriptor = new GetJobStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobStatsResponse GetJobStats(GetJobStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobStatsResponse GetJobStats(Action configureRequest) + { + var descriptor = new GetJobStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetJobStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(GetJobStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetJobStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetMemoryStatsResponse GetMemoryStats(GetMemoryStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(GetMemoryStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMemoryStatsResponse GetMemoryStats() + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMemoryStatsResponse GetMemoryStats(GetMemoryStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetMemoryStatsResponse GetMemoryStats(Action configureRequest) + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(GetMemoryStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information on how ML is using memory. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetMemoryStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetMemoryStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetModelSnapshotsResponse GetModelSnapshots(GetModelSnapshotsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotsResponse GetModelSnapshots(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotsResponse GetModelSnapshots(GetModelSnapshotsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotsResponse GetModelSnapshots(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotsResponse GetModelSnapshots(GetModelSnapshotsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotsResponse GetModelSnapshots(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(GetModelSnapshotsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves information about model snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetModelSnapshotsResponse, GetModelSnapshotsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetModelSnapshotUpgradeStatsResponse GetModelSnapshotUpgradeStats(GetModelSnapshotUpgradeStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(GetModelSnapshotUpgradeStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotUpgradeStatsResponse GetModelSnapshotUpgradeStats(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotUpgradeStatsResponse GetModelSnapshotUpgradeStats(GetModelSnapshotUpgradeStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetModelSnapshotUpgradeStatsResponse GetModelSnapshotUpgradeStats(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(GetModelSnapshotUpgradeStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Gets stats for anomaly detection job model snapshot upgrades that are in progress. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetModelSnapshotUpgradeStatsAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetModelSnapshotUpgradeStatsRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetOverallBucketsResponse GetOverallBuckets(GetOverallBucketsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(GetOverallBucketsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetOverallBucketsResponse GetOverallBuckets(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetOverallBucketsResponse GetOverallBuckets(GetOverallBucketsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetOverallBucketsResponse GetOverallBuckets(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(GetOverallBucketsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetOverallBucketsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetOverallBucketsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRecordsResponse GetRecords(GetRecordsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRecordsResponse GetRecords(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRecordsResponse GetRecords(GetRecordsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRecordsResponse GetRecords(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRecordsResponse GetRecords(GetRecordsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, GetRecordsResponse, GetRecordsRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRecordsResponse GetRecords(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, GetRecordsResponse, GetRecordsRequestParameters>(descriptor); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(GetRecordsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, GetRecordsResponse, GetRecordsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves anomaly records for an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRecordsAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRecordsRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, GetRecordsResponse, GetRecordsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTrainedModelsResponse GetTrainedModels(GetTrainedModelsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(GetTrainedModelsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsResponse GetTrainedModels() + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsResponse GetTrainedModels(GetTrainedModelsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsResponse GetTrainedModels(Action configureRequest) + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(GetTrainedModelsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for a trained inference model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTrainedModelsStatsResponse GetTrainedModelsStats(GetTrainedModelsStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(GetTrainedModelsStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsStatsResponse GetTrainedModelsStats() + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsStatsResponse GetTrainedModelsStats(GetTrainedModelsStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTrainedModelsStatsResponse GetTrainedModelsStats(Action configureRequest) + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(GetTrainedModelsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for trained inference models. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTrainedModelsStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTrainedModelsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual InferTrainedModelResponse InferTrainedModel(InferTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferTrainedModelResponse InferTrainedModel(InferTrainedModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferTrainedModelResponse InferTrainedModel(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferTrainedModelResponse InferTrainedModel(InferTrainedModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual InferTrainedModelResponse InferTrainedModel(Elastic.Clients.Elasticsearch.Id modelId, Action> configureRequest) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(InferTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Evaluate a trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InferTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new InferTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, InferTrainedModelResponse, InferTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MlInfoResponse Info(MlInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(MlInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MlInfoResponse Info() + { + var descriptor = new MlInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MlInfoResponse Info(MlInfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MlInfoResponse Info(Action configureRequest) + { + var descriptor = new MlInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new MlInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(MlInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns defaults and limits used by machine learning. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MlInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual OpenJobResponse OpenJob(OpenJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(OpenJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenJobResponse OpenJob(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenJobResponse OpenJob(OpenJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual OpenJobResponse OpenJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(OpenJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Opens one or more anomaly detection jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task OpenJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new OpenJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PostCalendarEventsResponse PostCalendarEvents(PostCalendarEventsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(PostCalendarEventsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostCalendarEventsResponse PostCalendarEvents(PostCalendarEventsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PostCalendarEventsResponse PostCalendarEvents(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest) + { + var descriptor = new PostCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(PostCalendarEventsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Posts scheduled events in a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PostCalendarEventsAsync(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PostCalendarEventsRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(PreviewDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics() + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(PreviewDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(Action configureRequest) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(PreviewDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewDataFrameAnalyticsResponse PreviewDataFrameAnalytics(Action> configureRequest) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(PreviewDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews that will be analyzed given a data frame analytics config. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PreviewDataFrameAnalyticsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewDataFrameAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewDataFrameAnalyticsResponse, PreviewDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutCalendarResponse PutCalendar(PutCalendarRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(PutCalendarRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarResponse PutCalendar(Elastic.Clients.Elasticsearch.Id calendarId) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarResponse PutCalendar(PutCalendarRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarResponse PutCalendar(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(Elastic.Clients.Elasticsearch.Id calendarId, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(PutCalendarRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarAsync(Elastic.Clients.Elasticsearch.Id calendarId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarRequestDescriptor(calendarId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutCalendarJobResponse PutCalendarJob(PutCalendarJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(PutCalendarJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarJobResponse PutCalendarJob(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarJobResponse PutCalendarJob(PutCalendarJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutCalendarJobResponse PutCalendarJob(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(PutCalendarJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Adds an anomaly detection job to a calendar. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutCalendarJobAsync(Elastic.Clients.Elasticsearch.Id calendarId, Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutCalendarJobRequestDescriptor(calendarId, jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDatafeedResponse PutDatafeed(PutDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDatafeedResponse PutDatafeed(PutDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDatafeedResponse PutDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDatafeedResponse PutDatafeed(PutDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDatafeedResponse PutDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action> configureRequest) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(PutDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutDatafeedResponse, PutDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(PutDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(PutDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(PutDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutDataFrameAnalyticsResponse PutDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(PutDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutDataFrameAnalyticsResponse, PutDataFrameAnalyticsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutFilterResponse PutFilter(PutFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(PutFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutFilterResponse PutFilter(PutFilterRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutFilterResponse PutFilter(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest) + { + var descriptor = new PutFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(PutFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a filter. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutFilterAsync(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutJobResponse PutJob(PutJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(PutJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(PutJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutJobResponse, PutJobRequestParameters>(descriptor); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutJobResponse, PutJobRequestParameters>(descriptor); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelResponse PutTrainedModel(PutTrainedModelRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelResponse PutTrainedModel(PutTrainedModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelResponse PutTrainedModel(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelResponse PutTrainedModel(PutTrainedModelRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelResponse PutTrainedModel(Elastic.Clients.Elasticsearch.Id modelId, Action> configureRequest) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(PutTrainedModelRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates an inference trained model. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAsync(Elastic.Clients.Elasticsearch.Id modelId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutTrainedModelResponse, PutTrainedModelRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelAliasResponse PutTrainedModelAlias(PutTrainedModelAliasRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(PutTrainedModelAliasRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelAliasResponse PutTrainedModelAlias(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelAliasResponse PutTrainedModelAlias(PutTrainedModelAliasRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelAliasResponse PutTrainedModelAlias(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, Action configureRequest) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(PutTrainedModelAliasRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a new model alias (or reassigns an existing one) to refer to the trained model + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelAliasAsync(Elastic.Clients.Elasticsearch.Id modelId, Elastic.Clients.Elasticsearch.Name modelAlias, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelAliasRequestDescriptor(modelId, modelAlias); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelDefinitionPartResponse PutTrainedModelDefinitionPart(PutTrainedModelDefinitionPartRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(PutTrainedModelDefinitionPartRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelDefinitionPartResponse PutTrainedModelDefinitionPart(PutTrainedModelDefinitionPartRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelDefinitionPartResponse PutTrainedModelDefinitionPart(Elastic.Clients.Elasticsearch.Id modelId, int part, Action configureRequest) + { + var descriptor = new PutTrainedModelDefinitionPartRequestDescriptor(modelId, part); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(PutTrainedModelDefinitionPartRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates part of a trained model definition + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelDefinitionPartAsync(Elastic.Clients.Elasticsearch.Id modelId, int part, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelDefinitionPartRequestDescriptor(modelId, part); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTrainedModelVocabularyResponse PutTrainedModelVocabulary(PutTrainedModelVocabularyRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(PutTrainedModelVocabularyRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelVocabularyResponse PutTrainedModelVocabulary(PutTrainedModelVocabularyRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTrainedModelVocabularyResponse PutTrainedModelVocabulary(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new PutTrainedModelVocabularyRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(PutTrainedModelVocabularyRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a trained model vocabulary + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTrainedModelVocabularyAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTrainedModelVocabularyRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResetJobResponse ResetJob(ResetJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(ResetJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetJobResponse ResetJob(Elastic.Clients.Elasticsearch.Id jobId) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetJobResponse ResetJob(ResetJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetJobResponse ResetJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(Elastic.Clients.Elasticsearch.Id jobId, CancellationToken cancellationToken = default) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(ResetJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResetJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RevertModelSnapshotResponse RevertModelSnapshot(RevertModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(RevertModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RevertModelSnapshotResponse RevertModelSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RevertModelSnapshotResponse RevertModelSnapshot(RevertModelSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RevertModelSnapshotResponse RevertModelSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(RevertModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reverts to a specific snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RevertModelSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RevertModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SetUpgradeModeResponse SetUpgradeMode(SetUpgradeModeRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(SetUpgradeModeRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SetUpgradeModeResponse SetUpgradeMode() + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SetUpgradeModeResponse SetUpgradeMode(SetUpgradeModeRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SetUpgradeModeResponse SetUpgradeMode(Action configureRequest) + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(SetUpgradeModeRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SetUpgradeModeAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SetUpgradeModeRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartDatafeedResponse StartDatafeed(StartDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(StartDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDatafeedResponse StartDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDatafeedResponse StartDatafeed(StartDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDatafeedResponse StartDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(StartDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartDataFrameAnalyticsResponse StartDataFrameAnalytics(StartDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(StartDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDataFrameAnalyticsResponse StartDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDataFrameAnalyticsResponse StartDataFrameAnalytics(StartDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartDataFrameAnalyticsResponse StartDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(StartDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartTrainedModelDeploymentResponse StartTrainedModelDeployment(StartTrainedModelDeploymentRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(StartTrainedModelDeploymentRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTrainedModelDeploymentResponse StartTrainedModelDeployment(Elastic.Clients.Elasticsearch.Id modelId) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTrainedModelDeploymentResponse StartTrainedModelDeployment(StartTrainedModelDeploymentRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTrainedModelDeploymentResponse StartTrainedModelDeployment(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(StartTrainedModelDeploymentRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Start a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopDatafeedResponse StopDatafeed(StopDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(StopDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDatafeedResponse StopDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDatafeedResponse StopDatafeed(StopDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDatafeedResponse StopDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, CancellationToken cancellationToken = default) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(StopDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more datafeeds. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopDataFrameAnalyticsResponse StopDataFrameAnalytics(StopDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(StopDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDataFrameAnalyticsResponse StopDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDataFrameAnalyticsResponse StopDataFrameAnalytics(StopDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopDataFrameAnalyticsResponse StopDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(StopDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more data frame analytics jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopTrainedModelDeploymentResponse StopTrainedModelDeployment(StopTrainedModelDeploymentRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(StopTrainedModelDeploymentRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTrainedModelDeploymentResponse StopTrainedModelDeployment(Elastic.Clients.Elasticsearch.Id modelId) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTrainedModelDeploymentResponse StopTrainedModelDeployment(StopTrainedModelDeploymentRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTrainedModelDeploymentResponse StopTrainedModelDeployment(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Id modelId, CancellationToken cancellationToken = default) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(StopTrainedModelDeploymentRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stop a trained model deployment. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTrainedModelDeploymentAsync(Elastic.Clients.Elasticsearch.Id modelId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopTrainedModelDeploymentRequestDescriptor(modelId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateDatafeedResponse UpdateDatafeed(UpdateDatafeedRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDatafeedResponse UpdateDatafeed(UpdateDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDatafeedResponse UpdateDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDatafeedResponse UpdateDatafeed(UpdateDatafeedRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDatafeedResponse UpdateDatafeed(Elastic.Clients.Elasticsearch.Id datafeedId, Action> configureRequest) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(UpdateDatafeedRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a datafeed. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDatafeedAsync(Elastic.Clients.Elasticsearch.Id datafeedId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDatafeedRequestDescriptor(datafeedId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateDatafeedResponse, UpdateDatafeedRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateDataFrameAnalyticsResponse UpdateDataFrameAnalytics(UpdateDataFrameAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(UpdateDataFrameAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDataFrameAnalyticsResponse UpdateDataFrameAnalytics(UpdateDataFrameAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateDataFrameAnalyticsResponse UpdateDataFrameAnalytics(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new UpdateDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(UpdateDataFrameAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a data frame analytics job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateDataFrameAnalyticsAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateDataFrameAnalyticsRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateFilterResponse UpdateFilter(UpdateFilterRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(UpdateFilterRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateFilterResponse UpdateFilter(UpdateFilterRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateFilterResponse UpdateFilter(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest) + { + var descriptor = new UpdateFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(UpdateFilterRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates the description of a filter, adds items, or removes items. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateFilterAsync(Elastic.Clients.Elasticsearch.Id filterId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateFilterRequestDescriptor(filterId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateJobResponse UpdateJob(UpdateJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateJobResponse UpdateJob(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateJobResponse UpdateJob(UpdateJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateJobResponse, UpdateJobRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateJobResponse UpdateJob(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateJobResponse, UpdateJobRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(UpdateJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateJobResponse, UpdateJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateJobAsync(Elastic.Clients.Elasticsearch.Id jobId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateJobRequestDescriptor(jobId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateJobResponse, UpdateJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateModelSnapshotResponse UpdateModelSnapshot(UpdateModelSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(UpdateModelSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateModelSnapshotResponse UpdateModelSnapshot(UpdateModelSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateModelSnapshotResponse UpdateModelSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest) + { + var descriptor = new UpdateModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(UpdateModelSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateModelSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateModelSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpgradeJobSnapshotResponse UpgradeJobSnapshot(UpgradeJobSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(UpgradeJobSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeJobSnapshotResponse UpgradeJobSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeJobSnapshotResponse UpgradeJobSnapshot(UpgradeJobSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeJobSnapshotResponse UpgradeJobSnapshot(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(UpgradeJobSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades a given job snapshot to the current major version. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeJobSnapshotAsync(Elastic.Clients.Elasticsearch.Id jobId, Elastic.Clients.Elasticsearch.Id snapshotId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeJobSnapshotRequestDescriptor(jobId, snapshotId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ValidateResponse Validate(ValidateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateResponse Validate(ValidateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateResponse Validate(Action configureRequest) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateResponse Validate(ValidateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ValidateResponse, ValidateRequestParameters>(descriptor); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateResponse Validate(Action> configureRequest) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ValidateResponse, ValidateRequestParameters>(descriptor); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(ValidateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateResponse, ValidateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateResponse, ValidateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ValidateDetectorResponse ValidateDetector(ValidateDetectorRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateDetectorResponse ValidateDetector(ValidateDetectorRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateDetectorResponse ValidateDetector(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector, Action configureRequest) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateDetectorResponse ValidateDetector(ValidateDetectorRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ValidateDetectorResponse ValidateDetector(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector, Action> configureRequest) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(ValidateDetectorRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Validates an anomaly detection detector. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ValidateDetectorAsync(Elastic.Clients.Elasticsearch.MachineLearning.Detector detector, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ValidateDetectorRequestDescriptor(detector); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, ValidateDetectorResponse, ValidateDetectorRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Nodes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Nodes.g.cs new file mode 100644 index 00000000000..d97120c95ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Nodes.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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public partial class NodesNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected NodesNamespacedClient() : base() + { + } + + internal NodesNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearRepositoriesMeteringArchiveResponse ClearRepositoriesMeteringArchive(ClearRepositoriesMeteringArchiveRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearRepositoriesMeteringArchiveAsync(ClearRepositoriesMeteringArchiveRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearRepositoriesMeteringArchiveResponse ClearRepositoriesMeteringArchive(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion) + { + var descriptor = new ClearRepositoriesMeteringArchiveRequestDescriptor(nodeId, maxArchiveVersion); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearRepositoriesMeteringArchiveResponse ClearRepositoriesMeteringArchive(ClearRepositoriesMeteringArchiveRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearRepositoriesMeteringArchiveResponse ClearRepositoriesMeteringArchive(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion, Action configureRequest) + { + var descriptor = new ClearRepositoriesMeteringArchiveRequestDescriptor(nodeId, maxArchiveVersion); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearRepositoriesMeteringArchiveAsync(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion, CancellationToken cancellationToken = default) + { + var descriptor = new ClearRepositoriesMeteringArchiveRequestDescriptor(nodeId, maxArchiveVersion); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearRepositoriesMeteringArchiveAsync(ClearRepositoriesMeteringArchiveRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes the archived repositories metering information present in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearRepositoriesMeteringArchiveAsync(Elastic.Clients.Elasticsearch.NodeIds nodeId, long maxArchiveVersion, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClearRepositoriesMeteringArchiveRequestDescriptor(nodeId, maxArchiveVersion); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRepositoriesMeteringInfoResponse GetRepositoriesMeteringInfo(GetRepositoriesMeteringInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoriesMeteringInfoAsync(GetRepositoriesMeteringInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoriesMeteringInfoResponse GetRepositoriesMeteringInfo(Elastic.Clients.Elasticsearch.NodeIds nodeId) + { + var descriptor = new GetRepositoriesMeteringInfoRequestDescriptor(nodeId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoriesMeteringInfoResponse GetRepositoriesMeteringInfo(GetRepositoriesMeteringInfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoriesMeteringInfoResponse GetRepositoriesMeteringInfo(Elastic.Clients.Elasticsearch.NodeIds nodeId, Action configureRequest) + { + var descriptor = new GetRepositoriesMeteringInfoRequestDescriptor(nodeId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoriesMeteringInfoAsync(Elastic.Clients.Elasticsearch.NodeIds nodeId, CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoriesMeteringInfoRequestDescriptor(nodeId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoriesMeteringInfoAsync(GetRepositoriesMeteringInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns cluster repositories metering information. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoriesMeteringInfoAsync(Elastic.Clients.Elasticsearch.NodeIds nodeId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoriesMeteringInfoRequestDescriptor(nodeId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual HotThreadsResponse HotThreads(HotThreadsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(HotThreadsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HotThreadsResponse HotThreads() + { + var descriptor = new HotThreadsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HotThreadsResponse HotThreads(HotThreadsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HotThreadsResponse HotThreads(Action configureRequest) + { + var descriptor = new HotThreadsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new HotThreadsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(HotThreadsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about hot threads on each node in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HotThreadsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new HotThreadsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesInfoResponse Info(NodesInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(NodesInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesInfoResponse Info() + { + var descriptor = new NodesInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesInfoResponse Info(NodesInfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesInfoResponse Info(Action configureRequest) + { + var descriptor = new NodesInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(NodesInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ReloadSecureSettingsResponse ReloadSecureSettings(ReloadSecureSettingsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ReloadSecureSettingsAsync(ReloadSecureSettingsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSecureSettingsResponse ReloadSecureSettings() + { + var descriptor = new ReloadSecureSettingsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSecureSettingsResponse ReloadSecureSettings(ReloadSecureSettingsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReloadSecureSettingsResponse ReloadSecureSettings(Action configureRequest) + { + var descriptor = new ReloadSecureSettingsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ReloadSecureSettingsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ReloadSecureSettingsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ReloadSecureSettingsAsync(ReloadSecureSettingsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Reloads secure settings. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ReloadSecureSettingsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ReloadSecureSettingsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesStatsResponse Stats(NodesStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesStatsResponse Stats() + { + var descriptor = new NodesStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesStatsResponse Stats(NodesStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesStatsResponse Stats(Action configureRequest) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesStatsResponse Stats(NodesStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, NodesStatsResponse, NodesStatsRequestParameters>(descriptor); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesStatsResponse Stats(Action> configureRequest) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, NodesStatsResponse, NodesStatsRequestParameters>(descriptor); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(NodesStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, NodesStatsResponse, NodesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns statistical information about nodes in the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, NodesStatsResponse, NodesStatsRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual NodesUsageResponse Usage(NodesUsageRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(NodesUsageRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesUsageResponse Usage() + { + var descriptor = new NodesUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesUsageResponse Usage(NodesUsageRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual NodesUsageResponse Usage(Action configureRequest) + { + var descriptor = new NodesUsageRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(CancellationToken cancellationToken = default) + { + var descriptor = new NodesUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(NodesUsageRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns low-level information about REST actions usage on nodes. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new NodesUsageRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs new file mode 100644 index 00000000000..df3117f1f81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.QueryRuleset.g.cs @@ -0,0 +1,372 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public partial class QueryRulesetNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected QueryRulesetNamespacedClient() : base() + { + } + + internal QueryRulesetNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteQueryRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId) + { + var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteQueryRulesetResponse Delete(DeleteQueryRulesetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteQueryRulesetResponse Delete(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + { + var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetQueryRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId) + { + var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetQueryRulesetResponse Get(GetQueryRulesetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetQueryRulesetResponse Get(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + { + var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, CancellationToken cancellationToken = default) + { + var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ListResponse List(ListRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(ListRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List() + { + var descriptor = new ListRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List(ListRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List(Action configureRequest) + { + var descriptor = new ListRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ListRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(ListRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Lists query rulesets. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ListRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(PutQueryRulesetRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutQueryRulesetResponse Put(PutQueryRulesetRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutQueryRulesetResponse Put(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest) + { + var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(PutQueryRulesetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a query ruleset. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(Elastic.Clients.Elasticsearch.Id rulesetId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutQueryRulesetRequestDescriptor(rulesetId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Rollup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Rollup.g.cs new file mode 100644 index 00000000000..ee1f35a5f21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Rollup.g.cs @@ -0,0 +1,774 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public partial class RollupNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected RollupNamespacedClient() : base() + { + } + + internal RollupNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteJobResponse DeleteJob(DeleteJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new DeleteJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(DeleteJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteJobResponse DeleteJob(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new DeleteJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(DeleteJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteJobAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetJobsResponse GetJobs(GetJobsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs() + { + var descriptor = new GetJobsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs(GetJobsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetJobsResponse GetJobs(Action configureRequest) + { + var descriptor = new GetJobsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(GetJobsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the configuration, stats, and status of rollup jobs. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetJobsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetJobsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRollupCapsResponse GetRollupCaps(GetRollupCapsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupCapsAsync(GetRollupCapsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupCapsResponse GetRollupCaps() + { + var descriptor = new GetRollupCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupCapsResponse GetRollupCaps(GetRollupCapsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupCapsResponse GetRollupCaps(Action configureRequest) + { + var descriptor = new GetRollupCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupCapsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetRollupCapsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupCapsAsync(GetRollupCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupCapsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRollupCapsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRollupIndexCapsResponse GetRollupIndexCaps(GetRollupIndexCapsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupIndexCapsAsync(GetRollupIndexCapsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupIndexCapsResponse GetRollupIndexCaps(Elastic.Clients.Elasticsearch.Ids index) + { + var descriptor = new GetRollupIndexCapsRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupIndexCapsResponse GetRollupIndexCaps(GetRollupIndexCapsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRollupIndexCapsResponse GetRollupIndexCaps(Elastic.Clients.Elasticsearch.Ids index, Action configureRequest) + { + var descriptor = new GetRollupIndexCapsRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupIndexCapsAsync(Elastic.Clients.Elasticsearch.Ids index, CancellationToken cancellationToken = default) + { + var descriptor = new GetRollupIndexCapsRequestDescriptor(index); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupIndexCapsAsync(GetRollupIndexCapsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRollupIndexCapsAsync(Elastic.Clients.Elasticsearch.Ids index, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRollupIndexCapsRequestDescriptor(index); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutJobResponse PutJob(PutJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(PutJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new PutJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(PutJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutJobResponse, PutJobRequestParameters>(descriptor); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutJobResponse PutJob(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + { + var descriptor = new PutJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutJobResponse, PutJobRequestParameters>(descriptor); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(PutJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Creates a rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutJobAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutJobResponse, PutJobRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RollupSearchResponse RollupSearch(RollupSearchRequest request) + { + request.BeforeRequest(); + return DoRequest, RollupSearchRequestParameters>(request); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> RollupSearchAsync(RollupSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, RollupSearchRequestParameters>(request, cancellationToken); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RollupSearchResponse RollupSearch(Elastic.Clients.Elasticsearch.Indices indices) + { + var descriptor = new RollupSearchRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequest, RollupSearchResponse, RollupSearchRequestParameters>(descriptor); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RollupSearchResponse RollupSearch(RollupSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, RollupSearchResponse, RollupSearchRequestParameters>(descriptor); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RollupSearchResponse RollupSearch(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) + { + var descriptor = new RollupSearchRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RollupSearchResponse, RollupSearchRequestParameters>(descriptor); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> RollupSearchAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) + { + var descriptor = new RollupSearchRequestDescriptor(indices); + descriptor.BeforeRequest(); + return DoRequestAsync, RollupSearchResponse, RollupSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> RollupSearchAsync(RollupSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, RollupSearchResponse, RollupSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Enables searching rolled-up data using the standard query DSL. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> RollupSearchAsync(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RollupSearchRequestDescriptor(indices); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RollupSearchResponse, RollupSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartJobResponse StartJob(StartJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartJobAsync(StartJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartJobResponse StartJob(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new StartJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartJobResponse StartJob(StartJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartJobResponse StartJob(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new StartJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartJobAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StartJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartJobAsync(StartJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts an existing, stopped rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartJobAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopJobResponse StopJob(StopJobRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopJobAsync(StopJobRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopJobResponse StopJob(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new StopJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopJobResponse StopJob(StopJobRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopJobResponse StopJob(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new StopJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopJobAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new StopJobRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopJobAsync(StopJobRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops an existing, started rollup job. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopJobAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopJobRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchApplication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchApplication.g.cs new file mode 100644 index 00000000000..78ed798a16b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchApplication.g.cs @@ -0,0 +1,728 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public partial class SearchApplicationNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SearchApplicationNamespacedClient() : base() + { + } + + internal SearchApplicationNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSearchApplicationResponse Delete(DeleteSearchApplicationRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSearchApplicationRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSearchApplicationResponse Delete(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new DeleteSearchApplicationRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSearchApplicationResponse Delete(DeleteSearchApplicationRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSearchApplicationResponse Delete(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new DeleteSearchApplicationRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSearchApplicationRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSearchApplicationRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSearchApplicationRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteBehavioralAnalyticsResponse DeleteBehavioralAnalytics(DeleteBehavioralAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteBehavioralAnalyticsAsync(DeleteBehavioralAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteBehavioralAnalyticsResponse DeleteBehavioralAnalytics(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new DeleteBehavioralAnalyticsRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteBehavioralAnalyticsResponse DeleteBehavioralAnalytics(DeleteBehavioralAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteBehavioralAnalyticsResponse DeleteBehavioralAnalytics(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new DeleteBehavioralAnalyticsRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteBehavioralAnalyticsAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteBehavioralAnalyticsRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteBehavioralAnalyticsAsync(DeleteBehavioralAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Delete a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteBehavioralAnalyticsAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteBehavioralAnalyticsRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSearchApplicationResponse Get(GetSearchApplicationRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSearchApplicationRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSearchApplicationResponse Get(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new GetSearchApplicationRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSearchApplicationResponse Get(GetSearchApplicationRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSearchApplicationResponse Get(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new GetSearchApplicationRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new GetSearchApplicationRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSearchApplicationRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the details about a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSearchApplicationRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetBehavioralAnalyticsResponse GetBehavioralAnalytics(GetBehavioralAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBehavioralAnalyticsAsync(GetBehavioralAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBehavioralAnalyticsResponse GetBehavioralAnalytics() + { + var descriptor = new GetBehavioralAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBehavioralAnalyticsResponse GetBehavioralAnalytics(GetBehavioralAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetBehavioralAnalyticsResponse GetBehavioralAnalytics(Action configureRequest) + { + var descriptor = new GetBehavioralAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBehavioralAnalyticsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetBehavioralAnalyticsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBehavioralAnalyticsAsync(GetBehavioralAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing behavioral analytics collections. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetBehavioralAnalyticsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetBehavioralAnalyticsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ListResponse List(ListRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(ListRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List() + { + var descriptor = new ListRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List(ListRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ListResponse List(Action configureRequest) + { + var descriptor = new ListRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ListRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(ListRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns the existing search applications. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ListAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ListRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutSearchApplicationResponse Put(PutSearchApplicationRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(PutSearchApplicationRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSearchApplicationResponse Put(PutSearchApplicationRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSearchApplicationResponse Put(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication searchApplication, Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PutSearchApplicationRequestDescriptor(searchApplication, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(PutSearchApplicationRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a search application. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutAsync(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication searchApplication, Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutSearchApplicationRequestDescriptor(searchApplication, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutBehavioralAnalyticsResponse PutBehavioralAnalytics(PutBehavioralAnalyticsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutBehavioralAnalyticsAsync(PutBehavioralAnalyticsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutBehavioralAnalyticsResponse PutBehavioralAnalytics(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new PutBehavioralAnalyticsRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutBehavioralAnalyticsResponse PutBehavioralAnalytics(PutBehavioralAnalyticsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutBehavioralAnalyticsResponse PutBehavioralAnalytics(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new PutBehavioralAnalyticsRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutBehavioralAnalyticsAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new PutBehavioralAnalyticsRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutBehavioralAnalyticsAsync(PutBehavioralAnalyticsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a behavioral analytics collection. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutBehavioralAnalyticsAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutBehavioralAnalyticsRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchApplicationSearchResponse Search(SearchApplicationSearchRequest request) + { + request.BeforeRequest(); + return DoRequest, SearchApplicationSearchRequestParameters>(request); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(SearchApplicationSearchRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, SearchApplicationSearchRequestParameters>(request, cancellationToken); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchApplicationSearchResponse Search(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new SearchApplicationSearchRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest, SearchApplicationSearchRequestParameters>(descriptor); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchApplicationSearchResponse Search(SearchApplicationSearchRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, SearchApplicationSearchRequestParameters>(descriptor); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchApplicationSearchResponse Search(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new SearchApplicationSearchRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, SearchApplicationSearchRequestParameters>(descriptor); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new SearchApplicationSearchRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchApplicationSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(SearchApplicationSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, SearchApplicationSearchRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Perform a search against a search application + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> SearchAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SearchApplicationSearchRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, SearchApplicationSearchRequestParameters>(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchableSnapshots.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchableSnapshots.g.cs new file mode 100644 index 00000000000..1511ecb1cc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.SearchableSnapshots.g.cs @@ -0,0 +1,372 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public partial class SearchableSnapshotsNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SearchableSnapshotsNamespacedClient() : base() + { + } + + internal SearchableSnapshotsNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CacheStatsResponse CacheStats(CacheStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CacheStatsAsync(CacheStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CacheStatsResponse CacheStats() + { + var descriptor = new CacheStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CacheStatsResponse CacheStats(CacheStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CacheStatsResponse CacheStats(Action configureRequest) + { + var descriptor = new CacheStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CacheStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new CacheStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CacheStatsAsync(CacheStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieve node-level cache statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CacheStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CacheStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ClearCacheResponse ClearCache(ClearCacheRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearCacheAsync(ClearCacheRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache() + { + var descriptor = new ClearCacheRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(ClearCacheRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ClearCacheResponse ClearCache(Action configureRequest) + { + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearCacheAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ClearCacheRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearCacheAsync(ClearCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clear the cache of searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ClearCacheAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ClearCacheRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MountResponse Mount(MountRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MountAsync(MountRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MountResponse Mount(MountRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MountResponse Mount(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest) + { + var descriptor = new MountRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MountAsync(MountRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Mount a snapshot as a searchable index. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task MountAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MountRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchableSnapshotsStatsResponse Stats(SearchableSnapshotsStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(SearchableSnapshotsStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchableSnapshotsStatsResponse Stats() + { + var descriptor = new SearchableSnapshotsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchableSnapshotsStatsResponse Stats(SearchableSnapshotsStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchableSnapshotsStatsResponse Stats(Action configureRequest) + { + var descriptor = new SearchableSnapshotsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SearchableSnapshotsStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(SearchableSnapshotsStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieve shard-level statistics about searchable snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SearchableSnapshotsStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Slm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Slm.g.cs new file mode 100644 index 00000000000..54e98898587 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Slm.g.cs @@ -0,0 +1,840 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public partial class SnapshotLifecycleManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SnapshotLifecycleManagementNamespacedClient() : base() + { + } + + internal SnapshotLifecycleManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteLifecycleResponse DeleteLifecycle(DeleteLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(Elastic.Clients.Elasticsearch.Name policyId) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(DeleteLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteLifecycleResponse DeleteLifecycle(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(DeleteLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecuteLifecycleResponse ExecuteLifecycle(ExecuteLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(ExecuteLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteLifecycleResponse ExecuteLifecycle(Elastic.Clients.Elasticsearch.Name policyId) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteLifecycleResponse ExecuteLifecycle(ExecuteLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteLifecycleResponse ExecuteLifecycle(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(ExecuteLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ExecuteRetentionResponse ExecuteRetention(ExecuteRetentionRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(ExecuteRetentionRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteRetentionResponse ExecuteRetention() + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteRetentionResponse ExecuteRetention(ExecuteRetentionRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ExecuteRetentionResponse ExecuteRetention(Action configureRequest) + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(ExecuteRetentionRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes any snapshots that are expired according to the policy's retention rules. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ExecuteRetentionAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ExecuteRetentionRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetLifecycleResponse GetLifecycle(GetLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle() + { + var descriptor = new GetLifecycleRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle(GetLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetLifecycleResponse GetLifecycle(Action configureRequest) + { + var descriptor = new GetLifecycleRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(GetLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetLifecycleAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetLifecycleRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetStatsResponse GetStats(GetStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(GetStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetStatsResponse GetStats() + { + var descriptor = new GetStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetStatsResponse GetStats(GetStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetStatsResponse GetStats(Action configureRequest) + { + var descriptor = new GetStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetStatsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(GetStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetStatsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSlmStatusResponse GetStatus(GetSlmStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetSlmStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSlmStatusResponse GetStatus() + { + var descriptor = new GetSlmStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSlmStatusResponse GetStatus(GetSlmStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSlmStatusResponse GetStatus(Action configureRequest) + { + var descriptor = new GetSlmStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetSlmStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(GetSlmStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves the status of snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetStatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSlmStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutLifecycleResponse PutLifecycle(PutLifecycleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(Elastic.Clients.Elasticsearch.Name policyId) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(PutLifecycleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutLifecycleResponse PutLifecycle(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(PutLifecycleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a snapshot lifecycle policy. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutLifecycleAsync(Elastic.Clients.Elasticsearch.Name policyId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutLifecycleRequestDescriptor(policyId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartSlmResponse Start(StartSlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartSlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartSlmResponse Start() + { + var descriptor = new StartSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartSlmResponse Start(StartSlmRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartSlmResponse Start(Action configureRequest) + { + var descriptor = new StartSlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StartSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(StartSlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns on snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartSlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopSlmResponse Stop(StopSlmRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopSlmRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopSlmResponse Stop() + { + var descriptor = new StopSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopSlmResponse Stop(StopSlmRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopSlmResponse Stop(Action configureRequest) + { + var descriptor = new StopSlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(CancellationToken cancellationToken = default) + { + var descriptor = new StopSlmRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(StopSlmRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Turns off snapshot lifecycle management (SLM). + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopSlmRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Snapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Snapshot.g.cs new file mode 100644 index 00000000000..7262e6cb4b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Snapshot.g.cs @@ -0,0 +1,1018 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public partial class SnapshotNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SnapshotNamespacedClient() : base() + { + } + + internal SnapshotNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CleanupRepositoryResponse CleanupRepository(CleanupRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(CleanupRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CleanupRepositoryResponse CleanupRepository(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CleanupRepositoryResponse CleanupRepository(CleanupRepositoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CleanupRepositoryResponse CleanupRepository(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(CleanupRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Removes stale data from repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CleanupRepositoryAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CleanupRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CloneSnapshotResponse Clone(CloneSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(CloneSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneSnapshotResponse Clone(CloneSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CloneSnapshotResponse Clone(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Elastic.Clients.Elasticsearch.Name targetSnapshot, Action configureRequest) + { + var descriptor = new CloneSnapshotRequestDescriptor(repository, snapshot, targetSnapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(CloneSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Clones indices from one snapshot into another snapshot in the same repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CloneAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Elastic.Clients.Elasticsearch.Name targetSnapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CloneSnapshotRequestDescriptor(repository, snapshot, targetSnapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateSnapshotResponse Create(CreateSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateSnapshotResponse Create(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateSnapshotResponse Create(CreateSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateSnapshotResponse Create(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(CreateSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a snapshot in a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual CreateRepositoryResponse CreateRepository(CreateRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(CreateRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateRepositoryResponse CreateRepository(CreateRepositoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual CreateRepositoryResponse CreateRepository(Elastic.Clients.Elasticsearch.Snapshot.IRepository repository, Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new CreateRepositoryRequestDescriptor(repository, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(CreateRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task CreateRepositoryAsync(Elastic.Clients.Elasticsearch.Snapshot.IRepository repository, Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new CreateRepositoryRequestDescriptor(repository, name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSnapshotResponse Delete(DeleteSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSnapshotResponse Delete(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSnapshotResponse Delete(DeleteSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSnapshotResponse Delete(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(DeleteSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes one or more snapshots. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteRepositoryResponse DeleteRepository(DeleteRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(DeleteRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteRepositoryResponse DeleteRepository(Elastic.Clients.Elasticsearch.Names name) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteRepositoryResponse DeleteRepository(DeleteRepositoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteRepositoryResponse DeleteRepository(Elastic.Clients.Elasticsearch.Names name, Action configureRequest) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(Elastic.Clients.Elasticsearch.Names name, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(DeleteRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteRepositoryAsync(Elastic.Clients.Elasticsearch.Names name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSnapshotResponse Get(GetSnapshotRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSnapshotRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSnapshotResponse Get(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSnapshotResponse Get(GetSnapshotRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSnapshotResponse Get(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot, Action configureRequest) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(GetSnapshotRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Names snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSnapshotRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetRepositoryResponse GetRepository(GetRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(GetRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoryResponse GetRepository() + { + var descriptor = new GetRepositoryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoryResponse GetRepository(GetRepositoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetRepositoryResponse GetRepository(Action configureRequest) + { + var descriptor = new GetRepositoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoryRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(GetRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetRepositoryAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetRepositoryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual RestoreResponse Restore(RestoreRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RestoreResponse Restore(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RestoreResponse Restore(RestoreRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RestoreResponse Restore(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RestoreResponse Restore(RestoreRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, RestoreResponse, RestoreRequestParameters>(descriptor); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual RestoreResponse Restore(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action> configureRequest) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, RestoreResponse, RestoreRequestParameters>(descriptor); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(RestoreRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, RestoreResponse, RestoreRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Restores a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task RestoreAsync(Elastic.Clients.Elasticsearch.Name repository, Elastic.Clients.Elasticsearch.Name snapshot, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new RestoreRequestDescriptor(repository, snapshot); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, RestoreResponse, RestoreRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SnapshotStatusResponse Status(SnapshotStatusRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(SnapshotStatusRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SnapshotStatusResponse Status() + { + var descriptor = new SnapshotStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SnapshotStatusResponse Status(SnapshotStatusRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SnapshotStatusResponse Status(Action configureRequest) + { + var descriptor = new SnapshotStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(CancellationToken cancellationToken = default) + { + var descriptor = new SnapshotStatusRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(SnapshotStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Returns information about the status of a snapshot. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StatusAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new SnapshotStatusRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual VerifyRepositoryResponse VerifyRepository(VerifyRepositoryRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(VerifyRepositoryRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual VerifyRepositoryResponse VerifyRepository(Elastic.Clients.Elasticsearch.Name name) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual VerifyRepositoryResponse VerifyRepository(VerifyRepositoryRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual VerifyRepositoryResponse VerifyRepository(Elastic.Clients.Elasticsearch.Name name, Action configureRequest) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(Elastic.Clients.Elasticsearch.Name name, CancellationToken cancellationToken = default) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(VerifyRepositoryRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Verifies a repository. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task VerifyRepositoryAsync(Elastic.Clients.Elasticsearch.Name name, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new VerifyRepositoryRequestDescriptor(name); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Sql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Sql.g.cs index 1db4b099b19..d7be055ca00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Sql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Sql.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; public partial class SqlNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected SqlNamespacedClient() : base() { @@ -60,6 +61,7 @@ public virtual Task ClearCursorAsync(ClearCursorRequest req /// Clears the SQL cursor /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClearCursorResponse ClearCursor(ClearCursorRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -70,6 +72,7 @@ public virtual ClearCursorResponse ClearCursor(ClearCursorRequestDescriptor desc /// Clears the SQL cursor /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClearCursorResponse ClearCursor(Action configureRequest) { var descriptor = new ClearCursorRequestDescriptor(); @@ -104,7 +107,7 @@ public virtual Task ClearCursorAsync(ActionDeletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequest request) + public virtual DeleteAsyncResponse DeleteAsync(DeleteAsyncRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -114,7 +117,7 @@ public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequest request) /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequest request, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(DeleteAsyncRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -124,7 +127,8 @@ public virtual Task DeleteAsyncSearchAsync(DeleteAsyncReque /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Id id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAsyncResponse DeleteAsync(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new DeleteAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -135,7 +139,8 @@ public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsear /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAsyncResponse DeleteAsync(DeleteAsyncRequestDescriptor descriptor) { descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -145,7 +150,8 @@ public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequestDescripto /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteAsyncResponse DeleteAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new DeleteAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -157,29 +163,7 @@ public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsear /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(DeleteAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual DeleteAsyncResponse DeleteAsyncSearch(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { var descriptor = new DeleteAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -190,7 +174,7 @@ public virtual Task DeleteAsyncSearchAsync(Elastic.Clients. /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -200,7 +184,7 @@ public virtual Task DeleteAsyncSearchAsync(DeleteAsyncReque /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsyncAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new DeleteAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -208,33 +192,11 @@ public virtual Task DeleteAsyncSearchAsync(Elastic.Clients. return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(DeleteAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task DeleteAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new DeleteAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, DeleteAsyncResponse, DeleteAsyncRequestParameters>(descriptor, cancellationToken); - } - /// /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequest request) + public virtual GetAsyncResponse GetAsync(GetAsyncRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -244,7 +206,7 @@ public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequest request) /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchAsync(GetAsyncRequest request, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(GetAsyncRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -254,7 +216,8 @@ public virtual Task GetAsyncSearchAsync(GetAsyncRequest reques /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Id id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncResponse GetAsync(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new GetAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -265,7 +228,8 @@ public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Id /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncResponse GetAsync(GetAsyncRequestDescriptor descriptor) { descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -275,7 +239,8 @@ public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequestDescriptor descrip /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncResponse GetAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new GetAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -287,29 +252,7 @@ public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Id /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncResponse GetAsyncSearch(GetAsyncRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, GetAsyncResponse, GetAsyncRequestParameters>(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncResponse GetAsyncSearch(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) - { - var descriptor = new GetAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetAsyncResponse, GetAsyncRequestParameters>(descriptor); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncRequestDescriptor(id); descriptor.BeforeRequest(); @@ -320,7 +263,7 @@ public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasti /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -330,7 +273,7 @@ public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescrip /// Returns the current status and available results for an async SQL search or stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetAsyncAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -338,33 +281,11 @@ public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasti return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(GetAsyncRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncResponse, GetAsyncRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns the current status and available results for an async SQL search or stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetAsyncRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncResponse, GetAsyncRequestParameters>(descriptor, cancellationToken); - } - /// /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequest request) + public virtual GetAsyncStatusResponse GetAsyncStatus(GetAsyncStatusRequest request) { request.BeforeRequest(); return DoRequest(request); @@ -374,7 +295,7 @@ public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequest /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequest request, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(GetAsyncStatusRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync(request, cancellationToken); @@ -384,7 +305,8 @@ public virtual Task GetAsyncSearchStatusAsync(GetAsyncSt /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Id id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncStatusResponse GetAsyncStatus(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new GetAsyncStatusRequestDescriptor(id); descriptor.BeforeRequest(); @@ -395,7 +317,8 @@ public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elast /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequestDescriptor descriptor) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncStatusResponse GetAsyncStatus(GetAsyncStatusRequestDescriptor descriptor) { descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -405,7 +328,8 @@ public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequest /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetAsyncStatusResponse GetAsyncStatus(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new GetAsyncStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -417,29 +341,7 @@ public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elast /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(GetAsyncStatusRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual GetAsyncStatusResponse GetAsyncSearchStatus(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncStatusRequestDescriptor(id); descriptor.BeforeRequest(); @@ -450,7 +352,7 @@ public virtual Task GetAsyncSearchStatusAsync(Elastic.Cl /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -460,7 +362,7 @@ public virtual Task GetAsyncSearchStatusAsync(GetAsyncSt /// Returns the current status of an async SQL search or a stored synchronous SQL search /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetAsyncStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new GetAsyncStatusRequestDescriptor(id); configureRequest?.Invoke(descriptor); @@ -468,28 +370,6 @@ public virtual Task GetAsyncSearchStatusAsync(Elastic.Cl return DoRequestAsync(descriptor, cancellationToken); } - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(GetAsyncStatusRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns the current status of an async SQL search or a stored synchronous SQL search - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task GetAsyncSearchStatusAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new GetAsyncStatusRequestDescriptor(id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncStatusResponse, GetAsyncStatusRequestParameters>(descriptor, cancellationToken); - } - /// /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. @@ -514,6 +394,7 @@ public virtual Task QueryAsync(QueryRequest request, Cancellation /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual QueryResponse Query() { var descriptor = new QueryRequestDescriptor(); @@ -525,6 +406,7 @@ public virtual QueryResponse Query() /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual QueryResponse Query(QueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -535,6 +417,7 @@ public virtual QueryResponse Query(QueryRequestDescriptor descriptor) /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual QueryResponse Query(Action configureRequest) { var descriptor = new QueryRequestDescriptor(); @@ -547,6 +430,7 @@ public virtual QueryResponse Query(Action configureReque /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual QueryResponse Query(QueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -557,6 +441,7 @@ public virtual QueryResponse Query(QueryRequestDescriptor /// Executes a SQL request /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual QueryResponse Query(Action> configureRequest) { var descriptor = new QueryRequestDescriptor(); @@ -619,4 +504,139 @@ public virtual Task QueryAsync(Action, QueryResponse, QueryRequestParameters>(descriptor, cancellationToken); } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TranslateResponse Translate(TranslateRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(TranslateRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TranslateResponse Translate() + { + var descriptor = new TranslateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TranslateResponse Translate(TranslateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TranslateResponse Translate(Action configureRequest) + { + var descriptor = new TranslateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TranslateResponse Translate(TranslateRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, TranslateResponse, TranslateRequestParameters>(descriptor); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TranslateResponse Translate(Action> configureRequest) + { + var descriptor = new TranslateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, TranslateResponse, TranslateRequestParameters>(descriptor); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TranslateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(TranslateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TranslateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(TranslateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, TranslateResponse, TranslateRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Translates SQL into Elasticsearch queries + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TranslateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TranslateRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, TranslateResponse, TranslateRequestParameters>(descriptor, cancellationToken); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Synonyms.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Synonyms.g.cs new file mode 100644 index 00000000000..c419fa79106 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Synonyms.g.cs @@ -0,0 +1,616 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public partial class SynonymsNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected SynonymsNamespacedClient() : base() + { + } + + internal SynonymsNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSynonymResponse DeleteSynonym(DeleteSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(DeleteSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymResponse DeleteSynonym(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymResponse DeleteSynonym(DeleteSynonymRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymResponse DeleteSynonym(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(DeleteSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteSynonymRuleResponse DeleteSynonymRule(DeleteSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(DeleteSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymRuleResponse DeleteSynonymRule(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymRuleResponse DeleteSynonymRule(DeleteSynonymRuleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteSynonymRuleResponse DeleteSynonymRule(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(DeleteSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteSynonymRuleAsync(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymResponse GetSynonym(GetSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(GetSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymResponse GetSynonym(Elastic.Clients.Elasticsearch.Id id) + { + var descriptor = new GetSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymResponse GetSynonym(GetSynonymRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymResponse GetSynonym(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new GetSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRequestDescriptor(id); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(GetSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymRuleResponse GetSynonymRule(GetSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(GetSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymRuleResponse GetSynonymRule(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymRuleResponse GetSynonymRule(GetSynonymRuleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymRuleResponse GetSynonymRule(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(GetSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a synonym rule from a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymRuleAsync(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetSynonymsSetsResponse GetSynonymsSets(GetSynonymsSetsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(GetSynonymsSetsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymsSetsResponse GetSynonymsSets() + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymsSetsResponse GetSynonymsSets(GetSynonymsSetsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetSynonymsSetsResponse GetSynonymsSets(Action configureRequest) + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(GetSynonymsSetsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves a summary of all defined synonym sets + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetSynonymsSetsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetSynonymsSetsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutSynonymResponse PutSynonym(PutSynonymRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(PutSynonymRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSynonymResponse PutSynonym(PutSynonymRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSynonymResponse PutSynonym(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new PutSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(PutSynonymRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonyms set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutSynonymRequestDescriptor(id); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutSynonymRuleResponse PutSynonymRule(PutSynonymRuleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(PutSynonymRuleRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSynonymRuleResponse PutSynonymRule(PutSynonymRuleRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutSynonymRuleResponse PutSynonymRule(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest) + { + var descriptor = new PutSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(PutSynonymRuleRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Creates or updates a synonym rule in a synonym set + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutSynonymRuleAsync(Elastic.Clients.Elasticsearch.Id setId, Elastic.Clients.Elasticsearch.Id ruleId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutSynonymRuleRequestDescriptor(setId, ruleId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file 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 39ebe4a94c5..a2592de1f00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs @@ -18,6 +18,7 @@ #nullable restore using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -26,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; public partial class TasksNamespacedClient : NamespacedClientProxy { /// - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of the class for mocking. /// protected TasksNamespacedClient() : base() { @@ -37,9 +38,8 @@ 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) { @@ -48,9 +48,8 @@ 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) { @@ -59,10 +58,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CancelResponse Cancel() { var descriptor = new CancelRequestDescriptor(); @@ -71,10 +70,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CancelResponse Cancel(CancelRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -82,10 +81,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CancelResponse Cancel(Action configureRequest) { var descriptor = new CancelRequestDescriptor(); @@ -95,9 +94,8 @@ 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) { @@ -107,9 +105,8 @@ 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) { @@ -118,9 +115,8 @@ 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) { @@ -131,9 +127,8 @@ 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) { @@ -142,9 +137,8 @@ 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) { @@ -153,22 +147,22 @@ 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id taskId) { - var descriptor = new GetTasksRequestDescriptor(task_id); + var descriptor = new GetTasksRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequest(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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetTasksResponse Get(GetTasksRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -176,34 +170,32 @@ 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTasksResponse Get(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest) { - var descriptor = new GetTasksRequestDescriptor(task_id); + var descriptor = new GetTasksRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(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 Task GetAsync(Elastic.Clients.Elasticsearch.Id task_id, CancellationToken cancellationToken = default) + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id taskId, CancellationToken cancellationToken = default) { - var descriptor = new GetTasksRequestDescriptor(task_id); + var descriptor = new GetTasksRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } /// - /// 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) { @@ -212,22 +204,20 @@ 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) + public virtual Task GetAsync(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetTasksRequestDescriptor(task_id); + var descriptor = new GetTasksRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, 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 ListResponse List(ListRequest request) { @@ -236,9 +226,8 @@ 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) { @@ -247,10 +236,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListResponse List() { var descriptor = new ListRequestDescriptor(); @@ -259,10 +248,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListResponse List(ListRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -270,10 +259,10 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ListResponse List(Action configureRequest) { var descriptor = new ListRequestDescriptor(); @@ -283,9 +272,8 @@ 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) { @@ -295,9 +283,8 @@ 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) { @@ -306,9 +293,8 @@ 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.TextStructure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.TextStructure.g.cs new file mode 100644 index 00000000000..cab0266a974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.TextStructure.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 System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +public partial class TextStructureNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected TextStructureNamespacedClient() : base() + { + } + + internal TextStructureNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual TestGrokPatternResponse TestGrokPattern(TestGrokPatternRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(TestGrokPatternRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TestGrokPatternResponse TestGrokPattern() + { + var descriptor = new TestGrokPatternRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TestGrokPatternResponse TestGrokPattern(TestGrokPatternRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TestGrokPatternResponse TestGrokPattern(Action configureRequest) + { + var descriptor = new TestGrokPatternRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(CancellationToken cancellationToken = default) + { + var descriptor = new TestGrokPatternRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(TestGrokPatternRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Tests a Grok pattern on some text. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task TestGrokPatternAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new TestGrokPatternRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Transform.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Transform.g.cs new file mode 100644 index 00000000000..9e3ebb39dd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Transform.g.cs @@ -0,0 +1,1064 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public partial class TransformManagementNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected TransformManagementNamespacedClient() : base() + { + } + + internal TransformManagementNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual DeleteTransformResponse DeleteTransform(DeleteTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(DeleteTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTransformResponse DeleteTransform(Elastic.Clients.Elasticsearch.Id transformId) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTransformResponse DeleteTransform(DeleteTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteTransformResponse DeleteTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(DeleteTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Deletes an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task DeleteTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTransformResponse GetTransform(GetTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(GetTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformResponse GetTransform() + { + var descriptor = new GetTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformResponse GetTransform(GetTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformResponse GetTransform(Action configureRequest) + { + var descriptor = new GetTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(GetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves configuration information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual GetTransformStatsResponse GetTransformStats(GetTransformStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(GetTransformStatsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformStatsResponse GetTransformStats(Elastic.Clients.Elasticsearch.Names transformId) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformStatsResponse GetTransformStats(GetTransformStatsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetTransformStatsResponse GetTransformStats(Elastic.Clients.Elasticsearch.Names transformId, Action configureRequest) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Names transformId, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(GetTransformStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information for transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Names transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new GetTransformStatsRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PreviewTransformResponse PreviewTransform(PreviewTransformRequest request) + { + request.BeforeRequest(); + return DoRequest, PreviewTransformRequestParameters>(request); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(PreviewTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, PreviewTransformRequestParameters>(request, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewTransformResponse PreviewTransform() + { + var descriptor = new PreviewTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewTransformResponse PreviewTransform(PreviewTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PreviewTransformResponse PreviewTransform(Action> configureRequest) + { + var descriptor = new PreviewTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(CancellationToken cancellationToken = default) + { + var descriptor = new PreviewTransformRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(PreviewTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Previews a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> PreviewTransformAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PreviewTransformRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PreviewTransformResponse, PreviewTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual PutTransformResponse PutTransform(PutTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTransformResponse PutTransform(PutTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTransformResponse PutTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTransformResponse PutTransform(PutTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, PutTransformResponse, PutTransformRequestParameters>(descriptor); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual PutTransformResponse PutTransform(Elastic.Clients.Elasticsearch.Id transformId, Action> configureRequest) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, PutTransformResponse, PutTransformRequestParameters>(descriptor); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(PutTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Instantiates a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task PutTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new PutTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ResetTransformResponse ResetTransform(ResetTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(ResetTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetTransformResponse ResetTransform(Elastic.Clients.Elasticsearch.Id transformId) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetTransformResponse ResetTransform(ResetTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ResetTransformResponse ResetTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(ResetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Resets an existing transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ResetTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ResetTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual ScheduleNowTransformResponse ScheduleNowTransform(ScheduleNowTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(ScheduleNowTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScheduleNowTransformResponse ScheduleNowTransform(Elastic.Clients.Elasticsearch.Id transformId) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScheduleNowTransformResponse ScheduleNowTransform(ScheduleNowTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScheduleNowTransformResponse ScheduleNowTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(ScheduleNowTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Schedules now a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new ScheduleNowTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StartTransformResponse StartTransform(StartTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(StartTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTransformResponse StartTransform(Elastic.Clients.Elasticsearch.Id transformId) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTransformResponse StartTransform(StartTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StartTransformResponse StartTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, CancellationToken cancellationToken = default) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(StartTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Starts one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StartTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StartTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual StopTransformResponse StopTransform(StopTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(StopTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTransformResponse StopTransform(Elastic.Clients.Elasticsearch.Name transformId) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTransformResponse StopTransform(StopTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual StopTransformResponse StopTransform(Elastic.Clients.Elasticsearch.Name transformId, Action configureRequest) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(Elastic.Clients.Elasticsearch.Name transformId, CancellationToken cancellationToken = default) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(StopTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Stops one or more transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task StopTransformAsync(Elastic.Clients.Elasticsearch.Name transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new StopTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpdateTransformResponse UpdateTransform(UpdateTransformRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateTransformResponse UpdateTransform(UpdateTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateTransformResponse UpdateTransform(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateTransformResponse UpdateTransform(UpdateTransformRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateTransformResponse UpdateTransform(Elastic.Clients.Elasticsearch.Id transformId, Action> configureRequest) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(UpdateTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Updates certain properties of a transform. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpdateTransformAsync(Elastic.Clients.Elasticsearch.Id transformId, Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpdateTransformRequestDescriptor(transformId); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual UpgradeTransformsResponse UpgradeTransforms(UpgradeTransformsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(UpgradeTransformsRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeTransformsResponse UpgradeTransforms() + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeTransformsResponse UpgradeTransforms(UpgradeTransformsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpgradeTransformsResponse UpgradeTransforms(Action configureRequest) + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(UpgradeTransformsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Upgrades all transforms. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UpgradeTransformsAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new UpgradeTransformsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Xpack.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Xpack.g.cs new file mode 100644 index 00000000000..4d31161cc5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Xpack.g.cs @@ -0,0 +1,217 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public partial class XpackNamespacedClient : NamespacedClientProxy +{ + /// + /// Initializes a new instance of the class for mocking. + /// + protected XpackNamespacedClient() : base() + { + } + + internal XpackNamespacedClient(ElasticsearchClient client) : base(client) + { + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual XpackInfoResponse Info(XpackInfoRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(XpackInfoRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackInfoResponse Info() + { + var descriptor = new XpackInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackInfoResponse Info(XpackInfoRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackInfoResponse Info(Action configureRequest) + { + var descriptor = new XpackInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(CancellationToken cancellationToken = default) + { + var descriptor = new XpackInfoRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(XpackInfoRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task InfoAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new XpackInfoRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual XpackUsageResponse Usage(XpackUsageRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(XpackUsageRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackUsageResponse Usage() + { + var descriptor = new XpackUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackUsageResponse Usage(XpackUsageRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual XpackUsageResponse Usage(Action configureRequest) + { + var descriptor = new XpackUsageRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(CancellationToken cancellationToken = default) + { + var descriptor = new XpackUsageRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(XpackUsageRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + + /// + /// Retrieves usage information about the installed X-Pack features. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task UsageAsync(Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new XpackUsageRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 193209923fe..fbcb87b1740 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -19,15 +19,32 @@ using Elastic.Clients.Elasticsearch.AsyncSearch; using Elastic.Clients.Elasticsearch.Cluster; +using Elastic.Clients.Elasticsearch.CrossClusterReplication; using Elastic.Clients.Elasticsearch.DanglingIndices; using Elastic.Clients.Elasticsearch.Enrich; using Elastic.Clients.Elasticsearch.Eql; using Elastic.Clients.Elasticsearch.Esql; +using Elastic.Clients.Elasticsearch.Features; using Elastic.Clients.Elasticsearch.Graph; +using Elastic.Clients.Elasticsearch.IndexLifecycleManagement; using Elastic.Clients.Elasticsearch.IndexManagement; +using Elastic.Clients.Elasticsearch.Inference; using Elastic.Clients.Elasticsearch.Ingest; +using Elastic.Clients.Elasticsearch.LicenseManagement; +using Elastic.Clients.Elasticsearch.MachineLearning; +using Elastic.Clients.Elasticsearch.Nodes; +using Elastic.Clients.Elasticsearch.QueryRuleset; +using Elastic.Clients.Elasticsearch.Rollup; +using Elastic.Clients.Elasticsearch.SearchableSnapshots; +using Elastic.Clients.Elasticsearch.SearchApplication; +using Elastic.Clients.Elasticsearch.Snapshot; +using Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; using Elastic.Clients.Elasticsearch.Sql; +using Elastic.Clients.Elasticsearch.Synonyms; using Elastic.Clients.Elasticsearch.Tasks; +using Elastic.Clients.Elasticsearch.TextStructure; +using Elastic.Clients.Elasticsearch.TransformManagement; +using Elastic.Clients.Elasticsearch.Xpack; using System; using System.Threading; using System.Threading.Tasks; @@ -38,24 +55,68 @@ public partial class ElasticsearchClient { public virtual AsyncSearchNamespacedClient AsyncSearch { get; private set; } public virtual ClusterNamespacedClient Cluster { get; private set; } + public virtual CrossClusterReplicationNamespacedClient CrossClusterReplication { get; private set; } public virtual DanglingIndicesNamespacedClient DanglingIndices { get; private set; } public virtual EnrichNamespacedClient Enrich { get; private set; } public virtual EqlNamespacedClient Eql { get; private set; } public virtual EsqlNamespacedClient Esql { get; private set; } + public virtual FeaturesNamespacedClient Features { get; private set; } public virtual GraphNamespacedClient Graph { get; private set; } + public virtual IndexLifecycleManagementNamespacedClient IndexLifecycleManagement { get; private set; } public virtual IndicesNamespacedClient Indices { get; private set; } + public virtual InferenceNamespacedClient Inference { get; private set; } public virtual IngestNamespacedClient Ingest { get; private set; } + public virtual LicenseManagementNamespacedClient LicenseManagement { get; private set; } + public virtual MachineLearningNamespacedClient MachineLearning { get; private set; } + public virtual NodesNamespacedClient Nodes { get; private set; } + public virtual QueryRulesetNamespacedClient QueryRuleset { get; private set; } + public virtual RollupNamespacedClient Rollup { get; private set; } + public virtual SearchableSnapshotsNamespacedClient SearchableSnapshots { get; private set; } + public virtual SearchApplicationNamespacedClient SearchApplication { get; private set; } + public virtual SnapshotNamespacedClient Snapshot { get; private set; } + public virtual SnapshotLifecycleManagementNamespacedClient SnapshotLifecycleManagement { get; private set; } public virtual SqlNamespacedClient Sql { get; private set; } + public virtual SynonymsNamespacedClient Synonyms { get; private set; } public virtual TasksNamespacedClient Tasks { get; private set; } + public virtual TextStructureNamespacedClient TextStructure { get; private set; } + public virtual TransformManagementNamespacedClient TransformManagement { get; private set; } + public virtual XpackNamespacedClient Xpack { get; private set; } private partial void SetupNamespaces() { - AsyncSearch = new AsyncSearchNamespacedClient(this); Cluster = new ClusterNamespacedClient(this); DanglingIndices = new DanglingIndicesNamespacedClient(this); Enrich = new EnrichNamespacedClient(this); Eql = new EqlNamespacedClient(this); Esql = new EsqlNamespacedClient(this); Graph = new GraphNamespacedClient(this); Indices = new IndicesNamespacedClient(this); Ingest = new IngestNamespacedClient(this); Sql = new SqlNamespacedClient(this); Tasks = new TasksNamespacedClient(this); + AsyncSearch = new AsyncSearchNamespacedClient(this); + Cluster = new ClusterNamespacedClient(this); + CrossClusterReplication = new CrossClusterReplicationNamespacedClient(this); + DanglingIndices = new DanglingIndicesNamespacedClient(this); + Enrich = new EnrichNamespacedClient(this); + Eql = new EqlNamespacedClient(this); + Esql = new EsqlNamespacedClient(this); + Features = new FeaturesNamespacedClient(this); + Graph = new GraphNamespacedClient(this); + IndexLifecycleManagement = new IndexLifecycleManagementNamespacedClient(this); + Indices = new IndicesNamespacedClient(this); + Inference = new InferenceNamespacedClient(this); + Ingest = new IngestNamespacedClient(this); + LicenseManagement = new LicenseManagementNamespacedClient(this); + MachineLearning = new MachineLearningNamespacedClient(this); + Nodes = new NodesNamespacedClient(this); + QueryRuleset = new QueryRulesetNamespacedClient(this); + Rollup = new RollupNamespacedClient(this); + SearchableSnapshots = new SearchableSnapshotsNamespacedClient(this); + SearchApplication = new SearchApplicationNamespacedClient(this); + Snapshot = new SnapshotNamespacedClient(this); + SnapshotLifecycleManagement = new SnapshotLifecycleManagementNamespacedClient(this); + Sql = new SqlNamespacedClient(this); + Synonyms = new SynonymsNamespacedClient(this); + Tasks = new TasksNamespacedClient(this); + TextStructure = new TextStructureNamespacedClient(this); + TransformManagement = new TransformManagementNamespacedClient(this); + Xpack = new XpackNamespacedClient(this); } /// /// 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) { @@ -65,7 +126,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) { @@ -75,8 +136,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -85,8 +147,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual BulkResponse Bulk(Action configureRequest) { var descriptor = new BulkRequestDescriptor(); @@ -97,8 +160,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual BulkResponse Bulk(BulkRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -107,8 +171,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual BulkResponse Bulk(Action> configureRequest) { var descriptor = new BulkRequestDescriptor(); @@ -119,7 +184,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) { @@ -129,7 +194,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) { @@ -141,7 +206,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) { @@ -151,7 +216,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) { @@ -163,7 +228,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) { @@ -173,7 +238,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) { @@ -183,8 +248,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClearScrollResponse ClearScroll() { var descriptor = new ClearScrollRequestDescriptor(); @@ -194,8 +260,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClearScrollResponse ClearScroll(ClearScrollRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -204,8 +271,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClearScrollResponse ClearScroll(Action configureRequest) { var descriptor = new ClearScrollRequestDescriptor(); @@ -216,7 +284,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) { @@ -227,7 +295,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) { @@ -237,7 +305,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) { @@ -249,7 +317,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) { @@ -259,7 +327,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) { @@ -269,8 +337,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClosePointInTimeResponse ClosePointInTime() { var descriptor = new ClosePointInTimeRequestDescriptor(); @@ -280,8 +349,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClosePointInTimeResponse ClosePointInTime(ClosePointInTimeRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -290,8 +360,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ClosePointInTimeResponse ClosePointInTime(Action configureRequest) { var descriptor = new ClosePointInTimeRequestDescriptor(); @@ -302,7 +373,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) { @@ -313,7 +384,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) { @@ -323,7 +394,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) { @@ -357,6 +428,7 @@ public virtual Task CountAsync(CountRequest request, Cancellation /// Returns number of documents matching a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CountResponse Count() { var descriptor = new CountRequestDescriptor(); @@ -368,6 +440,7 @@ public virtual CountResponse Count() /// Returns number of documents matching a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CountResponse Count(CountRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -378,6 +451,7 @@ public virtual CountResponse Count(CountRequestDescriptor descriptor) /// Returns number of documents matching a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CountResponse Count(Action configureRequest) { var descriptor = new CountRequestDescriptor(); @@ -390,6 +464,7 @@ public virtual CountResponse Count(Action configureReque /// Returns number of documents matching a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CountResponse Count(CountRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -400,6 +475,7 @@ public virtual CountResponse Count(CountRequestDescriptor /// Returns number of documents matching a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CountResponse Count(Action> configureRequest) { var descriptor = new CountRequestDescriptor(); @@ -490,6 +566,7 @@ public virtual Task CreateAsync(CreateRequestReturns a 409 response when a document with a same ID already exists in the index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CreateResponse Create(CreateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -501,6 +578,7 @@ public virtual CreateResponse Create(CreateRequestDescriptorReturns a 409 response when a document with a same ID already exists in the index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual CreateResponse Create(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new CreateRequestDescriptor(document, index, id); @@ -514,12 +592,10 @@ public virtual CreateResponse Create(TDocument document, Elastic.Clie /// 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) + public virtual Task CreateAsync(CreateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new CreateRequestDescriptor(document); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, CreateResponse, CreateRequestParameters>(descriptor); + return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); } /// @@ -527,36 +603,101 @@ public virtual CreateResponse Create(TDocument document, ActionReturns 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) + public virtual Task CreateAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.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. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual DeleteResponse Delete(DeleteRequest request) { - var descriptor = new CreateRequestDescriptor(document, index, id); + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + return DoRequest(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. + /// Removes a document from the index. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task CreateAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new CreateRequestDescriptor(document); + 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.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new DeleteRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, CreateResponse, CreateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -583,6 +724,7 @@ public virtual Task DeleteByQueryAsync(DeleteByQueryReque /// Deletes documents matching the provided query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -593,6 +735,7 @@ public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescripto /// Deletes documents matching the provided query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new DeleteByQueryRequestDescriptor(indices); @@ -605,6 +748,7 @@ public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch /// Deletes documents matching the provided query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -615,6 +759,7 @@ public virtual DeleteByQueryResponse DeleteByQuery(DeleteByQueryReque /// Deletes documents matching the provided query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteByQueryResponse DeleteByQuery(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { var descriptor = new DeleteByQueryRequestDescriptor(indices); @@ -691,9 +836,10 @@ public virtual Task DeleteByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId task_id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId taskId) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequest(descriptor); } @@ -702,6 +848,7 @@ public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.C /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(DeleteByQueryRethrottleRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -712,9 +859,10 @@ public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(DeleteByQ /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId task_id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId taskId, Action configureRequest) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -724,9 +872,9 @@ public virtual DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.C /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId task_id, CancellationToken cancellationToken = default) + public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId taskId, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -745,190 +893,14 @@ public virtual Task DeleteByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Delete By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new DeleteByQueryRethrottleRequestDescriptor(taskId); 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 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.IndexName index, Elastic.Clients.Elasticsearch.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.IndexName index, Elastic.Clients.Elasticsearch.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.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.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.IndexName index, Elastic.Clients.Elasticsearch.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.IndexName index, Elastic.Clients.Elasticsearch.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.IndexName index, Elastic.Clients.Elasticsearch.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.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.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.IndexName index, Elastic.Clients.Elasticsearch.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. @@ -953,6 +925,7 @@ public virtual Task DeleteScriptAsync(DeleteScriptRequest /// Deletes a script. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Id id) { var descriptor = new DeleteScriptRequestDescriptor(id); @@ -964,6 +937,7 @@ public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.I /// Deletes a script. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -974,6 +948,7 @@ public virtual DeleteScriptResponse DeleteScript(DeleteScriptRequestDescriptor d /// Deletes a script. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new DeleteScriptRequestDescriptor(id); @@ -982,28 +957,6 @@ public virtual DeleteScriptResponse DeleteScript(Elastic.Clients.Elasticsearch.I 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.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. @@ -1037,28 +990,6 @@ public virtual Task DeleteScriptAsync(Elastic.Clients.Elas 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.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. @@ -1083,6 +1014,7 @@ public virtual Task ExistsAsync(ExistsRequest request, Cancellat /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { var descriptor = new ExistsRequestDescriptor(index, id); @@ -1094,6 +1026,7 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName ind /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1104,6 +1037,7 @@ public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) /// Returns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new ExistsRequestDescriptor(index, id); @@ -1116,29 +1050,7 @@ public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName ind /// 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.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.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. - /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(ExistsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1149,6 +1061,7 @@ public virtual ExistsResponse Exists(ExistsRequestDescriptorReturns information about whether a document exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new ExistsRequestDescriptor(index, id); @@ -1190,29 +1103,6 @@ public virtual Task ExistsAsync(Elastic.Clients.Elasticsearch.In 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.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.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. @@ -1259,6 +1149,7 @@ public virtual Task ExistsSourceAsync(ExistsSourceRequest /// Returns information about whether a document source exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { var descriptor = new ExistsSourceRequestDescriptor(index, id); @@ -1270,6 +1161,7 @@ public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.I /// Returns information about whether a document source exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1280,6 +1172,7 @@ public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor d /// Returns information about whether a document source exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new ExistsSourceRequestDescriptor(index, id); @@ -1292,29 +1185,7 @@ public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.I /// 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.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.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. - /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1325,6 +1196,7 @@ public virtual ExistsSourceResponse ExistsSource(ExistsSourceRequestD /// Returns information about whether a document source exists in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new ExistsSourceRequestDescriptor(index, id); @@ -1366,29 +1238,6 @@ public virtual Task ExistsSourceAsync(Elastic.Clients.Elas 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.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.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. @@ -1435,6 +1284,7 @@ public virtual Task> ExplainAsync(ExplainR /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { var descriptor = new ExplainRequestDescriptor(index, id); @@ -1446,6 +1296,7 @@ public virtual ExplainResponse Explain(Elastic.Clients.Ela /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainResponse Explain(ExplainRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1456,6 +1307,7 @@ public virtual ExplainResponse Explain(ExplainRequestDescr /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new ExplainRequestDescriptor(index, id); @@ -1468,54 +1320,9 @@ public virtual ExplainResponse Explain(Elastic.Clients.Ela /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Id id) - { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual ExplainResponse Explain(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) - { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, ExplainResponse, ExplainRequestParameters>(descriptor); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) - { - var descriptor = new ExplainRequestDescriptor(index, id); - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about why a specific matches (or doesn't match) a query. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { var descriptor = new ExplainRequestDescriptor(index, id); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } @@ -1524,9 +1331,8 @@ public virtual Task> ExplainAsync(Elastic. /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(ExplainRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); } @@ -1535,9 +1341,9 @@ public virtual Task> ExplainAsync(Elastic. /// Returns information about why a specific matches (or doesn't match) a query. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> ExplainAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ExplainRequestDescriptor(typeof(TDocument), id); + var descriptor = new ExplainRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync, ExplainResponse, ExplainRequestParameters>(descriptor, cancellationToken); @@ -1567,6 +1373,7 @@ public virtual Task FieldCapsAsync(FieldCapsRequest request, /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual FieldCapsResponse FieldCaps() { var descriptor = new FieldCapsRequestDescriptor(); @@ -1578,6 +1385,7 @@ public virtual FieldCapsResponse FieldCaps() /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1588,6 +1396,7 @@ public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor descriptor /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual FieldCapsResponse FieldCaps(Action configureRequest) { var descriptor = new FieldCapsRequestDescriptor(); @@ -1600,6 +1409,7 @@ public virtual FieldCapsResponse FieldCaps(Action co /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1610,6 +1420,7 @@ public virtual FieldCapsResponse FieldCaps(FieldCapsRequestDescriptor /// Returns the information about the capabilities of fields among multiple indices. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual FieldCapsResponse FieldCaps(Action> configureRequest) { var descriptor = new FieldCapsRequestDescriptor(); @@ -1697,6 +1508,7 @@ public virtual Task> GetAsync(GetRequest reque /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { var descriptor = new GetRequestDescriptor(index, id); @@ -1708,6 +1520,7 @@ public virtual GetResponse Get(Elastic.Clients.Elasticsear /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetResponse Get(GetRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1718,6 +1531,7 @@ public virtual GetResponse Get(GetRequestDescriptorReturns a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetResponse Get(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new GetRequestDescriptor(index, id); @@ -1730,79 +1544,122 @@ public virtual GetResponse Get(Elastic.Clients.Elasticsear /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Id id) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + var descriptor = new GetRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest, GetResponse, GetRequestParameters>(descriptor); + return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); } /// /// Returns a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetResponse Get(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetResponse, GetRequestParameters>(descriptor); + 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.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.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. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetRequestDescriptor descriptor, CancellationToken cancellationToken = default) + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetScriptResponse GetScript(Elastic.Clients.Elasticsearch.Id id) { + var descriptor = new GetScriptRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns a document. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetScriptResponse GetScript(GetScriptRequestDescriptor descriptor) { - var descriptor = new GetRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual GetScriptResponse GetScript(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + { + var descriptor = new GetScriptRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns a document. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns a script. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + var descriptor = new GetScriptRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns a document. - /// Learn more about this API in the Elasticsearch documentation. + /// 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> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task GetScriptAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetRequestDescriptor(typeof(TDocument), id); + var descriptor = new GetScriptRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetResponse, GetRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -1829,6 +1686,7 @@ public virtual Task GetScriptContextAsync(GetScriptCon /// Returns all script contexts. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptContextResponse GetScriptContext() { var descriptor = new GetScriptContextRequestDescriptor(); @@ -1840,6 +1698,7 @@ public virtual GetScriptContextResponse GetScriptContext() /// Returns all script contexts. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptContextResponse GetScriptContext(GetScriptContextRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1850,6 +1709,7 @@ public virtual GetScriptContextResponse GetScriptContext(GetScriptContextRequest /// Returns all script contexts. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptContextResponse GetScriptContext(Action configureRequest) { var descriptor = new GetScriptContextRequestDescriptor(); @@ -1915,6 +1775,7 @@ public virtual Task GetScriptLanguagesAsync(GetScrip /// Returns available script types, languages and contexts /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptLanguagesResponse GetScriptLanguages() { var descriptor = new GetScriptLanguagesRequestDescriptor(); @@ -1926,6 +1787,7 @@ public virtual GetScriptLanguagesResponse GetScriptLanguages() /// Returns available script types, languages and contexts /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptLanguagesResponse GetScriptLanguages(GetScriptLanguagesRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -1936,6 +1798,7 @@ public virtual GetScriptLanguagesResponse GetScriptLanguages(GetScriptLanguagesR /// Returns available script types, languages and contexts /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetScriptLanguagesResponse GetScriptLanguages(Action configureRequest) { var descriptor = new GetScriptLanguagesRequestDescriptor(); @@ -1977,136 +1840,6 @@ public virtual Task GetScriptLanguagesAsync(Action(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.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.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.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.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.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.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. @@ -2131,6 +1864,7 @@ public virtual Task> GetSourceAsync(GetS /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id) { var descriptor = new GetSourceRequestDescriptor(index, id); @@ -2142,6 +1876,7 @@ public virtual GetSourceResponse GetSource(Elastic.Clients /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetSourceResponse GetSource(GetSourceRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2152,6 +1887,7 @@ public virtual GetSourceResponse GetSource(GetSourceReques /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { var descriptor = new GetSourceRequestDescriptor(index, id); @@ -2164,79 +1900,122 @@ public virtual GetSourceResponse GetSource(Elastic.Clients /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Id id) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + var descriptor = new GetSourceRequestDescriptor(index, id); descriptor.BeforeRequest(); - return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); } /// /// Returns the source of a document. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual GetSourceResponse GetSource(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) + public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetSourceResponse, GetSourceRequestParameters>(descriptor); + 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.IndexName index, Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.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. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(GetSourceRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual HealthReportResponse HealthReport(HealthReportRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthReportAsync(HealthReportRequest request, CancellationToken cancellationToken = default) { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HealthReportResponse HealthReport() + { + var descriptor = new HealthReportRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns the source of a document. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HealthReportResponse HealthReport(HealthReportRequestDescriptor descriptor) { - var descriptor = new GetSourceRequestDescriptor(index, id); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual HealthReportResponse HealthReport(Action configureRequest) + { + var descriptor = new HealthReportRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); + } + + /// + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task HealthReportAsync(CancellationToken cancellationToken = default) + { + var descriptor = new HealthReportRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the source of a document. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) + public virtual Task HealthReportAsync(HealthReportRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); descriptor.BeforeRequest(); - return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns the source of a document. - /// Learn more about this API in the Elasticsearch documentation. + /// Returns the health of the cluster. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetSourceAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task HealthReportAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetSourceRequestDescriptor(typeof(TDocument), id); + var descriptor = new HealthReportRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetSourceResponse, GetSourceRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// @@ -2263,6 +2042,7 @@ public virtual Task IndexAsync(IndexRequest /// Creates or updates a document in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual IndexResponse Index(IndexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2273,6 +2053,7 @@ public virtual IndexResponse Index(IndexRequestDescriptor /// Creates or updates a document in an index. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual IndexResponse Index(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { var descriptor = new IndexRequestDescriptor(document, index); @@ -2281,18 +2062,6 @@ public virtual IndexResponse Index(TDocument document, Elastic.Client 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. @@ -2315,18 +2084,6 @@ public virtual Task IndexAsync(TDocument document, Ela 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. @@ -2351,6 +2108,7 @@ public virtual Task InfoAsync(InfoRequest request, CancellationTok /// Returns basic information about the cluster. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual InfoResponse Info() { var descriptor = new InfoRequestDescriptor(); @@ -2362,6 +2120,7 @@ public virtual InfoResponse Info() /// Returns basic information about the cluster. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual InfoResponse Info(InfoRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2372,6 +2131,7 @@ public virtual InfoResponse Info(InfoRequestDescriptor descriptor) /// Returns basic information about the cluster. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual InfoResponse Info(Action configureRequest) { var descriptor = new InfoRequestDescriptor(); @@ -2413,6 +2173,141 @@ public virtual Task InfoAsync(Action config return DoRequestAsync(descriptor, cancellationToken); } + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual MultiTermVectorsResponse Mtermvectors(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 MtermvectorsAsync(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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiTermVectorsResponse Mtermvectors() + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiTermVectorsResponse Mtermvectors(MultiTermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiTermVectorsResponse Mtermvectors(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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiTermVectorsResponse Mtermvectors(MultiTermVectorsRequestDescriptor descriptor) + { + descriptor.BeforeRequest(); + return DoRequest, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor); + } + + /// + /// Returns multiple termvectors in one request. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiTermVectorsResponse Mtermvectors(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 MtermvectorsAsync(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 MtermvectorsAsync(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 MtermvectorsAsync(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 MtermvectorsAsync(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 MtermvectorsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + { + var descriptor = new MultiTermVectorsRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + } + /// /// Allows to get multiple documents in one request. /// Learn more about this API in the Elasticsearch documentation. @@ -2437,6 +2332,7 @@ public virtual Task> MultiGetAsync(MultiG /// Allows to get multiple documents in one request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual MultiGetResponse MultiGet() { var descriptor = new MultiGetRequestDescriptor(); @@ -2448,6 +2344,7 @@ public virtual MultiGetResponse MultiGet() /// Allows to get multiple documents in one request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual MultiGetResponse MultiGet(MultiGetRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2458,6 +2355,7 @@ public virtual MultiGetResponse MultiGet(MultiGetRequestDe /// Allows to get multiple documents in one request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual MultiGetResponse MultiGet(Action> configureRequest) { var descriptor = new MultiGetRequestDescriptor(); @@ -2523,33 +2421,36 @@ public virtual Task> MultiSearchAsync( /// Allows to execute several search operations in one request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual MultiSearchResponse MultiSearch() { - var descriptor = new MultiSearchRequestDescriptor(); + var descriptor = new MultiSearchRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + return DoRequest, 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiSearchResponse MultiSearch(MultiSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + return DoRequest, 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiSearchResponse MultiSearch(Action configureRequest) { - var descriptor = new MultiSearchRequestDescriptor(); + var descriptor = new MultiSearchRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, MultiSearchResponse, MultiSearchRequestParameters>(descriptor); + return DoRequest, MultiSearchRequestParameters>(descriptor); } /// @@ -2558,31 +2459,31 @@ public virtual MultiSearchResponse MultiSearch(Action public virtual Task> MultiSearchAsync(CancellationToken cancellationToken = default) { - var descriptor = new MultiSearchRequestDescriptor(); + var descriptor = new MultiSearchRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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) + public virtual Task> MultiSearchAsync(MultiSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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) + public virtual Task> MultiSearchAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new MultiSearchRequestDescriptor(); + var descriptor = new MultiSearchRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, MultiSearchResponse, MultiSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchRequestParameters>(descriptor, cancellationToken); } /// @@ -2609,201 +2510,74 @@ public virtual Task> MultiSearchTemplateA /// Allows to execute several search template operations in one request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] 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) - { + var descriptor = new MultiSearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, MultiSearchTemplateResponse, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequest, 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(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. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiSearchTemplateResponse MultiSearchTemplate(MultiSearchTemplateRequestDescriptor descriptor) { - var descriptor = new MultiTermVectorsRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, MultiSearchTemplateRequestParameters>(descriptor); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual MultiSearchTemplateResponse MultiSearchTemplate(Action configureRequest) { + var descriptor = new MultiSearchTemplateRequestDescriptor(); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, MultiSearchTemplateRequestParameters>(descriptor); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new MultiTermVectorsRequestDescriptor(); - configureRequest?.Invoke(descriptor); + var descriptor = new MultiSearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(MultiTermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchTemplateAsync(MultiSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// - /// Returns multiple termvectors in one request. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows to execute several search template operations in one request. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task MultiTermVectorsAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> MultiSearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new MultiTermVectorsRequestDescriptor(); + var descriptor = new MultiSearchTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, MultiTermVectorsResponse, MultiTermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, MultiSearchTemplateRequestParameters>(descriptor, cancellationToken); } /// /// 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) { @@ -2813,7 +2587,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) { @@ -2823,8 +2597,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Indices indices) { var descriptor = new OpenPointInTimeRequestDescriptor(indices); @@ -2834,8 +2609,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual OpenPointInTimeResponse OpenPointInTime(OpenPointInTimeRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2844,8 +2620,9 @@ 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual OpenPointInTimeResponse OpenPointInTime(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new OpenPointInTimeRequestDescriptor(indices); @@ -2856,29 +2633,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. - /// - 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.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. + /// Learn more about this API in the Elasticsearch documentation. /// public virtual Task OpenPointInTimeAsync(Elastic.Clients.Elasticsearch.Indices indices, CancellationToken cancellationToken = default) { @@ -2889,7 +2644,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) { @@ -2899,7 +2654,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,28 +2664,6 @@ public virtual Task OpenPointInTimeAsync(Elastic.Client 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.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. @@ -2955,6 +2688,7 @@ public virtual Task PingAsync(PingRequest request, CancellationTok /// Returns whether the cluster is running. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PingResponse Ping() { var descriptor = new PingRequestDescriptor(); @@ -2966,6 +2700,7 @@ public virtual PingResponse Ping() /// Returns whether the cluster is running. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PingResponse Ping(PingRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -2976,6 +2711,7 @@ public virtual PingResponse Ping(PingRequestDescriptor descriptor) /// Returns whether the cluster is running. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PingResponse Ping(Action configureRequest) { var descriptor = new PingRequestDescriptor(); @@ -3041,6 +2777,7 @@ public virtual Task PutScriptAsync(PutScriptRequest request, /// Creates or updates a script. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutScriptResponse PutScript(PutScriptRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3051,6 +2788,7 @@ public virtual PutScriptResponse PutScript(PutScriptRequestDescriptor descriptor /// Creates or updates a script. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual PutScriptResponse PutScript(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) { var descriptor = new PutScriptRequestDescriptor(id); @@ -3059,28 +2797,6 @@ public virtual PutScriptResponse PutScript(Elastic.Clients.Elasticsearch.Id id, 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.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. @@ -3103,28 +2819,6 @@ public virtual Task PutScriptAsync(Elastic.Clients.Elasticsea 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.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. @@ -3149,6 +2843,7 @@ public virtual Task RankEvalAsync(RankEvalRequest request, Can /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RankEvalResponse RankEval() { var descriptor = new RankEvalRequestDescriptor(); @@ -3160,6 +2855,7 @@ public virtual RankEvalResponse RankEval() /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RankEvalResponse RankEval(RankEvalRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3170,6 +2866,7 @@ public virtual RankEvalResponse RankEval(RankEvalRequestDescriptor 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RankEvalResponse RankEval(Action configureRequest) { var descriptor = new RankEvalRequestDescriptor(); @@ -3182,6 +2879,7 @@ public virtual RankEvalResponse RankEval(Action confi /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RankEvalResponse RankEval(RankEvalRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3192,6 +2890,7 @@ public virtual RankEvalResponse RankEval(RankEvalRequestDescriptorAllows to evaluate the quality of ranked search results over a set of typical search queries /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RankEvalResponse RankEval(Action> configureRequest) { var descriptor = new RankEvalRequestDescriptor(); @@ -3279,6 +2978,7 @@ public virtual Task ReindexAsync(ReindexRequest request, Cancel /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
/// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ReindexResponse Reindex(ReindexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3289,6 +2989,7 @@ public virtual ReindexResponse Reindex(ReindexRequestDescriptor descriptor) /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
/// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ReindexResponse Reindex(Action configureRequest) { var descriptor = new ReindexRequestDescriptor(); @@ -3301,6 +3002,7 @@ public virtual ReindexResponse Reindex(Action configur /// Allows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster.
/// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ReindexResponse Reindex(ReindexRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3311,6 +3013,7 @@ public virtual ReindexResponse Reindex(ReindexRequestDescriptorAllows to copy documents from one index to another, optionally filtering the source
documents by a query, changing the destination index settings, or fetching the
documents from a remote cluster. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ReindexResponse Reindex(Action> configureRequest) { var descriptor = new ReindexRequestDescriptor(); @@ -3387,9 +3090,10 @@ public virtual Task ReindexRethrottleAsync(ReindexRet /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Id task_id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Id taskId) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequest(descriptor); } @@ -3398,6 +3102,7 @@ public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elast /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ReindexRethrottleResponse ReindexRethrottle(ReindexRethrottleRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3408,9 +3113,10 @@ public virtual ReindexRethrottleResponse ReindexRethrottle(ReindexRethrottleRequ /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -3420,9 +3126,9 @@ public virtual ReindexRethrottleResponse ReindexRethrottle(Elastic.Clients.Elast /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, CancellationToken cancellationToken = default) + public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Id taskId, CancellationToken cancellationToken = default) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -3441,9 +3147,9 @@ public virtual Task ReindexRethrottleAsync(ReindexRet /// Changes the number of requests per second for a particular Reindex operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task ReindexRethrottleAsync(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new ReindexRethrottleRequestDescriptor(task_id); + var descriptor = new ReindexRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); @@ -3473,6 +3179,7 @@ public virtual Task RenderSearchTemplateAsync(Rend /// Allows to use the Mustache language to pre-render a search definition. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RenderSearchTemplateResponse RenderSearchTemplate() { var descriptor = new RenderSearchTemplateRequestDescriptor(); @@ -3484,6 +3191,7 @@ public virtual RenderSearchTemplateResponse RenderSearchTemplate() /// Allows to use the Mustache language to pre-render a search definition. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RenderSearchTemplateResponse RenderSearchTemplate(RenderSearchTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3494,6 +3202,7 @@ public virtual RenderSearchTemplateResponse RenderSearchTemplate(RenderSearchTem /// Allows to use the Mustache language to pre-render a search definition. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual RenderSearchTemplateResponse RenderSearchTemplate(Action configureRequest) { var descriptor = new RenderSearchTemplateRequestDescriptor(); @@ -3506,77 +3215,122 @@ public virtual RenderSearchTemplateResponse RenderSearchTemplate(ActionAllows 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) + public virtual Task RenderSearchTemplateAsync(CancellationToken cancellationToken = default) { + var descriptor = new RenderSearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor); + 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 RenderSearchTemplateResponse RenderSearchTemplate(Action> configureRequest) + public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new RenderSearchTemplateRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor); + 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(CancellationToken cancellationToken = default) + 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. + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual ScriptsPainlessExecuteResponse ScriptsPainlessExecute(ScriptsPainlessExecuteRequest request) + { + request.BeforeRequest(); + return DoRequest, ScriptsPainlessExecuteRequestParameters>(request); + } + + /// + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScriptsPainlessExecuteAsync(ScriptsPainlessExecuteRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync, ScriptsPainlessExecuteRequestParameters>(request, cancellationToken); + } + + /// + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScriptsPainlessExecuteResponse ScriptsPainlessExecute() { + var descriptor = new ScriptsPainlessExecuteRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor); } /// - /// Allows to use the Mustache language to pre-render a search definition. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RenderSearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScriptsPainlessExecuteResponse ScriptsPainlessExecute(ScriptsPainlessExecuteRequestDescriptor descriptor) { - var descriptor = new RenderSearchTemplateRequestDescriptor(); + descriptor.BeforeRequest(); + return DoRequest, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor); + } + + /// + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual ScriptsPainlessExecuteResponse ScriptsPainlessExecute(Action> configureRequest) + { + var descriptor = new ScriptsPainlessExecuteRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync(descriptor, cancellationToken); + return DoRequest, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor); } /// - /// Allows to use the Mustache language to pre-render a search definition. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RenderSearchTemplateAsync(RenderSearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> ScriptsPainlessExecuteAsync(CancellationToken cancellationToken = default) { + var descriptor = new ScriptsPainlessExecuteRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor, cancellationToken); } /// - /// Allows to use the Mustache language to pre-render a search definition. - /// Learn more about this API in the Elasticsearch documentation. + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task> ScriptsPainlessExecuteAsync(ScriptsPainlessExecuteRequestDescriptor descriptor, CancellationToken cancellationToken = default) + { + descriptor.BeforeRequest(); + return DoRequestAsync, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Allows an arbitrary script to be executed and a result to be returned + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task RenderSearchTemplateAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> ScriptsPainlessExecuteAsync(Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new RenderSearchTemplateRequestDescriptor(); + var descriptor = new ScriptsPainlessExecuteRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, RenderSearchTemplateResponse, RenderSearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, ScriptsPainlessExecuteResponse, ScriptsPainlessExecuteRequestParameters>(descriptor, cancellationToken); } /// @@ -3603,6 +3357,7 @@ public virtual Task> ScrollAsync(ScrollRequ /// Allows to retrieve a large numbers of results from a single search request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ScrollResponse Scroll() { var descriptor = new ScrollRequestDescriptor(); @@ -3614,6 +3369,7 @@ public virtual ScrollResponse Scroll() /// Allows to retrieve a large numbers of results from a single search request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ScrollResponse Scroll(ScrollRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3624,6 +3380,7 @@ public virtual ScrollResponse Scroll(ScrollRequestDescript /// Allows to retrieve a large numbers of results from a single search request. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual ScrollResponse Scroll(Action configureRequest) { var descriptor = new ScrollRequestDescriptor(); @@ -3647,108 +3404,246 @@ public virtual Task> ScrollAsync(Cancellati /// 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) + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + 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); + } + + /// + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual SearchMvtResponse SearchMvt(SearchMvtRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + /// + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. + /// + public virtual Task SearchMvtAsync(SearchMvtRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + /// + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchMvtResponse SearchMvt(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y) { + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); descriptor.BeforeRequest(); - return DoRequestAsync, ScrollRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Allows to retrieve a large numbers of results from a single search request. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> ScrollAsync(Action configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchMvtResponse SearchMvt(SearchMvtRequestDescriptor descriptor) { - var descriptor = new ScrollRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, ScrollRequestParameters>(descriptor, cancellationToken); + return DoRequest(descriptor); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SearchResponse Search(SearchRequest request) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchMvtResponse SearchMvt(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y, Action configureRequest) { - request.BeforeRequest(); - return DoRequest, SearchRequestParameters>(request); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(SearchRequest request, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchMvtResponse SearchMvt(SearchMvtRequestDescriptor descriptor) { - request.BeforeRequest(); - return DoRequestAsync, SearchRequestParameters>(request, cancellationToken); + descriptor.BeforeRequest(); + return DoRequest, SearchMvtResponse, SearchMvtRequestParameters>(descriptor); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SearchResponse Search() + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchMvtResponse SearchMvt(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y, Action> configureRequest) { - var descriptor = new SearchRequestDescriptor(); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + return DoRequest, SearchMvtResponse, SearchMvtRequestParameters>(descriptor); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SearchResponse Search(SearchRequestDescriptor descriptor) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y, CancellationToken cancellationToken = default) { + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); descriptor.BeforeRequest(); - return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual SearchResponse Search(Action> configureRequest) + public virtual Task SearchMvtAsync(SearchMvtRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new SearchRequestDescriptor(); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, SearchResponse, SearchRequestParameters>(descriptor); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SearchRequestDescriptor(); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); + configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync(descriptor, cancellationToken); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(SearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(SearchMvtRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, SearchMvtResponse, SearchMvtRequestParameters>(descriptor, cancellationToken); } /// - /// Returns results matching a query. - /// Learn more about this API in the Elasticsearch documentation. + /// Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> SearchAsync(Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task SearchMvtAsync(Elastic.Clients.Elasticsearch.Indices indices, Elastic.Clients.Elasticsearch.Field field, int zoom, int x, int y, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SearchRequestDescriptor(); + var descriptor = new SearchMvtRequestDescriptor(indices, field, zoom, x, y); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, SearchResponse, SearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, SearchMvtResponse, SearchMvtRequestParameters>(descriptor, cancellationToken); } /// @@ -3775,6 +3670,7 @@ public virtual Task SearchShardsAsync(SearchShardsRequest /// Returns information about the indices and shards that a search request would be executed against. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SearchShardsResponse SearchShards() { var descriptor = new SearchShardsRequestDescriptor(); @@ -3786,6 +3682,7 @@ public virtual SearchShardsResponse SearchShards() /// Returns information about the indices and shards that a search request would be executed against. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SearchShardsResponse SearchShards(SearchShardsRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -3796,6 +3693,7 @@ public virtual SearchShardsResponse SearchShards(SearchShardsRequestDescriptor d /// Returns information about the indices and shards that a search request would be executed against. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SearchShardsResponse SearchShards(Action configureRequest) { var descriptor = new SearchShardsRequestDescriptor(); @@ -3804,28 +3702,6 @@ public virtual SearchShardsResponse SearchShards(Action(descriptor); } - /// - /// Returns information about the indices and shards that a search request would be executed against. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual SearchShardsResponse SearchShards(SearchShardsRequestDescriptor descriptor) - { - descriptor.BeforeRequest(); - return DoRequest, SearchShardsResponse, SearchShardsRequestParameters>(descriptor); - } - - /// - /// Returns information about the indices and shards that a search request would be executed against. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual SearchShardsResponse SearchShards(Action> configureRequest) - { - var descriptor = new SearchShardsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest, SearchShardsResponse, SearchShardsRequestParameters>(descriptor); - } - /// /// Returns information about the indices and shards that a search request would be executed against. /// Learn more about this API in the Elasticsearch documentation. @@ -3859,28 +3735,6 @@ public virtual Task SearchShardsAsync(Action(descriptor, cancellationToken); } - /// - /// Returns information about the indices and shards that a search request would be executed against. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task SearchShardsAsync(SearchShardsRequestDescriptor descriptor, CancellationToken cancellationToken = default) - { - descriptor.BeforeRequest(); - return DoRequestAsync, SearchShardsResponse, SearchShardsRequestParameters>(descriptor, cancellationToken); - } - - /// - /// Returns information about the indices and shards that a search request would be executed against. - /// Learn more about this API in the Elasticsearch documentation. - /// - public virtual Task SearchShardsAsync(Action> configureRequest, CancellationToken cancellationToken = default) - { - var descriptor = new SearchShardsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync, SearchShardsResponse, SearchShardsRequestParameters>(descriptor, cancellationToken); - } - /// /// Allows to use the Mustache language to pre-render a search definition. /// Learn more about this API in the Elasticsearch documentation. @@ -3905,33 +3759,36 @@ public virtual Task> SearchTemplateAsyncAllows to use the Mustache language to pre-render a search definition. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual SearchTemplateResponse SearchTemplate() { - var descriptor = new SearchTemplateRequestDescriptor(); + var descriptor = new SearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + return DoRequest, 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchTemplateResponse SearchTemplate(SearchTemplateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + return DoRequest, 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual SearchTemplateResponse SearchTemplate(Action configureRequest) { - var descriptor = new SearchTemplateRequestDescriptor(); + var descriptor = new SearchTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor); + return DoRequest, SearchTemplateRequestParameters>(descriptor); } /// @@ -3940,31 +3797,31 @@ public virtual SearchTemplateResponse SearchTemplate(Actio /// public virtual Task> SearchTemplateAsync(CancellationToken cancellationToken = default) { - var descriptor = new SearchTemplateRequestDescriptor(); + var descriptor = new SearchTemplateRequestDescriptor(); descriptor.BeforeRequest(); - return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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) + public virtual Task> SearchTemplateAsync(SearchTemplateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, 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) + public virtual Task> SearchTemplateAsync(Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new SearchTemplateRequestDescriptor(); + var descriptor = new SearchTemplateRequestDescriptor(); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, SearchTemplateResponse, SearchTemplateRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, SearchTemplateRequestParameters>(descriptor, cancellationToken); } /// @@ -3991,6 +3848,7 @@ public virtual Task TermsEnumAsync(TermsEnumRequest 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.IndexName index) { var descriptor = new TermsEnumRequestDescriptor(index); @@ -4002,6 +3860,7 @@ public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.IndexNa /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4012,6 +3871,7 @@ public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.IndexName index, Action configureRequest) { var descriptor = new TermsEnumRequestDescriptor(index); @@ -4024,29 +3884,7 @@ public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.IndexNa /// 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. - /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4057,6 +3895,7 @@ public virtual TermsEnumResponse TermsEnum(TermsEnumRequestDescriptor /// 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. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual TermsEnumResponse TermsEnum(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { var descriptor = new TermsEnumRequestDescriptor(index); @@ -4098,29 +3937,6 @@ public virtual Task TermsEnumAsync(Elastic.Clients.Elasticsea 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. @@ -4147,7 +3963,7 @@ public virtual Task TermsEnumAsync(Elastic.Clients /// 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) + public virtual TermVectorsResponse Termvectors(TermVectorsRequest request) { request.BeforeRequest(); return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(request); @@ -4157,7 +3973,7 @@ public virtual TermVectorsResponse TermVectors(TermVectorsRequestReturns 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) + public virtual Task TermvectorsAsync(TermVectorsRequest request, CancellationToken cancellationToken = default) { request.BeforeRequest(); return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(request, cancellationToken); @@ -4167,9 +3983,10 @@ public virtual Task TermVectorsAsync(TermVectors /// 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.IndexName index) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new TermVectorsRequestDescriptor(index); descriptor.BeforeRequest(); return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); } @@ -4178,7 +3995,8 @@ public virtual TermVectorsResponse TermVectors(TDocument document, El /// 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) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(TermVectorsRequestDescriptor descriptor) { descriptor.BeforeRequest(); return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); @@ -4188,9 +4006,10 @@ public virtual TermVectorsResponse TermVectors(TermVectorsRequestDesc /// 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.IndexName index, Action> configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual TermVectorsResponse Termvectors(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new TermVectorsRequestDescriptor(index); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); @@ -4200,83 +4019,103 @@ public virtual TermVectorsResponse TermVectors(TDocument document, El /// 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) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); + var descriptor = new TermVectorsRequestDescriptor(index); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + 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 TermVectorsResponse TermVectors(TDocument document, Action> configureRequest) + public virtual Task TermvectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); - configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, TermVectorsResponse, TermVectorsRequestParameters>(descriptor); + 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.IndexName index, CancellationToken cancellationToken = default) + public virtual Task TermvectorsAsync(Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new TermVectorsRequestDescriptor(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. + /// 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 TermVectorsAsync(TermVectorsRequestDescriptor descriptor, CancellationToken cancellationToken = default) + 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. + /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(UpdateRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermVectorsAsync(TDocument document, Elastic.Clients.Elasticsearch.IndexName index, Action> configureRequest, CancellationToken cancellationToken = default) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateResponse Update(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new TermVectorsRequestDescriptor(document, index); + var descriptor = new UpdateRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequest, UpdateResponse, UpdateRequestParameters>(descriptor); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermVectorsAsync(TDocument document, CancellationToken cancellationToken = default) + public virtual Task> UpdateAsync(UpdateRequestDescriptor descriptor, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } /// - /// Returns information and statistics about terms in the fields of a particular document. - /// Learn more about this API in the Elasticsearch documentation. + /// Updates a document with a script or partial document. + /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task TermVectorsAsync(TDocument document, Action> configureRequest, CancellationToken cancellationToken = default) + public virtual Task> UpdateAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new TermVectorsRequestDescriptor(document); + var descriptor = new UpdateRequestDescriptor(index, id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, TermVectorsResponse, TermVectorsRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, UpdateResponse, UpdateRequestParameters>(descriptor, cancellationToken); } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4286,7 +4125,7 @@ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequest request) } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4296,9 +4135,10 @@ public virtual Task UpdateByQueryAsync(UpdateByQueryReque } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Indices indices) { var descriptor = new UpdateByQueryRequestDescriptor(indices); @@ -4307,9 +4147,10 @@ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4317,9 +4158,10 @@ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescripto } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Indices indices, Action configureRequest) { var descriptor = new UpdateByQueryRequestDescriptor(indices); @@ -4329,9 +4171,10 @@ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4339,9 +4182,10 @@ public virtual UpdateByQueryResponse UpdateByQuery(UpdateByQueryReque } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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. ///
+ [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.Elasticsearch.Indices indices, Action> configureRequest) { var descriptor = new UpdateByQueryRequestDescriptor(indices); @@ -4351,7 +4195,7 @@ public virtual UpdateByQueryResponse UpdateByQuery(Elastic.Clients.El } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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.Indices indices, CancellationToken cancellationToken = default) @@ -4362,7 +4206,7 @@ public virtual Task UpdateByQueryAsync(Elastic.Clients.El } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4372,7 +4216,7 @@ public virtual Task UpdateByQueryAsync(UpdateByQueryReque } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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.Indices indices, Action configureRequest, CancellationToken cancellationToken = default) @@ -4384,7 +4228,7 @@ public virtual Task UpdateByQueryAsync(Elastic.Clients.El } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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) @@ -4394,7 +4238,7 @@ public virtual Task UpdateByQueryAsync(UpdateB } /// - /// Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
+ /// Updates documents that match the specified query. If no query is specified,
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.Indices indices, Action> configureRequest, CancellationToken cancellationToken = default) @@ -4429,9 +4273,10 @@ public virtual Task UpdateByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Id task_id) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Id taskId) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequest(descriptor); } @@ -4440,6 +4285,7 @@ public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.C /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(UpdateByQueryRethrottleRequestDescriptor descriptor) { descriptor.BeforeRequest(); @@ -4450,9 +4296,10 @@ public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(UpdateByQ /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest) + [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] + public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequest(descriptor); @@ -4462,9 +4309,9 @@ public virtual UpdateByQueryRethrottleResponse UpdateByQueryRethrottle(Elastic.C /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, CancellationToken cancellationToken = default) + public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id taskId, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); descriptor.BeforeRequest(); return DoRequestAsync(descriptor, cancellationToken); } @@ -4483,99 +4330,11 @@ public virtual Task UpdateByQueryRethrottleAsyn /// Changes the number of requests per second for a particular Update By Query operation. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task UpdateByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id taskId, Action configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new UpdateByQueryRethrottleRequestDescriptor(task_id); + var descriptor = new UpdateByQueryRethrottleRequestDescriptor(taskId); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); return DoRequestAsync(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.IndexName index, Elastic.Clients.Elasticsearch.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.IndexName index, Elastic.Clients.Elasticsearch.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/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs index 1ed74ae8652..8abb4a0d300 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs @@ -27,111 +27,19 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class AdjacencyMatrixAggregationConverter : JsonConverter +public sealed partial class AdjacencyMatrixAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Filters used to create buckets.
At least one filter is required.
///
+ [JsonInclude, JsonPropertyName("filters")] public IDictionary? Filters { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.AdjacencyMatrix(adjacencyMatrixAggregation); } public sealed partial class AdjacencyMatrixAggregationDescriptor : SerializableDescriptor> @@ -142,42 +50,16 @@ public AdjacencyMatrixAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } - private IDictionary? FiltersValue { get; set; } + private IDictionary> FiltersValue { get; set; } private IDictionary? MetaValue { get; set; } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private string? NameValue { get; set; } /// /// Filters used to create buckets.
At least one filter is required.
///
- public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + public AdjacencyMatrixAggregationDescriptor Filters(Func>, FluentDescriptorDictionary>> selector) { - FiltersValue = selector?.Invoke(new FluentDictionary()); + FiltersValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -187,10 +69,14 @@ public AdjacencyMatrixAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + 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) { @@ -198,27 +84,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -233,42 +108,16 @@ public AdjacencyMatrixAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } - private IDictionary? FiltersValue { get; set; } + private IDictionary FiltersValue { get; set; } private IDictionary? MetaValue { get; set; } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public AdjacencyMatrixAggregationDescriptor Aggregations(Action configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private string? NameValue { get; set; } /// /// Filters used to create buckets.
At least one filter is required.
///
- public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDictionary> selector) + public AdjacencyMatrixAggregationDescriptor Filters(Func, FluentDescriptorDictionary> selector) { - FiltersValue = selector?.Invoke(new FluentDictionary()); + FiltersValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -278,10 +127,14 @@ public AdjacencyMatrixAggregationDescriptor Meta(Func 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 +internal sealed partial class AdjacencyMatrixBucketConverter : JsonConverter { - public override AdjacencyMatrixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new AdjacencyMatrixBucket(subAggs) { DocCount = docCount, Key = key }; + return new AdjacencyMatrixBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, AdjacencyMatrixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, AdjacencyMatrixBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'AdjacencyMatrixBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(AdjacencyMatrixBucketConverter))] +public sealed partial class AdjacencyMatrixBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs index 68509912500..9995d8c3f7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs @@ -24,12 +24,17 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Linq; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; namespace Elastic.Clients.Elasticsearch.Aggregations; +public partial interface IAggregate +{ +} + [JsonConverter(typeof(AggregateDictionaryConverter))] public partial class AggregateDictionary : IsAReadOnlyDictionary { @@ -37,63 +42,595 @@ public AggregateDictionary(IReadOnlyDictionary backingDictio { } - public Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate? GetTDigestPercentiles(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate? GetTDigestPercentileRanks(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate? GetPercentilesBucket(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate? GetMedianAbsoluteDeviation(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MinAggregate? GetMin(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate? GetMax(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.SumAggregate? GetSum(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate? GetAverage(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate? GetWeightedAverage(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate? GetValueCount(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate? GetDerivative(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate? GetStats(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate? GetStatsBucket(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate? GetExtendedStats(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate? GetExtendedStatsBucket(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate? GetGeoBounds(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate? GetGeoCentroid(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate? GetHistogram(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate? GetAutoDateHistogram(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate? GetVariableWidthHistogram(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate? GetStringTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate? GetLongTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate? GetDoubleTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate? GetStringRareTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate? GetMultiTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate? GetMissing(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate? GetNested(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate? GetReverseNested(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate? GetGlobal(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate? GetFilter(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate? GetParent(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate? GetSampler(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate? GetGeohashGrid(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate? GetGeotileGrid(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate? GetGeohexGrid(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate? GetRange(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate? GetDateRange(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate? GetGeoDistance(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate? GetIpRange(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate? GetIpPrefix(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate? GetFilters(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate? GetAdjacencyMatrix(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate? GetSignificantStringTerms(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate? GetScriptedMetric(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate? GetTopHits(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate? GetInference(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate? GetStringStats(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate? GetTopMetrics(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate? GetTTest(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.RateAggregate? GetRate(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate? GetCumulativeCardinality(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate? GetMatrixStats(string key) => TryGet(key); - public Elastic.Clients.Elasticsearch.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; + public Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate? GetAdjacencyMatrix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate? GetAutoDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate? GetAverage(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate? GetBucketMetricValue(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate? GetCumulativeCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate? GetDateRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate? GetDerivative(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate? GetDoubleTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate? GetExtendedStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate? GetExtendedStatsBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate? GetFilter(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate? GetFilters(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate? GetFrequentItemSets(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate? GetGeoBounds(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate? GetGeoCentroid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate? GetGeoDistance(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate? GetGeohashGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate? GetGeohexGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate? GetGeoLine(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate? GetGeotileGrid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate? GetGlobal(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate? GetHdrPercentileRanks(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate? GetHdrPercentiles(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate? GetHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate? GetInference(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate? GetIpPrefix(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate? GetIpRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate? GetLongRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate? GetLongTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate? GetMatrixStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate? GetMax(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate? GetMedianAbsoluteDeviation(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MinAggregate? GetMin(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate? GetMissing(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate? GetMultiTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate? GetNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate? GetParent(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate? GetPercentilesBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate? GetRange(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.RateAggregate? GetRate(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate? GetReverseNested(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate? GetSampler(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate? GetScriptedMetric(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate? GetSignificantLongTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate? GetSignificantStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate? GetSimpleValue(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate? GetStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate? GetStatsBucket(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate? GetStringRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate? GetStringStats(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate? GetStringTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.SumAggregate? GetSum(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate? GetTDigestPercentileRanks(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate? GetTDigestPercentiles(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate? GetTopHits(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate? GetTopMetrics(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate? GetTTest(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate? GetUnmappedRareTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate? GetUnmappedSampler(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate? GetUnmappedSignificantTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate? GetUnmappedTerms(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate? GetValueCount(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate? GetVariableWidthHistogram(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate? GetWeightedAverage(string key) => TryGet(key); + private T? TryGet(string key) where T : class, IAggregate => BackingDictionary.TryGetValue(key, out var value) ? value as T : null; +} + +internal sealed partial class AggregateDictionaryConverter : JsonConverter +{ + public override AggregateDictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var dictionary = new Dictionary(); + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString(); + reader.Read(); + ReadItem(ref reader, options, dictionary, name); + } + + return new AggregateDictionary(dictionary); + } + + public override void Write(Utf8JsonWriter writer, AggregateDictionary value, JsonSerializerOptions options) + { + throw new NotImplementedException("'AggregateDictionary' is a readonly type, used only on responses and does not support being written to JSON."); + } + + public static void ReadItem(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary dictionary, string name) + { + var nameParts = name.Split('#'); + if (nameParts.Length != 2) + throw new JsonException($"Unable to parse typed-key '{name}'."); + var type = nameParts[0]; + switch (type) + { + case "adjacency_matrix": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "auto_date_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "avg": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "box_plot": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "bucket_metric_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "cardinality": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "children": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "composite": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "simple_long_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "date_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "date_range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "derivative": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "dterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "extended_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "extended_stats_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "filter": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "filters": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "frequent_item_sets": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_bounds": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_centroid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_distance": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geohash_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geohex_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geo_line": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "geotile_grid": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "global": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "hdr_percentile_ranks": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "hdr_percentiles": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "inference": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "ip_prefix": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "ip_range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "lrareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "lterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "matrix_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "max": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "median_absolute_deviation": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "min": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "missing": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "multi_terms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "nested": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "parent": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "percentiles_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "range": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "rate": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "reverse_nested": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sampler": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "scripted_metric": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "siglterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sigsterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "simple_value": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "stats_bucket": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "srareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "string_stats": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "sum": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "tdigest_percentile_ranks": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "tdigest_percentiles": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "top_hits": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "top_metrics": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "t_test": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umrareterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "unmapped_sampler": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umsigterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "umterms": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "value_count": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "variable_width_histogram": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "weighted_avg": + { + var item = JsonSerializer.Deserialize(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + default: + throw new NotSupportedException($"The tagged variant '{type}' is currently not supported."); + } + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs index 02673b72621..dad977c029d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -30,1192 +31,1404 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; [JsonConverter(typeof(AggregationConverter))] public sealed partial class Aggregation { - internal Aggregation(ISearchAggregation variant) => Variant = variant ?? throw new ArgumentNullException(nameof(variant)); + internal Aggregation(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 Aggregation AdjacencyMatrix(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => new Aggregation("adjacency_matrix", adjacencyMatrixAggregation); + public static Aggregation AutoDateHistogram(Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => new Aggregation("auto_date_histogram", autoDateHistogramAggregation); + public static Aggregation Avg(Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation averageAggregation) => new Aggregation("avg", averageAggregation); + public static Aggregation AvgBucket(Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation averageBucketAggregation) => new Aggregation("avg_bucket", averageBucketAggregation); + public static Aggregation Boxplot(Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation boxplotAggregation) => new Aggregation("boxplot", boxplotAggregation); + public static Aggregation BucketCorrelation(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation bucketCorrelationAggregation) => new Aggregation("bucket_correlation", bucketCorrelationAggregation); + public static Aggregation BucketCountKsTest(Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation bucketKsAggregation) => new Aggregation("bucket_count_ks_test", bucketKsAggregation); + public static Aggregation BucketScript(Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation bucketScriptAggregation) => new Aggregation("bucket_script", bucketScriptAggregation); + public static Aggregation BucketSelector(Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => new Aggregation("bucket_selector", bucketSelectorAggregation); + public static Aggregation BucketSort(Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation bucketSortAggregation) => new Aggregation("bucket_sort", bucketSortAggregation); + public static Aggregation Cardinality(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation cardinalityAggregation) => new Aggregation("cardinality", cardinalityAggregation); + public static Aggregation CategorizeText(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation categorizeTextAggregation) => new Aggregation("categorize_text", categorizeTextAggregation); + public static Aggregation Children(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation childrenAggregation) => new Aggregation("children", childrenAggregation); + public static Aggregation Composite(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation compositeAggregation) => new Aggregation("composite", compositeAggregation); + public static Aggregation CumulativeCardinality(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => new Aggregation("cumulative_cardinality", cumulativeCardinalityAggregation); + public static Aggregation CumulativeSum(Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => new Aggregation("cumulative_sum", cumulativeSumAggregation); + public static Aggregation DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation dateHistogramAggregation) => new Aggregation("date_histogram", dateHistogramAggregation); + public static Aggregation DateRange(Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation dateRangeAggregation) => new Aggregation("date_range", dateRangeAggregation); + public static Aggregation Derivative(Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation derivativeAggregation) => new Aggregation("derivative", derivativeAggregation); + public static Aggregation DiversifiedSampler(Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => new Aggregation("diversified_sampler", diversifiedSamplerAggregation); + public static Aggregation ExtendedStats(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => new Aggregation("extended_stats", extendedStatsAggregation); + public static Aggregation ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => new Aggregation("extended_stats_bucket", extendedStatsBucketAggregation); + public static Aggregation Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query queryContainer) => new Aggregation("filter", queryContainer); + public static Aggregation Filters(Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation filtersAggregation) => new Aggregation("filters", filtersAggregation); + public static Aggregation FrequentItemSets(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => new Aggregation("frequent_item_sets", frequentItemSetsAggregation); + public static Aggregation GeoBounds(Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => new Aggregation("geo_bounds", geoBoundsAggregation); + public static Aggregation GeoCentroid(Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => new Aggregation("geo_centroid", geoCentroidAggregation); + public static Aggregation GeoDistance(Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => new Aggregation("geo_distance", geoDistanceAggregation); + public static Aggregation GeohashGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation geohashGridAggregation) => new Aggregation("geohash_grid", geohashGridAggregation); + public static Aggregation GeohexGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation geohexGridAggregation) => new Aggregation("geohex_grid", geohexGridAggregation); + public static Aggregation GeoLine(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => new Aggregation("geo_line", geoLineAggregation); + public static Aggregation GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => new Aggregation("geotile_grid", geotileGridAggregation); + public static Aggregation Global(Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation globalAggregation) => new Aggregation("global", globalAggregation); + public static Aggregation Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => new Aggregation("histogram", histogramAggregation); + public static Aggregation Inference(Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation inferenceAggregation) => new Aggregation("inference", inferenceAggregation); + public static Aggregation IpPrefix(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation ipPrefixAggregation) => new Aggregation("ip_prefix", ipPrefixAggregation); + public static Aggregation IpRange(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation ipRangeAggregation) => new Aggregation("ip_range", ipRangeAggregation); + public static Aggregation Line(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => new Aggregation("line", geoLineAggregation); + public static Aggregation MatrixStats(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => new Aggregation("matrix_stats", matrixStatsAggregation); + public static Aggregation Max(Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation maxAggregation) => new Aggregation("max", maxAggregation); + public static Aggregation MaxBucket(Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation maxBucketAggregation) => new Aggregation("max_bucket", maxBucketAggregation); + public static Aggregation MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => new Aggregation("median_absolute_deviation", medianAbsoluteDeviationAggregation); + public static Aggregation Min(Elastic.Clients.Elasticsearch.Aggregations.MinAggregation minAggregation) => new Aggregation("min", minAggregation); + public static Aggregation MinBucket(Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation minBucketAggregation) => new Aggregation("min_bucket", minBucketAggregation); + public static Aggregation Missing(Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation missingAggregation) => new Aggregation("missing", missingAggregation); + public static Aggregation MovingFn(Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => new Aggregation("moving_fn", movingFunctionAggregation); + public static Aggregation MovingPercentiles(Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => new Aggregation("moving_percentiles", movingPercentilesAggregation); + public static Aggregation MultiTerms(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation multiTermsAggregation) => new Aggregation("multi_terms", multiTermsAggregation); + public static Aggregation Nested(Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation nestedAggregation) => new Aggregation("nested", nestedAggregation); + public static Aggregation Normalize(Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation normalizeAggregation) => new Aggregation("normalize", normalizeAggregation); + public static Aggregation Parent(Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation parentAggregation) => new Aggregation("parent", parentAggregation); + public static Aggregation PercentileRanks(Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => new Aggregation("percentile_ranks", percentileRanksAggregation); + public static Aggregation Percentiles(Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation percentilesAggregation) => new Aggregation("percentiles", percentilesAggregation); + public static Aggregation PercentilesBucket(Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => new Aggregation("percentiles_bucket", percentilesBucketAggregation); + public static Aggregation Range(Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation rangeAggregation) => new Aggregation("range", rangeAggregation); + public static Aggregation RareTerms(Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation rareTermsAggregation) => new Aggregation("rare_terms", rareTermsAggregation); + public static Aggregation Rate(Elastic.Clients.Elasticsearch.Aggregations.RateAggregation rateAggregation) => new Aggregation("rate", rateAggregation); + public static Aggregation ReverseNested(Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => new Aggregation("reverse_nested", reverseNestedAggregation); + public static Aggregation Sampler(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation samplerAggregation) => new Aggregation("sampler", samplerAggregation); + public static Aggregation ScriptedMetric(Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => new Aggregation("scripted_metric", scriptedMetricAggregation); + public static Aggregation SerialDiff(Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => new Aggregation("serial_diff", serialDifferencingAggregation); + public static Aggregation SignificantTerms(Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation significantTermsAggregation) => new Aggregation("significant_terms", significantTermsAggregation); + public static Aggregation SignificantText(Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation significantTextAggregation) => new Aggregation("significant_text", significantTextAggregation); + public static Aggregation Stats(Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation statsAggregation) => new Aggregation("stats", statsAggregation); + public static Aggregation StatsBucket(Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation statsBucketAggregation) => new Aggregation("stats_bucket", statsBucketAggregation); + public static Aggregation StringStats(Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation stringStatsAggregation) => new Aggregation("string_stats", stringStatsAggregation); + public static Aggregation Sum(Elastic.Clients.Elasticsearch.Aggregations.SumAggregation sumAggregation) => new Aggregation("sum", sumAggregation); + public static Aggregation SumBucket(Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation sumBucketAggregation) => new Aggregation("sum_bucket", sumBucketAggregation); + public static Aggregation Terms(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation termsAggregation) => new Aggregation("terms", termsAggregation); + public static Aggregation TopHits(Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation topHitsAggregation) => new Aggregation("top_hits", topHitsAggregation); + public static Aggregation TopMetrics(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation topMetricsAggregation) => new Aggregation("top_metrics", topMetricsAggregation); + public static Aggregation TTest(Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation tTestAggregation) => new Aggregation("t_test", tTestAggregation); + public static Aggregation ValueCount(Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation valueCountAggregation) => new Aggregation("value_count", valueCountAggregation); + public static Aggregation VariableWidthHistogram(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => new Aggregation("variable_width_histogram", variableWidthHistogramAggregation); + public static Aggregation WeightedAvg(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => new Aggregation("weighted_avg", weightedAverageAggregation); + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ [JsonInclude, JsonPropertyName("aggregations")] + public IDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal ISearchAggregation Variant { get; } + return false; + } } 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 == "geohash_grid") - { - return AggregationSerializationHelper.ReadContainer("geohash_grid", ref reader, options); - } - - if (propertyName == "geohex_grid") - { - return AggregationSerializationHelper.ReadContainer("geohex_grid", ref reader, options); - } - - if (propertyName == "geo_line") - { - return AggregationSerializationHelper.ReadContainer("geo_line", 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") + if (reader.TokenType != JsonTokenType.StartObject) { - return AggregationSerializationHelper.ReadContainer("significant_terms", ref reader, options); + throw new JsonException("Expected start token."); } - if (propertyName == "stats") + object? variantValue = default; + string? variantNameValue = default; + IDictionary? aggregationsValue = default; + IDictionary? metaValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - return AggregationSerializationHelper.ReadContainer("stats", ref reader, options); + 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 == "aggregations") + { + aggregationsValue = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (propertyName == "meta") + { + metaValue = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (propertyName == "adjacency_matrix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "auto_date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "avg") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "avg_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "boxplot") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_correlation") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_count_ks_test") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_selector") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "bucket_sort") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cardinality") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "categorize_text") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "children") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "composite") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cumulative_cardinality") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "cumulative_sum") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "date_range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "derivative") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "diversified_sampler") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "extended_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "extended_stats_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "filter") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "filters") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "frequent_item_sets") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_bounds") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_centroid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_distance") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geohash_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geohex_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geo_line") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "geotile_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "global") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "inference") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ip_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ip_range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "line") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "matrix_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "max") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "max_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "median_absolute_deviation") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "min") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "min_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "missing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "moving_fn") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "moving_percentiles") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "multi_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "normalize") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "parent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentile_ranks") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentiles") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "percentiles_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "rare_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "rate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "reverse_nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sampler") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "scripted_metric") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "serial_diff") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "significant_terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "significant_text") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stats_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "string_stats") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sum") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "sum_bucket") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "top_hits") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "top_metrics") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "t_test") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "value_count") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "variable_width_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "weighted_avg") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Aggregation' from the response."); } - if (propertyName == "stats_bucket") - { - return AggregationSerializationHelper.ReadContainer("stats_bucket", ref reader, options); - } + reader.Read(); + var result = new Aggregation(variantNameValue, variantValue); + result.Aggregations = aggregationsValue; + result.Meta = metaValue; + return result; + } - if (propertyName == "string_stats") + public override void Write(Utf8JsonWriter writer, Aggregation value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) { - return AggregationSerializationHelper.ReadContainer("string_stats", ref reader, options); + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); } - if (propertyName == "sum") + if (value.Meta is not null) { - return AggregationSerializationHelper.ReadContainer("sum", ref reader, options); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, value.Meta, options); } - if (propertyName == "terms") + if (value.VariantName is not null && value.Variant is not null) { - return AggregationSerializationHelper.ReadContainer("terms", ref reader, options); + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "adjacency_matrix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation)value.Variant, options); + break; + case "auto_date_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation)value.Variant, options); + break; + case "avg": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation)value.Variant, options); + break; + case "avg_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation)value.Variant, options); + break; + case "boxplot": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation)value.Variant, options); + break; + case "bucket_correlation": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation)value.Variant, options); + break; + case "bucket_count_ks_test": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation)value.Variant, options); + break; + case "bucket_script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation)value.Variant, options); + break; + case "bucket_selector": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation)value.Variant, options); + break; + case "bucket_sort": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation)value.Variant, options); + break; + case "cardinality": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, options); + break; + case "categorize_text": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation)value.Variant, options); + break; + case "children": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation)value.Variant, options); + break; + case "composite": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation)value.Variant, options); + break; + case "cumulative_cardinality": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation)value.Variant, options); + break; + case "cumulative_sum": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation)value.Variant, options); + break; + case "date_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation)value.Variant, options); + break; + case "date_range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation)value.Variant, options); + break; + case "derivative": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation)value.Variant, options); + break; + case "diversified_sampler": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation)value.Variant, options); + break; + case "extended_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation)value.Variant, options); + break; + case "extended_stats_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation)value.Variant, options); + break; + case "filter": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Query)value.Variant, options); + break; + case "filters": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation)value.Variant, options); + break; + case "frequent_item_sets": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation)value.Variant, options); + break; + case "geo_bounds": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation)value.Variant, options); + break; + case "geo_centroid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation)value.Variant, options); + break; + case "geo_distance": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation)value.Variant, options); + break; + case "geohash_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation)value.Variant, options); + break; + case "geohex_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation)value.Variant, options); + break; + case "geo_line": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, options); + break; + case "geotile_grid": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation)value.Variant, options); + break; + case "global": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation)value.Variant, options); + break; + case "histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation)value.Variant, options); + break; + case "inference": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation)value.Variant, options); + break; + case "ip_prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation)value.Variant, options); + break; + case "ip_range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation)value.Variant, options); + break; + case "line": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, options); + break; + case "matrix_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation)value.Variant, options); + break; + case "max": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation)value.Variant, options); + break; + case "max_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation)value.Variant, options); + break; + case "median_absolute_deviation": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation)value.Variant, options); + break; + case "min": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MinAggregation)value.Variant, options); + break; + case "min_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation)value.Variant, options); + break; + case "missing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation)value.Variant, options); + break; + case "moving_fn": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation)value.Variant, options); + break; + case "moving_percentiles": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation)value.Variant, options); + break; + case "multi_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation)value.Variant, options); + break; + case "nested": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation)value.Variant, options); + break; + case "normalize": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation)value.Variant, options); + break; + case "parent": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation)value.Variant, options); + break; + case "percentile_ranks": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation)value.Variant, options); + break; + case "percentiles": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation)value.Variant, options); + break; + case "percentiles_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation)value.Variant, options); + break; + case "range": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation)value.Variant, options); + break; + case "rare_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation)value.Variant, options); + break; + case "rate": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.RateAggregation)value.Variant, options); + break; + case "reverse_nested": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation)value.Variant, options); + break; + case "sampler": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation)value.Variant, options); + break; + case "scripted_metric": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation)value.Variant, options); + break; + case "serial_diff": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation)value.Variant, options); + break; + case "significant_terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation)value.Variant, options); + break; + case "significant_text": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation)value.Variant, options); + break; + case "stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation)value.Variant, options); + break; + case "stats_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation)value.Variant, options); + break; + case "string_stats": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation)value.Variant, options); + break; + case "sum": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SumAggregation)value.Variant, options); + break; + case "sum_bucket": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation)value.Variant, options); + break; + case "terms": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, options); + break; + case "top_hits": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation)value.Variant, options); + break; + case "top_metrics": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation)value.Variant, options); + break; + case "t_test": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation)value.Variant, options); + break; + case "value_count": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation)value.Variant, options); + break; + case "variable_width_histogram": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation)value.Variant, options); + break; + case "weighted_avg": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation)value.Variant, options); + break; + } } - if (propertyName == "top_hits") - { - return AggregationSerializationHelper.ReadContainer("top_hits", ref reader, options); - } + writer.WriteEndObject(); + } +} - if (propertyName == "top_metrics") - { - return AggregationSerializationHelper.ReadContainer("top_metrics", ref reader, options); - } +public sealed partial class AggregationDescriptor : SerializableDescriptor> +{ + internal AggregationDescriptor(Action> configure) => configure.Invoke(this); - if (propertyName == "t_test") - { - return AggregationSerializationHelper.ReadContainer("t_test", ref reader, options); - } + public AggregationDescriptor() : base() + { + } - if (propertyName == "value_count") + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private AggregationDescriptor 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 AggregationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private IDictionary> AggregationsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ public AggregationDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + public AggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregationDescriptor AdjacencyMatrix(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Set(adjacencyMatrixAggregation, "adjacency_matrix"); + public AggregationDescriptor AdjacencyMatrix(Action> configure) => Set(configure, "adjacency_matrix"); + public AggregationDescriptor AutoDateHistogram(Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => Set(autoDateHistogramAggregation, "auto_date_histogram"); + public AggregationDescriptor AutoDateHistogram(Action> configure) => Set(configure, "auto_date_histogram"); + public AggregationDescriptor Avg(Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation averageAggregation) => Set(averageAggregation, "avg"); + public AggregationDescriptor Avg(Action> configure) => Set(configure, "avg"); + public AggregationDescriptor AvgBucket(Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation averageBucketAggregation) => Set(averageBucketAggregation, "avg_bucket"); + public AggregationDescriptor AvgBucket(Action configure) => Set(configure, "avg_bucket"); + public AggregationDescriptor Boxplot(Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation boxplotAggregation) => Set(boxplotAggregation, "boxplot"); + public AggregationDescriptor Boxplot(Action> configure) => Set(configure, "boxplot"); + public AggregationDescriptor BucketCorrelation(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation bucketCorrelationAggregation) => Set(bucketCorrelationAggregation, "bucket_correlation"); + public AggregationDescriptor BucketCorrelation(Action configure) => Set(configure, "bucket_correlation"); + public AggregationDescriptor BucketCountKsTest(Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation bucketKsAggregation) => Set(bucketKsAggregation, "bucket_count_ks_test"); + public AggregationDescriptor BucketCountKsTest(Action configure) => Set(configure, "bucket_count_ks_test"); + public AggregationDescriptor BucketScript(Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation bucketScriptAggregation) => Set(bucketScriptAggregation, "bucket_script"); + public AggregationDescriptor BucketScript(Action configure) => Set(configure, "bucket_script"); + public AggregationDescriptor BucketSelector(Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => Set(bucketSelectorAggregation, "bucket_selector"); + public AggregationDescriptor BucketSelector(Action configure) => Set(configure, "bucket_selector"); + public AggregationDescriptor BucketSort(Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation bucketSortAggregation) => Set(bucketSortAggregation, "bucket_sort"); + public AggregationDescriptor BucketSort(Action> configure) => Set(configure, "bucket_sort"); + public AggregationDescriptor Cardinality(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation cardinalityAggregation) => Set(cardinalityAggregation, "cardinality"); + public AggregationDescriptor Cardinality(Action> configure) => Set(configure, "cardinality"); + public AggregationDescriptor CategorizeText(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation categorizeTextAggregation) => Set(categorizeTextAggregation, "categorize_text"); + public AggregationDescriptor CategorizeText(Action> configure) => Set(configure, "categorize_text"); + public AggregationDescriptor Children(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation childrenAggregation) => Set(childrenAggregation, "children"); + public AggregationDescriptor Children(Action configure) => Set(configure, "children"); + public AggregationDescriptor Composite(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation compositeAggregation) => Set(compositeAggregation, "composite"); + public AggregationDescriptor Composite(Action> configure) => Set(configure, "composite"); + public AggregationDescriptor CumulativeCardinality(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Set(cumulativeCardinalityAggregation, "cumulative_cardinality"); + public AggregationDescriptor CumulativeCardinality(Action configure) => Set(configure, "cumulative_cardinality"); + public AggregationDescriptor CumulativeSum(Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => Set(cumulativeSumAggregation, "cumulative_sum"); + public AggregationDescriptor CumulativeSum(Action configure) => Set(configure, "cumulative_sum"); + public AggregationDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public AggregationDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public AggregationDescriptor DateRange(Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation dateRangeAggregation) => Set(dateRangeAggregation, "date_range"); + public AggregationDescriptor DateRange(Action> configure) => Set(configure, "date_range"); + public AggregationDescriptor Derivative(Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation derivativeAggregation) => Set(derivativeAggregation, "derivative"); + public AggregationDescriptor Derivative(Action configure) => Set(configure, "derivative"); + public AggregationDescriptor DiversifiedSampler(Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Set(diversifiedSamplerAggregation, "diversified_sampler"); + public AggregationDescriptor DiversifiedSampler(Action> configure) => Set(configure, "diversified_sampler"); + public AggregationDescriptor ExtendedStats(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => Set(extendedStatsAggregation, "extended_stats"); + public AggregationDescriptor ExtendedStats(Action> configure) => Set(configure, "extended_stats"); + public AggregationDescriptor ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Set(extendedStatsBucketAggregation, "extended_stats_bucket"); + public AggregationDescriptor ExtendedStatsBucket(Action configure) => Set(configure, "extended_stats_bucket"); + public AggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query queryContainer) => Set(queryContainer, "filter"); + public AggregationDescriptor Filter(Action> configure) => Set(configure, "filter"); + public AggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation filtersAggregation) => Set(filtersAggregation, "filters"); + public AggregationDescriptor Filters(Action> configure) => Set(configure, "filters"); + public AggregationDescriptor FrequentItemSets(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => Set(frequentItemSetsAggregation, "frequent_item_sets"); + public AggregationDescriptor FrequentItemSets(Action> configure) => Set(configure, "frequent_item_sets"); + public AggregationDescriptor GeoBounds(Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => Set(geoBoundsAggregation, "geo_bounds"); + public AggregationDescriptor GeoBounds(Action> configure) => Set(configure, "geo_bounds"); + public AggregationDescriptor GeoCentroid(Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => Set(geoCentroidAggregation, "geo_centroid"); + public AggregationDescriptor GeoCentroid(Action> configure) => Set(configure, "geo_centroid"); + public AggregationDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => Set(geoDistanceAggregation, "geo_distance"); + public AggregationDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public AggregationDescriptor GeohashGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation geohashGridAggregation) => Set(geohashGridAggregation, "geohash_grid"); + public AggregationDescriptor GeohashGrid(Action> configure) => Set(configure, "geohash_grid"); + public AggregationDescriptor GeohexGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation geohexGridAggregation) => Set(geohexGridAggregation, "geohex_grid"); + public AggregationDescriptor GeohexGrid(Action> configure) => Set(configure, "geohex_grid"); + public AggregationDescriptor GeoLine(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "geo_line"); + public AggregationDescriptor GeoLine(Action> configure) => Set(configure, "geo_line"); + public AggregationDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public AggregationDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public AggregationDescriptor Global(Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation globalAggregation) => Set(globalAggregation, "global"); + public AggregationDescriptor Global(Action configure) => Set(configure, "global"); + public AggregationDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public AggregationDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public AggregationDescriptor Inference(Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation inferenceAggregation) => Set(inferenceAggregation, "inference"); + public AggregationDescriptor Inference(Action> configure) => Set(configure, "inference"); + public AggregationDescriptor IpPrefix(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation ipPrefixAggregation) => Set(ipPrefixAggregation, "ip_prefix"); + public AggregationDescriptor IpPrefix(Action> configure) => Set(configure, "ip_prefix"); + public AggregationDescriptor IpRange(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation ipRangeAggregation) => Set(ipRangeAggregation, "ip_range"); + public AggregationDescriptor IpRange(Action> configure) => Set(configure, "ip_range"); + public AggregationDescriptor Line(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "line"); + public AggregationDescriptor Line(Action> configure) => Set(configure, "line"); + public AggregationDescriptor MatrixStats(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => Set(matrixStatsAggregation, "matrix_stats"); + public AggregationDescriptor MatrixStats(Action> configure) => Set(configure, "matrix_stats"); + public AggregationDescriptor Max(Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation maxAggregation) => Set(maxAggregation, "max"); + public AggregationDescriptor Max(Action> configure) => Set(configure, "max"); + public AggregationDescriptor MaxBucket(Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation maxBucketAggregation) => Set(maxBucketAggregation, "max_bucket"); + public AggregationDescriptor MaxBucket(Action configure) => Set(configure, "max_bucket"); + public AggregationDescriptor MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Set(medianAbsoluteDeviationAggregation, "median_absolute_deviation"); + public AggregationDescriptor MedianAbsoluteDeviation(Action> configure) => Set(configure, "median_absolute_deviation"); + public AggregationDescriptor Min(Elastic.Clients.Elasticsearch.Aggregations.MinAggregation minAggregation) => Set(minAggregation, "min"); + public AggregationDescriptor Min(Action> configure) => Set(configure, "min"); + public AggregationDescriptor MinBucket(Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation minBucketAggregation) => Set(minBucketAggregation, "min_bucket"); + public AggregationDescriptor MinBucket(Action configure) => Set(configure, "min_bucket"); + public AggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation missingAggregation) => Set(missingAggregation, "missing"); + public AggregationDescriptor Missing(Action> configure) => Set(configure, "missing"); + public AggregationDescriptor MovingFn(Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => Set(movingFunctionAggregation, "moving_fn"); + public AggregationDescriptor MovingFn(Action configure) => Set(configure, "moving_fn"); + public AggregationDescriptor MovingPercentiles(Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => Set(movingPercentilesAggregation, "moving_percentiles"); + public AggregationDescriptor MovingPercentiles(Action configure) => Set(configure, "moving_percentiles"); + public AggregationDescriptor MultiTerms(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation multiTermsAggregation) => Set(multiTermsAggregation, "multi_terms"); + public AggregationDescriptor MultiTerms(Action> configure) => Set(configure, "multi_terms"); + public AggregationDescriptor Nested(Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation nestedAggregation) => Set(nestedAggregation, "nested"); + public AggregationDescriptor Nested(Action> configure) => Set(configure, "nested"); + public AggregationDescriptor Normalize(Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation normalizeAggregation) => Set(normalizeAggregation, "normalize"); + public AggregationDescriptor Normalize(Action configure) => Set(configure, "normalize"); + public AggregationDescriptor Parent(Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation parentAggregation) => Set(parentAggregation, "parent"); + public AggregationDescriptor Parent(Action configure) => Set(configure, "parent"); + public AggregationDescriptor PercentileRanks(Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => Set(percentileRanksAggregation, "percentile_ranks"); + public AggregationDescriptor PercentileRanks(Action> configure) => Set(configure, "percentile_ranks"); + public AggregationDescriptor Percentiles(Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation percentilesAggregation) => Set(percentilesAggregation, "percentiles"); + public AggregationDescriptor Percentiles(Action> configure) => Set(configure, "percentiles"); + public AggregationDescriptor PercentilesBucket(Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => Set(percentilesBucketAggregation, "percentiles_bucket"); + public AggregationDescriptor PercentilesBucket(Action configure) => Set(configure, "percentiles_bucket"); + public AggregationDescriptor Range(Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation rangeAggregation) => Set(rangeAggregation, "range"); + public AggregationDescriptor Range(Action> configure) => Set(configure, "range"); + public AggregationDescriptor RareTerms(Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation rareTermsAggregation) => Set(rareTermsAggregation, "rare_terms"); + public AggregationDescriptor RareTerms(Action> configure) => Set(configure, "rare_terms"); + public AggregationDescriptor Rate(Elastic.Clients.Elasticsearch.Aggregations.RateAggregation rateAggregation) => Set(rateAggregation, "rate"); + public AggregationDescriptor Rate(Action> configure) => Set(configure, "rate"); + public AggregationDescriptor ReverseNested(Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => Set(reverseNestedAggregation, "reverse_nested"); + public AggregationDescriptor ReverseNested(Action> configure) => Set(configure, "reverse_nested"); + public AggregationDescriptor Sampler(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation samplerAggregation) => Set(samplerAggregation, "sampler"); + public AggregationDescriptor Sampler(Action configure) => Set(configure, "sampler"); + public AggregationDescriptor ScriptedMetric(Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => Set(scriptedMetricAggregation, "scripted_metric"); + public AggregationDescriptor ScriptedMetric(Action> configure) => Set(configure, "scripted_metric"); + public AggregationDescriptor SerialDiff(Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => Set(serialDifferencingAggregation, "serial_diff"); + public AggregationDescriptor SerialDiff(Action configure) => Set(configure, "serial_diff"); + public AggregationDescriptor SignificantTerms(Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation significantTermsAggregation) => Set(significantTermsAggregation, "significant_terms"); + public AggregationDescriptor SignificantTerms(Action> configure) => Set(configure, "significant_terms"); + public AggregationDescriptor SignificantText(Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation significantTextAggregation) => Set(significantTextAggregation, "significant_text"); + public AggregationDescriptor SignificantText(Action> configure) => Set(configure, "significant_text"); + public AggregationDescriptor Stats(Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation statsAggregation) => Set(statsAggregation, "stats"); + public AggregationDescriptor Stats(Action> configure) => Set(configure, "stats"); + public AggregationDescriptor StatsBucket(Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation statsBucketAggregation) => Set(statsBucketAggregation, "stats_bucket"); + public AggregationDescriptor StatsBucket(Action configure) => Set(configure, "stats_bucket"); + public AggregationDescriptor StringStats(Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation stringStatsAggregation) => Set(stringStatsAggregation, "string_stats"); + public AggregationDescriptor StringStats(Action> configure) => Set(configure, "string_stats"); + public AggregationDescriptor Sum(Elastic.Clients.Elasticsearch.Aggregations.SumAggregation sumAggregation) => Set(sumAggregation, "sum"); + public AggregationDescriptor Sum(Action> configure) => Set(configure, "sum"); + public AggregationDescriptor SumBucket(Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation sumBucketAggregation) => Set(sumBucketAggregation, "sum_bucket"); + public AggregationDescriptor SumBucket(Action configure) => Set(configure, "sum_bucket"); + public AggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public AggregationDescriptor Terms(Action> configure) => Set(configure, "terms"); + public AggregationDescriptor TopHits(Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation topHitsAggregation) => Set(topHitsAggregation, "top_hits"); + public AggregationDescriptor TopHits(Action> configure) => Set(configure, "top_hits"); + public AggregationDescriptor TopMetrics(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation topMetricsAggregation) => Set(topMetricsAggregation, "top_metrics"); + public AggregationDescriptor TopMetrics(Action> configure) => Set(configure, "top_metrics"); + public AggregationDescriptor TTest(Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation tTestAggregation) => Set(tTestAggregation, "t_test"); + public AggregationDescriptor TTest(Action> configure) => Set(configure, "t_test"); + public AggregationDescriptor ValueCount(Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation valueCountAggregation) => Set(valueCountAggregation, "value_count"); + public AggregationDescriptor ValueCount(Action> configure) => Set(configure, "value_count"); + public AggregationDescriptor VariableWidthHistogram(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Set(variableWidthHistogramAggregation, "variable_width_histogram"); + public AggregationDescriptor VariableWidthHistogram(Action> configure) => Set(configure, "variable_width_histogram"); + public AggregationDescriptor WeightedAvg(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => Set(weightedAverageAggregation, "weighted_avg"); + public AggregationDescriptor WeightedAvg(Action> configure) => Set(configure, "weighted_avg"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) { - return AggregationSerializationHelper.ReadContainer("value_count", ref reader, options); + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); } - if (propertyName == "variable_width_histogram") + if (MetaValue is not null) { - return AggregationSerializationHelper.ReadContainer("variable_width_histogram", ref reader, options); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } - if (propertyName == "weighted_avg") + if (!string.IsNullOrEmpty(ContainedVariantName)) { - return AggregationSerializationHelper.ReadContainer("weighted_avg", ref reader, options); + 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); } - 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"); - } + writer.WriteEndObject(); } } -public sealed partial class AggregationDescriptor : SerializableDescriptor> +public sealed partial class AggregationDescriptor : SerializableDescriptor { - internal AggregationDescriptor(Action> configure) => configure.Invoke(this); + 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)); - } + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private AggregationDescriptor 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 AggregationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + private IDictionary AggregationsValue { get; set; } + private IDictionary? MetaValue { get; set; } + + /// + /// Sub-aggregations for this aggregation.
Only applies to bucket aggregations.
+ ///
+ public AggregationDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + public AggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AggregationDescriptor AdjacencyMatrix(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation adjacencyMatrixAggregation) => Set(adjacencyMatrixAggregation, "adjacency_matrix"); + public AggregationDescriptor AdjacencyMatrix(Action configure) => Set(configure, "adjacency_matrix"); + public AggregationDescriptor AutoDateHistogram(Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation autoDateHistogramAggregation) => Set(autoDateHistogramAggregation, "auto_date_histogram"); + public AggregationDescriptor AutoDateHistogram(Action configure) => Set(configure, "auto_date_histogram"); + public AggregationDescriptor Avg(Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation averageAggregation) => Set(averageAggregation, "avg"); + public AggregationDescriptor Avg(Action configure) => Set(configure, "avg"); + public AggregationDescriptor AvgBucket(Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation averageBucketAggregation) => Set(averageBucketAggregation, "avg_bucket"); + public AggregationDescriptor AvgBucket(Action configure) => Set(configure, "avg_bucket"); + public AggregationDescriptor Boxplot(Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation boxplotAggregation) => Set(boxplotAggregation, "boxplot"); + public AggregationDescriptor Boxplot(Action configure) => Set(configure, "boxplot"); + public AggregationDescriptor BucketCorrelation(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation bucketCorrelationAggregation) => Set(bucketCorrelationAggregation, "bucket_correlation"); + public AggregationDescriptor BucketCorrelation(Action configure) => Set(configure, "bucket_correlation"); + public AggregationDescriptor BucketCountKsTest(Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation bucketKsAggregation) => Set(bucketKsAggregation, "bucket_count_ks_test"); + public AggregationDescriptor BucketCountKsTest(Action configure) => Set(configure, "bucket_count_ks_test"); + public AggregationDescriptor BucketScript(Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation bucketScriptAggregation) => Set(bucketScriptAggregation, "bucket_script"); + public AggregationDescriptor BucketScript(Action configure) => Set(configure, "bucket_script"); + public AggregationDescriptor BucketSelector(Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation bucketSelectorAggregation) => Set(bucketSelectorAggregation, "bucket_selector"); + public AggregationDescriptor BucketSelector(Action configure) => Set(configure, "bucket_selector"); + public AggregationDescriptor BucketSort(Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation bucketSortAggregation) => Set(bucketSortAggregation, "bucket_sort"); + public AggregationDescriptor BucketSort(Action configure) => Set(configure, "bucket_sort"); + public AggregationDescriptor Cardinality(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation cardinalityAggregation) => Set(cardinalityAggregation, "cardinality"); + public AggregationDescriptor Cardinality(Action configure) => Set(configure, "cardinality"); + public AggregationDescriptor CategorizeText(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation categorizeTextAggregation) => Set(categorizeTextAggregation, "categorize_text"); + public AggregationDescriptor CategorizeText(Action configure) => Set(configure, "categorize_text"); + public AggregationDescriptor Children(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation childrenAggregation) => Set(childrenAggregation, "children"); + public AggregationDescriptor Children(Action configure) => Set(configure, "children"); + public AggregationDescriptor Composite(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation compositeAggregation) => Set(compositeAggregation, "composite"); + public AggregationDescriptor Composite(Action configure) => Set(configure, "composite"); + public AggregationDescriptor CumulativeCardinality(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Set(cumulativeCardinalityAggregation, "cumulative_cardinality"); + public AggregationDescriptor CumulativeCardinality(Action configure) => Set(configure, "cumulative_cardinality"); + public AggregationDescriptor CumulativeSum(Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation cumulativeSumAggregation) => Set(cumulativeSumAggregation, "cumulative_sum"); + public AggregationDescriptor CumulativeSum(Action configure) => Set(configure, "cumulative_sum"); + public AggregationDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public AggregationDescriptor DateHistogram(Action configure) => Set(configure, "date_histogram"); + public AggregationDescriptor DateRange(Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation dateRangeAggregation) => Set(dateRangeAggregation, "date_range"); + public AggregationDescriptor DateRange(Action configure) => Set(configure, "date_range"); + public AggregationDescriptor Derivative(Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation derivativeAggregation) => Set(derivativeAggregation, "derivative"); + public AggregationDescriptor Derivative(Action configure) => Set(configure, "derivative"); + public AggregationDescriptor DiversifiedSampler(Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Set(diversifiedSamplerAggregation, "diversified_sampler"); + public AggregationDescriptor DiversifiedSampler(Action configure) => Set(configure, "diversified_sampler"); + public AggregationDescriptor ExtendedStats(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation extendedStatsAggregation) => Set(extendedStatsAggregation, "extended_stats"); + public AggregationDescriptor ExtendedStats(Action configure) => Set(configure, "extended_stats"); + public AggregationDescriptor ExtendedStatsBucket(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Set(extendedStatsBucketAggregation, "extended_stats_bucket"); + public AggregationDescriptor ExtendedStatsBucket(Action configure) => Set(configure, "extended_stats_bucket"); + public AggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query queryContainer) => Set(queryContainer, "filter"); + public AggregationDescriptor Filter(Action configure) => Set(configure, "filter"); + public AggregationDescriptor Filters(Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation filtersAggregation) => Set(filtersAggregation, "filters"); + public AggregationDescriptor Filters(Action configure) => Set(configure, "filters"); + public AggregationDescriptor FrequentItemSets(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation frequentItemSetsAggregation) => Set(frequentItemSetsAggregation, "frequent_item_sets"); + public AggregationDescriptor FrequentItemSets(Action configure) => Set(configure, "frequent_item_sets"); + public AggregationDescriptor GeoBounds(Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation geoBoundsAggregation) => Set(geoBoundsAggregation, "geo_bounds"); + public AggregationDescriptor GeoBounds(Action configure) => Set(configure, "geo_bounds"); + public AggregationDescriptor GeoCentroid(Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation geoCentroidAggregation) => Set(geoCentroidAggregation, "geo_centroid"); + public AggregationDescriptor GeoCentroid(Action configure) => Set(configure, "geo_centroid"); + public AggregationDescriptor GeoDistance(Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation geoDistanceAggregation) => Set(geoDistanceAggregation, "geo_distance"); + public AggregationDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); + public AggregationDescriptor GeohashGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation geohashGridAggregation) => Set(geohashGridAggregation, "geohash_grid"); + public AggregationDescriptor GeohashGrid(Action configure) => Set(configure, "geohash_grid"); + public AggregationDescriptor GeohexGrid(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation geohexGridAggregation) => Set(geohexGridAggregation, "geohex_grid"); + public AggregationDescriptor GeohexGrid(Action configure) => Set(configure, "geohex_grid"); + public AggregationDescriptor GeoLine(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "geo_line"); + public AggregationDescriptor GeoLine(Action configure) => Set(configure, "geo_line"); + public AggregationDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public AggregationDescriptor GeotileGrid(Action configure) => Set(configure, "geotile_grid"); + public AggregationDescriptor Global(Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation globalAggregation) => Set(globalAggregation, "global"); + public AggregationDescriptor Global(Action configure) => Set(configure, "global"); + public AggregationDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public AggregationDescriptor Histogram(Action configure) => Set(configure, "histogram"); + public AggregationDescriptor Inference(Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation inferenceAggregation) => Set(inferenceAggregation, "inference"); + public AggregationDescriptor Inference(Action configure) => Set(configure, "inference"); + public AggregationDescriptor IpPrefix(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation ipPrefixAggregation) => Set(ipPrefixAggregation, "ip_prefix"); + public AggregationDescriptor IpPrefix(Action configure) => Set(configure, "ip_prefix"); + public AggregationDescriptor IpRange(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation ipRangeAggregation) => Set(ipRangeAggregation, "ip_range"); + public AggregationDescriptor IpRange(Action configure) => Set(configure, "ip_range"); + public AggregationDescriptor Line(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation geoLineAggregation) => Set(geoLineAggregation, "line"); + public AggregationDescriptor Line(Action configure) => Set(configure, "line"); + public AggregationDescriptor MatrixStats(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation matrixStatsAggregation) => Set(matrixStatsAggregation, "matrix_stats"); + public AggregationDescriptor MatrixStats(Action configure) => Set(configure, "matrix_stats"); + public AggregationDescriptor Max(Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation maxAggregation) => Set(maxAggregation, "max"); + public AggregationDescriptor Max(Action configure) => Set(configure, "max"); + public AggregationDescriptor MaxBucket(Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation maxBucketAggregation) => Set(maxBucketAggregation, "max_bucket"); + public AggregationDescriptor MaxBucket(Action configure) => Set(configure, "max_bucket"); + public AggregationDescriptor MedianAbsoluteDeviation(Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Set(medianAbsoluteDeviationAggregation, "median_absolute_deviation"); + public AggregationDescriptor MedianAbsoluteDeviation(Action configure) => Set(configure, "median_absolute_deviation"); + public AggregationDescriptor Min(Elastic.Clients.Elasticsearch.Aggregations.MinAggregation minAggregation) => Set(minAggregation, "min"); + public AggregationDescriptor Min(Action configure) => Set(configure, "min"); + public AggregationDescriptor MinBucket(Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation minBucketAggregation) => Set(minBucketAggregation, "min_bucket"); + public AggregationDescriptor MinBucket(Action configure) => Set(configure, "min_bucket"); + public AggregationDescriptor Missing(Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation missingAggregation) => Set(missingAggregation, "missing"); + public AggregationDescriptor Missing(Action configure) => Set(configure, "missing"); + public AggregationDescriptor MovingFn(Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation movingFunctionAggregation) => Set(movingFunctionAggregation, "moving_fn"); + public AggregationDescriptor MovingFn(Action configure) => Set(configure, "moving_fn"); + public AggregationDescriptor MovingPercentiles(Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation movingPercentilesAggregation) => Set(movingPercentilesAggregation, "moving_percentiles"); + public AggregationDescriptor MovingPercentiles(Action configure) => Set(configure, "moving_percentiles"); + public AggregationDescriptor MultiTerms(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation multiTermsAggregation) => Set(multiTermsAggregation, "multi_terms"); + public AggregationDescriptor MultiTerms(Action configure) => Set(configure, "multi_terms"); + public AggregationDescriptor Nested(Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation nestedAggregation) => Set(nestedAggregation, "nested"); + public AggregationDescriptor Nested(Action configure) => Set(configure, "nested"); + public AggregationDescriptor Normalize(Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation normalizeAggregation) => Set(normalizeAggregation, "normalize"); + public AggregationDescriptor Normalize(Action configure) => Set(configure, "normalize"); + public AggregationDescriptor Parent(Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation parentAggregation) => Set(parentAggregation, "parent"); + public AggregationDescriptor Parent(Action configure) => Set(configure, "parent"); + public AggregationDescriptor PercentileRanks(Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation percentileRanksAggregation) => Set(percentileRanksAggregation, "percentile_ranks"); + public AggregationDescriptor PercentileRanks(Action configure) => Set(configure, "percentile_ranks"); + public AggregationDescriptor Percentiles(Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation percentilesAggregation) => Set(percentilesAggregation, "percentiles"); + public AggregationDescriptor Percentiles(Action configure) => Set(configure, "percentiles"); + public AggregationDescriptor PercentilesBucket(Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation percentilesBucketAggregation) => Set(percentilesBucketAggregation, "percentiles_bucket"); + public AggregationDescriptor PercentilesBucket(Action configure) => Set(configure, "percentiles_bucket"); + public AggregationDescriptor Range(Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation rangeAggregation) => Set(rangeAggregation, "range"); + public AggregationDescriptor Range(Action configure) => Set(configure, "range"); + public AggregationDescriptor RareTerms(Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation rareTermsAggregation) => Set(rareTermsAggregation, "rare_terms"); + public AggregationDescriptor RareTerms(Action configure) => Set(configure, "rare_terms"); + public AggregationDescriptor Rate(Elastic.Clients.Elasticsearch.Aggregations.RateAggregation rateAggregation) => Set(rateAggregation, "rate"); + public AggregationDescriptor Rate(Action configure) => Set(configure, "rate"); + public AggregationDescriptor ReverseNested(Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation reverseNestedAggregation) => Set(reverseNestedAggregation, "reverse_nested"); + public AggregationDescriptor ReverseNested(Action configure) => Set(configure, "reverse_nested"); + public AggregationDescriptor Sampler(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation samplerAggregation) => Set(samplerAggregation, "sampler"); + public AggregationDescriptor Sampler(Action configure) => Set(configure, "sampler"); + public AggregationDescriptor ScriptedMetric(Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation scriptedMetricAggregation) => Set(scriptedMetricAggregation, "scripted_metric"); + public AggregationDescriptor ScriptedMetric(Action configure) => Set(configure, "scripted_metric"); + public AggregationDescriptor SerialDiff(Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation serialDifferencingAggregation) => Set(serialDifferencingAggregation, "serial_diff"); + public AggregationDescriptor SerialDiff(Action configure) => Set(configure, "serial_diff"); + public AggregationDescriptor SignificantTerms(Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation significantTermsAggregation) => Set(significantTermsAggregation, "significant_terms"); + public AggregationDescriptor SignificantTerms(Action configure) => Set(configure, "significant_terms"); + public AggregationDescriptor SignificantText(Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation significantTextAggregation) => Set(significantTextAggregation, "significant_text"); + public AggregationDescriptor SignificantText(Action configure) => Set(configure, "significant_text"); + public AggregationDescriptor Stats(Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation statsAggregation) => Set(statsAggregation, "stats"); + public AggregationDescriptor Stats(Action configure) => Set(configure, "stats"); + public AggregationDescriptor StatsBucket(Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation statsBucketAggregation) => Set(statsBucketAggregation, "stats_bucket"); + public AggregationDescriptor StatsBucket(Action configure) => Set(configure, "stats_bucket"); + public AggregationDescriptor StringStats(Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation stringStatsAggregation) => Set(stringStatsAggregation, "string_stats"); + public AggregationDescriptor StringStats(Action configure) => Set(configure, "string_stats"); + public AggregationDescriptor Sum(Elastic.Clients.Elasticsearch.Aggregations.SumAggregation sumAggregation) => Set(sumAggregation, "sum"); + public AggregationDescriptor Sum(Action configure) => Set(configure, "sum"); + public AggregationDescriptor SumBucket(Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation sumBucketAggregation) => Set(sumBucketAggregation, "sum_bucket"); + public AggregationDescriptor SumBucket(Action configure) => Set(configure, "sum_bucket"); + public AggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation termsAggregation) => Set(termsAggregation, "terms"); + public AggregationDescriptor Terms(Action configure) => Set(configure, "terms"); + public AggregationDescriptor TopHits(Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation topHitsAggregation) => Set(topHitsAggregation, "top_hits"); + public AggregationDescriptor TopHits(Action configure) => Set(configure, "top_hits"); + public AggregationDescriptor TopMetrics(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation topMetricsAggregation) => Set(topMetricsAggregation, "top_metrics"); + public AggregationDescriptor TopMetrics(Action configure) => Set(configure, "top_metrics"); + public AggregationDescriptor TTest(Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation tTestAggregation) => Set(tTestAggregation, "t_test"); + public AggregationDescriptor TTest(Action configure) => Set(configure, "t_test"); + public AggregationDescriptor ValueCount(Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation valueCountAggregation) => Set(valueCountAggregation, "value_count"); + public AggregationDescriptor ValueCount(Action configure) => Set(configure, "value_count"); + public AggregationDescriptor VariableWidthHistogram(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Set(variableWidthHistogramAggregation, "variable_width_histogram"); + public AggregationDescriptor VariableWidthHistogram(Action configure) => Set(configure, "variable_width_histogram"); + public AggregationDescriptor WeightedAvg(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation weightedAverageAggregation) => Set(weightedAverageAggregation, "weighted_avg"); + public AggregationDescriptor WeightedAvg(Action configure) => Set(configure, "weighted_avg"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } - public AggregationDescriptor GeohexGrid(string name, Action> configure) - { - return SetContainer(name, Aggregation.CreateWithAction("geohex_grid", configure)); - } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } - public AggregationDescriptor GeotileGrid(string name, Action> configure) - { - return SetContainer(name, Aggregation.CreateWithAction("geotile_grid", configure)); - } + 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); + } - 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)); + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs index 872fba91b48..c699b09f2f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs @@ -27,287 +27,59 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class AutoDateHistogramAggregationConverter : JsonConverter +public sealed partial class AutoDateHistogramAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The target number of buckets. /// + [JsonInclude, JsonPropertyName("buckets")] public int? Buckets { get; set; } /// /// The field on which to run the aggregation. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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`.
///
+ [JsonInclude, JsonPropertyName("minimum_interval")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("missing")] public DateTimeOffset? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Time zone specified as a ISO 8601 UTC offset. /// + [JsonInclude, JsonPropertyName("offset")] public string? Offset { get; set; } + [JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Time zone ID. /// + [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(AutoDateHistogramAggregation autoDateHistogramAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.AutoDateHistogram(autoDateHistogramAggregation); } public sealed partial class AutoDateHistogramAggregationDescriptor : SerializableDescriptor> @@ -318,44 +90,18 @@ public AutoDateHistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private int? BucketsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? MinimumIntervalValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private string? OffsetValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? TimeZoneValue { get; set; } - public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -383,6 +129,15 @@ public AutoDateHistogramAggregationDescriptor Field(Expressio 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.
///
@@ -416,6 +171,12 @@ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? return Self; } + public AutoDateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Time zone specified as a ISO 8601 UTC offset. /// @@ -448,8 +209,6 @@ public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZo protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("auto_date_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -469,6 +228,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinimumIntervalValue is not null) { writer.WritePropertyName("minimum_interval"); @@ -481,6 +246,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (!string.IsNullOrEmpty(OffsetValue)) { writer.WritePropertyName("offset"); @@ -499,33 +270,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -540,44 +288,18 @@ public AutoDateHistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private int? BucketsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? MinimumIntervalValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private string? OffsetValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? TimeZoneValue { get; set; } - public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public AutoDateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -647,6 +369,12 @@ public AutoDateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) return Self; } + public AutoDateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Time zone specified as a ISO 8601 UTC offset. /// @@ -679,8 +407,6 @@ public AutoDateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("auto_date_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -700,6 +426,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinimumIntervalValue is not null) { writer.WritePropertyName("minimum_interval"); @@ -712,6 +444,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (!string.IsNullOrEmpty(OffsetValue)) { writer.WritePropertyName("offset"); @@ -730,33 +468,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs index 4c8cc0fd99e..ffc0f39d6c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class AverageAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs index 26f32b48699..115c1f88b75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class AverageAggregationConverter : JsonConverter +public sealed partial class AverageAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(AverageAggregation averageAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Avg(averageAggregation); } public sealed partial class AverageAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public AverageAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public AverageAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public AverageAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) + public AverageAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public AverageAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AverageAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("avg"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public AverageAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public AverageAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public AverageAggregationDescriptor Format(string? format) return Self; } - public AverageAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public AverageAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public AverageAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("avg"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs new file mode 100644 index 00000000000..169480b9811 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class AverageBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(AverageBucketAggregation averageBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.AvgBucket(averageBucketAggregation); +} + +public sealed partial class AverageBucketAggregationDescriptor : SerializableDescriptor +{ + internal AverageBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public AverageBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public AverageBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public AverageBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public AverageBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public AverageBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public AverageBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs index 4c1013a01a1..80b37371a0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs @@ -27,150 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class BoxplotAggregationConverter : JsonConverter +public sealed partial class BoxplotAggregation { - 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. /// + [JsonInclude, JsonPropertyName("compression")] public double? Compression { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BoxplotAggregation boxplotAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Boxplot(boxplotAggregation); } public sealed partial class BoxplotAggregationDescriptor : SerializableDescriptor> @@ -183,8 +62,7 @@ public BoxplotAggregationDescriptor() : base() private double? CompressionValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -196,25 +74,37 @@ public BoxplotAggregationDescriptor Compression(double? compression) return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public BoxplotAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public BoxplotAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public BoxplotAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public BoxplotAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -228,8 +118,6 @@ public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("boxplot"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -255,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,8 +157,7 @@ public BoxplotAggregationDescriptor() : base() private double? CompressionValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -289,31 +169,37 @@ public BoxplotAggregationDescriptor Compression(double? compression) return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public BoxplotAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public BoxplotAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -327,8 +213,6 @@ public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("boxplot"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -354,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs new file mode 100644 index 00000000000..718a01daad6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation. +/// +public sealed partial class BucketCorrelationAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// The correlation function to execute. + /// + [JsonInclude, JsonPropertyName("function")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction Function { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BucketCorrelationAggregation bucketCorrelationAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.BucketCorrelation(bucketCorrelationAggregation); +} + +/// +/// A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation. +/// +public sealed partial class BucketCorrelationAggregationDescriptor : SerializableDescriptor +{ + internal BucketCorrelationAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketCorrelationAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction FunctionValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionDescriptor FunctionDescriptor { get; set; } + private Action FunctionDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketCorrelationAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// The correlation function to execute. + /// + public BucketCorrelationAggregationDescriptor Function(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction function) + { + FunctionDescriptor = null; + FunctionDescriptorAction = null; + FunctionValue = function; + return Self; + } + + public BucketCorrelationAggregationDescriptor Function(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionDescriptor descriptor) + { + FunctionValue = null; + FunctionDescriptorAction = null; + FunctionDescriptor = descriptor; + return Self; + } + + public BucketCorrelationAggregationDescriptor Function(Action configure) + { + FunctionValue = null; + FunctionDescriptor = null; + FunctionDescriptorAction = configure; + return Self; + } + + public BucketCorrelationAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketCorrelationAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (FunctionDescriptor is not null) + { + writer.WritePropertyName("function"); + JsonSerializer.Serialize(writer, FunctionDescriptor, options); + } + else if (FunctionDescriptorAction is not null) + { + writer.WritePropertyName("function"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionDescriptor(FunctionDescriptorAction), options); + } + else + { + writer.WritePropertyName("function"); + JsonSerializer.Serialize(writer, FunctionValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs new file mode 100644 index 00000000000..04da7a8c17f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketCorrelationFunction +{ + /// + /// The configuration to calculate a count correlation. This function is designed for determining the correlation of a term value and a given metric. + /// + [JsonInclude, JsonPropertyName("count_correlation")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation CountCorrelation { get; set; } +} + +public sealed partial class BucketCorrelationFunctionDescriptor : SerializableDescriptor +{ + internal BucketCorrelationFunctionDescriptor(Action configure) => configure.Invoke(this); + + public BucketCorrelationFunctionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation CountCorrelationValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationDescriptor CountCorrelationDescriptor { get; set; } + private Action CountCorrelationDescriptorAction { get; set; } + + /// + /// The configuration to calculate a count correlation. This function is designed for determining the correlation of a term value and a given metric. + /// + public BucketCorrelationFunctionDescriptor CountCorrelation(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation countCorrelation) + { + CountCorrelationDescriptor = null; + CountCorrelationDescriptorAction = null; + CountCorrelationValue = countCorrelation; + return Self; + } + + public BucketCorrelationFunctionDescriptor CountCorrelation(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationDescriptor descriptor) + { + CountCorrelationValue = null; + CountCorrelationDescriptorAction = null; + CountCorrelationDescriptor = descriptor; + return Self; + } + + public BucketCorrelationFunctionDescriptor CountCorrelation(Action configure) + { + CountCorrelationValue = null; + CountCorrelationDescriptor = null; + CountCorrelationDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CountCorrelationDescriptor is not null) + { + writer.WritePropertyName("count_correlation"); + JsonSerializer.Serialize(writer, CountCorrelationDescriptor, options); + } + else if (CountCorrelationDescriptorAction is not null) + { + writer.WritePropertyName("count_correlation"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationDescriptor(CountCorrelationDescriptorAction), options); + } + else + { + writer.WritePropertyName("count_correlation"); + JsonSerializer.Serialize(writer, CountCorrelationValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs new file mode 100644 index 00000000000..139775ed635 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketCorrelationFunctionCountCorrelation +{ + /// + /// The indicator with which to correlate the configured `bucket_path` values. + /// + [JsonInclude, JsonPropertyName("indicator")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator Indicator { get; set; } +} + +public sealed partial class BucketCorrelationFunctionCountCorrelationDescriptor : SerializableDescriptor +{ + internal BucketCorrelationFunctionCountCorrelationDescriptor(Action configure) => configure.Invoke(this); + + public BucketCorrelationFunctionCountCorrelationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator IndicatorValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicatorDescriptor IndicatorDescriptor { get; set; } + private Action IndicatorDescriptorAction { get; set; } + + /// + /// The indicator with which to correlate the configured `bucket_path` values. + /// + public BucketCorrelationFunctionCountCorrelationDescriptor Indicator(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator indicator) + { + IndicatorDescriptor = null; + IndicatorDescriptorAction = null; + IndicatorValue = indicator; + return Self; + } + + public BucketCorrelationFunctionCountCorrelationDescriptor Indicator(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicatorDescriptor descriptor) + { + IndicatorValue = null; + IndicatorDescriptorAction = null; + IndicatorDescriptor = descriptor; + return Self; + } + + public BucketCorrelationFunctionCountCorrelationDescriptor Indicator(Action configure) + { + IndicatorValue = null; + IndicatorDescriptor = null; + IndicatorDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (IndicatorDescriptor is not null) + { + writer.WritePropertyName("indicator"); + JsonSerializer.Serialize(writer, IndicatorDescriptor, options); + } + else if (IndicatorDescriptorAction is not null) + { + writer.WritePropertyName("indicator"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicatorDescriptor(IndicatorDescriptorAction), options); + } + else + { + writer.WritePropertyName("indicator"); + JsonSerializer.Serialize(writer, IndicatorValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs new file mode 100644 index 00000000000..a0b96bef1e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketCorrelationFunctionCountCorrelationIndicator +{ + /// + /// The total number of documents that initially created the expectations. It’s required to be greater
than or equal to the sum of all values in the buckets_path as this is the originating superset of data
to which the term values are correlated.
+ ///
+ [JsonInclude, JsonPropertyName("doc_count")] + public int DocCount { get; set; } + + /// + /// An array of numbers with which to correlate the configured `bucket_path` values.
The length of this value must always equal the number of buckets returned by the `bucket_path`.
+ ///
+ [JsonInclude, JsonPropertyName("expectations")] + public ICollection Expectations { get; set; } + + /// + /// An array of fractions to use when averaging and calculating variance. This should be used if
the pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,
must equal expectations.
+ ///
+ [JsonInclude, JsonPropertyName("fractions")] + public ICollection? Fractions { get; set; } +} + +public sealed partial class BucketCorrelationFunctionCountCorrelationIndicatorDescriptor : SerializableDescriptor +{ + internal BucketCorrelationFunctionCountCorrelationIndicatorDescriptor(Action configure) => configure.Invoke(this); + + public BucketCorrelationFunctionCountCorrelationIndicatorDescriptor() : base() + { + } + + private int DocCountValue { get; set; } + private ICollection ExpectationsValue { get; set; } + private ICollection? FractionsValue { get; set; } + + /// + /// The total number of documents that initially created the expectations. It’s required to be greater
than or equal to the sum of all values in the buckets_path as this is the originating superset of data
to which the term values are correlated.
+ ///
+ public BucketCorrelationFunctionCountCorrelationIndicatorDescriptor DocCount(int docCount) + { + DocCountValue = docCount; + return Self; + } + + /// + /// An array of numbers with which to correlate the configured `bucket_path` values.
The length of this value must always equal the number of buckets returned by the `bucket_path`.
+ ///
+ public BucketCorrelationFunctionCountCorrelationIndicatorDescriptor Expectations(ICollection expectations) + { + ExpectationsValue = expectations; + return Self; + } + + /// + /// An array of fractions to use when averaging and calculating variance. This should be used if
the pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided,
must equal expectations.
+ ///
+ public BucketCorrelationFunctionCountCorrelationIndicatorDescriptor Fractions(ICollection? fractions) + { + FractionsValue = fractions; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("doc_count"); + writer.WriteNumberValue(DocCountValue); + writer.WritePropertyName("expectations"); + JsonSerializer.Serialize(writer, ExpectationsValue, options); + if (FractionsValue is not null) + { + writer.WritePropertyName("fractions"); + JsonSerializer.Serialize(writer, FractionsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs new file mode 100644 index 00000000000..00940edade6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// A sibling pipeline aggregation which executes a two sample Kolmogorov–Smirnov test (referred
to as a "K-S test" from now on) against a provided distribution, and the distribution implied
by the documents counts in the configured sibling aggregation. Specifically, for some metric,
assuming that the percentile intervals of the metric are known beforehand or have been computed
by an aggregation, then one would use range aggregation for the sibling to compute the p-value
of the distribution difference between the metric and the restriction of that metric to a subset
of the documents. A natural use case is if the sibling aggregation range aggregation nested in a
terms aggregation, in which case one compares the overall distribution of metric to its restriction
to each term.
+///
+public sealed partial class BucketKsAggregation +{ + /// + /// A list of string values indicating which K-S test alternative to calculate. The valid values
are: "greater", "less", "two_sided". This parameter is key for determining the K-S statistic used
when calculating the K-S test. Default value is all possible alternative hypotheses.
+ ///
+ [JsonInclude, JsonPropertyName("alternative")] + public ICollection? Alternative { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// A list of doubles indicating the distribution of the samples with which to compare to the `buckets_path` results.
In typical usage this is the overall proportion of documents in each bucket, which is compared with the actual
document proportions in each bucket from the sibling aggregation counts. The default is to assume that overall
documents are uniformly distributed on these buckets, which they would be if one used equal percentiles of a
metric to define the bucket end points.
+ ///
+ [JsonInclude, JsonPropertyName("fractions")] + public ICollection? Fractions { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values.
This determines the cumulative distribution function (CDF) points used comparing the two samples. Default is
`upper_tail`, which emphasizes the upper end of the CDF points. Valid options are: `upper_tail`, `uniform`,
and `lower_tail`.
+ ///
+ [JsonInclude, JsonPropertyName("sampling_method")] + public string? SamplingMethod { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BucketKsAggregation bucketKsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.BucketCountKsTest(bucketKsAggregation); +} + +/// +/// A sibling pipeline aggregation which executes a two sample Kolmogorov–Smirnov test (referred
to as a "K-S test" from now on) against a provided distribution, and the distribution implied
by the documents counts in the configured sibling aggregation. Specifically, for some metric,
assuming that the percentile intervals of the metric are known beforehand or have been computed
by an aggregation, then one would use range aggregation for the sibling to compute the p-value
of the distribution difference between the metric and the restriction of that metric to a subset
of the documents. A natural use case is if the sibling aggregation range aggregation nested in a
terms aggregation, in which case one compares the overall distribution of metric to its restriction
to each term.
+///
+public sealed partial class BucketKsAggregationDescriptor : SerializableDescriptor +{ + internal BucketKsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketKsAggregationDescriptor() : base() + { + } + + private ICollection? AlternativeValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private ICollection? FractionsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + private string? SamplingMethodValue { get; set; } + + /// + /// A list of string values indicating which K-S test alternative to calculate. The valid values
are: "greater", "less", "two_sided". This parameter is key for determining the K-S statistic used
when calculating the K-S test. Default value is all possible alternative hypotheses.
+ ///
+ public BucketKsAggregationDescriptor Alternative(ICollection? alternative) + { + AlternativeValue = alternative; + return Self; + } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketKsAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// A list of doubles indicating the distribution of the samples with which to compare to the `buckets_path` results.
In typical usage this is the overall proportion of documents in each bucket, which is compared with the actual
document proportions in each bucket from the sibling aggregation counts. The default is to assume that overall
documents are uniformly distributed on these buckets, which they would be if one used equal percentiles of a
metric to define the bucket end points.
+ ///
+ public BucketKsAggregationDescriptor Fractions(ICollection? fractions) + { + FractionsValue = fractions; + return Self; + } + + public BucketKsAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketKsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// Indicates the sampling methodology when calculating the K-S test. Note, this is sampling of the returned values.
This determines the cumulative distribution function (CDF) points used comparing the two samples. Default is
`upper_tail`, which emphasizes the upper end of the CDF points. Valid options are: `upper_tail`, `uniform`,
and `lower_tail`.
+ ///
+ public BucketKsAggregationDescriptor SamplingMethod(string? samplingMethod) + { + SamplingMethodValue = samplingMethod; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlternativeValue is not null) + { + writer.WritePropertyName("alternative"); + JsonSerializer.Serialize(writer, AlternativeValue, options); + } + + if (BucketsPathValue is not null) + { + writer.WritePropertyName("buckets_path"); + JsonSerializer.Serialize(writer, BucketsPathValue, options); + } + + if (FractionsValue is not null) + { + writer.WritePropertyName("fractions"); + JsonSerializer.Serialize(writer, FractionsValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (!string.IsNullOrEmpty(SamplingMethodValue)) + { + writer.WritePropertyName("sampling_method"); + writer.WriteStringValue(SamplingMethodValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs new file mode 100644 index 00000000000..0eec8453ffc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketMetricValueAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("keys")] + public IReadOnlyCollection Keys { get; init; } + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
+ [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/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs new file mode 100644 index 00000000000..36e899c19a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketScriptAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script to run for this aggregation. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BucketScriptAggregation bucketScriptAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.BucketScript(bucketScriptAggregation); +} + +public sealed partial class BucketScriptAggregationDescriptor : SerializableDescriptor +{ + internal BucketScriptAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketScriptAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketScriptAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public BucketScriptAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public BucketScriptAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketScriptAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketScriptAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script to run for this aggregation. + /// + public BucketScriptAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs new file mode 100644 index 00000000000..fa12e440328 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class BucketSelectorAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script to run for this aggregation. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BucketSelectorAggregation bucketSelectorAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.BucketSelector(bucketSelectorAggregation); +} + +public sealed partial class BucketSelectorAggregationDescriptor : SerializableDescriptor +{ + internal BucketSelectorAggregationDescriptor(Action configure) => configure.Invoke(this); + + public BucketSelectorAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public BucketSelectorAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public BucketSelectorAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public BucketSelectorAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public BucketSelectorAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public BucketSelectorAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script to run for this aggregation. + /// + public BucketSelectorAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/_Generated/Types/Aggregations/BucketSortAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs index c8921311120..f874d86a413 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs @@ -27,161 +27,38 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class BucketSortAggregationConverter : JsonConverter +public sealed partial class BucketSortAggregation { - 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. /// + [JsonInclude, JsonPropertyName("from")] public int? From { get; set; } /// /// The policy to apply when gaps are found in the data. /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
+ [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The list of fields to sort on. /// + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(BucketSortAggregation bucketSortAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.BucketSort(bucketSortAggregation); } public sealed partial class BucketSortAggregationDescriptor : SerializableDescriptor> @@ -195,11 +72,12 @@ public BucketSortAggregationDescriptor() : base() private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } /// /// Buckets in positions prior to `from` will be truncated. @@ -225,6 +103,12 @@ public BucketSortAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
@@ -246,7 +130,7 @@ public BucketSortAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public BucketSortAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -255,7 +139,7 @@ public BucketSortAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public BucketSortAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -264,7 +148,7 @@ public BucketSortAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public BucketSortAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -275,8 +159,6 @@ public BucketSortAggregationDescriptor Sort(params Action(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -313,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -325,13 +219,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -347,11 +234,12 @@ public BucketSortAggregationDescriptor() : base() private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } /// /// Buckets in positions prior to `from` will be truncated. @@ -377,6 +265,12 @@ public BucketSortAggregationDescriptor Meta(Func /// The number of buckets to return.
Defaults to all buckets of the parent aggregation.
///
@@ -398,7 +292,7 @@ public BucketSortAggregationDescriptor Sort(ICollection configure) + public BucketSortAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -416,7 +310,7 @@ public BucketSortAggregationDescriptor Sort(Action config return Self; } - public BucketSortAggregationDescriptor Sort(params Action[] configure) + public BucketSortAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -427,8 +321,6 @@ public BucketSortAggregationDescriptor Sort(params Action protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("bucket_sort"); writer.WriteStartObject(); if (FromValue.HasValue) { @@ -442,6 +334,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, GapPolicyValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (SizeValue.HasValue) { writer.WritePropertyName("size"); @@ -456,7 +360,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -465,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -477,13 +381,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, 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/_Generated/Types/Aggregations/Buckets.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs index b73fab8b19a..98d0e84b572 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; +/// +/// Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for
the different buckets, the result is a dictionary.
+///
public sealed partial class Buckets : Union, IReadOnlyCollection> { - public Buckets(IReadOnlyDictionary dictionary) : base(dictionary) + public Buckets(IReadOnlyDictionary Keyed) : base(Keyed) { } - public Buckets(IReadOnlyCollection collection) : base(collection) + public Buckets(IReadOnlyCollection Array) : base(Array) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketsPath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketsPath.g.cs index bba2ad5a659..e5a53d02f40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketsPath.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketsPath.g.cs @@ -115,9 +115,8 @@ internal sealed class BucketsPathConverter : MultiItemUnionConverter { { BucketsPath.Kind.Single, typeof(string) }, { BucketsPath.Kind.Array, typeof(string[]) }, { BucketsPath.Kind.Dictionary, typeof(Dictionary) } }; + _types = new Dictionary { { BucketsPath.Kind.Single, typeof(string) }, { BucketsPath.Kind.Array, typeof(IReadOnlyCollection) }, { BucketsPath.Kind.Dictionary, typeof(IReadOnlyDictionary) } }; _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 { }; + _uniquePropertyToType = new Dictionary { { "", typeof(string) }, { "", typeof(IReadOnlyCollection) }, { "", typeof(IReadOnlyDictionary) } }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs index 828ff151d55..ae6b2e2b789 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs @@ -27,192 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class CardinalityAggregationConverter : JsonConverter +public sealed partial class CardinalityAggregation { - 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. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? ExecutionHint { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } /// /// A unique count below which counts are expected to be close to accurate.
This allows to trade memory for accuracy.
///
+ [JsonInclude, JsonPropertyName("precision_threshold")] public int? PrecisionThreshold { get; set; } + [JsonInclude, JsonPropertyName("rehash")] public bool? Rehash { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(CardinalityAggregation cardinalityAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Cardinality(cardinalityAggregation); } public sealed partial class CardinalityAggregationDescriptor : SerializableDescriptor> @@ -225,8 +70,7 @@ public CardinalityAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -240,25 +84,37 @@ public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public CardinalityAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public CardinalityAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public CardinalityAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public CardinalityAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -287,8 +143,6 @@ public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasti protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("cardinality"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -326,13 +180,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -347,8 +194,7 @@ public CardinalityAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -362,31 +208,37 @@ public CardinalityAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsea return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public CardinalityAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public CardinalityAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -415,8 +267,6 @@ public CardinalityAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Scr protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("cardinality"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -454,13 +304,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs new file mode 100644 index 00000000000..bc34c26e503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs @@ -0,0 +1,538 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// A multi-bucket aggregation that groups semi-structured text into buckets. Each text
field is re-analyzed using a custom analyzer. The resulting tokens are then categorized
creating buckets of similarly formatted text values. This aggregation works best with machine
generated text like system logs. Only the first 100 analyzed tokens are used to categorize the text.
+///
+public sealed partial class CategorizeTextAggregation +{ + /// + /// The categorization analyzer specifies how the text is analyzed and tokenized before being categorized.
The syntax is very similar to that used to define the analyzer in the [Analyze endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-analyze.html). This property
cannot be used at the same time as categorization_filters.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer? CategorizationAnalyzer { get; set; } + + /// + /// This property expects an array of regular expressions. The expressions are used to filter out matching
sequences from the categorization field values. You can use this functionality to fine tune the categorization
by excluding sequences from consideration when categories are defined. For example, you can exclude SQL
statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.
If you only want to define simple regular expression filters that are applied prior to tokenization, setting
this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,
use the categorization_analyzer property instead and include the filters as pattern_replace character filters.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_filters")] + public ICollection? CategorizationFilters { get; set; } + + /// + /// The semi-structured text field to categorize. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// The maximum number of token positions to match on before attempting to merge categories. Larger
values will use more memory and create narrower categories. Max allowed value is 100.
+ ///
+ [JsonInclude, JsonPropertyName("max_matched_tokens")] + public int? MaxMatchedTokens { get; set; } + + /// + /// The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.
Smaller values use less memory and create fewer categories. Larger values will use more memory and
create narrower categories. Max allowed value is 100.
+ ///
+ [JsonInclude, JsonPropertyName("max_unique_tokens")] + public int? MaxUniqueTokens { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + /// + /// The minimum number of documents in a bucket to be returned to the results. + /// + [JsonInclude, JsonPropertyName("min_doc_count")] + public int? MinDocCount { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The minimum number of documents in a bucket to be returned from the shard before merging. + /// + [JsonInclude, JsonPropertyName("shard_min_doc_count")] + public int? ShardMinDocCount { get; set; } + + /// + /// The number of categorization buckets to return from each shard before merging all the results. + /// + [JsonInclude, JsonPropertyName("shard_size")] + public int? ShardSize { get; set; } + + /// + /// The minimum percentage of tokens that must match for text to be added to the category bucket. Must
be between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory
usage and create narrower categories.
+ ///
+ [JsonInclude, JsonPropertyName("similarity_threshold")] + public int? SimilarityThreshold { get; set; } + + /// + /// The number of buckets to return. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(CategorizeTextAggregation categorizeTextAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.CategorizeText(categorizeTextAggregation); +} + +/// +/// A multi-bucket aggregation that groups semi-structured text into buckets. Each text
field is re-analyzed using a custom analyzer. The resulting tokens are then categorized
creating buckets of similarly formatted text values. This aggregation works best with machine
generated text like system logs. Only the first 100 analyzed tokens are used to categorize the text.
+///
+public sealed partial class CategorizeTextAggregationDescriptor : SerializableDescriptor> +{ + internal CategorizeTextAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CategorizeTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer? CategorizationAnalyzerValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private int? MaxMatchedTokensValue { get; set; } + private int? MaxUniqueTokensValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private string? NameValue { get; set; } + private int? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SimilarityThresholdValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The categorization analyzer specifies how the text is analyzed and tokenized before being categorized.
The syntax is very similar to that used to define the analyzer in the [Analyze endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-analyze.html). This property
cannot be used at the same time as categorization_filters.
+ ///
+ public CategorizeTextAggregationDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// This property expects an array of regular expressions. The expressions are used to filter out matching
sequences from the categorization field values. You can use this functionality to fine tune the categorization
by excluding sequences from consideration when categories are defined. For example, you can exclude SQL
statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.
If you only want to define simple regular expression filters that are applied prior to tokenization, setting
this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,
use the categorization_analyzer property instead and include the filters as pattern_replace character filters.
+ ///
+ public CategorizeTextAggregationDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The maximum number of token positions to match on before attempting to merge categories. Larger
values will use more memory and create narrower categories. Max allowed value is 100.
+ ///
+ public CategorizeTextAggregationDescriptor MaxMatchedTokens(int? maxMatchedTokens) + { + MaxMatchedTokensValue = maxMatchedTokens; + return Self; + } + + /// + /// The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.
Smaller values use less memory and create fewer categories. Larger values will use more memory and
create narrower categories. Max allowed value is 100.
+ ///
+ public CategorizeTextAggregationDescriptor MaxUniqueTokens(int? maxUniqueTokens) + { + MaxUniqueTokensValue = maxUniqueTokens; + return Self; + } + + public CategorizeTextAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum number of documents in a bucket to be returned to the results. + /// + public CategorizeTextAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + public CategorizeTextAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The minimum number of documents in a bucket to be returned from the shard before merging. + /// + public CategorizeTextAggregationDescriptor ShardMinDocCount(int? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// The number of categorization buckets to return from each shard before merging all the results. + /// + public CategorizeTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The minimum percentage of tokens that must match for text to be added to the category bucket. Must
be between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory
usage and create narrower categories.
+ ///
+ public CategorizeTextAggregationDescriptor SimilarityThreshold(int? similarityThreshold) + { + SimilarityThresholdValue = similarityThreshold; + return Self; + } + + /// + /// The number of buckets to return. + /// + public CategorizeTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxMatchedTokensValue.HasValue) + { + writer.WritePropertyName("max_matched_tokens"); + writer.WriteNumberValue(MaxMatchedTokensValue.Value); + } + + if (MaxUniqueTokensValue.HasValue) + { + writer.WritePropertyName("max_unique_tokens"); + writer.WriteNumberValue(MaxUniqueTokensValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 (SimilarityThresholdValue.HasValue) + { + writer.WritePropertyName("similarity_threshold"); + writer.WriteNumberValue(SimilarityThresholdValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +/// +/// A multi-bucket aggregation that groups semi-structured text into buckets. Each text
field is re-analyzed using a custom analyzer. The resulting tokens are then categorized
creating buckets of similarly formatted text values. This aggregation works best with machine
generated text like system logs. Only the first 100 analyzed tokens are used to categorize the text.
+///
+public sealed partial class CategorizeTextAggregationDescriptor : SerializableDescriptor +{ + internal CategorizeTextAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CategorizeTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer? CategorizationAnalyzerValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private int? MaxMatchedTokensValue { get; set; } + private int? MaxUniqueTokensValue { get; set; } + private IDictionary? MetaValue { get; set; } + private int? MinDocCountValue { get; set; } + private string? NameValue { get; set; } + private int? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SimilarityThresholdValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// The categorization analyzer specifies how the text is analyzed and tokenized before being categorized.
The syntax is very similar to that used to define the analyzer in the [Analyze endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-analyze.html). This property
cannot be used at the same time as categorization_filters.
+ ///
+ public CategorizeTextAggregationDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// This property expects an array of regular expressions. The expressions are used to filter out matching
sequences from the categorization field values. You can use this functionality to fine tune the categorization
by excluding sequences from consideration when categories are defined. For example, you can exclude SQL
statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer.
If you only want to define simple regular expression filters that are applied prior to tokenization, setting
this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering,
use the categorization_analyzer property instead and include the filters as pattern_replace character filters.
+ ///
+ public CategorizeTextAggregationDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The semi-structured text field to categorize. + /// + public CategorizeTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The maximum number of token positions to match on before attempting to merge categories. Larger
values will use more memory and create narrower categories. Max allowed value is 100.
+ ///
+ public CategorizeTextAggregationDescriptor MaxMatchedTokens(int? maxMatchedTokens) + { + MaxMatchedTokensValue = maxMatchedTokens; + return Self; + } + + /// + /// The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1.
Smaller values use less memory and create fewer categories. Larger values will use more memory and
create narrower categories. Max allowed value is 100.
+ ///
+ public CategorizeTextAggregationDescriptor MaxUniqueTokens(int? maxUniqueTokens) + { + MaxUniqueTokensValue = maxUniqueTokens; + return Self; + } + + public CategorizeTextAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The minimum number of documents in a bucket to be returned to the results. + /// + public CategorizeTextAggregationDescriptor MinDocCount(int? minDocCount) + { + MinDocCountValue = minDocCount; + return Self; + } + + public CategorizeTextAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The minimum number of documents in a bucket to be returned from the shard before merging. + /// + public CategorizeTextAggregationDescriptor ShardMinDocCount(int? shardMinDocCount) + { + ShardMinDocCountValue = shardMinDocCount; + return Self; + } + + /// + /// The number of categorization buckets to return from each shard before merging all the results. + /// + public CategorizeTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The minimum percentage of tokens that must match for text to be added to the category bucket. Must
be between 1 and 100. The larger the value the narrower the categories. Larger values will increase memory
usage and create narrower categories.
+ ///
+ public CategorizeTextAggregationDescriptor SimilarityThreshold(int? similarityThreshold) + { + SimilarityThresholdValue = similarityThreshold; + return Self; + } + + /// + /// The number of buckets to return. + /// + public CategorizeTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (MaxMatchedTokensValue.HasValue) + { + writer.WritePropertyName("max_matched_tokens"); + writer.WriteNumberValue(MaxMatchedTokensValue.Value); + } + + if (MaxUniqueTokensValue.HasValue) + { + writer.WritePropertyName("max_unique_tokens"); + writer.WriteNumberValue(MaxUniqueTokensValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (MinDocCountValue.HasValue) + { + writer.WritePropertyName("min_doc_count"); + writer.WriteNumberValue(MinDocCountValue.Value); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 (SimilarityThresholdValue.HasValue) + { + writer.WritePropertyName("similarity_threshold"); + writer.WriteNumberValue(SimilarityThresholdValue.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/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs new file mode 100644 index 00000000000..8cba621b3b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.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.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.Aggregations; + +public sealed partial class CategorizeTextAnalyzer : Union +{ + public CategorizeTextAnalyzer(string Builtin) : base(Builtin) + { + } + + public CategorizeTextAnalyzer(Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer Custom) : base(Custom) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs index 570a27f212e..26563345807 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class ChildrenAggregateConverter : JsonConverter { - public override ChildrenAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ChildrenAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ChildrenAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ChildrenAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ChildrenAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ChildrenAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ChildrenAggregateConverter))] +public sealed partial class ChildrenAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs index 2041499dc27..e2bf2574932 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ChildrenAggregationConverter : JsonConverter +public sealed partial class ChildrenAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The child type that should be selected. /// + [JsonInclude, JsonPropertyName("type")] 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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ChildrenAggregation childrenAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Children(childrenAggregation); } public sealed partial class ChildrenAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ public ChildrenAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private string? TypeValue { get; set; } - public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ChildrenAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public ChildrenAggregationDescriptor Aggregations(Action configure) + public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ChildrenAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ChildrenAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public ChildrenAggregationDescriptor Type(string? type) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(TypeValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs index 9844bb06e7a..600426a0e04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; public sealed partial class CompositeAggregate : IAggregate { [JsonInclude, JsonPropertyName("after_key")] - public IReadOnlyDictionary? AfterKey { get; init; } + public IReadOnlyDictionary? AfterKey { get; init; } [JsonInclude, JsonPropertyName("buckets")] public IReadOnlyCollection Buckets { get; init; } [JsonInclude, JsonPropertyName("meta")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs index e543cfd3daf..59df8c16312 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs @@ -27,156 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class CompositeAggregationConverter : JsonConverter +public sealed partial class CompositeAggregation { - 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. /// + [JsonInclude, JsonPropertyName("after")] public IDictionary? After { get; set; } - public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of composite buckets that should be returned. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The value sources used to build composite buckets.
Keys are returned in the order of the `sources` definition.
///
+ [JsonInclude, JsonPropertyName("sources")] public ICollection>? Sources { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(CompositeAggregation compositeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Composite(compositeAggregation); } public sealed partial class CompositeAggregationDescriptor : SerializableDescriptor> @@ -188,10 +63,8 @@ public CompositeAggregationDescriptor() : base() } private IDictionary? AfterValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { get; set; } private ICollection>? SourcesValue { get; set; } @@ -204,33 +77,15 @@ public CompositeAggregationDescriptor After(Func Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public CompositeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public CompositeAggregationDescriptor Aggregations(Action> configure) + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + public CompositeAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -254,8 +109,6 @@ public CompositeAggregationDescriptor Sources(ICollection(AggregationsDescriptorAction), options); + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); } - else if (AggregationsValue is not null) + + if (SourcesValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("sources"); + JsonSerializer.Serialize(writer, SourcesValue, options); } writer.WriteEndObject(); @@ -311,10 +153,8 @@ public CompositeAggregationDescriptor() : base() } private IDictionary? AfterValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? SizeValue { get; set; } private ICollection>? SourcesValue { get; set; } @@ -327,33 +167,15 @@ public CompositeAggregationDescriptor After(Func configure) + public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public CompositeAggregationDescriptor Meta(Func, FluentDictionary> selector) + public CompositeAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -377,8 +199,6 @@ public CompositeAggregationDescriptor Sources(ICollection + /// A date histogram aggregation. + ///
+ [JsonInclude, JsonPropertyName("date_histogram")] + public Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation? DateHistogram { get; set; } + + /// + /// A geotile grid aggregation. + /// + [JsonInclude, JsonPropertyName("geotile_grid")] + public Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation? GeotileGrid { get; set; } + + /// + /// A histogram aggregation. + /// + [JsonInclude, JsonPropertyName("histogram")] + public Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation? Histogram { get; set; } + + /// + /// A terms aggregation. + /// + [JsonInclude, JsonPropertyName("terms")] + public Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation? Terms { get; set; } +} + +public sealed partial class CompositeAggregationSourceDescriptor : SerializableDescriptor> +{ + internal CompositeAggregationSourceDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeAggregationSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor DateHistogramDescriptor { get; set; } + private Action> DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation? GeotileGridValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor GeotileGridDescriptor { get; set; } + private Action> GeotileGridDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor HistogramDescriptor { get; set; } + private Action> HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + + /// + /// A date histogram aggregation. + /// + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Action> configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// A geotile grid aggregation. + /// + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation? geotileGrid) + { + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = null; + GeotileGridValue = geotileGrid; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor descriptor) + { + GeotileGridValue = null; + GeotileGridDescriptorAction = null; + GeotileGridDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Action> configure) + { + GeotileGridValue = null; + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = configure; + return Self; + } + + /// + /// A histogram aggregation. + /// + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Action> configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// A terms aggregation. + /// + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Action> configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (GeotileGridDescriptor is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridDescriptor, options); + } + else if (GeotileGridDescriptorAction is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor(GeotileGridDescriptorAction), options); + } + else if (GeotileGridValue is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } } public sealed partial class CompositeAggregationSourceDescriptor : SerializableDescriptor @@ -39,7 +262,194 @@ public CompositeAggregationSourceDescriptor() : base() { } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor DateHistogramDescriptor { get; set; } + private Action DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation? GeotileGridValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor GeotileGridDescriptor { get; set; } + private Action GeotileGridDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor HistogramDescriptor { get; set; } + private Action HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + + /// + /// A date histogram aggregation. + /// + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor DateHistogram(Action configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// A geotile grid aggregation. + /// + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation? geotileGrid) + { + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = null; + GeotileGridValue = geotileGrid; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor descriptor) + { + GeotileGridValue = null; + GeotileGridDescriptorAction = null; + GeotileGridDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor GeotileGrid(Action configure) + { + GeotileGridValue = null; + GeotileGridDescriptor = null; + GeotileGridDescriptorAction = configure; + return Self; + } + + /// + /// A histogram aggregation. + /// + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Histogram(Action configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// A terms aggregation. + /// + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public CompositeAggregationSourceDescriptor Terms(Action configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (GeotileGridDescriptor is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridDescriptor, options); + } + else if (GeotileGridDescriptorAction is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationDescriptor(GeotileGridDescriptorAction), options); + } + else if (GeotileGridValue is not null) + { + writer.WritePropertyName("geotile_grid"); + JsonSerializer.Serialize(writer, GeotileGridValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs index 92563a7e784..05712794cc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -[JsonConverter(typeof(CompositeBucketConverter))] -public sealed partial class CompositeBucket : AggregateDictionary +internal sealed partial class CompositeBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; - IReadOnlyDictionary key = default; - while (reader.Read()) + IReadOnlyDictionary key = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize>(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new CompositeBucket(subAggs) { DocCount = docCount, Key = key }; + return new CompositeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; + } + + public override void Write(Utf8JsonWriter writer, CompositeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'CompositeBucket' is a readonly type, used only on responses and does not support being written to JSON."); } +} - public override void Write(Utf8JsonWriter writer, CompositeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +[JsonConverter(typeof(CompositeBucketConverter))] +public sealed partial class CompositeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs new file mode 100644 index 00000000000..5a3212abe70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class CompositeDateHistogramAggregation +{ + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + [JsonInclude, JsonPropertyName("calendar_interval")] + public string? CalendarInterval { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + [JsonInclude, JsonPropertyName("fixed_interval")] + public string? FixedInterval { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("offset")] + public Elastic.Clients.Elasticsearch.Duration? Offset { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeDateHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeDateHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeDateHistogramAggregationDescriptor() : base() + { + } + + private string? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private string? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? OffsetValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor CalendarInterval(string? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor FixedInterval(string? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CalendarIntervalValue)) + { + writer.WritePropertyName("calendar_interval"); + writer.WriteStringValue(CalendarIntervalValue); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FixedIntervalValue)) + { + writer.WritePropertyName("fixed_interval"); + writer.WriteStringValue(FixedIntervalValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + 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 (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeDateHistogramAggregationDescriptor : SerializableDescriptor +{ + internal CompositeDateHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeDateHistogramAggregationDescriptor() : base() + { + } + + private string? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private string? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? OffsetValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? TimeZoneValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor CalendarInterval(string? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `calendar_interval` or `fixed_interval` must be present + /// + public CompositeDateHistogramAggregationDescriptor FixedInterval(string? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.Duration? offset) + { + OffsetValue = offset; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeDateHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + public CompositeDateHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(CalendarIntervalValue)) + { + writer.WritePropertyName("calendar_interval"); + writer.WriteStringValue(CalendarIntervalValue); + } + + if (FieldValue is not null) + { + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + } + + if (!string.IsNullOrEmpty(FixedIntervalValue)) + { + writer.WritePropertyName("fixed_interval"); + writer.WriteStringValue(FixedIntervalValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + 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 (OffsetValue is not null) + { + writer.WritePropertyName("offset"); + JsonSerializer.Serialize(writer, OffsetValue, options); + } + + if (OrderValue is not null) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs new file mode 100644 index 00000000000..5b114bf7a39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class CompositeGeoTileGridAggregation +{ + [JsonInclude, JsonPropertyName("bounds")] + public Elastic.Clients.Elasticsearch.GeoBounds? Bounds { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } + [JsonInclude, JsonPropertyName("precision")] + public int? Precision { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeGeoTileGridAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeGeoTileGridAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeGeoTileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private int? PrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + public CompositeGeoTileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeGeoTileGridAggregationDescriptor : SerializableDescriptor +{ + internal CompositeGeoTileGridAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeGeoTileGridAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private int? PrecisionValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + public CompositeGeoTileGridAggregationDescriptor Bounds(Elastic.Clients.Elasticsearch.GeoBounds? bounds) + { + BoundsValue = bounds; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor Precision(int? precision) + { + PrecisionValue = precision; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeGeoTileGridAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeGeoTileGridAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (PrecisionValue.HasValue) + { + writer.WritePropertyName("precision"); + writer.WriteNumberValue(PrecisionValue.Value); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs new file mode 100644 index 00000000000..f0896c607eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs @@ -0,0 +1,307 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class CompositeHistogramAggregation +{ + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("interval")] + public double Interval { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeHistogramAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeHistogramAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private double IntervalValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeHistogramAggregationDescriptor Interval(double interval) + { + IntervalValue = interval; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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("interval"); + writer.WriteNumberValue(IntervalValue); + 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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeHistogramAggregationDescriptor : SerializableDescriptor +{ + internal CompositeHistogramAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeHistogramAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private double IntervalValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeHistogramAggregationDescriptor Interval(double interval) + { + IntervalValue = interval; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeHistogramAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeHistogramAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeHistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeHistogramAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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("interval"); + writer.WriteNumberValue(IntervalValue); + 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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs new file mode 100644 index 00000000000..bb7f3df68b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class CompositeTermsAggregation +{ + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] + public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] + public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } + [JsonInclude, JsonPropertyName("order")] + public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } + + /// + /// Either `field` or `script` must be present + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude, JsonPropertyName("value_type")] + public Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueType { get; set; } +} + +public sealed partial class CompositeTermsAggregationDescriptor : SerializableDescriptor> +{ + internal CompositeTermsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public CompositeTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeTermsAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeTermsAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class CompositeTermsAggregationDescriptor : SerializableDescriptor +{ + internal CompositeTermsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public CompositeTermsAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? MissingBucketValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingBucket(bool? missingBucket = true) + { + MissingBucketValue = missingBucket; + return Self; + } + + public CompositeTermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? missingOrder) + { + MissingOrderValue = missingOrder; + return Self; + } + + public CompositeTermsAggregationDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + { + OrderValue = order; + return Self; + } + + /// + /// Either `field` or `script` must be present + /// + public CompositeTermsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + + public CompositeTermsAggregationDescriptor ValueType(Elastic.Clients.Elasticsearch.Aggregations.ValueType? valueType) + { + ValueTypeValue = valueType; + 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 (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"); + JsonSerializer.Serialize(writer, OrderValue, options); + } + + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + + if (ValueTypeValue is not null) + { + writer.WritePropertyName("value_type"); + JsonSerializer.Serialize(writer, ValueTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs index 1bdbd6f123e..ffb7b47d155 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class CumulativeCardinalityAggregationConverter : JsonConverter +public sealed partial class CumulativeCardinalityAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(CumulativeCardinalityAggregation cumulativeCardinalityAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.CumulativeCardinality(cumulativeCardinalityAggregation); } public sealed partial class CumulativeCardinalityAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public CumulativeCardinalityAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public CumulativeCardinalityAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public CumulativeCardinalityAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public CumulativeCardinalityAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public CumulativeCardinalityAggregationDescriptor Meta(Func +public sealed partial class CumulativeSumAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(CumulativeSumAggregation cumulativeSumAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.CumulativeSum(cumulativeSumAggregation); } public sealed partial class CumulativeSumAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public CumulativeSumAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public CumulativeSumAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public CumulativeSumAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public CumulativeSumAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public CumulativeSumAggregationDescriptor Meta(Func? CharFilter { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + [JsonInclude, JsonPropertyName("tokenizer")] + public string? Tokenizer { get; set; } +} + +public sealed partial class CustomCategorizeTextAnalyzerDescriptor : SerializableDescriptor +{ + internal CustomCategorizeTextAnalyzerDescriptor(Action configure) => configure.Invoke(this); + + public CustomCategorizeTextAnalyzerDescriptor() : base() + { + } + + private ICollection? CharFilterValue { get; set; } + private ICollection? FilterValue { get; set; } + private string? TokenizerValue { get; set; } + + public CustomCategorizeTextAnalyzerDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + public CustomCategorizeTextAnalyzerDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + public CustomCategorizeTextAnalyzerDescriptor 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 (!string.IsNullOrEmpty(TokenizerValue)) + { + writer.WritePropertyName("tokenizer"); + writer.WriteStringValue(TokenizerValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs index cc999940151..dedd40b2c64 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs @@ -27,333 +27,73 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class DateHistogramAggregationConverter : JsonConverter +public sealed partial class DateHistogramAggregation { - 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.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`.
///
+ [JsonInclude, JsonPropertyName("calendar_interval")] public Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? CalendarInterval { get; set; } /// /// The date field whose values are use to build a histogram. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar. /// + [JsonInclude, JsonPropertyName("fixed_interval")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public DateTimeOffset? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// + [JsonInclude, JsonPropertyName("offset")] public Elastic.Clients.Elasticsearch.Duration? Offset { get; set; } - [JsonConverter(typeof(AggregateOrderConverter))] + /// /// The sort order of the returned buckets. /// - public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Time zone used for bucketing and rounding.
Defaults to Coordinated Universal Time (UTC).
///
+ [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(DateHistogramAggregation dateHistogramAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.DateHistogram(dateHistogramAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(DateHistogramAggregation dateHistogramAggregation) => Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy.DateHistogram(dateHistogramAggregation); } public sealed partial class DateHistogramAggregationDescriptor : SerializableDescriptor> @@ -364,9 +104,6 @@ public DateHistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? CalendarIntervalValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? FixedIntervalValue { get; set; } @@ -374,36 +111,13 @@ public DateHistogramAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? OffsetValue { get; set; } - private ICollection>? OrderValue { get; set; } + private ICollection>? OrderValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? TimeZoneValue { get; set; } - public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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`.
///
@@ -431,6 +145,15 @@ public DateHistogramAggregationDescriptor Field(Expression + /// 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. /// @@ -473,6 +196,12 @@ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? mis return Self; } + public DateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// @@ -485,7 +214,7 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elas /// /// The sort order of the returned buckets. /// - public DateHistogramAggregationDescriptor Order(ICollection>? order) + public DateHistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -514,8 +243,6 @@ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_histogram"); writer.WriteStartObject(); if (CalendarIntervalValue is not null) { @@ -541,6 +268,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -553,6 +286,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue is not null) { writer.WritePropertyName("offset"); @@ -562,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ParamsValue is not null) @@ -577,33 +316,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -618,9 +334,6 @@ public DateHistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? CalendarIntervalValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? FixedIntervalValue { get; set; } @@ -628,36 +341,13 @@ public DateHistogramAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } private DateTimeOffset? MissingValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? OffsetValue { get; set; } - private ICollection>? OrderValue { get; set; } + private ICollection>? OrderValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? TimeZoneValue { get; set; } - public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DateHistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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`.
///
@@ -736,6 +426,12 @@ public DateHistogramAggregationDescriptor Missing(DateTimeOffset? missing) return Self; } + public DateHistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Changes the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration. /// @@ -748,7 +444,7 @@ public DateHistogramAggregationDescriptor Offset(Elastic.Clients.Elasticsearch.D /// /// The sort order of the returned buckets. /// - public DateHistogramAggregationDescriptor Order(ICollection>? order) + public DateHistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -777,8 +473,6 @@ public DateHistogramAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_histogram"); writer.WriteStartObject(); if (CalendarIntervalValue is not null) { @@ -804,6 +498,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -816,6 +516,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue is not null) { writer.WritePropertyName("offset"); @@ -825,7 +531,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ParamsValue is not null) @@ -840,33 +546,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs index 0a45f3f22e1..c35be0f08c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs @@ -27,68 +27,67 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class DateHistogramBucketConverter : JsonConverter { - public override DateHistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new DateHistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + return new DateHistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, DateHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, DateHistogramBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'DateHistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DateHistogramBucketConverter))] +public sealed partial class DateHistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs index eb21b95e059..84fcf50168e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class DateRangeAggregationConverter : JsonConverter +public sealed partial class DateRangeAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The date field whose values are use to build ranges. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// The date format used to format `from` and `to` in the response. /// + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Array of date ranges. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } /// /// Time zone used to convert dates from another time zone to UTC. /// + [JsonInclude, JsonPropertyName("time_zone")] public string? TimeZone { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(DateRangeAggregation dateRangeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.DateRange(dateRangeAggregation); } public sealed partial class DateRangeAggregationDescriptor : SerializableDescriptor> @@ -234,47 +74,30 @@ public DateRangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private ICollection? RangesValue { get; set; } - private DateRangeExpressionDescriptor RangesDescriptor { get; set; } - private Action RangesDescriptorAction { get; set; } - private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public DateRangeAggregationDescriptor Aggregations(Action> configure) + /// + /// The date field whose values are use to build ranges. + /// + public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are use to build ranges. /// - public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + public DateRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -283,7 +106,7 @@ public DateRangeAggregationDescriptor Field(Elastic.Clients.Elasticse /// /// The date field whose values are use to build ranges. /// - public DateRangeAggregationDescriptor Field(Expression> field) + public DateRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -307,12 +130,18 @@ public DateRangeAggregationDescriptor Meta(Func /// 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) + public DateRangeAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public DateRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of date ranges. /// @@ -325,7 +154,7 @@ public DateRangeAggregationDescriptor Ranges(ICollection Ranges(DateRangeExpressionDescriptor descriptor) + public DateRangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -334,7 +163,7 @@ public DateRangeAggregationDescriptor Ranges(DateRangeExpressionDescr return Self; } - public DateRangeAggregationDescriptor Ranges(Action configure) + public DateRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -343,7 +172,7 @@ public DateRangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public DateRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -363,8 +192,6 @@ public DateRangeAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -378,12 +205,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -395,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -404,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionDescriptor(action), options); } writer.WriteEndArray(); @@ -415,33 +254,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RangesValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); @@ -456,43 +272,17 @@ public DateRangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private ICollection? RangesValue { get; set; } - private DateRangeExpressionDescriptor RangesDescriptor { get; set; } - private Action RangesDescriptorAction { get; set; } - private Action[] RangesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DateRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -538,12 +328,18 @@ public DateRangeAggregationDescriptor Meta(Func /// /// 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) + public DateRangeAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public DateRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of date ranges. /// @@ -556,7 +352,7 @@ public DateRangeAggregationDescriptor Ranges(ICollection configure) + public DateRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -574,7 +370,7 @@ public DateRangeAggregationDescriptor Ranges(Action[] configure) + public DateRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -594,8 +390,6 @@ public DateRangeAggregationDescriptor TimeZone(string? timeZone) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("date_range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -609,12 +403,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -626,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -635,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new DateRangeExpressionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionDescriptor(action), options); } writer.WriteEndArray(); @@ -646,33 +452,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RangesValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { 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.WriteStringValue(TimeZoneValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs index 3aa34960282..a003dec3f63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs @@ -35,6 +35,10 @@ public sealed partial class DerivativeAggregate : IAggregate public double? NormalizedValue { get; init; } [JsonInclude, JsonPropertyName("normalized_value_as_string")] public string? NormalizedValueAsString { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs index 116e2c8b1f6..bf02a6aae98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class DerivativeAggregationConverter : JsonConverter +public sealed partial class DerivativeAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(DerivativeAggregation derivativeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Derivative(derivativeAggregation); } public sealed partial class DerivativeAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public DerivativeAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public DerivativeAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public DerivativeAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public DerivativeAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public DerivativeAggregationDescriptor Meta(Func +public sealed partial class DiversifiedSamplerAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The type of value used for de-duplication. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field used to provide values used for de-duplication. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Limits how many documents are permitted per choice of de-duplicating value. /// + [JsonInclude, JsonPropertyName("max_docs_per_value")] public int? MaxDocsPerValue { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Limits how many top-scoring documents are collected in the sample processed on each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(DiversifiedSamplerAggregation diversifiedSamplerAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.DiversifiedSampler(diversifiedSamplerAggregation); } public sealed partial class DiversifiedSamplerAggregationDescriptor : SerializableDescriptor> @@ -230,40 +70,14 @@ public DiversifiedSamplerAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? MaxDocsPerValueValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } - public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -291,6 +105,15 @@ public DiversifiedSamplerAggregationDescriptor Field(Expressi 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. /// @@ -306,6 +129,12 @@ public DiversifiedSamplerAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + public DiversifiedSamplerAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -323,8 +152,6 @@ public DiversifiedSamplerAggregationDescriptor ShardSize(int? shardSi protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("diversified_sampler"); writer.WriteStartObject(); if (ExecutionHintValue is not null) { @@ -344,39 +171,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (ScriptValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); } - else if (AggregationsValue is not null) + + if (ShardSizeValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); } writer.WriteEndObject(); @@ -391,40 +207,14 @@ public DiversifiedSamplerAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? MaxDocsPerValueValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } - public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public DiversifiedSamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -476,6 +266,12 @@ public DiversifiedSamplerAggregationDescriptor Meta(Func 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 +internal sealed partial class DoubleTermsBucketConverter : JsonConverter { - public override DoubleTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; double key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new DoubleTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + return new DoubleTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, DoubleTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, DoubleTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'DoubleTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DoubleTermsBucketConverter))] +public sealed partial class DoubleTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public double Key { get; init; } + public string? KeyAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs index e1fe4adfee4..ba227158785 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs @@ -27,170 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ExtendedStatsAggregationConverter : JsonConverter +public sealed partial class ExtendedStatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// The number of standard deviations above/below the mean to display. /// + [JsonInclude, JsonPropertyName("sigma")] public double? Sigma { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ExtendedStatsAggregation extendedStatsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.ExtendedStats(extendedStatsAggregation); } public sealed partial class ExtendedStatsAggregationDescriptor : SerializableDescriptor> @@ -203,36 +64,47 @@ public ExtendedStatsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public ExtendedStatsAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public ExtendedStatsAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ExtendedStatsAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ExtendedStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -255,8 +127,6 @@ public ExtendedStatsAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -288,13 +158,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(SigmaValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -309,23 +172,31 @@ public ExtendedStatsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ExtendedStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -338,13 +209,10 @@ public ExtendedStatsAggregationDescriptor Format(string? format) return Self; } - public ExtendedStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ExtendedStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ExtendedStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -367,8 +235,6 @@ public ExtendedStatsAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -400,13 +266,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs index a0cf17dcacb..07255035e2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs @@ -27,150 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ExtendedStatsBucketAggregationConverter : JsonConverter +public sealed partial class ExtendedStatsBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The number of standard deviations above/below the mean to display. /// + [JsonInclude, JsonPropertyName("sigma")] public double? Sigma { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ExtendedStatsBucketAggregation extendedStatsBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.ExtendedStatsBucket(extendedStatsBucketAggregation); } public sealed partial class ExtendedStatsBucketAggregationDescriptor : SerializableDescriptor @@ -185,20 +72,30 @@ public ExtendedStatsBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private double? SigmaValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public ExtendedStatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public ExtendedStatsBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public ExtendedStatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -211,6 +108,12 @@ public ExtendedStatsBucketAggregationDescriptor Meta(Func /// The number of standard deviations above/below the mean to display. /// @@ -222,8 +125,6 @@ public ExtendedStatsBucketAggregationDescriptor Sigma(double? sigma) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("extended_stats_bucket"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -243,19 +144,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (SigmaValue.HasValue) + { + writer.WritePropertyName("sigma"); + writer.WriteNumberValue(SigmaValue.Value); + } + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs index ce2e172824c..c86090484b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -public sealed partial class FieldDateMath : Union +/// +/// A date range limit, represented either as a DateMath expression or a number expressed
according to the target field's precision.
+///
+public sealed partial class FieldDateMath : Union { - public FieldDateMath(Elastic.Clients.Elasticsearch.DateMath expr) : base(expr) + public FieldDateMath(string Expr) : base(Expr) { } - public FieldDateMath(double value) : base(value) + public FieldDateMath(double Value) : base(Value) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs index 8ceceef101a..b441704f28f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class FilterAggregateConverter : JsonConverter { - public override FilterAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new FilterAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new FilterAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, FilterAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, FilterAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FilterAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FilterAggregateConverter))] +public sealed partial class FilterAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs index 3e550f6e2fc..a81f2376b8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs @@ -27,157 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class FiltersAggregationConverter : JsonConverter +public sealed partial class FiltersAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Collection of queries from which to build buckets. /// + [JsonInclude, JsonPropertyName("filters")] public Elastic.Clients.Elasticsearch.Aggregations.Buckets? Filters { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. /// + [JsonInclude, JsonPropertyName("other_bucket")] public bool? OtherBucket { get; set; } /// /// The key with which the other bucket is returned. /// + [JsonInclude, JsonPropertyName("other_bucket_key")] public string? OtherBucketKey { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(FiltersAggregation filtersAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Filters(filtersAggregation); } public sealed partial class FiltersAggregationDescriptor : SerializableDescriptor> @@ -188,38 +62,12 @@ public FiltersAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.Buckets? FiltersValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private bool? OtherBucketValue { get; set; } private string? OtherBucketKeyValue { get; set; } - public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -235,6 +83,12 @@ public FiltersAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + 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. /// @@ -255,8 +109,6 @@ public FiltersAggregationDescriptor OtherBucketKey(string? otherBucke protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("filters"); writer.WriteStartObject(); if (FiltersValue is not null) { @@ -264,39 +116,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (OtherBucketValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); } writer.WriteEndObject(); @@ -311,38 +152,12 @@ public FiltersAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.Buckets? FiltersValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private bool? OtherBucketValue { get; set; } private string? OtherBucketKeyValue { get; set; } - public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public FiltersAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -358,6 +173,12 @@ public FiltersAggregationDescriptor Meta(Func, return Self; } + public FiltersAggregationDescriptor Name(string? name) + { + NameValue = name; + 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. /// @@ -378,8 +199,6 @@ public FiltersAggregationDescriptor OtherBucketKey(string? otherBucketKey) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("filters"); writer.WriteStartObject(); if (FiltersValue is not null) { @@ -387,39 +206,28 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) + + if (OtherBucketValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("other_bucket"); + writer.WriteBooleanValue(OtherBucketValue.Value); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(OtherBucketKeyValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("other_bucket_key"); + writer.WriteStringValue(OtherBucketKeyValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs index 49b384b3c60..74114646062 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs @@ -27,50 +27,51 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class FiltersBucketConverter : JsonConverter { - public override FiltersBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new FiltersBucket(subAggs) { DocCount = docCount }; + return new FiltersBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount }; } - public override void Write(Utf8JsonWriter writer, FiltersBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, FiltersBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FiltersBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FiltersBucketConverter))] +public sealed partial class FiltersBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs new file mode 100644 index 00000000000..10bd279d590 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class FrequentItemSetsAggregate : 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/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs new file mode 100644 index 00000000000..71a49965742 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs @@ -0,0 +1,431 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class FrequentItemSetsAggregation +{ + /// + /// Fields to analyze. + /// + [JsonInclude, JsonPropertyName("fields")] + public ICollection Fields { get; set; } + + /// + /// Query that filters documents from analysis. + /// + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Filter { get; set; } + + /// + /// The minimum size of one item set. + /// + [JsonInclude, JsonPropertyName("minimum_set_size")] + public int? MinimumSetSize { get; set; } + + /// + /// The minimum support of one item set. + /// + [JsonInclude, JsonPropertyName("minimum_support")] + public double? MinimumSupport { get; set; } + + /// + /// The number of top item sets to return. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(FrequentItemSetsAggregation frequentItemSetsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.FrequentItemSets(frequentItemSetsAggregation); +} + +public sealed partial class FrequentItemSetsAggregationDescriptor : SerializableDescriptor> +{ + internal FrequentItemSetsAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public FrequentItemSetsAggregationDescriptor() : base() + { + } + + private ICollection FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor FieldsDescriptor { get; set; } + private Action> FieldsDescriptorAction { get; set; } + private Action>[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private int? MinimumSetSizeValue { get; set; } + private double? MinimumSupportValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Fields to analyze. + /// + public FrequentItemSetsAggregationDescriptor Fields(ICollection fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Action> configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(params Action>[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Query that filters documents from analysis. + /// + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Action> configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The minimum size of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSetSize(int? minimumSetSize) + { + MinimumSetSizeValue = minimumSetSize; + return Self; + } + + /// + /// The minimum support of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSupport(double? minimumSupport) + { + MinimumSupportValue = minimumSupport; + return Self; + } + + /// + /// The number of top item sets to return. + /// + public FrequentItemSetsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MinimumSetSizeValue.HasValue) + { + writer.WritePropertyName("minimum_set_size"); + writer.WriteNumberValue(MinimumSetSizeValue.Value); + } + + if (MinimumSupportValue.HasValue) + { + writer.WritePropertyName("minimum_support"); + writer.WriteNumberValue(MinimumSupportValue.Value); + } + + if (SizeValue.HasValue) + { + writer.WritePropertyName("size"); + writer.WriteNumberValue(SizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FrequentItemSetsAggregationDescriptor : SerializableDescriptor +{ + internal FrequentItemSetsAggregationDescriptor(Action configure) => configure.Invoke(this); + + public FrequentItemSetsAggregationDescriptor() : base() + { + } + + private ICollection FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor FieldsDescriptor { get; set; } + private Action FieldsDescriptorAction { get; set; } + private Action[] FieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private int? MinimumSetSizeValue { get; set; } + private double? MinimumSupportValue { get; set; } + private int? SizeValue { get; set; } + + /// + /// Fields to analyze. + /// + public FrequentItemSetsAggregationDescriptor Fields(ICollection fields) + { + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsValue = fields; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor descriptor) + { + FieldsValue = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = null; + FieldsDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(Action configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorActions = null; + FieldsDescriptorAction = configure; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Fields(params Action[] configure) + { + FieldsValue = null; + FieldsDescriptor = null; + FieldsDescriptorAction = null; + FieldsDescriptorActions = configure; + return Self; + } + + /// + /// Query that filters documents from analysis. + /// + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) + { + FilterDescriptor = null; + FilterDescriptorAction = null; + FilterValue = filter; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + FilterValue = null; + FilterDescriptorAction = null; + FilterDescriptor = descriptor; + return Self; + } + + public FrequentItemSetsAggregationDescriptor Filter(Action configure) + { + FilterValue = null; + FilterDescriptor = null; + FilterDescriptorAction = configure; + return Self; + } + + /// + /// The minimum size of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSetSize(int? minimumSetSize) + { + MinimumSetSizeValue = minimumSetSize; + return Self; + } + + /// + /// The minimum support of one item set. + /// + public FrequentItemSetsAggregationDescriptor MinimumSupport(double? minimumSupport) + { + MinimumSupportValue = minimumSupport; + return Self; + } + + /// + /// The number of top item sets to return. + /// + public FrequentItemSetsAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor(FieldsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FieldsDescriptorActions is not null) + { + writer.WritePropertyName("fields"); + writer.WriteStartArray(); + foreach (var action in FieldsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + } + else if (FilterValue is not null) + { + writer.WritePropertyName("filter"); + JsonSerializer.Serialize(writer, FilterValue, options); + } + + if (MinimumSetSizeValue.HasValue) + { + writer.WritePropertyName("minimum_set_size"); + writer.WriteNumberValue(MinimumSetSizeValue.Value); + } + + if (MinimumSupportValue.HasValue) + { + writer.WritePropertyName("minimum_support"); + writer.WriteNumberValue(MinimumSupportValue.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/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs new file mode 100644 index 00000000000..1bda9e601e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +internal sealed partial class FrequentItemSetsBucketConverter : JsonConverter +{ + public override FrequentItemSetsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + IReadOnlyDictionary> key = default; + double support = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize>>(ref reader, options); + continue; + } + + if (property == "support") + { + support = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new FrequentItemSetsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, Support = support }; + } + + public override void Write(Utf8JsonWriter writer, FrequentItemSetsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'FrequentItemSetsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(FrequentItemSetsBucketConverter))] +public sealed partial class FrequentItemSetsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary> Key { get; init; } + public double Support { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs new file mode 100644 index 00000000000..bf08d600056 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class FrequentItemSetsField +{ + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ [JsonInclude, JsonPropertyName("exclude")] + public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? Include { get; set; } +} + +public sealed partial class FrequentItemSetsFieldDescriptor : SerializableDescriptor> +{ + internal FrequentItemSetsFieldDescriptor(Action> configure) => configure.Invoke(this); + + public FrequentItemSetsFieldDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } + + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Include(Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? include) + { + IncludeValue = include; + 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 (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class FrequentItemSetsFieldDescriptor : SerializableDescriptor +{ + internal FrequentItemSetsFieldDescriptor(Action configure) => configure.Invoke(this); + + public FrequentItemSetsFieldDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } + + /// + /// Values to exclude.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public FrequentItemSetsFieldDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Values to include.
Can be regular expression strings or arrays of strings of exact terms.
+ ///
+ public FrequentItemSetsFieldDescriptor Include(Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? include) + { + IncludeValue = include; + 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 (IncludeValue is not null) + { + writer.WritePropertyName("include"); + JsonSerializer.Serialize(writer, IncludeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs index f5e9b73a227..823e964c0e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs @@ -27,151 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeoBoundsAggregationConverter : JsonConverter +public sealed partial class GeoBoundsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Specifies whether the bounding box should be allowed to overlap the international date line. /// + [JsonInclude, JsonPropertyName("wrap_longitude")] public bool? WrapLongitude { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeoBoundsAggregation geoBoundsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeoBounds(geoBoundsAggregation); } public sealed partial class GeoBoundsAggregationDescriptor : SerializableDescriptor> @@ -183,30 +61,41 @@ public GeoBoundsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? WrapLongitudeValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public GeoBoundsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public GeoBoundsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public GeoBoundsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoBoundsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -229,8 +118,6 @@ public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitu protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_bounds"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -256,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(WrapLongitudeValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,36 +156,41 @@ public GeoBoundsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? WrapLongitudeValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoBoundsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoBoundsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -328,8 +213,6 @@ public GeoBoundsAggregationDescriptor WrapLongitude(bool? wrapLongitude = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_bounds"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs index 4cb9cefeb73..931866b1706 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs @@ -27,166 +27,28 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeoCentroidAggregationConverter : JsonConverter +public sealed partial class GeoCentroidAggregation { - 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() - { - } - + [JsonInclude, JsonPropertyName("count")] public long? Count { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("location")] public Elastic.Clients.Elasticsearch.GeoLocation? Location { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeoCentroidAggregation geoCentroidAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeoCentroid(geoCentroidAggregation); } public sealed partial class GeoCentroidAggregationDescriptor : SerializableDescriptor> @@ -200,8 +62,7 @@ public GeoCentroidAggregationDescriptor() : base() private long? CountValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.GeoLocation? LocationValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public GeoCentroidAggregationDescriptor Count(long? count) @@ -210,31 +71,43 @@ public GeoCentroidAggregationDescriptor Count(long? count) return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.GeoLocation? location) + /// + /// The field on which to run the aggregation. + /// + public GeoCentroidAggregationDescriptor Field(Expression> field) { - LocationValue = location; + FieldValue = field; return Self; } - public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) + public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.GeoLocation? location) { - MetaValue = selector?.Invoke(new FluentDictionary()); + LocationValue = location; return Self; } - public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoCentroidAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -248,8 +121,6 @@ public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasti protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_centroid"); writer.WriteStartObject(); if (CountValue.HasValue) { @@ -281,13 +152,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -303,8 +167,7 @@ public GeoCentroidAggregationDescriptor() : base() private long? CountValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.GeoLocation? LocationValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public GeoCentroidAggregationDescriptor Count(long? count) @@ -313,18 +176,27 @@ public GeoCentroidAggregationDescriptor Count(long? count) return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public GeoCentroidAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -337,13 +209,10 @@ public GeoCentroidAggregationDescriptor Location(Elastic.Clients.Elasticsearch.G return Self; } - public GeoCentroidAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public GeoCentroidAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public GeoCentroidAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -357,8 +226,6 @@ public GeoCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Scr protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_centroid"); writer.WriteStartObject(); if (CountValue.HasValue) { @@ -390,13 +257,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs index 4dc589e25a4..3c5c3f6dbeb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeoDistanceAggregationConverter : JsonConverter +public sealed partial class GeoDistanceAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The distance calculation type. /// + [JsonInclude, JsonPropertyName("distance_type")] public Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceType { get; set; } /// /// A field of type `geo_point` used to evaluate the distance. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The origin used to evaluate the distance. /// + [JsonInclude, JsonPropertyName("origin")] public Elastic.Clients.Elasticsearch.GeoLocation? Origin { get; set; } /// /// An array of ranges used to bucket documents. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } /// /// The distance unit. /// + [JsonInclude, JsonPropertyName("unit")] public Elastic.Clients.Elasticsearch.DistanceUnit? Unit { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeoDistanceAggregation geoDistanceAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeoDistance(geoDistanceAggregation); } public sealed partial class GeoDistanceAggregationDescriptor : SerializableDescriptor> @@ -234,43 +74,17 @@ public GeoDistanceAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.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.Aggregations.AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -298,12 +112,27 @@ public GeoDistanceAggregationDescriptor Field(Expression + /// 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; } + public GeoDistanceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The origin used to evaluate the distance. /// @@ -325,7 +154,7 @@ public GeoDistanceAggregationDescriptor Ranges(ICollection Ranges(AggregationRangeDescriptor descriptor) + public GeoDistanceAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -334,7 +163,7 @@ public GeoDistanceAggregationDescriptor Ranges(AggregationRangeDescri return Self; } - public GeoDistanceAggregationDescriptor Ranges(Action configure) + public GeoDistanceAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -343,7 +172,7 @@ public GeoDistanceAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -363,8 +192,6 @@ public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elastics protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_distance"); writer.WriteStartObject(); if (DistanceTypeValue is not null) { @@ -378,6 +205,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OriginValue is not null) { writer.WritePropertyName("origin"); @@ -395,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -404,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -421,29 +260,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -456,43 +272,17 @@ public GeoDistanceAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.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.Aggregations.AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeoDistanceAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -535,6 +325,12 @@ public GeoDistanceAggregationDescriptor Meta(Func /// The origin used to evaluate the distance. /// @@ -556,7 +352,7 @@ public GeoDistanceAggregationDescriptor Ranges(ICollection configure) + public GeoDistanceAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -574,7 +370,7 @@ public GeoDistanceAggregationDescriptor Ranges(Action[] configure) + public GeoDistanceAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -594,8 +390,6 @@ public GeoDistanceAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Dista protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_distance"); writer.WriteStartObject(); if (DistanceTypeValue is not null) { @@ -609,6 +403,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OriginValue is not null) { writer.WritePropertyName("origin"); @@ -626,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -635,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -652,29 +458,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeoLineAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs index ee1a4f5645b..18ec3bb8eed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs @@ -27,167 +27,36 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeoLineAggregationConverter : JsonConverter +public sealed partial class GeoLineAggregation { - 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. /// + [JsonInclude, JsonPropertyName("include_sort")] public bool? IncludeSort { get; set; } - public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } /// /// The name of the geo_point field. /// + [JsonInclude, JsonPropertyName("point")] public Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint Point { get; set; } /// /// The maximum length of the line represented in the aggregation.
Valid sizes are between 1 and 10000.
///
+ [JsonInclude, JsonPropertyName("size")] 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.
///
+ [JsonInclude, JsonPropertyName("sort")] public Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort Sort { get; set; } /// /// The order in which the line is sorted (ascending or descending). /// + [JsonInclude, JsonPropertyName("sort_order")] public Elastic.Clients.Elasticsearch.SortOrder? SortOrder { get; set; } } @@ -200,14 +69,13 @@ public GeoLineAggregationDescriptor() : base() } private bool? IncludeSortValue { get; set; } - private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint PointValue { get; set; } - private GeoLinePointDescriptor PointDescriptor { get; set; } - private Action> PointDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor PointDescriptor { get; set; } + private Action> PointDescriptorAction { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort SortValue { get; set; } - private GeoLineSortDescriptor SortDescriptor { get; set; } - private Action> SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? SortOrderValue { get; set; } /// @@ -219,12 +87,6 @@ public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = t return Self; } - public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The name of the geo_point field. /// @@ -236,7 +98,7 @@ public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsear return Self; } - public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor descriptor) { PointValue = null; PointDescriptorAction = null; @@ -244,7 +106,7 @@ public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor Point(Action> configure) + public GeoLineAggregationDescriptor Point(Action> configure) { PointValue = null; PointDescriptor = null; @@ -272,7 +134,7 @@ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearc return Self; } - public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -280,7 +142,7 @@ public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor Sort(Action> configure) + public GeoLineAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -299,8 +161,6 @@ public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elastic protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_line"); writer.WriteStartObject(); if (IncludeSortValue.HasValue) { @@ -316,7 +176,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PointDescriptorAction is not null) { writer.WritePropertyName("point"); - JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor(PointDescriptorAction), options); } else { @@ -338,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor(SortDescriptorAction), options); } else { @@ -352,13 +212,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SortOrderValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -372,14 +225,13 @@ public GeoLineAggregationDescriptor() : base() } private bool? IncludeSortValue { get; set; } - private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint PointValue { get; set; } - private GeoLinePointDescriptor PointDescriptor { get; set; } - private Action PointDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor PointDescriptor { get; set; } + private Action PointDescriptorAction { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort SortValue { get; set; } - private GeoLineSortDescriptor SortDescriptor { get; set; } - private Action SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? SortOrderValue { get; set; } /// @@ -391,12 +243,6 @@ public GeoLineAggregationDescriptor IncludeSort(bool? includeSort = true) return Self; } - public GeoLineAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The name of the geo_point field. /// @@ -408,7 +254,7 @@ public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Aggregat return Self; } - public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) + public GeoLineAggregationDescriptor Point(Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor descriptor) { PointValue = null; PointDescriptorAction = null; @@ -416,7 +262,7 @@ public GeoLineAggregationDescriptor Point(GeoLinePointDescriptor descriptor) return Self; } - public GeoLineAggregationDescriptor Point(Action configure) + public GeoLineAggregationDescriptor Point(Action configure) { PointValue = null; PointDescriptor = null; @@ -444,7 +290,7 @@ public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Aggregati return Self; } - public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) + public GeoLineAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -452,7 +298,7 @@ public GeoLineAggregationDescriptor Sort(GeoLineSortDescriptor descriptor) return Self; } - public GeoLineAggregationDescriptor Sort(Action configure) + public GeoLineAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -471,8 +317,6 @@ public GeoLineAggregationDescriptor SortOrder(Elastic.Clients.Elasticsearch.Sort protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geo_line"); writer.WriteStartObject(); if (IncludeSortValue.HasValue) { @@ -488,7 +332,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PointDescriptorAction is not null) { writer.WritePropertyName("point"); - JsonSerializer.Serialize(writer, new GeoLinePointDescriptor(PointDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointDescriptor(PointDescriptorAction), options); } else { @@ -510,7 +354,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new GeoLineSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortDescriptor(SortDescriptorAction), options); } else { @@ -524,13 +368,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeoLinePoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs index ab26f8f02bf..467e14abe96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs @@ -64,6 +64,15 @@ public GeoLinePointDescriptor Field(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs index 080520cf0e1..abe11727992 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs @@ -64,6 +64,15 @@ public GeoLineSortDescriptor Field(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs index 0431128bc09..03b6bfec018 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs @@ -27,203 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeohashGridAggregationConverter : JsonConverter +public sealed partial class GeohashGridAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The bounding box to filter the points in each bucket. /// + [JsonInclude, JsonPropertyName("bounds")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The string length of the geohashes used to define cells/buckets in the results. /// + [JsonInclude, JsonPropertyName("precision")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The maximum number of geohash buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeohashGridAggregation geohashGridAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeohashGrid(geohashGridAggregation); } public sealed partial class GeohashGridAggregationDescriptor : SerializableDescriptor> @@ -234,40 +74,14 @@ public GeohashGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.GeohashPrecision? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -295,12 +109,27 @@ public GeohashGridAggregationDescriptor Field(Expression + /// 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; } + public GeohashGridAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The string length of the geohashes used to define cells/buckets in the results. /// @@ -330,8 +159,6 @@ public GeohashGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohash_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -345,6 +172,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue is not null) { writer.WritePropertyName("precision"); @@ -363,29 +202,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -398,40 +214,14 @@ public GeohashGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.GeohashPrecision? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeohashGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -474,6 +264,12 @@ public GeohashGridAggregationDescriptor Meta(Func /// The string length of the geohashes used to define cells/buckets in the results. /// @@ -503,8 +299,6 @@ public GeohashGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohash_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -518,6 +312,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue is not null) { writer.WritePropertyName("precision"); @@ -536,29 +342,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeohashGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs index 72757387c3a..8afc6c8acb4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class GeohashGridBucketConverter : JsonConverter { - public override GeohashGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeohashGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeohashGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeohashGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeohashGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeohashGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeohashGridBucketConverter))] +public sealed partial class GeohashGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs index 6fa495849ff..60236b6e4b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs @@ -27,195 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeohexGridAggregationConverter : JsonConverter +public sealed partial class GeohexGridAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Bounding box used to filter the geo-points in each bucket. /// + [JsonInclude, JsonPropertyName("bounds")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
///
+ [JsonInclude, JsonPropertyName("precision")] public int? Precision { get; set; } /// /// Number of buckets returned from each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// Maximum number of buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeohexGridAggregation geohexGridAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeohexGrid(geohexGridAggregation); } public sealed partial class GeohexGridAggregationDescriptor : SerializableDescriptor> @@ -226,40 +74,14 @@ public GeohexGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -287,12 +109,27 @@ public GeohexGridAggregationDescriptor Field(Expression + /// 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; } + public GeohexGridAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
///
@@ -322,8 +159,6 @@ public GeohexGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohex_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -333,6 +168,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -351,29 +198,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -386,40 +210,14 @@ public GeohexGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeohexGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -462,6 +260,12 @@ public GeohexGridAggregationDescriptor Meta(Func /// Integer zoom of the key used to defined cells or buckets
in the results. Value should be between 0-15.
/// @@ -491,8 +295,6 @@ public GeohexGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geohex_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -502,6 +304,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("field"); JsonSerializer.Serialize(writer, FieldValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -520,29 +334,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeohexGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs index 15b1ed0f912..8ade2177d76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class GeohexGridBucketConverter : JsonConverter { - public override GeohexGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeohexGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeohexGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeohexGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeohexGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeohexGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeohexGridBucketConverter))] +public sealed partial class GeohexGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs index 6d94aad20a5..68c7354d28f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs @@ -27,203 +27,44 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GeotileGridAggregationConverter : JsonConverter +public sealed partial class GeotileGridAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// A bounding box to filter the geo-points or geo-shapes in each bucket. /// + [JsonInclude, JsonPropertyName("bounds")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
///
+ [JsonInclude, JsonPropertyName("precision")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The maximum number of buckets to return. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GeotileGridAggregation geotileGridAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.GeotileGrid(geotileGridAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(GeotileGridAggregation geotileGridAggregation) => Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy.GeotileGrid(geotileGridAggregation); } public sealed partial class GeotileGridAggregationDescriptor : SerializableDescriptor> @@ -234,40 +75,14 @@ public GeotileGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private double? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -295,12 +110,27 @@ public GeotileGridAggregationDescriptor Field(Expression + /// 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; } + public GeotileGridAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -330,8 +160,6 @@ public GeotileGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geotile_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -345,10 +173,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } - if (PrecisionValue is not null) + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, PrecisionValue, options); + writer.WriteNumberValue(PrecisionValue.Value); } if (ShardSizeValue.HasValue) @@ -363,29 +203,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -398,40 +215,14 @@ public GeotileGridAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.GeoBounds? BoundsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private double? PrecisionValue { get; set; } private int? ShardSizeValue { get; set; } private int? SizeValue { get; set; } - public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GeotileGridAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -474,6 +265,12 @@ public GeotileGridAggregationDescriptor Meta(Func /// Integer zoom of the key used to define cells/buckets in the results.
Values outside of the range [0,29] will be rejected.
/// @@ -503,8 +300,6 @@ public GeotileGridAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("geotile_grid"); writer.WriteStartObject(); if (BoundsValue is not null) { @@ -518,10 +313,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } - if (PrecisionValue is not null) + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, PrecisionValue, options); + writer.WriteNumberValue(PrecisionValue.Value); } if (ShardSizeValue.HasValue) @@ -536,29 +343,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/GeotileGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs index 4e5b857d319..c3046f22f92 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class GeotileGridBucketConverter : JsonConverter { - public override GeotileGridBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GeotileGridBucket(subAggs) { DocCount = docCount, Key = key }; + return new GeotileGridBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, GeotileGridBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GeotileGridBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GeotileGridBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GeotileGridBucketConverter))] +public sealed partial class GeotileGridBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs index 7b669e164e4..3abc0ec6ae5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class GlobalAggregateConverter : JsonConverter { - public override GlobalAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new GlobalAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new GlobalAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, GlobalAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, GlobalAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'GlobalAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(GlobalAggregateConverter))] +public sealed partial class GlobalAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs index e714d2b3699..3f359d14df2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs @@ -27,164 +27,14 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class GlobalAggregationConverter : JsonConverter +public sealed partial class GlobalAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - - public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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); - } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } - writer.WriteEndObject(); - } + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(GlobalAggregation globalAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Global(globalAggregation); } public sealed partial class GlobalAggregationDescriptor : SerializableDescriptor @@ -195,67 +45,34 @@ public GlobalAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } - public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public GlobalAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public GlobalAggregationDescriptor Aggregations(Action configure) + public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public GlobalAggregationDescriptor Meta(Func, FluentDictionary> selector) + public GlobalAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs new file mode 100644 index 00000000000..dcf051f90b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class HdrPercentileRanksAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Aggregations.Percentiles Values { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs new file mode 100644 index 00000000000..f82bc12e77d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class HdrPercentilesAggregate : IAggregate +{ + [JsonInclude, JsonPropertyName("meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("values")] + public Elastic.Clients.Elasticsearch.Aggregations.Percentiles Values { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs index e57e18b0b50..1a1dd073ba6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs @@ -27,264 +27,55 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class HistogramAggregationConverter : JsonConverter +public sealed partial class HistogramAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The name of the field to aggregate on. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// The interval for the buckets.
Must be a positive decimal.
///
+ [JsonInclude, JsonPropertyName("interval")] public double? Interval { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public double? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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.
///
+ [JsonInclude, JsonPropertyName("offset")] 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; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(HistogramAggregation histogramAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Histogram(histogramAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(HistogramAggregation histogramAggregation) => Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy.Histogram(histogramAggregation); } public sealed partial class HistogramAggregationDescriptor : SerializableDescriptor> @@ -295,47 +86,30 @@ public HistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.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 string? NameValue { get; set; } private double? OffsetValue { get; set; } - private ICollection>? OrderValue { get; set; } + private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public HistogramAggregationDescriptor Aggregations(Action> configure) + /// + /// The name of the field to aggregate on. + /// + public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The name of the field to aggregate on. /// - public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + public HistogramAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -344,7 +118,7 @@ public HistogramAggregationDescriptor Field(Elastic.Clients.Elasticse /// /// The name of the field to aggregate on. /// - public HistogramAggregationDescriptor Field(Expression> field) + public HistogramAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -389,6 +163,12 @@ public HistogramAggregationDescriptor Missing(double? missing) return Self; } + public HistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -401,7 +181,7 @@ public HistogramAggregationDescriptor Offset(double? offset) /// /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
///
- public HistogramAggregationDescriptor Order(ICollection>? order) + public HistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -415,8 +195,6 @@ public HistogramAggregationDescriptor Script(Elastic.Clients.Elastics protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("histogram"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -436,6 +214,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(IntervalValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -448,6 +232,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue.HasValue) { writer.WritePropertyName("offset"); @@ -457,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ScriptValue is not null) @@ -466,29 +256,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -501,43 +268,17 @@ public HistogramAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.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 string? NameValue { get; set; } private double? OffsetValue { get; set; } - private ICollection>? OrderValue { get; set; } + private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public HistogramAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -604,6 +345,12 @@ public HistogramAggregationDescriptor Missing(double? missing) return Self; } + public HistogramAggregationDescriptor Name(string? name) + { + NameValue = name; + 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.
///
@@ -616,7 +363,7 @@ public HistogramAggregationDescriptor Offset(double? offset) /// /// The sort order of the returned buckets.
By default, the returned buckets are sorted by their key ascending.
///
- public HistogramAggregationDescriptor Order(ICollection>? order) + public HistogramAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -630,8 +377,6 @@ public HistogramAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Scrip protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("histogram"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -651,6 +396,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(IntervalValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -663,6 +414,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OffsetValue.HasValue) { writer.WritePropertyName("offset"); @@ -672,7 +429,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ScriptValue is not null) @@ -681,29 +438,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/HistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs index 4826e85da11..25fa6901a3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs @@ -27,68 +27,67 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class HistogramBucketConverter : JsonConverter { - public override HistogramBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new HistogramBucket(subAggs) { DocCount = docCount, Key = key, KeyAsString = keyAsString }; + return new HistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, HistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, HistogramBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'HistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(HistogramBucketConverter))] +public sealed partial class HistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double Key { get; init; } + public string? KeyAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs index 8acc72f90b0..385f6342927 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs @@ -27,18 +27,78 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; +internal sealed partial class InferenceAggregateConverter : JsonConverter +{ + public override InferenceAggregate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection? featureImportance = default; + IReadOnlyDictionary? meta = default; + IReadOnlyCollection? topClasses = default; + Elastic.Clients.Elasticsearch.FieldValue? value = default; + string? warning = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "feature_importance") + { + featureImportance = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "top_classes") + { + topClasses = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "value") + { + value = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "warning") + { + warning = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new InferenceAggregate { Data = additionalProperties, FeatureImportance = featureImportance, Meta = meta, TopClasses = topClasses, Value = value, Warning = warning }; + } + + public override void Write(Utf8JsonWriter writer, InferenceAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'InferenceAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(InferenceAggregateConverter))] public sealed partial class InferenceAggregate : IAggregate { - [JsonInclude, JsonPropertyName("data")] + /// + /// Additional 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.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/_Generated/Types/Aggregations/InferenceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs index 67f8a884ad2..5a7d5ef2c34 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs @@ -27,165 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class InferenceAggregationConverter : JsonConverter +public sealed partial class InferenceAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } /// /// Contains the inference type and its options. /// + [JsonInclude, JsonPropertyName("inference_config")] public Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig? InferenceConfig { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// The ID or alias for the trained model. /// + [JsonInclude, JsonPropertyName("model_id")] public Elastic.Clients.Elasticsearch.Name ModelId { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(InferenceAggregation inferenceAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Inference(inferenceAggregation); } public sealed partial class InferenceAggregationDescriptor : SerializableDescriptor> @@ -200,23 +78,33 @@ public InferenceAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Name ModelIdValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public InferenceAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -234,7 +122,7 @@ public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients return Self; } - public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -242,7 +130,7 @@ public InferenceAggregationDescriptor InferenceConfig(InferenceConfig return Self; } - public InferenceAggregationDescriptor InferenceConfig(Action> configure) + public InferenceAggregationDescriptor InferenceConfig(Action> configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -265,10 +153,14 @@ public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elastic return Self; } + public InferenceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("inference"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -296,7 +188,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -304,15 +196,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, InferenceConfigValue, 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.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + writer.WriteEndObject(); } } @@ -329,23 +226,33 @@ public InferenceAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Name ModelIdValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public InferenceAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public InferenceAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public InferenceAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -363,7 +270,7 @@ public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsea return Self; } - public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceAggregationDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -371,7 +278,7 @@ public InferenceAggregationDescriptor InferenceConfig(InferenceConfigDescriptor return Self; } - public InferenceAggregationDescriptor InferenceConfig(Action configure) + public InferenceAggregationDescriptor InferenceConfig(Action configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -394,10 +301,14 @@ public InferenceAggregationDescriptor ModelId(Elastic.Clients.Elasticsearch.Name return Self; } + public InferenceAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("inference"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -425,7 +336,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -433,15 +344,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, InferenceConfigValue, 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.WritePropertyName("model_id"); + JsonSerializer.Serialize(writer, ModelIdValue, options); + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs index 6e4c1907721..65cdffb2ff4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -45,8 +46,20 @@ internal InferenceConfig(string variantName, object variant) internal object Variant { get; } internal string VariantName { get; } - public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfig("classification", classificationInferenceOptions); - public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfig("regression", regressionInferenceOptions); + public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfig("classification", classificationInferenceOptions); + public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfig("regression", regressionInferenceOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class InferenceConfigConverter : JsonConverter @@ -58,44 +71,57 @@ public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "classification") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new InferenceConfig(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "regression") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new InferenceConfig(propertyName, variant); + if (propertyName == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfig' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new InferenceConfig(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + 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.Ml.ClassificationInferenceOptions)value.Variant, options); + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, options); break; case "regression": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions)value.Variant, options); + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, options); break; } } @@ -135,29 +161,27 @@ private InferenceConfigDescriptor Set(object variant, string variantN 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 Classification(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -193,30 +217,27 @@ private InferenceConfigDescriptor Set(object variant, string variantName) 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs index 6f80a3e147a..51d70646007 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs @@ -27,210 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class IpPrefixAggregationConverter : JsonConverter +public sealed partial class IpPrefixAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Defines whether the prefix length is appended to IP address keys in the response. /// + [JsonInclude, JsonPropertyName("append_prefix_length")] public bool? AppendPrefixLength { get; set; } /// /// The IP address field to aggregation on. The field mapping type must be `ip`. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Defines whether the prefix applies to IPv6 addresses. /// + [JsonInclude, JsonPropertyName("is_ipv6")] 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; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Minimum number of documents in a bucket for it to be included in the response. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Length of the network prefix. For IPv4 addresses the accepted range is [0, 32].
For IPv6 addresses the accepted range is [0, 128].
///
+ [JsonInclude, JsonPropertyName("prefix_length")] public int PrefixLength { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(IpPrefixAggregation ipPrefixAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.IpPrefix(ipPrefixAggregation); } public sealed partial class IpPrefixAggregationDescriptor : SerializableDescriptor> @@ -241,41 +74,14 @@ public IpPrefixAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private bool? AppendPrefixLengthValue { get; set; } private Elastic.Clients.Elasticsearch.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 string? NameValue { get; set; } private int PrefixLengthValue { get; set; } - public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -304,20 +110,20 @@ public IpPrefixAggregationDescriptor Field(Expression - /// Defines whether the prefix applies to IPv6 addresses. + /// The IP address field to aggregation on. The field mapping type must be `ip`. /// - public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) + public IpPrefixAggregationDescriptor Field(Expression> field) { - IsIpv6Value = isIpv6; + FieldValue = field; return Self; } /// - /// Defines whether buckets are returned as a hash rather than an array in the response. + /// Defines whether the prefix applies to IPv6 addresses. /// - public IpPrefixAggregationDescriptor Keyed(bool? keyed = true) + public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) { - KeyedValue = keyed; + IsIpv6Value = isIpv6; return Self; } @@ -336,6 +142,12 @@ public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public IpPrefixAggregationDescriptor Name(string? name) + { + NameValue = name; + 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].
///
@@ -347,8 +159,6 @@ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("ip_prefix"); writer.WriteStartObject(); if (AppendPrefixLengthValue.HasValue) { @@ -364,10 +174,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IsIpv6Value.Value); } - if (KeyedValue.HasValue) + if (MetaValue is not null) { - writer.WritePropertyName("keyed"); - writer.WriteBooleanValue(KeyedValue.Value); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } if (MinDocCountValue.HasValue) @@ -376,31 +186,14 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - 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.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); writer.WriteEndObject(); } } @@ -413,41 +206,14 @@ public IpPrefixAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private bool? AppendPrefixLengthValue { get; set; } private Elastic.Clients.Elasticsearch.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 string? NameValue { get; set; } private int PrefixLengthValue { get; set; } - public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public IpPrefixAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -493,15 +259,6 @@ public IpPrefixAggregationDescriptor IsIpv6(bool? isIpv6 = true) 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()); @@ -517,6 +274,12 @@ public IpPrefixAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public IpPrefixAggregationDescriptor Name(string? name) + { + NameValue = name; + 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].
///
@@ -528,8 +291,6 @@ public IpPrefixAggregationDescriptor PrefixLength(int prefixLength) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("ip_prefix"); writer.WriteStartObject(); if (AppendPrefixLengthValue.HasValue) { @@ -545,10 +306,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IsIpv6Value.Value); } - if (KeyedValue.HasValue) + if (MetaValue is not null) { - writer.WritePropertyName("keyed"); - writer.WriteBooleanValue(KeyedValue.Value); + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); } if (MinDocCountValue.HasValue) @@ -557,31 +318,14 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (!string.IsNullOrEmpty(NameValue)) { - 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.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(PrefixLengthValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs index d4da55c97d5..1951ce3aff7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs @@ -27,86 +27,83 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class IpPrefixBucketConverter : JsonConverter { - public override IpPrefixBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; bool isIpv6 = default; string key = default; string? netmask = default; int prefixLength = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("is_ipv6", StringComparison.Ordinal)) - { - isIpv6 = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "is_ipv6") + { + isIpv6 = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("netmask", StringComparison.Ordinal)) - { - netmask = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "netmask") + { + netmask = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("prefix_length", StringComparison.Ordinal)) - { - prefixLength = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "prefix_length") + { + prefixLength = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new IpPrefixBucket(subAggs) { DocCount = docCount, IsIpv6 = isIpv6, Key = key, Netmask = netmask, PrefixLength = prefixLength }; + return new IpPrefixBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, IsIpv6 = isIpv6, Key = key, Netmask = netmask, PrefixLength = prefixLength }; } - public override void Write(Utf8JsonWriter writer, IpPrefixBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, IpPrefixBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'IpPrefixBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(IpPrefixBucketConverter))] +public sealed partial class IpPrefixBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public bool IsIpv6 { get; init; } + public string Key { get; init; } + public string? Netmask { get; init; } + public int PrefixLength { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs index 18e407da0d6..956909112fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs @@ -27,134 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class IpRangeAggregationConverter : JsonConverter +public sealed partial class IpRangeAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The date field whose values are used to build ranges. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Array of IP ranges. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(IpRangeAggregation ipRangeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.IpRange(ipRangeAggregation); } public sealed partial class IpRangeAggregationDescriptor : SerializableDescriptor> @@ -165,44 +56,27 @@ public IpRangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { 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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } + private Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } - public IpRangeAggregationDescriptor Aggregations(Action> configure) + /// + /// The date field whose values are used to build ranges. + /// + public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are used to build ranges. /// - public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + public IpRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -211,7 +85,7 @@ public IpRangeAggregationDescriptor Field(Elastic.Clients.Elasticsear /// /// The date field whose values are used to build ranges. /// - public IpRangeAggregationDescriptor Field(Expression> field) + public IpRangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -223,6 +97,12 @@ public IpRangeAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of IP ranges. /// @@ -235,7 +115,7 @@ public IpRangeAggregationDescriptor Ranges(ICollection Ranges(IpRangeAggregationRangeDescriptor descriptor) + public IpRangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -244,7 +124,7 @@ public IpRangeAggregationDescriptor Ranges(IpRangeAggregationRangeDes return Self; } - public IpRangeAggregationDescriptor Ranges(Action configure) + public IpRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -253,7 +133,7 @@ public IpRangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public IpRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -264,8 +144,6 @@ public IpRangeAggregationDescriptor Ranges(params Action(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); - } - writer.WriteEndObject(); } } @@ -339,39 +206,13 @@ public IpRangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { 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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public IpRangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public IpRangeAggregationDescriptor Aggregations(Action configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } /// /// The date field whose values are used to build ranges. @@ -406,6 +247,12 @@ public IpRangeAggregationDescriptor Meta(Func, return Self; } + public IpRangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Array of IP ranges. /// @@ -418,7 +265,7 @@ public IpRangeAggregationDescriptor Ranges(ICollection configure) + public IpRangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -436,7 +283,7 @@ public IpRangeAggregationDescriptor Ranges(Action[] configure) + public IpRangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -447,8 +294,6 @@ public IpRangeAggregationDescriptor Ranges(params Action 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 +internal sealed partial class IpRangeBucketConverter : JsonConverter { - public override IpRangeBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string? from = default; string? key = default; string? to = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("from", StringComparison.Ordinal)) - { - from = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "from") + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("to", StringComparison.Ordinal)) - { - to = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "to") + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new IpRangeBucket(subAggs) { DocCount = docCount, From = from, Key = key, To = to }; + return new IpRangeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, From = from, Key = key, To = to }; } - public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'IpRangeBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(IpRangeBucketConverter))] +public sealed partial class IpRangeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string? From { get; init; } + public string? Key { get; init; } + public string? To { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs new file mode 100644 index 00000000000..1905d7aae1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// Result of the `rare_terms` aggregation when the field is some kind of whole number like a integer, long, or a date. +/// +public sealed partial class LongRareTermsAggregate : 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/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs new file mode 100644 index 00000000000..b7ff5d5bf10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +internal sealed partial class LongRareTermsBucketConverter : JsonConverter +{ + public override LongRareTermsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + long key = default; + string? keyAsString = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new LongRareTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key, KeyAsString = keyAsString }; + } + + public override void Write(Utf8JsonWriter writer, LongRareTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'LongRareTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(LongRareTermsBucketConverter))] +public sealed partial class LongRareTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs index 518266a14b0..824f5220a85 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs @@ -27,77 +27,75 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class LongTermsBucketConverter : JsonConverter { - public override LongTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; long key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new LongTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; + return new LongTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, LongTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, LongTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'LongTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(LongTermsBucketConverter))] +public sealed partial class LongTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public long Key { get; init; } + public string? KeyAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs index c1513bb4f0d..cb30e9af9a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs @@ -27,131 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MatrixStatsAggregationConverter : JsonConverter +public sealed partial class MatrixStatsAggregation { - 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() - { - } - + /// + /// An array of fields for computing the statistics. + /// + [JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Fields? Fields { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
+ ///
+ [JsonInclude, JsonPropertyName("missing")] public IDictionary? Missing { get; set; } /// /// Array value the aggregation will use for array or multi-valued fields. /// + [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.SortMode? Mode { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MatrixStatsAggregation matrixStatsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MatrixStats(matrixStatsAggregation); } public sealed partial class MatrixStatsAggregationDescriptor : SerializableDescriptor> @@ -166,7 +66,11 @@ public MatrixStatsAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private IDictionary? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } + private string? NameValue { get; set; } + /// + /// An array of fields for computing the statistics. + /// public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) { FieldsValue = fields; @@ -179,6 +83,9 @@ public MatrixStatsAggregationDescriptor Meta(Func + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) { MissingValue = selector?.Invoke(new FluentDictionary()); @@ -194,10 +101,14 @@ public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elastics return Self; } + public MatrixStatsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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) { @@ -205,6 +116,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldsValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); @@ -217,11 +134,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ModeValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -240,7 +156,11 @@ public MatrixStatsAggregationDescriptor() : base() private IDictionary? MetaValue { get; set; } private IDictionary? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } + private string? NameValue { get; set; } + /// + /// An array of fields for computing the statistics. + /// public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) { FieldsValue = fields; @@ -253,6 +173,9 @@ public MatrixStatsAggregationDescriptor Meta(Func + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ /// public MatrixStatsAggregationDescriptor Missing(Func, FluentDictionary> selector) { MissingValue = selector?.Invoke(new FluentDictionary()); @@ -268,10 +191,14 @@ public MatrixStatsAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.SortM return Self; } + public MatrixStatsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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) { @@ -279,6 +206,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldsValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); @@ -291,11 +224,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ModeValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs index 8c832e9a81e..366cc29ff0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MaxAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs index 73b24c2b608..e0b24a9da3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MaxAggregationConverter : JsonConverter +public sealed partial class MaxAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MaxAggregation maxAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Max(maxAggregation); } public sealed partial class MaxAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public MaxAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MaxAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MaxAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MaxAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MaxAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MaxAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("max"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public MaxAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MaxAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public MaxAggregationDescriptor Format(string? format) return Self; } - public MaxAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MaxAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MaxAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? scr protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("max"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs new file mode 100644 index 00000000000..bba5b617c5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class MaxBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MaxBucketAggregation maxBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MaxBucket(maxBucketAggregation); +} + +public sealed partial class MaxBucketAggregationDescriptor : SerializableDescriptor +{ + internal MaxBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MaxBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MaxBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MaxBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MaxBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MaxBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MaxBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs index 3412897a555..c4c5b91f0e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MedianAbsoluteDeviationAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs index 1360e30b0ea..08e34b68926 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs @@ -27,169 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MedianAbsoluteDeviationAggregationConverter : JsonConverter +public sealed partial class MedianAbsoluteDeviationAggregation { - 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. /// + [JsonInclude, JsonPropertyName("compression")] public double? Compression { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MedianAbsoluteDeviationAggregation medianAbsoluteDeviationAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MedianAbsoluteDeviation(medianAbsoluteDeviationAggregation); } public sealed partial class MedianAbsoluteDeviationAggregationDescriptor : SerializableDescriptor> @@ -203,8 +65,7 @@ public MedianAbsoluteDeviationAggregationDescriptor() : base() private double? CompressionValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -216,31 +77,43 @@ public MedianAbsoluteDeviationAggregationDescriptor Compression(doubl return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MedianAbsoluteDeviationAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -254,8 +127,6 @@ public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Cl protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("median_absolute_deviation"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -287,13 +158,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -309,8 +173,7 @@ public MedianAbsoluteDeviationAggregationDescriptor() : base() private double? CompressionValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -322,18 +185,27 @@ public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compress return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MedianAbsoluteDeviationAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -346,13 +218,10 @@ public MedianAbsoluteDeviationAggregationDescriptor Format(string? format) return Self; } - public MedianAbsoluteDeviationAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MedianAbsoluteDeviationAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MedianAbsoluteDeviationAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -366,8 +235,6 @@ public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Clients.Elast protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("median_absolute_deviation"); writer.WriteStartObject(); if (CompressionValue.HasValue) { @@ -399,13 +266,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/MinAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs index 1db309c45bc..d850b5efa0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class MinAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs index 6acd68e9e59..773e94dd321 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MinAggregationConverter : JsonConverter +public sealed partial class MinAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MinAggregation minAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Min(minAggregation); } public sealed partial class MinAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public MinAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public MinAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public MinAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) + public MinAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public MinAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MinAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("min"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public MinAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public MinAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public MinAggregationDescriptor Format(string? format) return Self; } - public MinAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public MinAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public MinAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? scr protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("min"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/MinBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs new file mode 100644 index 00000000000..7d125e6a88d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class MinBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MinBucketAggregation minBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MinBucket(minBucketAggregation); +} + +public sealed partial class MinBucketAggregationDescriptor : SerializableDescriptor +{ + internal MinBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MinBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MinBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MinBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MinBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MinBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MinBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs index 75bcb6e70b7..7fbf55c6165 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class MissingAggregateConverter : JsonConverter { - public override MissingAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new MissingAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new MissingAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, MissingAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, MissingAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'MissingAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(MissingAggregateConverter))] +public sealed partial class MissingAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs index d85a9762d4b..7c87406f292 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs @@ -27,130 +27,21 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MissingAggregationConverter : JsonConverter +public sealed partial class MissingAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The name of the field. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MissingAggregation missingAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Missing(missingAggregation); } public sealed partial class MissingAggregationDescriptor : SerializableDescriptor> @@ -161,41 +52,24 @@ public MissingAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } - public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public MissingAggregationDescriptor Aggregations(Action> configure) + /// + /// The name of the field. + /// + public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The name of the field. /// - public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + public MissingAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -204,7 +78,7 @@ public MissingAggregationDescriptor Field(Elastic.Clients.Elasticsear /// /// The name of the field. /// - public MissingAggregationDescriptor Field(Expression> field) + public MissingAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -216,16 +90,20 @@ public MissingAggregationDescriptor Meta(Func Missing(FieldValue? missing) + public MissingAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public MissingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("missing"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -233,33 +111,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (MissingValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); @@ -274,36 +141,10 @@ public MissingAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } - - public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public MissingAggregationDescriptor Aggregations(Action configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } /// /// The name of the field. @@ -338,16 +179,20 @@ public MissingAggregationDescriptor Meta(Func, return Self; } - public MissingAggregationDescriptor Missing(FieldValue? missing) + public MissingAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public MissingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("missing"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,33 +200,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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) + if (MissingValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs new file mode 100644 index 00000000000..f16d0a92e24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs @@ -0,0 +1,211 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class MovingFunctionAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The script that should be executed on each window of data. + /// + [JsonInclude, JsonPropertyName("script")] + public string? Script { get; set; } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ [JsonInclude, JsonPropertyName("shift")] + public int? Shift { get; set; } + + /// + /// The size of window to "slide" across the histogram. + /// + [JsonInclude, JsonPropertyName("window")] + public int? Window { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MovingFunctionAggregation movingFunctionAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MovingFn(movingFunctionAggregation); +} + +public sealed partial class MovingFunctionAggregationDescriptor : SerializableDescriptor +{ + internal MovingFunctionAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MovingFunctionAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + private string? ScriptValue { get; set; } + private int? ShiftValue { get; set; } + private int? WindowValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MovingFunctionAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MovingFunctionAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MovingFunctionAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MovingFunctionAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MovingFunctionAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// The script that should be executed on each window of data. + /// + public MovingFunctionAggregationDescriptor Script(string? script) + { + ScriptValue = script; + return Self; + } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ public MovingFunctionAggregationDescriptor Shift(int? shift) + { + ShiftValue = shift; + return Self; + } + + /// + /// The size of window to "slide" across the histogram. + /// + public MovingFunctionAggregationDescriptor Window(int? window) + { + WindowValue = window; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (!string.IsNullOrEmpty(ScriptValue)) + { + writer.WritePropertyName("script"); + writer.WriteStringValue(ScriptValue); + } + + if (ShiftValue.HasValue) + { + writer.WritePropertyName("shift"); + writer.WriteNumberValue(ShiftValue.Value); + } + + if (WindowValue.HasValue) + { + writer.WritePropertyName("window"); + writer.WriteNumberValue(WindowValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs new file mode 100644 index 00000000000..5b8ff3e4c39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class MovingPercentilesAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ [JsonInclude, JsonPropertyName("shift")] + public int? Shift { get; set; } + + /// + /// The size of window to "slide" across the histogram. + /// + [JsonInclude, JsonPropertyName("window")] + public int? Window { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MovingPercentilesAggregation movingPercentilesAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MovingPercentiles(movingPercentilesAggregation); +} + +public sealed partial class MovingPercentilesAggregationDescriptor : SerializableDescriptor +{ + internal MovingPercentilesAggregationDescriptor(Action configure) => configure.Invoke(this); + + public MovingPercentilesAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + private int? ShiftValue { get; set; } + private int? WindowValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public MovingPercentilesAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public MovingPercentilesAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public MovingPercentilesAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public MovingPercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public MovingPercentilesAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + /// + /// By default, the window consists of the last n values excluding the current bucket.
Increasing `shift` by 1, moves the starting window position by 1 to the right.
+ ///
+ public MovingPercentilesAggregationDescriptor Shift(int? shift) + { + ShiftValue = shift; + return Self; + } + + /// + /// The size of window to "slide" across the histogram. + /// + public MovingPercentilesAggregationDescriptor Window(int? window) + { + WindowValue = window; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (ShiftValue.HasValue) + { + writer.WritePropertyName("shift"); + writer.WriteNumberValue(ShiftValue.Value); + } + + if (WindowValue.HasValue) + { + writer.WritePropertyName("window"); + writer.WriteNumberValue(WindowValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs index 21a10e563aa..143c0588606 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs @@ -39,7 +39,7 @@ public sealed partial class MultiTermLookup /// 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } } public sealed partial class MultiTermLookupDescriptor : SerializableDescriptor> @@ -51,7 +51,7 @@ public MultiTermLookupDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } /// /// A fields from which to retrieve terms. @@ -71,10 +71,19 @@ public MultiTermLookupDescriptor Field(Expression + /// 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) + public MultiTermLookupDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -104,7 +113,7 @@ public MultiTermLookupDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } /// /// A fields from which to retrieve terms. @@ -136,7 +145,7 @@ public MultiTermLookupDescriptor Field(Expression /// 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) + public MultiTermLookupDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs index 115acb20193..9141fb3dbe9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs @@ -27,264 +27,62 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class MultiTermsAggregationConverter : JsonConverter +public sealed partial class MultiTermsAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Specifies the strategy for data collection. /// + [JsonInclude, JsonPropertyName("collect_mode")] public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// The minimum number of documents in a bucket for it to be returned. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } - override public string? Name { get; internal set; } - [JsonConverter(typeof(AggregateOrderConverter))] + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("order")] + [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] + public ICollection>? Order { get; set; } /// /// The minimum number of documents in a bucket on each shard for it to be returned. /// + [JsonInclude, JsonPropertyName("shard_min_doc_count")] 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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// Calculates the doc count error on per term basis. /// + [JsonInclude, JsonPropertyName("show_term_doc_count_error")] public bool? ShowTermDocCountError { get; set; } /// /// The number of term buckets should be returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The field from which to generate sets of terms. /// + [JsonInclude, JsonPropertyName("terms")] public ICollection Terms { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(MultiTermsAggregation multiTermsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.MultiTerms(multiTermsAggregation); } public sealed partial class MultiTermsAggregationDescriptor : SerializableDescriptor> @@ -295,45 +93,19 @@ public MultiTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } private IDictionary? MetaValue { get; set; } private long? MinDocCountValue { get; set; } - private ICollection>? OrderValue { get; set; } + private string? NameValue { 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; } private ICollection TermsValue { get; set; } - private MultiTermLookupDescriptor TermsDescriptor { get; set; } - private Action> TermsDescriptorAction { get; set; } - private Action>[] TermsDescriptorActions { get; set; } - - public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public MultiTermsAggregationDescriptor Aggregations(Action> configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + private Action>[] TermsDescriptorActions { get; set; } /// /// Specifies the strategy for data collection. @@ -359,10 +131,16 @@ public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public MultiTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public MultiTermsAggregationDescriptor Order(ICollection>? order) + public MultiTermsAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -416,7 +194,7 @@ public MultiTermsAggregationDescriptor Terms(ICollection Terms(MultiTermLookupDescriptor descriptor) + public MultiTermsAggregationDescriptor Terms(Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor descriptor) { TermsValue = null; TermsDescriptorAction = null; @@ -425,7 +203,7 @@ public MultiTermsAggregationDescriptor Terms(MultiTermLookupDescripto return Self; } - public MultiTermsAggregationDescriptor Terms(Action> configure) + public MultiTermsAggregationDescriptor Terms(Action> configure) { TermsValue = null; TermsDescriptor = null; @@ -434,7 +212,7 @@ public MultiTermsAggregationDescriptor Terms(Action Terms(params Action>[] configure) + public MultiTermsAggregationDescriptor Terms(params Action>[] configure) { TermsValue = null; TermsDescriptor = null; @@ -445,8 +223,6 @@ public MultiTermsAggregationDescriptor Terms(params Action>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ShardMinDocCountValue.HasValue) @@ -501,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("terms"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor(TermsDescriptorAction), options); writer.WriteEndArray(); } else if (TermsDescriptorActions is not null) @@ -510,7 +298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in TermsDescriptorActions) { - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor(action), options); } writer.WriteEndArray(); @@ -521,29 +309,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TermsValue, 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(); } } @@ -556,45 +321,19 @@ public MultiTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } private IDictionary? MetaValue { get; set; } private long? MinDocCountValue { get; set; } - private ICollection>? OrderValue { get; set; } + private string? NameValue { 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; } private ICollection TermsValue { get; set; } - private MultiTermLookupDescriptor TermsDescriptor { get; set; } - private Action TermsDescriptorAction { get; set; } - private Action[] TermsDescriptorActions { get; set; } - - public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MultiTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public MultiTermsAggregationDescriptor Aggregations(Action configure) - { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } + private Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + private Action[] TermsDescriptorActions { get; set; } /// /// Specifies the strategy for data collection. @@ -620,10 +359,16 @@ public MultiTermsAggregationDescriptor MinDocCount(long? minDocCount) return Self; } + public MultiTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public MultiTermsAggregationDescriptor Order(ICollection>? order) + public MultiTermsAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -677,7 +422,7 @@ public MultiTermsAggregationDescriptor Terms(ICollection configure) + public MultiTermsAggregationDescriptor Terms(Action configure) { TermsValue = null; TermsDescriptor = null; @@ -695,7 +440,7 @@ public MultiTermsAggregationDescriptor Terms(Action c return Self; } - public MultiTermsAggregationDescriptor Terms(params Action[] configure) + public MultiTermsAggregationDescriptor Terms(params Action[] configure) { TermsValue = null; TermsDescriptor = null; @@ -706,8 +451,6 @@ public MultiTermsAggregationDescriptor Terms(params Action>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ShardMinDocCountValue.HasValue) @@ -762,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("terms"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(TermsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor(TermsDescriptorAction), options); writer.WriteEndArray(); } else if (TermsDescriptorActions is not null) @@ -771,7 +526,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in TermsDescriptorActions) { - JsonSerializer.Serialize(writer, new MultiTermLookupDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupDescriptor(action), options); } writer.WriteEndArray(); @@ -782,29 +537,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TermsValue, 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/_Generated/Types/Aggregations/MultiTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs index 1061897d03a..55be961f991 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs @@ -27,77 +27,75 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class MultiTermsBucketConverter : JsonConverter { - public override MultiTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountErrorUpperBound = default; IReadOnlyCollection key = default; string? keyAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + 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 (property == "doc_count_error_upper_bound") + { + docCountErrorUpperBound = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize>(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize>(ref reader, options); + continue; + } - if (name.Equals("key_as_string", StringComparison.Ordinal)) - { - keyAsString = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new MultiTermsBucket(subAggs) { DocCount = docCount, DocCountErrorUpperBound = docCountErrorUpperBound, Key = key, KeyAsString = keyAsString }; + return new MultiTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountErrorUpperBound = docCountErrorUpperBound, Key = key, KeyAsString = keyAsString }; } - public override void Write(Utf8JsonWriter writer, MultiTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, MultiTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'MultiTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(MultiTermsBucketConverter))] +public sealed partial class MultiTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountErrorUpperBound { get; init; } + public IReadOnlyCollection Key { get; init; } + public string? KeyAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs index ca19ad4468b..153c7c8d2dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class NestedAggregateConverter : JsonConverter { - public override NestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new NestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new NestedAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, NestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, NestedAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NestedAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NestedAggregateConverter))] +public sealed partial class NestedAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs index 5198966b63c..9d32465bf04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs @@ -27,111 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class NestedAggregationConverter : JsonConverter +public sealed partial class NestedAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The path to the field of type `nested`. /// + [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Field? Path { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(NestedAggregation nestedAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Nested(nestedAggregation); } public sealed partial class NestedAggregationDescriptor : SerializableDescriptor> @@ -142,46 +51,35 @@ public NestedAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public NestedAggregationDescriptor Aggregations(Action> configure) + public NestedAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + NameValue = name; return Self; } - public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The path to the field of type `nested`. + /// + public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Field? path) { - MetaValue = selector?.Invoke(new FluentDictionary()); + PathValue = path; return Self; } /// /// The path to the field of type `nested`. /// - public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch.Field? path) + public NestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -190,7 +88,7 @@ public NestedAggregationDescriptor Path(Elastic.Clients.Elasticsearch /// /// The path to the field of type `nested`. /// - public NestedAggregationDescriptor Path(Expression> path) + public NestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -199,35 +97,22 @@ public NestedAggregationDescriptor Path(Expression(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (PathValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); } writer.WriteEndObject(); @@ -242,39 +127,19 @@ public NestedAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public NestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public NestedAggregationDescriptor Aggregations(Action configure) + public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public NestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + public NestedAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -308,35 +173,22 @@ public NestedAggregationDescriptor Path(Expression + /// Path to the buckets that contain one set of values to correlate. + ///
+ [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + /// + /// The specific method to apply. + /// + [JsonInclude, JsonPropertyName("method")] + public Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? Method { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(NormalizeAggregation normalizeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Normalize(normalizeAggregation); +} + +public sealed partial class NormalizeAggregationDescriptor : SerializableDescriptor +{ + internal NormalizeAggregationDescriptor(Action configure) => configure.Invoke(this); + + public NormalizeAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? MethodValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public NormalizeAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public NormalizeAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public NormalizeAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public NormalizeAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The specific method to apply. + /// + public NormalizeAggregationDescriptor Method(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? method) + { + MethodValue = method; + return Self; + } + + public NormalizeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (MethodValue is not null) + { + writer.WritePropertyName("method"); + JsonSerializer.Serialize(writer, MethodValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs index 7c6d8574468..97aec7ff4ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class ParentAggregateConverter : JsonConverter { - public override ParentAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ParentAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ParentAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ParentAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ParentAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ParentAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ParentAggregateConverter))] +public sealed partial class ParentAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs index 956e5ce01e1..5bec359e7a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ParentAggregationConverter : JsonConverter +public sealed partial class ParentAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The child type that should be selected. /// + [JsonInclude, JsonPropertyName("type")] 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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ParentAggregation parentAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Parent(parentAggregation); } public sealed partial class ParentAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ public ParentAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private string? TypeValue { get; set; } - public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ParentAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public ParentAggregationDescriptor Aggregations(Action configure) + public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ParentAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ParentAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public ParentAggregationDescriptor Type(string? type) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsDescriptor, options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsDescriptorAction is not null) - { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (!string.IsNullOrEmpty(TypeValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("type"); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs index 6f4fd2782fa..b25b58fbc19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs @@ -41,5 +41,7 @@ public PercentageScoreHeuristicDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs index f533836144c..4f8fb86ff99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs @@ -27,216 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class PercentileRanksAggregationConverter : JsonConverter +public sealed partial class PercentileRanksAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentile ranks. /// + [JsonInclude, JsonPropertyName("hdr")] public Elastic.Clients.Elasticsearch.Aggregations.HdrMethod? Hdr { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Sets parameters for the default TDigest algorithm used to calculate percentile ranks. /// + [JsonInclude, JsonPropertyName("tdigest")] public Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigest { get; set; } /// /// An array of values for which to calculate the percentile ranks. /// + [JsonInclude, JsonPropertyName("values")] public ICollection? Values { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(PercentileRanksAggregation percentileRanksAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.PercentileRanks(percentileRanksAggregation); } public sealed partial class PercentileRanksAggregationDescriptor : SerializableDescriptor> @@ -250,28 +77,42 @@ public PercentileRanksAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.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.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigestValue { get; set; } - private TDigestDescriptor TDigestDescriptor { get; set; } - private Action TDigestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } private ICollection? ValuesValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public PercentileRanksAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PercentileRanksAggregationDescriptor Format(string? format) { FormatValue = format; @@ -289,7 +130,7 @@ public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elast return Self; } - public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -297,7 +138,7 @@ public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor d return Self; } - public PercentileRanksAggregationDescriptor Hdr(Action configure) + public PercentileRanksAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -305,13 +146,10 @@ public PercentileRanksAggregationDescriptor Hdr(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentileRanksAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -334,7 +172,7 @@ public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.E return Self; } - public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -342,7 +180,7 @@ public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor return Self; } - public PercentileRanksAggregationDescriptor TDigest(Action configure) + public PercentileRanksAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -361,8 +199,6 @@ public PercentileRanksAggregationDescriptor Values(ICollection HdrDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigestValue { get; set; } - private TDigestDescriptor TDigestDescriptor { get; set; } - private Action TDigestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } private ICollection? ValuesValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentileRanksAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -493,7 +330,7 @@ public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Ag return Self; } - public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentileRanksAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -501,7 +338,7 @@ public PercentileRanksAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) return Self; } - public PercentileRanksAggregationDescriptor Hdr(Action configure) + public PercentileRanksAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -509,13 +346,10 @@ public PercentileRanksAggregationDescriptor Hdr(Action conf return Self; } - public PercentileRanksAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentileRanksAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentileRanksAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -538,7 +372,7 @@ public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearc return Self; } - public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentileRanksAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -546,7 +380,7 @@ public PercentileRanksAggregationDescriptor TDigest(TDigestDescriptor descriptor return Self; } - public PercentileRanksAggregationDescriptor TDigest(Action configure) + public PercentileRanksAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -565,8 +399,6 @@ public PercentileRanksAggregationDescriptor Values(ICollection? values) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentile_ranks"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -588,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HdrDescriptorAction is not null) { writer.WritePropertyName("hdr"); - JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor(HdrDescriptorAction), options); } else if (HdrValue is not null) { @@ -616,7 +448,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TDigestDescriptorAction is not null) { writer.WritePropertyName("tdigest"); - JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor(TDigestDescriptorAction), options); } else if (TDigestValue is not null) { @@ -630,13 +462,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/Percentiles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Percentiles.g.cs index b553bf1da4d..f74611a4c27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Percentiles.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Percentiles.g.cs @@ -30,13 +30,13 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -public sealed partial class Percentiles : Union, IReadOnlyCollection> +public sealed partial class Percentiles : Union, IReadOnlyCollection> { - public Percentiles(IReadOnlyDictionary dictionary) : base(dictionary) + public Percentiles(IReadOnlyDictionary Keyed) : base(Keyed) { } - public Percentiles(IReadOnlyCollection collection) : base(collection) + public Percentiles(IReadOnlyCollection Array) : base(Array) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs index 2263f4ee994..555cfada1d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs @@ -27,216 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class PercentilesAggregationConverter : JsonConverter +public sealed partial class PercentilesAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Uses the alternative High Dynamic Range Histogram algorithm to calculate percentiles. /// + [JsonInclude, JsonPropertyName("hdr")] public Elastic.Clients.Elasticsearch.Aggregations.HdrMethod? Hdr { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } /// /// The percentiles to calculate. /// + [JsonInclude, JsonPropertyName("percents")] public ICollection? Percents { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Sets parameters for the default TDigest algorithm used to calculate percentiles. /// + [JsonInclude, JsonPropertyName("tdigest")] public Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigest { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(PercentilesAggregation percentilesAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Percentiles(percentilesAggregation); } public sealed partial class PercentilesAggregationDescriptor : SerializableDescriptor> @@ -250,28 +77,42 @@ public PercentilesAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.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.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private ICollection? PercentsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigestValue { get; set; } - private TDigestDescriptor TDigestDescriptor { get; set; } - private Action TDigestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public PercentilesAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PercentilesAggregationDescriptor Format(string? format) { FormatValue = format; @@ -289,7 +130,7 @@ public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticse return Self; } - public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -297,7 +138,7 @@ public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descr return Self; } - public PercentilesAggregationDescriptor Hdr(Action configure) + public PercentilesAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -305,13 +146,10 @@ public PercentilesAggregationDescriptor Hdr(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentilesAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentilesAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -343,7 +181,7 @@ public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elast return Self; } - public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -351,7 +189,7 @@ public PercentilesAggregationDescriptor TDigest(TDigestDescriptor des return Self; } - public PercentilesAggregationDescriptor TDigest(Action configure) + public PercentilesAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -361,8 +199,6 @@ public PercentilesAggregationDescriptor TDigest(Action HdrDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor HdrDescriptor { get; set; } + private Action HdrDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private ICollection? PercentsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TDigest? TDigestValue { get; set; } - private TDigestDescriptor TDigestDescriptor { get; set; } - private Action TDigestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor TDigestDescriptor { get; set; } + private Action TDigestDescriptorAction { get; set; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public PercentilesAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -493,7 +330,7 @@ public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Aggreg return Self; } - public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) + public PercentilesAggregationDescriptor Hdr(Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor descriptor) { HdrValue = null; HdrDescriptorAction = null; @@ -501,7 +338,7 @@ public PercentilesAggregationDescriptor Hdr(HdrMethodDescriptor descriptor) return Self; } - public PercentilesAggregationDescriptor Hdr(Action configure) + public PercentilesAggregationDescriptor Hdr(Action configure) { HdrValue = null; HdrDescriptor = null; @@ -509,13 +346,10 @@ public PercentilesAggregationDescriptor Hdr(Action configur return Self; } - public PercentilesAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public PercentilesAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public PercentilesAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -547,7 +381,7 @@ public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Ag return Self; } - public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) + public PercentilesAggregationDescriptor TDigest(Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor descriptor) { TDigestValue = null; TDigestDescriptorAction = null; @@ -555,7 +389,7 @@ public PercentilesAggregationDescriptor TDigest(TDigestDescriptor descriptor) return Self; } - public PercentilesAggregationDescriptor TDigest(Action configure) + public PercentilesAggregationDescriptor TDigest(Action configure) { TDigestValue = null; TDigestDescriptor = null; @@ -565,8 +399,6 @@ public PercentilesAggregationDescriptor TDigest(Action config protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentiles"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -588,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HdrDescriptorAction is not null) { writer.WritePropertyName("hdr"); - JsonSerializer.Serialize(writer, new HdrMethodDescriptor(HdrDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.HdrMethodDescriptor(HdrDescriptorAction), options); } else if (HdrValue is not null) { @@ -622,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TDigestDescriptorAction is not null) { writer.WritePropertyName("tdigest"); - JsonSerializer.Serialize(writer, new TDigestDescriptor(TDigestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TDigestDescriptor(TDigestDescriptorAction), options); } else if (TDigestValue is not null) { @@ -630,13 +462,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs index bba3fb59809..538d1762054 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs @@ -27,150 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class PercentilesBucketAggregationConverter : JsonConverter +public sealed partial class PercentilesBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The list of percentiles to calculate. /// + [JsonInclude, JsonPropertyName("percents")] public ICollection? Percents { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(PercentilesBucketAggregation percentilesBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.PercentilesBucket(percentilesBucketAggregation); } public sealed partial class PercentilesBucketAggregationDescriptor : SerializableDescriptor @@ -185,20 +72,30 @@ public PercentilesBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private ICollection? PercentsValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public PercentilesBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public PercentilesBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public PercentilesBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -211,6 +108,12 @@ public PercentilesBucketAggregationDescriptor Meta(Func /// The list of percentiles to calculate. ///
@@ -222,8 +125,6 @@ public PercentilesBucketAggregationDescriptor Percents(ICollection? perc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("percentiles_bucket"); writer.WriteStartObject(); if (BucketsPathValue is not null) { @@ -243,19 +144,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (PercentsValue is not null) + { + writer.WritePropertyName("percents"); + JsonSerializer.Serialize(writer, PercentsValue, options); + } + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs index e34f3fc5bc4..1c5541c9c31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs @@ -27,195 +27,35 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class RangeAggregationConverter : JsonConverter +public sealed partial class RangeAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// The date field whose values are use to build ranges. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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.
///
+ [JsonInclude, JsonPropertyName("missing")] public int? Missing { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// An array of ranges used to bucket documents. /// + [JsonInclude, JsonPropertyName("ranges")] public ICollection? Ranges { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(RangeAggregation rangeAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Range(rangeAggregation); } public sealed partial class RangeAggregationDescriptor : SerializableDescriptor> @@ -226,47 +66,30 @@ public RangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } private int? MissingValue { get; set; } + private string? NameValue { 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.Aggregations.AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public RangeAggregationDescriptor Aggregations(Action> configure) + /// + /// The date field whose values are use to build ranges. + /// + public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + FieldValue = field; return Self; } /// /// The date field whose values are use to build ranges. /// - public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + public RangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -275,7 +98,7 @@ public RangeAggregationDescriptor Field(Elastic.Clients.Elasticsearch /// /// The date field whose values are use to build ranges. /// - public RangeAggregationDescriptor Field(Expression> field) + public RangeAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; @@ -302,6 +125,12 @@ public RangeAggregationDescriptor Missing(int? missing) return Self; } + public RangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// An array of ranges used to bucket documents. /// @@ -314,7 +143,7 @@ public RangeAggregationDescriptor Ranges(ICollection Ranges(AggregationRangeDescriptor descriptor) + public RangeAggregationDescriptor Ranges(Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor descriptor) { RangesValue = null; RangesDescriptorAction = null; @@ -323,7 +152,7 @@ public RangeAggregationDescriptor Ranges(AggregationRangeDescriptor d return Self; } - public RangeAggregationDescriptor Ranges(Action configure) + public RangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -332,7 +161,7 @@ public RangeAggregationDescriptor Ranges(Action Ranges(params Action[] configure) + public RangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -349,8 +178,6 @@ public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -364,12 +191,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue.HasValue) { writer.WritePropertyName("missing"); writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -381,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -390,7 +229,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -407,29 +246,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -442,43 +258,17 @@ public RangeAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } private int? MissingValue { get; set; } + private string? NameValue { 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.Aggregations.AggregationRangeDescriptor RangesDescriptor { get; set; } + private Action RangesDescriptorAction { get; set; } + private Action[] RangesDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public RangeAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -527,6 +317,12 @@ public RangeAggregationDescriptor Missing(int? missing) return Self; } + public RangeAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// An array of ranges used to bucket documents. /// @@ -539,7 +335,7 @@ public RangeAggregationDescriptor Ranges(ICollection configure) + public RangeAggregationDescriptor Ranges(Action configure) { RangesValue = null; RangesDescriptor = null; @@ -557,7 +353,7 @@ public RangeAggregationDescriptor Ranges(Action conf return Self; } - public RangeAggregationDescriptor Ranges(params Action[] configure) + public RangeAggregationDescriptor Ranges(params Action[] configure) { RangesValue = null; RangesDescriptor = null; @@ -574,8 +370,6 @@ public RangeAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? s protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("range"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -589,12 +383,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue.HasValue) { writer.WritePropertyName("missing"); writer.WriteNumberValue(MissingValue.Value); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -606,7 +412,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ranges"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(RangesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(RangesDescriptorAction), options); writer.WriteEndArray(); } else if (RangesDescriptorActions is not null) @@ -615,7 +421,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RangesDescriptorActions) { - JsonSerializer.Serialize(writer, new AggregationRangeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeDescriptor(action), options); } writer.WriteEndArray(); @@ -632,29 +438,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/RangeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs index f44ad4a097d..1aa80c3ce06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs @@ -27,99 +27,95 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -[JsonConverter(typeof(RangeBucketConverter))] -public sealed partial class RangeBucket : AggregateDictionary +internal sealed partial class RangeBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double? from = default; string? fromAsString = default; string? key = default; double? to = default; string? toAsString = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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("#")) + if (reader.TokenType == JsonTokenType.PropertyName) { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from") + { + from = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "from_as_string") + { + fromAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to") + { + to = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "to_as_string") + { + toAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); } - - throw new JsonException("Unknown property read from JSON."); } - return new RangeBucket(subAggs) { DocCount = docCount, From = from, FromAsString = fromAsString, Key = key, To = to, ToAsString = toAsString }; + return new RangeBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), 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(); + public override void Write(Utf8JsonWriter writer, RangeBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'RangeBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(RangeBucketConverter))] +public sealed partial class RangeBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double? From { get; init; } + public string? FromAsString { get; init; } + + /// + /// The bucket key. Present if the aggregation is _not_ keyed + /// + public string? Key { get; init; } + public double? To { get; init; } + public string? ToAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs index 6272fa83a4d..a45580dbe10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs @@ -27,245 +27,51 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class RareTermsAggregationConverter : JsonConverter +public sealed partial class RareTermsAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Terms that should be excluded from the aggregation. /// + [JsonInclude, JsonPropertyName("exclude")] public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; } /// /// The field from which to return rare terms. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Terms that should be included in the aggregation. /// + [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? Include { get; set; } /// /// The maximum number of documents a term should appear in. /// + [JsonInclude, JsonPropertyName("max_doc_count")] public long? MaxDocCount { get; set; } + [JsonInclude, JsonPropertyName("meta")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
+ [JsonInclude, JsonPropertyName("precision")] public double? Precision { get; set; } + [JsonInclude, JsonPropertyName("value_type")] public string? ValueType { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(RareTermsAggregation rareTermsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.RareTerms(rareTermsAggregation); } public sealed partial class RareTermsAggregationDescriptor : SerializableDescriptor> @@ -276,42 +82,16 @@ public RareTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private long? MaxDocCountValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private double? PrecisionValue { get; set; } private string? ValueTypeValue { get; set; } - public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -339,6 +119,15 @@ public RareTermsAggregationDescriptor Field(Expression + /// 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. /// @@ -366,12 +155,18 @@ public RareTermsAggregationDescriptor Meta(Func /// 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) + public RareTermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public RareTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
@@ -389,8 +184,6 @@ public RareTermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rare_terms"); writer.WriteStartObject(); if (ExcludeValue is not null) { @@ -416,12 +209,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MaxDocCountValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -434,29 +239,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -469,42 +251,16 @@ public RareTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private long? MaxDocCountValue { get; set; } private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } + private string? NameValue { get; set; } private double? PrecisionValue { get; set; } private string? ValueTypeValue { get; set; } - public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public RareTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -568,12 +324,18 @@ public RareTermsAggregationDescriptor Meta(Func /// /// 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) + public RareTermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; } + public RareTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The precision of the internal CuckooFilters.
Smaller precision leads to better approximation, but higher memory usage.
///
@@ -591,8 +353,6 @@ public RareTermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rare_terms"); writer.WriteStartObject(); if (ExcludeValue is not null) { @@ -618,12 +378,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MaxDocCountValue.Value); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MissingValue is not null) { writer.WritePropertyName("missing"); JsonSerializer.Serialize(writer, MissingValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PrecisionValue.HasValue) { writer.WritePropertyName("precision"); @@ -636,29 +408,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/RateAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs index c3cc6615fae..7e34e1ec0b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs @@ -27,193 +27,37 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class RateAggregationConverter : JsonConverter +public sealed partial class RateAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } /// /// How the rate is calculated. /// + [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.Aggregations.RateMode? Mode { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// The interval used to calculate the rate.
By default, the interval of the `date_histogram` is used.
///
+ [JsonInclude, JsonPropertyName("unit")] public Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? Unit { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(RateAggregation rateAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Rate(rateAggregation); } public sealed partial class RateAggregationDescriptor : SerializableDescriptor> @@ -226,37 +70,48 @@ public RateAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.RateMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? UnitValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public RateAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public RateAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) + public RateAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public RateAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RateAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -288,8 +143,6 @@ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.A protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rate"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -327,13 +180,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UnitValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -348,24 +194,32 @@ public RateAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.RateMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? UnitValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public RateAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -378,13 +232,10 @@ public RateAggregationDescriptor Format(string? format) return Self; } - public RateAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public RateAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public RateAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -416,8 +267,6 @@ public RateAggregationDescriptor Unit(Elastic.Clients.Elasticsearch.Aggregations protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("rate"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -455,13 +304,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs index 7429bc49036..3c156d208ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs @@ -27,59 +27,59 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class ReverseNestedAggregateConverter : JsonConverter { - public override ReverseNestedAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new ReverseNestedAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new ReverseNestedAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, ReverseNestedAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, ReverseNestedAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ReverseNestedAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ReverseNestedAggregateConverter))] +public sealed partial class ReverseNestedAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs index 54798e98042..ec998a092cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs @@ -27,111 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ReverseNestedAggregationConverter : JsonConverter +public sealed partial class ReverseNestedAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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.
///
+ [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Field? Path { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ReverseNestedAggregation reverseNestedAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.ReverseNested(reverseNestedAggregation); } public sealed partial class ReverseNestedAggregationDescriptor : SerializableDescriptor> @@ -142,46 +51,35 @@ public ReverseNestedAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ReverseNestedAggregationDescriptor Aggregations(Action> configure) + public ReverseNestedAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + NameValue = name; return Self; } - public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// 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.Field? path) { - MetaValue = selector?.Invoke(new FluentDictionary()); + 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(Elastic.Clients.Elasticsearch.Field? path) + public ReverseNestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -190,7 +88,7 @@ public ReverseNestedAggregationDescriptor Path(Elastic.Clients.Elasti /// /// 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) + public ReverseNestedAggregationDescriptor Path(Expression> path) { PathValue = path; return Self; @@ -199,35 +97,22 @@ public ReverseNestedAggregationDescriptor Path(Expression(AggregationsDescriptorAction), options); - } - else if (AggregationsValue is not null) + + if (PathValue is not null) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("path"); + JsonSerializer.Serialize(writer, PathValue, options); } writer.WriteEndObject(); @@ -242,39 +127,19 @@ public ReverseNestedAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public ReverseNestedAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) - { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; - return Self; - } - - public ReverseNestedAggregationDescriptor Aggregations(Action configure) + public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ReverseNestedAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ReverseNestedAggregationDescriptor Name(string? name) { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -308,35 +173,22 @@ public ReverseNestedAggregationDescriptor Path(Expression 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 +internal sealed partial class SamplerAggregateConverter : JsonConverter { - public override SamplerAggregate? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; IReadOnlyDictionary? meta = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("meta", StringComparison.Ordinal)) - { - meta = JsonSerializer.Deserialize?>(ref reader, options); - continue; - } + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new SamplerAggregate(subAggs) { DocCount = docCount, Meta = meta }; + return new SamplerAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; } - public override void Write(Utf8JsonWriter writer, SamplerAggregate value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, SamplerAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SamplerAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SamplerAggregateConverter))] +public sealed partial class SamplerAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs index 6499106c8b9..43cad861938 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs @@ -27,202 +27,20 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class SamplerAggregationConverter : JsonConverter +public sealed partial class SamplerAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Limits how many top-scoring documents are collected in the sample processed on each shard. /// + [JsonInclude, JsonPropertyName("shard_size")] 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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SamplerAggregation samplerAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Sampler(samplerAggregation); } public sealed partial class SamplerAggregationDescriptor : SerializableDescriptor @@ -233,39 +51,19 @@ public SamplerAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private int? ShardSizeValue { get; set; } - public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SamplerAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor descriptor) + public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) { - AggregationsValue = null; - AggregationsDescriptorAction = null; - AggregationsDescriptor = descriptor; + MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public SamplerAggregationDescriptor Aggregations(Action configure) + public SamplerAggregationDescriptor Name(string? name) { - AggregationsValue = null; - AggregationsDescriptor = null; - AggregationsDescriptorAction = configure; - return Self; - } - - public SamplerAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); + NameValue = name; return Self; } @@ -281,35 +79,22 @@ public SamplerAggregationDescriptor ShardSize(int? shardSize) 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) + if (!string.IsNullOrEmpty(NameValue)) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, new AggregationDescriptor(AggregationsDescriptorAction), options); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); } - else if (AggregationsValue is not null) + + if (ShardSizeValue.HasValue) { - writer.WritePropertyName("aggregations"); - JsonSerializer.Serialize(writer, AggregationsValue, options); + writer.WritePropertyName("shard_size"); + writer.WriteNumberValue(ShardSizeValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs index ce7fb5b0c3d..84063ce1a14 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs @@ -27,242 +27,53 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ScriptedMetricAggregationConverter : JsonConverter +public sealed partial class ScriptedMetricAggregation { - 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.
///
+ [JsonInclude, JsonPropertyName("combine_script")] public Elastic.Clients.Elasticsearch.Script? CombineScript { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Runs prior to any collection of documents.
Allows the aggregation to set up any initial state.
///
+ [JsonInclude, JsonPropertyName("init_script")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("map_script")] public Elastic.Clients.Elasticsearch.Script? MapScript { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } /// /// A global object with script parameters for `init`, `map` and `combine` scripts.
It is shared between the scripts.
///
+ [JsonInclude, JsonPropertyName("params")] 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.
///
+ [JsonInclude, JsonPropertyName("reduce_script")] public Elastic.Clients.Elasticsearch.Script? ReduceScript { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ScriptedMetricAggregation scriptedMetricAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.ScriptedMetric(scriptedMetricAggregation); } public sealed partial class ScriptedMetricAggregationDescriptor : SerializableDescriptor> @@ -277,8 +88,7 @@ public ScriptedMetricAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Script? InitScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Script? MapScriptValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ReduceScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -292,18 +102,33 @@ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clie return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + 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.
///
@@ -322,13 +147,10 @@ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients. return Self; } - public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ScriptedMetricAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -360,8 +182,6 @@ public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Ela protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("scripted_metric"); writer.WriteStartObject(); if (CombineScriptValue is not null) { @@ -411,13 +231,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -434,8 +247,7 @@ public ScriptedMetricAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Script? InitScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Script? MapScriptValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private IDictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ReduceScriptValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -449,18 +261,27 @@ public ScriptedMetricAggregationDescriptor CombineScript(Elastic.Clients.Elastic return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ScriptedMetricAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -485,13 +306,10 @@ public ScriptedMetricAggregationDescriptor MapScript(Elastic.Clients.Elasticsear return Self; } - public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ScriptedMetricAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ScriptedMetricAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -523,8 +341,6 @@ public ScriptedMetricAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("scripted_metric"); writer.WriteStartObject(); if (CombineScriptValue is not null) { @@ -574,13 +390,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs new file mode 100644 index 00000000000..39ba9c3a5a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class SerialDifferencingAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + + /// + /// The historical bucket to subtract from the current value.
Must be a positive, non-zero integer.
+ ///
+ [JsonInclude, JsonPropertyName("lag")] + public int? Lag { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SerialDifferencingAggregation serialDifferencingAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.SerialDiff(serialDifferencingAggregation); +} + +public sealed partial class SerialDifferencingAggregationDescriptor : SerializableDescriptor +{ + internal SerialDifferencingAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SerialDifferencingAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private int? LagValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public SerialDifferencingAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public SerialDifferencingAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public SerialDifferencingAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + /// + /// The historical bucket to subtract from the current value.
Must be a positive, non-zero integer.
+ ///
+ public SerialDifferencingAggregationDescriptor Lag(int? lag) + { + LagValue = lag; + return Self; + } + + public SerialDifferencingAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SerialDifferencingAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (LagValue.HasValue) + { + writer.WritePropertyName("lag"); + writer.WriteNumberValue(LagValue.Value); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs new file mode 100644 index 00000000000..04c561fc339 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class SignificantLongTermsAggregate : 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/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs new file mode 100644 index 00000000000..f8e0a042f6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +internal sealed partial class SignificantLongTermsBucketConverter : JsonConverter +{ + public override SignificantLongTermsBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long bgCount = default; + long docCount = default; + long key = default; + string? keyAsString = default; + double score = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "bg_count") + { + bgCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "score") + { + score = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new SignificantLongTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), BgCount = bgCount, DocCount = docCount, Key = key, KeyAsString = keyAsString, Score = score }; + } + + public override void Write(Utf8JsonWriter writer, SignificantLongTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SignificantLongTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SignificantLongTermsBucketConverter))] +public sealed partial class SignificantLongTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long BgCount { get; init; } + public long DocCount { get; init; } + public long Key { get; init; } + public string? KeyAsString { get; init; } + public double Score { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs index d24755a7daf..ef3e9ce86de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs @@ -27,77 +27,75 @@ namespace Elastic.Clients.Elasticsearch.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 +internal sealed partial class SignificantStringTermsBucketConverter : JsonConverter { - public override SignificantStringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long bgCount = default; long docCount = default; string key = default; double score = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - bgCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "bg_count") + { + bgCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count", StringComparison.Ordinal)) - { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("score", StringComparison.Ordinal)) - { - score = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "score") + { + score = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new SignificantStringTermsBucket(subAggs) { BgCount = bgCount, DocCount = docCount, Key = key, Score = score }; + return new SignificantStringTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), BgCount = bgCount, DocCount = docCount, Key = key, Score = score }; } - public override void Write(Utf8JsonWriter writer, SignificantStringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, SignificantStringTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SignificantStringTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(SignificantStringTermsBucketConverter))] +public sealed partial class SignificantStringTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long BgCount { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } + public double Score { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs index 78ad90def2b..5ee3a458e8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs @@ -27,433 +27,103 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class SignificantTermsAggregationConverter : JsonConverter +public sealed partial class SignificantTermsAggregation { - 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.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. /// + [JsonInclude, JsonPropertyName("background_filter")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilter { get; set; } /// /// Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score. /// + [JsonInclude, JsonPropertyName("chi_square")] public Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquare { get; set; } /// /// Terms to exclude. /// + [JsonInclude, JsonPropertyName("exclude")] public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; } /// /// Mechanism by which the aggregation should be executed: using field values directly or using global ordinals. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field from which to return significant terms. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. /// + [JsonInclude, JsonPropertyName("gnd")] public Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? Gnd { get; set; } /// /// Terms to include. /// + [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? Include { get; set; } /// /// Use JLH score as the significance score. /// + [JsonInclude, JsonPropertyName("jlh")] public Elastic.Clients.Elasticsearch.EmptyObject? Jlh { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Only return terms that are found in more than `min_doc_count` hits. /// + [JsonInclude, JsonPropertyName("min_doc_count")] public long? MinDocCount { get; set; } /// /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. /// + [JsonInclude, JsonPropertyName("mutual_information")] public Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformation { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. /// + [JsonInclude, JsonPropertyName("percentage")] public Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? Percentage { get; set; } /// /// Customized score, implemented via a script. /// + [JsonInclude, JsonPropertyName("script_heuristic")] public Elastic.Clients.Elasticsearch.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`.
///
+ [JsonInclude, JsonPropertyName("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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } /// /// The number of buckets returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SignificantTermsAggregation significantTermsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.SignificantTerms(significantTermsAggregation); } public sealed partial class SignificantTermsAggregationDescriptor : SerializableDescriptor> @@ -464,64 +134,38 @@ public SignificantTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilterValue { get; set; } - private QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } - private Action> BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action> BackgroundFilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } - private ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } - private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } - private GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } - private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private Elastic.Clients.Elasticsearch.EmptyObject? JlhValue { get; set; } - private EmptyObjectDescriptor JlhDescriptor { get; set; } - private Action JlhDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private long? MinDocCountValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } - private MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } - private Action MutualInformationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } - private PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } - private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } - private ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } - private Action ScriptHeuristicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -533,7 +177,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { BackgroundFilterValue = null; BackgroundFilterDescriptorAction = null; @@ -541,7 +185,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDs return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(Action> configure) + public SignificantTermsAggregationDescriptor BackgroundFilter(Action> configure) { BackgroundFilterValue = null; BackgroundFilterDescriptor = null; @@ -560,7 +204,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Client return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor descriptor) { ChiSquareValue = null; ChiSquareDescriptorAction = null; @@ -568,7 +212,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuri return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) { ChiSquareValue = null; ChiSquareDescriptor = null; @@ -612,6 +256,15 @@ public SignificantTermsAggregationDescriptor Field(Expression 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. /// @@ -623,7 +276,7 @@ public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elas return Self; } - public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) { GndValue = null; GndDescriptorAction = null; @@ -631,7 +284,7 @@ public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDist return Self; } - public SignificantTermsAggregationDescriptor Gnd(Action configure) + public SignificantTermsAggregationDescriptor Gnd(Action configure) { GndValue = null; GndDescriptor = null; @@ -659,7 +312,7 @@ public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elas return Self; } - public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor) { JlhValue = null; JlhDescriptorAction = null; @@ -667,7 +320,7 @@ public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescripto return Self; } - public SignificantTermsAggregationDescriptor Jlh(Action configure) + public SignificantTermsAggregationDescriptor Jlh(Action configure) { JlhValue = null; JlhDescriptor = null; @@ -701,7 +354,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Elasti return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor descriptor) { MutualInformationValue = null; MutualInformationDescriptorAction = null; @@ -709,7 +362,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Mutual return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) { MutualInformationValue = null; MutualInformationDescriptor = null; @@ -717,6 +370,12 @@ public SignificantTermsAggregationDescriptor MutualInformation(Action return Self; } + public SignificantTermsAggregationDescriptor Name(string? name) + { + NameValue = name; + 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. /// @@ -728,7 +387,7 @@ public SignificantTermsAggregationDescriptor Percentage(Elastic.Clien return Self; } - public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor descriptor) { PercentageValue = null; PercentageDescriptorAction = null; @@ -736,7 +395,7 @@ public SignificantTermsAggregationDescriptor Percentage(PercentageSco return Self; } - public SignificantTermsAggregationDescriptor Percentage(Action configure) + public SignificantTermsAggregationDescriptor Percentage(Action configure) { PercentageValue = null; PercentageDescriptor = null; @@ -755,7 +414,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic. return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor descriptor) { ScriptHeuristicValue = null; ScriptHeuristicDescriptorAction = null; @@ -763,7 +422,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Scripted return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) { ScriptHeuristicValue = null; ScriptHeuristicDescriptor = null; @@ -800,8 +459,6 @@ public SignificantTermsAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("significant_terms"); writer.WriteStartObject(); if (BackgroundFilterDescriptor is not null) { @@ -811,7 +468,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BackgroundFilterDescriptorAction is not null) { writer.WritePropertyName("background_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); } else if (BackgroundFilterValue is not null) { @@ -827,7 +484,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ChiSquareDescriptorAction is not null) { writer.WritePropertyName("chi_square"); - JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); } else if (ChiSquareValue is not null) { @@ -861,7 +518,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GndDescriptorAction is not null) { writer.WritePropertyName("gnd"); - JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); } else if (GndValue is not null) { @@ -883,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (JlhDescriptorAction is not null) { writer.WritePropertyName("jlh"); - JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(JlhDescriptorAction), options); } else if (JlhValue is not null) { @@ -891,6 +548,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, JlhValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -905,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MutualInformationDescriptorAction is not null) { writer.WritePropertyName("mutual_information"); - JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); } else if (MutualInformationValue is not null) { @@ -913,6 +576,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MutualInformationValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PercentageDescriptor is not null) { writer.WritePropertyName("percentage"); @@ -921,7 +590,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PercentageDescriptorAction is not null) { writer.WritePropertyName("percentage"); - JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); } else if (PercentageValue is not null) { @@ -937,7 +606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptHeuristicDescriptorAction is not null) { writer.WritePropertyName("script_heuristic"); - JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); } else if (ScriptHeuristicValue is not null) { @@ -963,29 +632,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -998,64 +644,38 @@ public SignificantTermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilterValue { get; set; } - private QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } - private Action BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action BackgroundFilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } - private ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } - private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } - private GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } - private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private Elastic.Clients.Elasticsearch.EmptyObject? JlhValue { get; set; } - private EmptyObjectDescriptor JlhDescriptor { get; set; } - private Action JlhDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private long? MinDocCountValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } - private MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } - private Action MutualInformationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } - private PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } - private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } - private ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } - private Action ScriptHeuristicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.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.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public SignificantTermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -1067,7 +687,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.El return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDescriptor descriptor) + public SignificantTermsAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { BackgroundFilterValue = null; BackgroundFilterDescriptorAction = null; @@ -1075,7 +695,7 @@ public SignificantTermsAggregationDescriptor BackgroundFilter(QueryDsl.QueryDesc return Self; } - public SignificantTermsAggregationDescriptor BackgroundFilter(Action configure) + public SignificantTermsAggregationDescriptor BackgroundFilter(Action configure) { BackgroundFilterValue = null; BackgroundFilterDescriptor = null; @@ -1094,7 +714,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticse return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor descriptor) { ChiSquareValue = null; ChiSquareDescriptorAction = null; @@ -1102,7 +722,7 @@ public SignificantTermsAggregationDescriptor ChiSquare(ChiSquareHeuristicDescrip return Self; } - public SignificantTermsAggregationDescriptor ChiSquare(Action configure) + public SignificantTermsAggregationDescriptor ChiSquare(Action configure) { ChiSquareValue = null; ChiSquareDescriptor = null; @@ -1166,7 +786,7 @@ public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.A return Self; } - public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) { GndValue = null; GndDescriptorAction = null; @@ -1174,7 +794,7 @@ public SignificantTermsAggregationDescriptor Gnd(GoogleNormalizedDistanceHeurist return Self; } - public SignificantTermsAggregationDescriptor Gnd(Action configure) + public SignificantTermsAggregationDescriptor Gnd(Action configure) { GndValue = null; GndDescriptor = null; @@ -1202,7 +822,7 @@ public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.E return Self; } - public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descriptor) + public SignificantTermsAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor) { JlhValue = null; JlhDescriptorAction = null; @@ -1210,7 +830,7 @@ public SignificantTermsAggregationDescriptor Jlh(EmptyObjectDescriptor descripto return Self; } - public SignificantTermsAggregationDescriptor Jlh(Action configure) + public SignificantTermsAggregationDescriptor Jlh(Action configure) { JlhValue = null; JlhDescriptor = null; @@ -1244,7 +864,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.E return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(MutualInformationHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor descriptor) { MutualInformationValue = null; MutualInformationDescriptorAction = null; @@ -1252,7 +872,7 @@ public SignificantTermsAggregationDescriptor MutualInformation(MutualInformation return Self; } - public SignificantTermsAggregationDescriptor MutualInformation(Action configure) + public SignificantTermsAggregationDescriptor MutualInformation(Action configure) { MutualInformationValue = null; MutualInformationDescriptor = null; @@ -1260,6 +880,12 @@ public SignificantTermsAggregationDescriptor MutualInformation(Action /// 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. /// @@ -1271,7 +897,7 @@ public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elastics return Self; } - public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor descriptor) { PercentageValue = null; PercentageDescriptorAction = null; @@ -1279,7 +905,7 @@ public SignificantTermsAggregationDescriptor Percentage(PercentageScoreHeuristic return Self; } - public SignificantTermsAggregationDescriptor Percentage(Action configure) + public SignificantTermsAggregationDescriptor Percentage(Action configure) { PercentageValue = null; PercentageDescriptor = null; @@ -1298,7 +924,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Ela return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDescriptor descriptor) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor descriptor) { ScriptHeuristicValue = null; ScriptHeuristicDescriptorAction = null; @@ -1306,7 +932,7 @@ public SignificantTermsAggregationDescriptor ScriptHeuristic(ScriptedHeuristicDe return Self; } - public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) + public SignificantTermsAggregationDescriptor ScriptHeuristic(Action configure) { ScriptHeuristicValue = null; ScriptHeuristicDescriptor = null; @@ -1343,8 +969,6 @@ public SignificantTermsAggregationDescriptor Size(int? size) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("significant_terms"); writer.WriteStartObject(); if (BackgroundFilterDescriptor is not null) { @@ -1354,7 +978,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BackgroundFilterDescriptorAction is not null) { writer.WritePropertyName("background_filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(BackgroundFilterDescriptorAction), options); } else if (BackgroundFilterValue is not null) { @@ -1370,7 +994,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ChiSquareDescriptorAction is not null) { writer.WritePropertyName("chi_square"); - JsonSerializer.Serialize(writer, new ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor(ChiSquareDescriptorAction), options); } else if (ChiSquareValue is not null) { @@ -1404,7 +1028,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (GndDescriptorAction is not null) { writer.WritePropertyName("gnd"); - JsonSerializer.Serialize(writer, new GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor(GndDescriptorAction), options); } else if (GndValue is not null) { @@ -1426,7 +1050,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (JlhDescriptorAction is not null) { writer.WritePropertyName("jlh"); - JsonSerializer.Serialize(writer, new EmptyObjectDescriptor(JlhDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(JlhDescriptorAction), options); } else if (JlhValue is not null) { @@ -1434,6 +1058,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, JlhValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -1448,7 +1078,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MutualInformationDescriptorAction is not null) { writer.WritePropertyName("mutual_information"); - JsonSerializer.Serialize(writer, new MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); } else if (MutualInformationValue is not null) { @@ -1456,6 +1086,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MutualInformationValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (PercentageDescriptor is not null) { writer.WritePropertyName("percentage"); @@ -1464,7 +1100,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PercentageDescriptorAction is not null) { writer.WritePropertyName("percentage"); - JsonSerializer.Serialize(writer, new PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor(PercentageDescriptorAction), options); } else if (PercentageValue is not null) { @@ -1480,7 +1116,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ScriptHeuristicDescriptorAction is not null) { writer.WritePropertyName("script_heuristic"); - JsonSerializer.Serialize(writer, new ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor(ScriptHeuristicDescriptorAction), options); } else if (ScriptHeuristicValue is not null) { @@ -1506,29 +1142,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs new file mode 100644 index 00000000000..99c32dc8ccd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs @@ -0,0 +1,1223 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class SignificantTextAggregation +{ + /// + /// A background filter that can be used to focus in on significant terms within a narrower context, instead of the entire index. + /// + [JsonInclude, JsonPropertyName("background_filter")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilter { get; set; } + + /// + /// Use Chi square, as described in "Information Retrieval", Manning et al., Chapter 13.5.2, as the significance score. + /// + [JsonInclude, JsonPropertyName("chi_square")] + public Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquare { get; set; } + + /// + /// Values to exclude. + /// + [JsonInclude, JsonPropertyName("exclude")] + public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + [JsonInclude, JsonPropertyName("execution_hint")] + public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } + + /// + /// The field from which to return significant text. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + [JsonInclude, JsonPropertyName("filter_duplicate_text")] + public bool? FilterDuplicateText { get; set; } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + [JsonInclude, JsonPropertyName("gnd")] + public Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? Gnd { get; set; } + + /// + /// Values to include. + /// + [JsonInclude, JsonPropertyName("include")] + public Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? Include { get; set; } + + /// + /// Use JLH score as the significance score. + /// + [JsonInclude, JsonPropertyName("jlh")] + public Elastic.Clients.Elasticsearch.EmptyObject? Jlh { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + + /// + /// Only return values that are found in more than `min_doc_count` hits. + /// + [JsonInclude, JsonPropertyName("min_doc_count")] + public long? MinDocCount { get; set; } + + /// + /// Use mutual information as described in "Information Retrieval", Manning et al., Chapter 13.5.1, as the significance score. + /// + [JsonInclude, JsonPropertyName("mutual_information")] + public Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformation { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; 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. + /// + [JsonInclude, JsonPropertyName("percentage")] + public Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? Percentage { get; set; } + + /// + /// Customized score, implemented via a script. + /// + [JsonInclude, JsonPropertyName("script_heuristic")] + public Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? ScriptHeuristic { get; set; } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ [JsonInclude, JsonPropertyName("shard_min_doc_count")] + 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.
+ ///
+ [JsonInclude, JsonPropertyName("shard_size")] + public int? ShardSize { get; set; } + + /// + /// The number of buckets returned out of the overall terms list. + /// + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + [JsonInclude, JsonPropertyName("source_fields")] + public Elastic.Clients.Elasticsearch.Fields? SourceFields { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SignificantTextAggregation significantTextAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.SignificantText(significantTextAggregation); +} + +public sealed partial class SignificantTextAggregationDescriptor : SerializableDescriptor> +{ + internal SignificantTextAggregationDescriptor(Action> configure) => configure.Invoke(this); + + public SignificantTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action> BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? FilterDuplicateTextValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObject? JlhValue { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? SourceFieldsValue { 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 SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Values to exclude. + /// + public SignificantTextAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + public SignificantTextAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + public SignificantTextAggregationDescriptor FilterDuplicateText(bool? filterDuplicateText = true) + { + FilterDuplicateTextValue = filterDuplicateText; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Values to include. + /// + public SignificantTextAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor Name(string? name) + { + NameValue = name; + 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 SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + public SignificantTextAggregationDescriptor SourceFields(Elastic.Clients.Elasticsearch.Fields? sourceFields) + { + SourceFieldsValue = sourceFields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Aggregations.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 (FilterDuplicateTextValue.HasValue) + { + writer.WritePropertyName("filter_duplicate_text"); + writer.WriteBooleanValue(FilterDuplicateTextValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Aggregations.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 Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, 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 Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 Elastic.Clients.Elasticsearch.Aggregations.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 Elastic.Clients.Elasticsearch.Aggregations.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); + } + + if (SourceFieldsValue is not null) + { + writer.WritePropertyName("source_fields"); + JsonSerializer.Serialize(writer, SourceFieldsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SignificantTextAggregationDescriptor : SerializableDescriptor +{ + internal SignificantTextAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SignificantTextAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.QueryDsl.Query? BackgroundFilterValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor BackgroundFilterDescriptor { get; set; } + private Action BackgroundFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? ChiSquareValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor ChiSquareDescriptor { get; set; } + private Action ChiSquareDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } + private bool? FilterDuplicateTextValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? GndValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor GndDescriptor { get; set; } + private Action GndDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObject? JlhValue { get; set; } + private Elastic.Clients.Elasticsearch.EmptyObjectDescriptor JlhDescriptor { get; set; } + private Action JlhDescriptorAction { get; set; } + private IDictionary? MetaValue { get; set; } + private long? MinDocCountValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? MutualInformationValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor MutualInformationDescriptor { get; set; } + private Action MutualInformationDescriptorAction { get; set; } + private string? NameValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? PercentageValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor PercentageDescriptor { get; set; } + private Action PercentageDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? ScriptHeuristicValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor ScriptHeuristicDescriptor { get; set; } + private Action ScriptHeuristicDescriptorAction { get; set; } + private long? ShardMinDocCountValue { get; set; } + private int? ShardSizeValue { get; set; } + private int? SizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? SourceFieldsValue { 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 SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.Query? backgroundFilter) + { + BackgroundFilterDescriptor = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterValue = backgroundFilter; + return Self; + } + + public SignificantTextAggregationDescriptor BackgroundFilter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + BackgroundFilterValue = null; + BackgroundFilterDescriptorAction = null; + BackgroundFilterDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic? chiSquare) + { + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = null; + ChiSquareValue = chiSquare; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicDescriptor descriptor) + { + ChiSquareValue = null; + ChiSquareDescriptorAction = null; + ChiSquareDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ChiSquare(Action configure) + { + ChiSquareValue = null; + ChiSquareDescriptor = null; + ChiSquareDescriptorAction = configure; + return Self; + } + + /// + /// Values to exclude. + /// + public SignificantTextAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude) + { + ExcludeValue = exclude; + return Self; + } + + /// + /// Determines whether the aggregation will use field values directly or global ordinals. + /// + public SignificantTextAggregationDescriptor ExecutionHint(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? executionHint) + { + ExecutionHintValue = executionHint; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field from which to return significant text. + /// + public SignificantTextAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Whether to out duplicate text to deal with noisy data. + /// + public SignificantTextAggregationDescriptor FilterDuplicateText(bool? filterDuplicateText = true) + { + FilterDuplicateTextValue = filterDuplicateText; + return Self; + } + + /// + /// Use Google normalized distance as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007, as the significance score. + /// + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic? gnd) + { + GndDescriptor = null; + GndDescriptorAction = null; + GndValue = gnd; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicDescriptor descriptor) + { + GndValue = null; + GndDescriptorAction = null; + GndDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Gnd(Action configure) + { + GndValue = null; + GndDescriptor = null; + GndDescriptorAction = configure; + return Self; + } + + /// + /// Values to include. + /// + public SignificantTextAggregationDescriptor Include(Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? include) + { + IncludeValue = include; + return Self; + } + + /// + /// Use JLH score as the significance score. + /// + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObject? jlh) + { + JlhDescriptor = null; + JlhDescriptorAction = null; + JlhValue = jlh; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Elastic.Clients.Elasticsearch.EmptyObjectDescriptor descriptor) + { + JlhValue = null; + JlhDescriptorAction = null; + JlhDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Jlh(Action configure) + { + JlhValue = null; + JlhDescriptor = null; + JlhDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic? mutualInformation) + { + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = null; + MutualInformationValue = mutualInformation; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor descriptor) + { + MutualInformationValue = null; + MutualInformationDescriptorAction = null; + MutualInformationDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor MutualInformation(Action configure) + { + MutualInformationValue = null; + MutualInformationDescriptor = null; + MutualInformationDescriptorAction = configure; + return Self; + } + + public SignificantTextAggregationDescriptor Name(string? name) + { + NameValue = name; + 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 SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic? percentage) + { + PercentageDescriptor = null; + PercentageDescriptorAction = null; + PercentageValue = percentage; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicDescriptor descriptor) + { + PercentageValue = null; + PercentageDescriptorAction = null; + PercentageDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor Percentage(Action configure) + { + PercentageValue = null; + PercentageDescriptor = null; + PercentageDescriptorAction = configure; + return Self; + } + + /// + /// Customized score, implemented via a script. + /// + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic? scriptHeuristic) + { + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicValue = scriptHeuristic; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicDescriptor descriptor) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptorAction = null; + ScriptHeuristicDescriptor = descriptor; + return Self; + } + + public SignificantTextAggregationDescriptor ScriptHeuristic(Action configure) + { + ScriptHeuristicValue = null; + ScriptHeuristicDescriptor = null; + ScriptHeuristicDescriptorAction = configure; + return Self; + } + + /// + /// Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count.
Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`.
+ ///
+ public SignificantTextAggregationDescriptor 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 SignificantTextAggregationDescriptor ShardSize(int? shardSize) + { + ShardSizeValue = shardSize; + return Self; + } + + /// + /// The number of buckets returned out of the overall terms list. + /// + public SignificantTextAggregationDescriptor Size(int? size) + { + SizeValue = size; + return Self; + } + + /// + /// Overrides the JSON `_source` fields from which text will be analyzed. + /// + public SignificantTextAggregationDescriptor SourceFields(Elastic.Clients.Elasticsearch.Fields? sourceFields) + { + SourceFieldsValue = sourceFields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Aggregations.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 (FilterDuplicateTextValue.HasValue) + { + writer.WritePropertyName("filter_duplicate_text"); + writer.WriteBooleanValue(FilterDuplicateTextValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.Aggregations.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 Elastic.Clients.Elasticsearch.EmptyObjectDescriptor(JlhDescriptorAction), options); + } + else if (JlhValue is not null) + { + writer.WritePropertyName("jlh"); + JsonSerializer.Serialize(writer, JlhValue, options); + } + + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, 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 Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicDescriptor(MutualInformationDescriptorAction), options); + } + else if (MutualInformationValue is not null) + { + writer.WritePropertyName("mutual_information"); + JsonSerializer.Serialize(writer, MutualInformationValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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 Elastic.Clients.Elasticsearch.Aggregations.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 Elastic.Clients.Elasticsearch.Aggregations.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); + } + + if (SourceFieldsValue is not null) + { + writer.WritePropertyName("source_fields"); + JsonSerializer.Serialize(writer, SourceFieldsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs index 98fc7cd5cca..896a16297e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs @@ -31,6 +31,10 @@ public sealed partial class SimpleValueAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs index 3cc29b1279e..4f5d8f6c8a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class StatsAggregationConverter : JsonConverter +public sealed partial class StatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(StatsAggregation statsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Stats(statsAggregation); } public sealed partial class StatsAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public StatsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public StatsAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public StatsAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + public StatsAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public StatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearc protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public StatsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StatsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public StatsAggregationDescriptor Format(string? format) return Self; } - public StatsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public StatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? s protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs index 04d7572d564..2725082c9d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs @@ -27,127 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class StatsBucketAggregationConverter : JsonConverter +public sealed partial class StatsBucketAggregation { - 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() - { - } - + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(StatsBucketAggregation statsBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.StatsBucket(statsBucketAggregation); } public sealed partial class StatsBucketAggregationDescriptor : SerializableDescriptor @@ -162,19 +66,29 @@ public StatsBucketAggregationDescriptor() : base() private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + /// + /// Path to the buckets that contain one set of values to correlate. + /// public StatsBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) { BucketsPathValue = bucketsPath; return Self; } + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
public StatsBucketAggregationDescriptor Format(string? format) { FormatValue = format; return Self; } + /// + /// Policy to apply when gaps are found in the data. + /// public StatsBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) { GapPolicyValue = gapPolicy; @@ -187,10 +101,14 @@ public StatsBucketAggregationDescriptor Meta(Func 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 +internal sealed partial class StringRareTermsBucketConverter : JsonConverter { - public override StringRareTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; string key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new StringRareTermsBucket(subAggs) { DocCount = docCount, Key = key }; + return new StringRareTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Key = key }; } - public override void Write(Utf8JsonWriter writer, StringRareTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, StringRareTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'StringRareTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StringRareTermsBucketConverter))] +public sealed partial class StringRareTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public string Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs index 0f153058861..99aa45eb084 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs @@ -27,151 +27,29 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class StringStatsAggregationConverter : JsonConverter +public sealed partial class StringStatsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Shows the probability distribution for all characters. /// + [JsonInclude, JsonPropertyName("show_distribution")] public bool? ShowDistribution { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(StringStatsAggregation stringStatsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.StringStats(stringStatsAggregation); } public sealed partial class StringStatsAggregationDescriptor : SerializableDescriptor> @@ -183,30 +61,41 @@ public StringStatsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public StringStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public StringStatsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } - public StringStatsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StringStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -229,8 +118,6 @@ public StringStatsAggregationDescriptor ShowDistribution(bool? showDi protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("string_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -256,13 +143,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(ShowDistributionValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -276,36 +156,41 @@ public StringStatsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public StringStatsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// 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) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public StringStatsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -328,8 +213,6 @@ public StringStatsAggregationDescriptor ShowDistribution(bool? showDistribution protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("string_stats"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -355,13 +238,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/StringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs index 4981b5508dd..fe533f4e2d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs @@ -27,68 +27,67 @@ namespace Elastic.Clients.Elasticsearch.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.FieldValue Key { get; init; } -} - -internal sealed class StringTermsBucketConverter : JsonConverter +internal sealed partial class StringTermsBucketConverter : JsonConverter { - public override StringTermsBucket? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; long? docCountError = default; Elastic.Clients.Elasticsearch.FieldValue key = default; - while (reader.Read()) + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - docCount = JsonSerializer.Deserialize(ref reader, options); - continue; - } + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("doc_count_error", StringComparison.Ordinal)) - { - docCountError = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "doc_count_error") + { + docCountError = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Equals("key", StringComparison.Ordinal)) - { - key = JsonSerializer.Deserialize(ref reader, options); - continue; - } + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } - if (name.Contains("#")) - { - AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); - continue; - } + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } - throw new JsonException("Unknown property read from JSON."); + throw new JsonException("Unknown property read from JSON."); + } } - return new StringTermsBucket(subAggs) { DocCount = docCount, DocCountError = docCountError, Key = key }; + return new StringTermsBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, DocCountError = docCountError, Key = key }; } - public override void Write(Utf8JsonWriter writer, StringTermsBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, StringTermsBucket value, JsonSerializerOptions options) + { + throw new NotImplementedException("'StringTermsBucket' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StringTermsBucketConverter))] +public sealed partial class StringTermsBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public long? DocCountError { get; init; } + public Elastic.Clients.Elasticsearch.FieldValue Key { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs index 2837796f7c0..37e8b722a52 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class SumAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs index a0bc9eeba70..4b6c54be7fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class SumAggregationConverter : JsonConverter +public sealed partial class SumAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SumAggregation sumAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Sum(sumAggregation); } public sealed partial class SumAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public SumAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public SumAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public SumAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) + public SumAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public SumAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public SumAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("sum"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public SumAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public SumAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public SumAggregationDescriptor Format(string? format) return Self; } - public SumAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public SumAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public SumAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? scr protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("sum"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/SumBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs new file mode 100644 index 00000000000..bb10b33eb66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +public sealed partial class SumBucketAggregation +{ + /// + /// Path to the buckets that contain one set of values to correlate. + /// + [JsonInclude, JsonPropertyName("buckets_path")] + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// Policy to apply when gaps are found in the data. + /// + [JsonInclude, JsonPropertyName("gap_policy")] + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } + [JsonInclude, JsonPropertyName("meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(SumBucketAggregation sumBucketAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.SumBucket(sumBucketAggregation); +} + +public sealed partial class SumBucketAggregationDescriptor : SerializableDescriptor +{ + internal SumBucketAggregationDescriptor(Action configure) => configure.Invoke(this); + + public SumBucketAggregationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPathValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicyValue { get; set; } + private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } + + /// + /// Path to the buckets that contain one set of values to correlate. + /// + public SumBucketAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? bucketsPath) + { + BucketsPathValue = bucketsPath; + return Self; + } + + /// + /// `DecimalFormat` pattern for the output value.
If specified, the formatted value is returned in the aggregation’s `value_as_string` property.
+ ///
+ public SumBucketAggregationDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// Policy to apply when gaps are found in the data. + /// + public SumBucketAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? gapPolicy) + { + GapPolicyValue = gapPolicy; + return Self; + } + + public SumBucketAggregationDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public SumBucketAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + 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 (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs index dfa9cddc86b..89d5a438bc1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs @@ -27,138 +27,31 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class TTestAggregationConverter : JsonConverter +public sealed partial class TTestAggregation { - 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. /// + [JsonInclude, JsonPropertyName("a")] public Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? a { get; set; } /// /// Test population B. /// + [JsonInclude, JsonPropertyName("b")] public Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? b { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// The type of test. /// + [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.Aggregations.TTestType? Type { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(TTestAggregation tTestAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.TTest(tTestAggregation); } public sealed partial class TTestAggregationDescriptor : SerializableDescriptor> @@ -170,12 +63,13 @@ public TTestAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? aValue { get; set; } - private TestPopulationDescriptor aDescriptor { get; set; } - private Action> aDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor aDescriptor { get; set; } + private Action> aDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? bValue { get; set; } - private TestPopulationDescriptor bDescriptor { get; set; } - private Action> bDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor bDescriptor { get; set; } + private Action> bDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TTestType? TypeValue { get; set; } /// @@ -189,7 +83,7 @@ public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Agg return Self; } - public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor descriptor) { aValue = null; aDescriptorAction = null; @@ -197,7 +91,7 @@ public TTestAggregationDescriptor a(TestPopulationDescriptor a(Action> configure) + public TTestAggregationDescriptor a(Action> configure) { aValue = null; aDescriptor = null; @@ -216,7 +110,7 @@ public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Agg return Self; } - public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor descriptor) { bValue = null; bDescriptorAction = null; @@ -224,7 +118,7 @@ public TTestAggregationDescriptor b(TestPopulationDescriptor b(Action> configure) + public TTestAggregationDescriptor b(Action> configure) { bValue = null; bDescriptor = null; @@ -238,6 +132,12 @@ public TTestAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The type of test. /// @@ -249,8 +149,6 @@ public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("t_test"); writer.WriteStartObject(); if (aDescriptor is not null) { @@ -260,7 +158,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (aDescriptorAction is not null) { writer.WritePropertyName("a"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor(aDescriptorAction), options); } else if (aValue is not null) { @@ -276,7 +174,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (bDescriptorAction is not null) { writer.WritePropertyName("b"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor(bDescriptorAction), options); } else if (bValue is not null) { @@ -284,19 +182,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + if (TypeValue is not null) + { + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + } + writer.WriteEndObject(); } } @@ -310,12 +213,13 @@ public TTestAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? aValue { get; set; } - private TestPopulationDescriptor aDescriptor { get; set; } - private Action aDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor aDescriptor { get; set; } + private Action aDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TestPopulation? bValue { get; set; } - private TestPopulationDescriptor bDescriptor { get; set; } - private Action bDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor bDescriptor { get; set; } + private Action bDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TTestType? TypeValue { get; set; } /// @@ -329,7 +233,7 @@ public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Aggregations.T return Self; } - public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor a(Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor descriptor) { aValue = null; aDescriptorAction = null; @@ -337,7 +241,7 @@ public TTestAggregationDescriptor a(TestPopulationDescriptor descriptor) return Self; } - public TTestAggregationDescriptor a(Action configure) + public TTestAggregationDescriptor a(Action configure) { aValue = null; aDescriptor = null; @@ -356,7 +260,7 @@ public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Aggregations.T return Self; } - public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) + public TTestAggregationDescriptor b(Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor descriptor) { bValue = null; bDescriptorAction = null; @@ -364,7 +268,7 @@ public TTestAggregationDescriptor b(TestPopulationDescriptor descriptor) return Self; } - public TTestAggregationDescriptor b(Action configure) + public TTestAggregationDescriptor b(Action configure) { bValue = null; bDescriptor = null; @@ -378,6 +282,12 @@ public TTestAggregationDescriptor Meta(Func, Fl return Self; } + public TTestAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// The type of test. /// @@ -389,8 +299,6 @@ public TTestAggregationDescriptor Type(Elastic.Clients.Elasticsearch.Aggregation protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("t_test"); writer.WriteStartObject(); if (aDescriptor is not null) { @@ -400,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (aDescriptorAction is not null) { writer.WritePropertyName("a"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(aDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor(aDescriptorAction), options); } else if (aValue is not null) { @@ -416,7 +324,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (bDescriptorAction is not null) { writer.WritePropertyName("b"); - JsonSerializer.Serialize(writer, new TestPopulationDescriptor(bDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TestPopulationDescriptor(bDescriptorAction), options); } else if (bValue is not null) { @@ -424,19 +332,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + + 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/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs index bf25fbe8a2a..7ca5ffbc9c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -27,440 +27,95 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class TermsAggregationConverter : JsonConverter +public sealed partial class TermsAggregation { - 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.Aggregations.AggregationDictionary? Aggregations { get; set; } - /// /// Determines how child aggregations should be calculated: breadth-first or depth-first. /// + [JsonInclude, JsonPropertyName("collect_mode")] public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; } /// /// Values to exclude.
Accepts regular expressions and partitions.
///
+ [JsonInclude, JsonPropertyName("exclude")] public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; } /// /// Determines whether the aggregation will use field values directly or global ordinals. /// + [JsonInclude, JsonPropertyName("execution_hint")] public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; } /// /// The field from which to return terms. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } /// /// Values to include.
Accepts regular expressions and partitions.
///
+ [JsonInclude, JsonPropertyName("include")] public Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? Include { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } /// /// Only return values that are found in more than `min_doc_count` hits. /// + [JsonInclude, JsonPropertyName("min_doc_count")] 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; } + [JsonInclude, JsonPropertyName("missing")] + public Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("missing_bucket")] public bool? MissingBucket { get; set; } + [JsonInclude, JsonPropertyName("missing_order")] public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } - override public string? Name { get; internal set; } - [JsonConverter(typeof(AggregateOrderConverter))] + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
+ [JsonInclude, JsonPropertyName("order")] + [JsonConverter(typeof(SingleOrManyCollectionConverter>))] public ICollection>? Order { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.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.
///
+ [JsonInclude, JsonPropertyName("shard_size")] 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. /// + [JsonInclude, JsonPropertyName("show_term_doc_count_error")] public bool? ShowTermDocCountError { get; set; } /// /// The number of buckets returned out of the overall terms list. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// Coerced unmapped fields into the specified type. /// + [JsonInclude, JsonPropertyName("value_type")] public string? ValueType { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(TermsAggregation termsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.Terms(termsAggregation); + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(TermsAggregation termsAggregation) => Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy.Terms(termsAggregation); } public sealed partial class TermsAggregationDescriptor : SerializableDescriptor> @@ -471,9 +126,6 @@ public TermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } @@ -482,9 +134,10 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private string? NameValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } @@ -492,30 +145,6 @@ public TermsAggregationDescriptor() : base() private int? SizeValue { get; set; } private string? ValueTypeValue { get; set; } - public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -561,6 +190,15 @@ public TermsAggregationDescriptor Field(Expression + /// The field from which to return terms. + ///
+ public TermsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermsAggregationDescriptor Format(string? format) { FormatValue = format; @@ -594,7 +232,7 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) /// /// 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) + public TermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -612,6 +250,12 @@ public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasti return Self; } + public TermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
@@ -665,8 +309,6 @@ public TermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("terms"); writer.WriteStartObject(); if (CollectModeValue is not null) { @@ -704,6 +346,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, IncludeValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -728,6 +376,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingOrderValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OrderValue is not null) { writer.WritePropertyName("order"); @@ -764,29 +418,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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(); } } @@ -799,9 +430,6 @@ public TermsAggregationDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; } @@ -810,9 +438,10 @@ public TermsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Aggregations.TermsInclude? IncludeValue { get; set; } private IDictionary? MetaValue { get; set; } private int? MinDocCountValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } + private string? NameValue { get; set; } private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } @@ -820,30 +449,6 @@ public TermsAggregationDescriptor() : base() private int? SizeValue { get; set; } private string? ValueTypeValue { get; set; } - public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public TermsAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.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. /// @@ -931,7 +536,7 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) /// /// 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) + public TermsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -949,6 +554,12 @@ public TermsAggregationDescriptor MissingOrder(Elastic.Clients.Elasticsearch.Agg return Self; } + public TermsAggregationDescriptor Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
@@ -1002,8 +613,6 @@ public TermsAggregationDescriptor ValueType(string? valueType) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("terms"); writer.WriteStartObject(); if (CollectModeValue is not null) { @@ -1041,6 +650,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, IncludeValue, options); } + if (MetaValue is not null) + { + writer.WritePropertyName("meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + if (MinDocCountValue.HasValue) { writer.WritePropertyName("min_doc_count"); @@ -1065,6 +680,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MissingOrderValue, options); } + if (!string.IsNullOrEmpty(NameValue)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + } + if (OrderValue is not null) { writer.WritePropertyName("order"); @@ -1101,29 +722,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/TestPopulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs index aebde88c944..51692d1fafe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs @@ -54,8 +54,8 @@ public TestPopulationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -76,6 +76,15 @@ public TestPopulationDescriptor Field(Expression + /// The field to aggregate. + /// + public TestPopulationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// A filter used to define a set of records to run unpaired t-test on. /// @@ -87,7 +96,7 @@ public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -95,7 +104,7 @@ public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public TestPopulationDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -122,7 +131,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -150,8 +159,8 @@ public TestPopulationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } /// @@ -192,7 +201,7 @@ public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Qu return Self; } - public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public TestPopulationDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -200,7 +209,7 @@ public TestPopulationDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public TestPopulationDescriptor Filter(Action configure) + public TestPopulationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -227,7 +236,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs index 66a325a3389..3fce3dd280f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -27,403 +27,96 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class TopHitsAggregationConverter : JsonConverter +public sealed partial class TopHitsAggregation { - 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.Core.Search.SourceConfig? Source { get; set; } - /// /// Fields for which to return doc values. /// + [JsonInclude, JsonPropertyName("docvalue_fields")] public Elastic.Clients.Elasticsearch.Fields? DocvalueFields { get; set; } /// /// If `true`, returns detailed information about score computation as part of a hit. /// + [JsonInclude, JsonPropertyName("explain")] public bool? Explain { get; set; } + + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } /// /// Starting document offset. /// + [JsonInclude, JsonPropertyName("from")] public int? From { get; set; } /// /// Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results. /// + [JsonInclude, JsonPropertyName("highlight")] public Elastic.Clients.Elasticsearch.Core.Search.Highlight? Highlight { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// Returns the result of one or more script evaluations for each hit. /// + [JsonInclude, JsonPropertyName("script_fields")] public IDictionary? ScriptFields { 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; } /// /// The maximum number of top matching hits to return per bucket. /// + [JsonInclude, JsonPropertyName("size")] 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.
///
+ [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } + /// + /// Selects the fields of the source that are returned. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } + /// /// Returns values for the specified stored fields (fields that use the `store` mapping option). /// + [JsonInclude, JsonPropertyName("stored_fields")] public Elastic.Clients.Elasticsearch.Fields? StoredFields { get; set; } /// /// If `true`, calculates and returns 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; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(TopHitsAggregation topHitsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.TopHits(topHitsAggregation); } public sealed partial class TopHitsAggregationDescriptor : SerializableDescriptor> @@ -439,18 +132,17 @@ public TopHitsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } @@ -474,18 +166,33 @@ public TopHitsAggregationDescriptor Explain(bool? explain = true) return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// + public TopHitsAggregationDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Starting document offset. /// @@ -506,7 +213,7 @@ public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elastic return Self; } - public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -514,7 +221,7 @@ public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDe return Self; } - public TopHitsAggregationDescriptor Highlight(Action> configure) + public TopHitsAggregationDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -522,13 +229,10 @@ public TopHitsAggregationDescriptor Highlight(Action Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public TopHitsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopHitsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -543,9 +247,9 @@ public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsea /// /// Returns the result of one or more script evaluations for each hit. /// - public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -579,7 +283,7 @@ public TopHitsAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public TopHitsAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -588,7 +292,7 @@ public TopHitsAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public TopHitsAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -597,7 +301,7 @@ public TopHitsAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public TopHitsAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -644,8 +348,6 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_hits"); writer.WriteStartObject(); if (DocvalueFieldsValue is not null) { @@ -679,7 +381,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -725,7 +427,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -734,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -770,13 +472,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(VersionValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -794,18 +489,17 @@ public TopHitsAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } @@ -829,18 +523,27 @@ public TopHitsAggregationDescriptor Explain(bool? explain = true) return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopHitsAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -867,7 +570,7 @@ public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Core return Self; } - public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor descriptor) + public TopHitsAggregationDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -875,7 +578,7 @@ public TopHitsAggregationDescriptor Highlight(Core.Search.HighlightDescriptor de return Self; } - public TopHitsAggregationDescriptor Highlight(Action configure) + public TopHitsAggregationDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -883,13 +586,10 @@ public TopHitsAggregationDescriptor Highlight(Action, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public TopHitsAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopHitsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -904,9 +604,9 @@ public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? /// /// Returns the result of one or more script evaluations for each hit. /// - public TopHitsAggregationDescriptor ScriptFields(Func, FluentDictionary> selector) + public TopHitsAggregationDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -940,7 +640,7 @@ public TopHitsAggregationDescriptor Sort(ICollection configure) + public TopHitsAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -958,7 +658,7 @@ public TopHitsAggregationDescriptor Sort(Action configure return Self; } - public TopHitsAggregationDescriptor Sort(params Action[] configure) + public TopHitsAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -1005,8 +705,6 @@ public TopHitsAggregationDescriptor Version(bool? version = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_hits"); writer.WriteStartObject(); if (DocvalueFieldsValue is not null) { @@ -1040,7 +738,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1086,7 +784,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -1095,7 +793,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -1131,13 +829,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/TopMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs index 11d3ef5a033..13fa03ba28f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; public sealed partial class TopMetrics { [JsonInclude, JsonPropertyName("metrics")] - public IReadOnlyDictionary? Metrics { get; init; } + public IReadOnlyDictionary Metrics { get; init; } [JsonInclude, JsonPropertyName("sort")] - public IReadOnlyCollection? Sort { get; init; } + public IReadOnlyCollection Sort { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs index f9211e8107f..1e224e11d27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs @@ -27,197 +27,43 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class TopMetricsAggregationConverter : JsonConverter +public sealed partial class TopMetricsAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } - public IDictionary? Meta { get; set; } /// /// The fields of the top document to return. /// + [JsonInclude, JsonPropertyName("metrics")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue))] public ICollection? Metrics { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } /// /// The number of top documents from which to return metrics. /// + [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } /// /// The sort order of the documents. /// + [JsonInclude, JsonPropertyName("sort")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(TopMetricsAggregation topMetricsAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.TopMetrics(topMetricsAggregation); } public sealed partial class TopMetricsAggregationDescriptor : SerializableDescriptor> @@ -229,34 +75,42 @@ public TopMetricsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } private ICollection? MetricsValue { get; set; } - private TopMetricsValueDescriptor MetricsDescriptor { get; set; } - private Action> MetricsDescriptorAction { get; set; } - private Action>[] MetricsDescriptorActions { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action> MetricsDescriptorAction { get; set; } + private Action>[] MetricsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// The field on which to run the aggregation. + /// + public TopMetricsAggregationDescriptor Field(Expression> field) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FieldValue = field; return Self; } @@ -272,7 +126,7 @@ public TopMetricsAggregationDescriptor Metrics(ICollection Metrics(TopMetricsValueDescriptor descriptor) + public TopMetricsAggregationDescriptor Metrics(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor descriptor) { MetricsValue = null; MetricsDescriptorAction = null; @@ -281,7 +135,7 @@ public TopMetricsAggregationDescriptor Metrics(TopMetricsValueDescrip return Self; } - public TopMetricsAggregationDescriptor Metrics(Action> configure) + public TopMetricsAggregationDescriptor Metrics(Action> configure) { MetricsValue = null; MetricsDescriptor = null; @@ -290,7 +144,7 @@ public TopMetricsAggregationDescriptor Metrics(Action Metrics(params Action>[] configure) + public TopMetricsAggregationDescriptor Metrics(params Action>[] configure) { MetricsValue = null; MetricsDescriptor = null; @@ -299,7 +153,10 @@ public TopMetricsAggregationDescriptor Metrics(params Action Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopMetricsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -332,7 +189,7 @@ public TopMetricsAggregationDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public TopMetricsAggregationDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -341,7 +198,7 @@ public TopMetricsAggregationDescriptor Sort(SortOptionsDescriptor Sort(Action> configure) + public TopMetricsAggregationDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -350,7 +207,7 @@ public TopMetricsAggregationDescriptor Sort(Action Sort(params Action>[] configure) + public TopMetricsAggregationDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -361,8 +218,6 @@ public TopMetricsAggregationDescriptor Sort(params Action(MetricsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor(MetricsDescriptorAction), options); } else if (MetricsDescriptorActions is not null) { @@ -387,7 +242,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MetricsDescriptorActions) { - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor(action), options); } if (MetricsDescriptorActions.Length > 1) @@ -425,7 +280,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -434,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -446,13 +301,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -466,43 +314,45 @@ public TopMetricsAggregationDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private IDictionary? MetaValue { get; set; } private ICollection? MetricsValue { get; set; } - private TopMetricsValueDescriptor MetricsDescriptor { get; set; } - private Action MetricsDescriptorAction { get; set; } - private Action[] MetricsDescriptorActions { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Action[] MetricsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public TopMetricsAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TopMetricsAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - /// /// The fields of the top document to return. /// @@ -515,7 +365,7 @@ public TopMetricsAggregationDescriptor Metrics(ICollection configure) + public TopMetricsAggregationDescriptor Metrics(Action configure) { MetricsValue = null; MetricsDescriptor = null; @@ -533,7 +383,7 @@ public TopMetricsAggregationDescriptor Metrics(Action return Self; } - public TopMetricsAggregationDescriptor Metrics(params Action[] configure) + public TopMetricsAggregationDescriptor Metrics(params Action[] configure) { MetricsValue = null; MetricsDescriptor = null; @@ -542,7 +392,10 @@ public TopMetricsAggregationDescriptor Metrics(params Action + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public TopMetricsAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -575,7 +428,7 @@ public TopMetricsAggregationDescriptor Sort(ICollection configure) + public TopMetricsAggregationDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -593,7 +446,7 @@ public TopMetricsAggregationDescriptor Sort(Action config return Self; } - public TopMetricsAggregationDescriptor Sort(params Action[] configure) + public TopMetricsAggregationDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -604,8 +457,6 @@ public TopMetricsAggregationDescriptor Sort(params Action protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("top_metrics"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -621,7 +472,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MetricsDescriptorAction is not null) { writer.WritePropertyName("metrics"); - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(MetricsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor(MetricsDescriptorAction), options); } else if (MetricsDescriptorActions is not null) { @@ -630,7 +481,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MetricsDescriptorActions) { - JsonSerializer.Serialize(writer, new TopMetricsValueDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueDescriptor(action), options); } if (MetricsDescriptorActions.Length > 1) @@ -668,7 +519,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -677,7 +528,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -689,13 +540,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(SortValue, writer, 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/_Generated/Types/Aggregations/TopMetricsValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs index d8b8a2d2ffa..699672837d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs @@ -64,6 +64,15 @@ public TopMetricsValueDescriptor Field(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs new file mode 100644 index 00000000000..dec97725d22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// Result of a `rare_terms` aggregation when the field is unmapped. `buckets` is always empty. +/// +public sealed partial class UnmappedRareTermsAggregate : 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/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs new file mode 100644 index 00000000000..73a799bd7b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +internal sealed partial class UnmappedSamplerAggregateConverter : JsonConverter +{ + public override UnmappedSamplerAggregate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + long docCount = default; + IReadOnlyDictionary? meta = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "meta") + { + meta = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); + } + } + + return new UnmappedSamplerAggregate { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), DocCount = docCount, Meta = meta }; + } + + public override void Write(Utf8JsonWriter writer, UnmappedSamplerAggregate value, JsonSerializerOptions options) + { + throw new NotImplementedException("'UnmappedSamplerAggregate' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(UnmappedSamplerAggregateConverter))] +public sealed partial class UnmappedSamplerAggregate : IAggregate +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public IReadOnlyDictionary? Meta { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs new file mode 100644 index 00000000000..1af0aedf52c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// Result of the `significant_terms` aggregation on an unmapped field. `buckets` is always empty. +/// +public sealed partial class UnmappedSignificantTermsAggregate : 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/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs new file mode 100644 index 00000000000..6d02dd1b04f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +/// +/// Result of a `terms` aggregation when the field is unmapped. `buckets` is always empty. +/// +public sealed partial class UnmappedTermsAggregate : 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/_Generated/Types/Aggregations/ValueCountAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs index 111bc0d9ec7..5821a7ca436 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class ValueCountAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs index f46c4e19dd8..1f1954dfc4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs @@ -27,147 +27,25 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class ValueCountAggregationConverter : JsonConverter +public sealed partial class ValueCountAggregation { - 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() - { - } - + /// + /// The field on which to run the aggregation. + /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } - public IDictionary? Meta { get; set; } - public FieldValue? Missing { get; set; } - override public string? Name { get; internal 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 Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } + [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(ValueCountAggregation valueCountAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.ValueCount(valueCountAggregation); } public sealed partial class ValueCountAggregationDescriptor : SerializableDescriptor> @@ -180,35 +58,46 @@ public ValueCountAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public ValueCountAggregationDescriptor Format(string? format) + /// + /// The field on which to run the aggregation. + /// + public ValueCountAggregationDescriptor Field(Expression> field) { - FormatValue = format; + FieldValue = field; return Self; } - public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) + public ValueCountAggregationDescriptor Format(string? format) { - MetaValue = selector?.Invoke(new FluentDictionary()); + FormatValue = format; return Self; } - public ValueCountAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ValueCountAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -222,8 +111,6 @@ public ValueCountAggregationDescriptor Script(Elastic.Clients.Elastic protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("value_count"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -249,13 +136,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -270,22 +150,30 @@ public ValueCountAggregationDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private string? FormatValue { get; set; } - private IDictionary? MetaValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field on which to run the aggregation. + /// public ValueCountAggregationDescriptor Field(Expression> field) { FieldValue = field; @@ -298,13 +186,10 @@ public ValueCountAggregationDescriptor Format(string? format) return Self; } - public ValueCountAggregationDescriptor Meta(Func, FluentDictionary> selector) - { - MetaValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public ValueCountAggregationDescriptor Missing(FieldValue? missing) + /// + /// The value to apply to documents that do not have a value.
By default, documents without a value are ignored.
+ ///
+ public ValueCountAggregationDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -318,8 +203,6 @@ public ValueCountAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Scri protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("value_count"); writer.WriteStartObject(); if (FieldValue is not null) { @@ -345,13 +228,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs index 38865f806f0..3c8d2a0966a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs @@ -27,161 +27,33 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class VariableWidthHistogramAggregationConverter : JsonConverter +public sealed partial class VariableWidthHistogramAggregation { - 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. /// + [JsonInclude, JsonPropertyName("buckets")] public int? Buckets { get; set; } /// /// The name of the field. /// + [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.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)`.
///
+ [JsonInclude, JsonPropertyName("initial_buffer")] 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`.
///
+ [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(VariableWidthHistogramAggregation variableWidthHistogramAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.VariableWidthHistogram(variableWidthHistogramAggregation); } public sealed partial class VariableWidthHistogramAggregationDescriptor : SerializableDescriptor> @@ -195,7 +67,6 @@ public VariableWidthHistogramAggregationDescriptor() : base() private int? BucketsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? InitialBufferValue { get; set; } - private IDictionary? MetaValue { get; set; } private int? ShardSizeValue { get; set; } /// @@ -226,17 +97,20 @@ public VariableWidthHistogramAggregationDescriptor Field(Expr } /// - /// 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)`.
+ /// The name of the field. ///
- public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuffer) + public VariableWidthHistogramAggregationDescriptor Field(Expression> field) { - InitialBufferValue = initialBuffer; + FieldValue = field; return Self; } - public VariableWidthHistogramAggregationDescriptor Meta(Func, FluentDictionary> selector) + /// + /// 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) { - MetaValue = selector?.Invoke(new FluentDictionary()); + InitialBufferValue = initialBuffer; return Self; } @@ -251,8 +125,6 @@ public VariableWidthHistogramAggregationDescriptor ShardSize(int? sha protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("variable_width_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -278,13 +150,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(ShardSizeValue.Value); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -300,7 +165,6 @@ public VariableWidthHistogramAggregationDescriptor() : base() private int? BucketsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } private int? InitialBufferValue { get; set; } - private IDictionary? MetaValue { get; set; } private int? ShardSizeValue { get; set; } /// @@ -348,12 +212,6 @@ public VariableWidthHistogramAggregationDescriptor InitialBuffer(int? initialBuf 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`.
///
@@ -365,8 +223,6 @@ public VariableWidthHistogramAggregationDescriptor ShardSize(int? shardSize) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { - writer.WriteStartObject(); - writer.WritePropertyName("variable_width_histogram"); writer.WriteStartObject(); if (BucketsValue.HasValue) { @@ -392,13 +248,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs index 4f314456580..496f411ee6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs @@ -27,36 +27,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -[JsonConverter(typeof(VariableWidthHistogramBucketConverter))] -public sealed partial class VariableWidthHistogramBucket : AggregateDictionary +internal sealed partial class VariableWidthHistogramBucketConverter : JsonConverter { - 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) + 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. + throw new JsonException("Unexpected JSON detected."); long docCount = default; double key = default; string? keyAsString = default; @@ -64,67 +40,86 @@ internal sealed class VariableWidthHistogramBucketConverter : JsonConverter additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - 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)) + if (reader.TokenType == JsonTokenType.PropertyName) { - max = JsonSerializer.Deserialize(ref reader, options); - continue; + var property = reader.GetString(); + if (property == "doc_count") + { + docCount = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key") + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "key_as_string") + { + keyAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max") + { + max = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_as_string") + { + maxAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "min") + { + min = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "min_as_string") + { + minAsString = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property.Contains("#")) + { + additionalProperties ??= new Dictionary(); + AggregateDictionaryConverter.ReadItem(ref reader, options, additionalProperties, property); + continue; + } + + throw new JsonException("Unknown property read from JSON."); } - - 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 }; + return new VariableWidthHistogramBucket { Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(additionalProperties), 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("'VariableWidthHistogramBucket' is a readonly type, used only on responses and does not support being written to JSON."); } +} - public override void Write(Utf8JsonWriter writer, VariableWidthHistogramBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); +[JsonConverter(typeof(VariableWidthHistogramBucketConverter))] +public sealed partial class VariableWidthHistogramBucket +{ + /// + /// Nested aggregations + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Aggregations { get; init; } + public long DocCount { get; init; } + public double Key { get; init; } + public string? KeyAsString { get; init; } + public double Max { get; init; } + public string? MaxAsString { get; init; } + public double Min { get; init; } + public string? MinAsString { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs index c3bc446401e..fcb2b8330e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs @@ -34,6 +34,10 @@ public sealed partial class WeightedAverageAggregate : IAggregate { [JsonInclude, JsonPropertyName("meta")] public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The metric value. A missing value generally means that there was no data to aggregate,
unless specified otherwise.
+ ///
[JsonInclude, JsonPropertyName("value")] public double? Value { get; init; } [JsonInclude, JsonPropertyName("value_as_string")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs index ba430af57a9..67402f22f89 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs @@ -27,157 +27,33 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed class WeightedAverageAggregationConverter : JsonConverter +public sealed partial class WeightedAverageAggregation { - 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. /// + [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } + [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } - override public string? Name { get; internal set; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; set; } /// /// Configuration for the field that provides the values. /// + [JsonInclude, JsonPropertyName("value")] public Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? Value { get; set; } + [JsonInclude, JsonPropertyName("value_type")] public Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueType { get; set; } /// /// Configuration for the field or script that provides the weights. /// + [JsonInclude, JsonPropertyName("weight")] public Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? Weight { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(WeightedAverageAggregation weightedAverageAggregation) => Elastic.Clients.Elasticsearch.Aggregations.Aggregation.WeightedAvg(weightedAverageAggregation); } public sealed partial class WeightedAverageAggregationDescriptor : SerializableDescriptor> @@ -190,13 +66,14 @@ public WeightedAverageAggregationDescriptor() : base() private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? ValueValue { get; set; } - private WeightedAverageValueDescriptor ValueDescriptor { get; set; } - private Action> ValueDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action> ValueDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? WeightValue { get; set; } - private WeightedAverageValueDescriptor WeightDescriptor { get; set; } - private Action> WeightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action> WeightDescriptorAction { get; set; } /// /// A numeric response formatter. @@ -213,6 +90,12 @@ public WeightedAverageAggregationDescriptor Meta(Func Name(string? name) + { + NameValue = name; + return Self; + } + /// /// Configuration for the field that provides the values. /// @@ -224,7 +107,7 @@ public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Ela return Self; } - public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor descriptor) { ValueValue = null; ValueDescriptorAction = null; @@ -232,7 +115,7 @@ public WeightedAverageAggregationDescriptor Value(WeightedAverageValu return Self; } - public WeightedAverageAggregationDescriptor Value(Action> configure) + public WeightedAverageAggregationDescriptor Value(Action> configure) { ValueValue = null; ValueDescriptor = null; @@ -257,7 +140,7 @@ public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.El return Self; } - public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor descriptor) { WeightValue = null; WeightDescriptorAction = null; @@ -265,7 +148,7 @@ public WeightedAverageAggregationDescriptor Weight(WeightedAverageVal return Self; } - public WeightedAverageAggregationDescriptor Weight(Action> configure) + public WeightedAverageAggregationDescriptor Weight(Action> configure) { WeightValue = null; WeightDescriptor = null; @@ -275,8 +158,6 @@ public WeightedAverageAggregationDescriptor Weight(Action(ValueDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor(ValueDescriptorAction), options); } else if (ValueValue is not null) { @@ -314,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (WeightDescriptorAction is not null) { writer.WritePropertyName("weight"); - JsonSerializer.Serialize(writer, new WeightedAverageValueDescriptor(WeightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor(WeightDescriptorAction), options); } else if (WeightValue is not null) { @@ -322,13 +215,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, WeightValue, options); } - writer.WriteEndObject(); - if (MetaValue is not null) - { - writer.WritePropertyName("meta"); - JsonSerializer.Serialize(writer, MetaValue, options); - } - writer.WriteEndObject(); } } @@ -343,13 +229,14 @@ public WeightedAverageAggregationDescriptor() : base() private string? FormatValue { get; set; } private IDictionary? MetaValue { get; set; } + private string? NameValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? ValueValue { get; set; } - private WeightedAverageValueDescriptor ValueDescriptor { get; set; } - private Action ValueDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor ValueDescriptor { get; set; } + private Action ValueDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.ValueType? ValueTypeValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue? WeightValue { get; set; } - private WeightedAverageValueDescriptor WeightDescriptor { get; set; } - private Action WeightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor WeightDescriptor { get; set; } + private Action WeightDescriptorAction { get; set; } /// /// A numeric response formatter. @@ -366,6 +253,12 @@ public WeightedAverageAggregationDescriptor Meta(Func /// Configuration for the field that provides the values. /// @@ -377,7 +270,7 @@ public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch. return Self; } - public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Value(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor descriptor) { ValueValue = null; ValueDescriptorAction = null; @@ -385,7 +278,7 @@ public WeightedAverageAggregationDescriptor Value(WeightedAverageValueDescriptor return Self; } - public WeightedAverageAggregationDescriptor Value(Action configure) + public WeightedAverageAggregationDescriptor Value(Action configure) { ValueValue = null; ValueDescriptor = null; @@ -410,7 +303,7 @@ public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch return Self; } - public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescriptor descriptor) + public WeightedAverageAggregationDescriptor Weight(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueDescriptor descriptor) { WeightValue = null; WeightDescriptorAction = null; @@ -418,7 +311,7 @@ public WeightedAverageAggregationDescriptor Weight(WeightedAverageValueDescripto return Self; } - public WeightedAverageAggregationDescriptor Weight(Action configure) + public WeightedAverageAggregationDescriptor Weight(Action configure) { WeightValue = null; WeightDescriptor = null; @@ -428,8 +321,6 @@ public WeightedAverageAggregationDescriptor Weight(Action Field(Expression + /// 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. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs index 3d4c9463667..f6fc616b0f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs @@ -66,47 +66,47 @@ public AnalyzersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(analyzerName, null); + public AnalyzersDescriptor Whitespace(string analyzerName, Action configure) => AssignVariant(analyzerName, configure); public AnalyzersDescriptor Whitespace(string analyzerName, WhitespaceAnalyzer whitespaceAnalyzer) => AssignVariant(analyzerName, whitespaceAnalyzer); } @@ -124,39 +124,36 @@ public override IAnalyzer Read(ref Utf8JsonReader reader, Type typeToConvert, Js switch (type) { + case "custom": + return JsonSerializer.Deserialize(ref reader, options); case "dutch": - return JsonSerializer.Deserialize(ref reader, options); - case "snowball": - return JsonSerializer.Deserialize(ref reader, options); - case "kuromoji": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji": + return JsonSerializer.Deserialize(ref reader, options); + case "language": + return JsonSerializer.Deserialize(ref reader, options); + case "nori": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "simple": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); default: - ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IAnalyzer)); - return null; + return JsonSerializer.Deserialize(ref reader, options); } } @@ -170,47 +167,47 @@ public override void Write(Utf8JsonWriter writer, IAnalyzer value, JsonSerialize switch (value.Type) { - case "dutch": - JsonSerializer.Serialize(writer, value, typeof(DutchAnalyzer), options); + case "custom": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer), options); return; - case "snowball": - JsonSerializer.Serialize(writer, value, typeof(SnowballAnalyzer), options); + case "dutch": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer), options); return; - case "kuromoji": - JsonSerializer.Serialize(writer, value, typeof(KuromojiAnalyzer), options); + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer), options); return; case "icu_analyzer": - JsonSerializer.Serialize(writer, value, typeof(IcuAnalyzer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer), options); return; - case "whitespace": - JsonSerializer.Serialize(writer, value, typeof(WhitespaceAnalyzer), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer), options); return; - case "stop": - JsonSerializer.Serialize(writer, value, typeof(StopAnalyzer), options); + case "kuromoji": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer), options); return; - case "standard": - JsonSerializer.Serialize(writer, value, typeof(StandardAnalyzer), options); + case "language": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LanguageAnalyzer), options); return; - case "simple": - JsonSerializer.Serialize(writer, value, typeof(SimpleAnalyzer), options); + case "nori": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer), options); return; case "pattern": - JsonSerializer.Serialize(writer, value, typeof(PatternAnalyzer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer), options); return; - case "nori": - JsonSerializer.Serialize(writer, value, typeof(NoriAnalyzer), options); + case "simple": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer), options); return; - case "language": - JsonSerializer.Serialize(writer, value, typeof(LanguageAnalyzer), options); + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordAnalyzer), options); + case "standard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer), options); return; - case "fingerprint": - JsonSerializer.Serialize(writer, value, typeof(FingerprintAnalyzer), options); + case "stop": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer), options); return; - case "custom": - JsonSerializer.Serialize(writer, value, typeof(CustomAnalyzer), options); + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer), options); return; default: var type = value.GetType(); @@ -223,5 +220,5 @@ public override void Write(Utf8JsonWriter writer, IAnalyzer value, JsonSerialize [JsonConverter(typeof(AnalyzerInterfaceConverter))] public partial interface IAnalyzer { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs index e1d8681b51e..cc96201fc6b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs @@ -30,7 +30,6 @@ namespace Elastic.Clients.Elasticsearch.Analysis; public sealed partial class AsciiFoldingTokenFilter : ITokenFilter { [JsonInclude, JsonPropertyName("preserve_original")] - [JsonConverter(typeof(StringifiedBoolConverter))] public bool? PreserveOriginal { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -66,18 +65,18 @@ public AsciiFoldingTokenFilterDescriptor Version(string? version) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("asciifolding"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs index d17e4f2919b..893e7f01f76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs @@ -66,20 +66,20 @@ public CharFiltersDescriptor() : base(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) => 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) => 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) => 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) => 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) => AssignVariant(charFilterName, null); + public CharFiltersDescriptor PatternReplace(string charFilterName, Action configure) => AssignVariant(charFilterName, configure); public CharFiltersDescriptor PatternReplace(string charFilterName, PatternReplaceCharFilter patternReplaceCharFilter) => AssignVariant(charFilterName, patternReplaceCharFilter); } @@ -97,16 +97,16 @@ public override ICharFilter Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { - case "kuromoji_iteration_mark": - return JsonSerializer.Deserialize(ref reader, options); + case "html_strip": + return JsonSerializer.Deserialize(ref reader, options); case "icu_normalizer": - return JsonSerializer.Deserialize(ref reader, options); - case "pattern_replace": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "kuromoji_iteration_mark": + return JsonSerializer.Deserialize(ref reader, options); case "mapping": - return JsonSerializer.Deserialize(ref reader, options); - case "html_strip": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ICharFilter)); return null; @@ -123,20 +123,20 @@ public override void Write(Utf8JsonWriter writer, ICharFilter value, JsonSeriali switch (value.Type) { - case "kuromoji_iteration_mark": - JsonSerializer.Serialize(writer, value, typeof(KuromojiIterationMarkCharFilter), options); + case "html_strip": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter), options); return; case "icu_normalizer": - JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationCharFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter), options); return; - case "pattern_replace": - JsonSerializer.Serialize(writer, value, typeof(PatternReplaceCharFilter), options); + case "kuromoji_iteration_mark": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter), options); return; case "mapping": - JsonSerializer.Serialize(writer, value, typeof(MappingCharFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter), options); return; - case "html_strip": - JsonSerializer.Serialize(writer, value, typeof(HtmlStripCharFilter), options); + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter), options); return; default: var type = value.GetType(); @@ -149,5 +149,5 @@ public override void Write(Utf8JsonWriter writer, ICharFilter value, JsonSeriali [JsonConverter(typeof(CharFilterInterfaceConverter))] public partial interface ICharFilter { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs index f0939636c69..867b2d1ca8a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs @@ -84,10 +84,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenizeOnCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("char_group"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs index 768907f2514..4f45e01e10e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("common_grams"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs index 191aefb74d7..fe67bca2de1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs @@ -80,10 +80,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("condition"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs index 6d4c5ab5b9c..37a5f56a30b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("delimited_payload"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs index d932b660f19..a1cead6976f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs @@ -151,10 +151,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("dictionary_decompounder"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } if (WordListValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs index 8e22cdbfae1..751526c6f2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; public sealed partial class DutchAnalyzer : IAnalyzer { [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs index 6f5cb969225..0d2f7137290 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs @@ -34,7 +34,6 @@ public sealed partial class EdgeNGramTokenFilter : ITokenFilter [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.Analysis.EdgeNGramSide? Side { get; set; } @@ -105,10 +104,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinGramValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (SideValue is not null) @@ -119,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("edge_ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs index 2847008add7..4141e89b468 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -106,10 +106,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("edge_ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs index 103b0d8a7fe..746bae05f3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs @@ -32,7 +32,6 @@ 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; } @@ -90,10 +89,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ArticlesValue, options); } - if (ArticlesCaseValue is not null) + if (ArticlesCaseValue.HasValue) { writer.WritePropertyName("articles_case"); - JsonSerializer.Serialize(writer, ArticlesCaseValue, options); + writer.WriteBooleanValue(ArticlesCaseValue.Value); } if (!string.IsNullOrEmpty(ArticlesPathValue)) @@ -104,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("elision"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs index 38991f71258..f91086db2f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs @@ -36,7 +36,7 @@ public sealed partial class FingerprintAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -122,10 +122,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("fingerprint"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs index 18a3be759fa..15b0a8f5f96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("fingerprint"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs index df1e77d6b0a..db8de620f02 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("html_strip"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs index 305cea5a6a1..5e65fa055e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs @@ -114,10 +114,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("hunspell"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs index a46583fa792..1c225a17a4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs @@ -151,10 +151,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("hyphenation_decompounder"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } if (WordListValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs index 3f3cc726fa7..e3ba9bc172b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs @@ -238,10 +238,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(VariantValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs index 5faf9114ef0..1d561c06279 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs @@ -68,10 +68,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("icu_folding"); writer.WritePropertyName("unicode_set_filter"); writer.WriteStringValue(UnicodeSetFilterValue); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs index 5c1bc6da67e..c1e72a28c51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("icu_normalizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs index bd37eb40934..49213f5fffb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("icu_normalizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs index 73b85eb4b30..effb1655fba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(RuleFilesValue); writer.WritePropertyName("type"); writer.WriteStringValue("icu_tokenizer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs index 07443891dd4..3d0a701aeda 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs @@ -84,10 +84,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(IdValue); writer.WritePropertyName("type"); writer.WriteStringValue("icu_transform"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs index 56304afa707..266bcb06e2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("kstem"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs index 8f0590a2994..3f92d59e42c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TypesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs index 2020fa30480..6e78e056980 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("keep"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs index 8dc07905af1..e2c5077e950 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs index 2733ce473df..3fd2f033907 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("keyword_marker"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs index fe0b14700f5..aee020454b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BufferSizeValue); writer.WritePropertyName("type"); writer.WriteStringValue("keyword"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs index 59b749d4230..7f6240c8258 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs @@ -80,10 +80,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(NormalizeKanjiValue); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_iteration_mark"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs index 66f9234645e..3566825f88d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, StoptagsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_part_of_speech"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs index c2a01a5b069..eb34f202699 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs @@ -68,10 +68,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("kuromoji_readingform"); writer.WritePropertyName("use_romaji"); writer.WriteBooleanValue(UseRomajiValue); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs index 2f0e877cea1..d98994983f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinimumLengthValue); writer.WritePropertyName("type"); writer.WriteStringValue("kuromoji_stemmer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs index 2d0304282fe..9e35cca0299 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs @@ -159,10 +159,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LanguageAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LanguageAnalyzer.g.cs index e81b7fcd18d..00a6d5a7171 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LanguageAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LanguageAnalyzer.g.cs @@ -34,7 +34,7 @@ public sealed partial class LanguageAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("stem_exclusion")] public ICollection StemExclusion { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -111,10 +111,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("language"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs index 54364641b07..c17c99012b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("length"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs index 66fd0858f1a..252b705fd7d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("letter"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs index f7ae3923ff7..3f1cce4ecc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -81,18 +80,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(ConsumeAllTokensValue.Value); } - if (MaxTokenCountValue is not null) + if (MaxTokenCountValue.HasValue) { writer.WritePropertyName("max_token_count"); - JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + writer.WriteNumberValue(MaxTokenCountValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("limit"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs index ce81678c2be..cdf9aff0505 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("lowercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs index eadc1a9d758..832e7dbb24f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("lowercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs index 827b99af2f1..d99840f9ae0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("mapping"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs index 9d806934155..db6a3e2173d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -77,18 +76,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("filters"); JsonSerializer.Serialize(writer, FiltersValue, options); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("multiplexer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs index 72ec03d06c1..1748bca3edd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs @@ -34,7 +34,6 @@ public sealed partial class NGramTokenFilter : ITokenFilter [JsonInclude, JsonPropertyName("min_gram")] public int? MinGram { get; set; } [JsonInclude, JsonPropertyName("preserve_original")] - [JsonConverter(typeof(StringifiedBoolConverter))] public bool? PreserveOriginal { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -96,18 +95,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinGramValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs index 80c95e91101..18208b70675 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -106,10 +106,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TokenCharsValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("ngram"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs index 73b447c6bd4..424a7e42934 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(UserDictionaryValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs index c06c611c9fd..f0fed1794fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("nori_part_of_speech"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs index e61d0ada48b..0199a815584 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs @@ -118,10 +118,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, UserDictionaryRulesValue, options); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs index 6fd0bd4bdf3..da1b504a596 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs @@ -66,11 +66,11 @@ public NormalizersDescriptor() : base(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) => 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) => AssignVariant(normalizerName, null); + public NormalizersDescriptor Lowercase(string normalizerName, Action configure) => AssignVariant(normalizerName, configure); public NormalizersDescriptor Lowercase(string normalizerName, LowercaseNormalizer lowercaseNormalizer) => AssignVariant(normalizerName, lowercaseNormalizer); } @@ -89,9 +89,9 @@ public override INormalizer Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { case "custom": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); case "lowercase": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(INormalizer)); return null; @@ -109,10 +109,10 @@ public override void Write(Utf8JsonWriter writer, INormalizer value, JsonSeriali switch (value.Type) { case "custom": - JsonSerializer.Serialize(writer, value, typeof(CustomNormalizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer), options); return; case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseNormalizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer), options); return; default: var type = value.GetType(); @@ -122,8 +122,11 @@ public override void Write(Utf8JsonWriter writer, INormalizer value, JsonSeriali } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(NormalizerInterfaceConverter))] public partial interface INormalizer { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs index 800644e5f5c..7101ee9d5a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs @@ -30,17 +30,14 @@ namespace Elastic.Clients.Elasticsearch.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")] @@ -104,10 +101,10 @@ public PathHierarchyTokenizerDescriptor Version(string? version) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (BufferSizeValue is not null) + if (BufferSizeValue.HasValue) { writer.WritePropertyName("buffer_size"); - JsonSerializer.Serialize(writer, BufferSizeValue, options); + writer.WriteNumberValue(BufferSizeValue.Value); } if (!string.IsNullOrEmpty(DelimiterValue)) @@ -122,24 +119,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(ReplacementValue); } - if (ReverseValue is not null) + if (ReverseValue.HasValue) { writer.WritePropertyName("reverse"); - JsonSerializer.Serialize(writer, ReverseValue, options); + writer.WriteBooleanValue(ReverseValue.Value); } - if (SkipValue is not null) + if (SkipValue.HasValue) { writer.WritePropertyName("skip"); - JsonSerializer.Serialize(writer, SkipValue, options); + writer.WriteNumberValue(SkipValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("path_hierarchy"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs index 9b3627fc648..90b4f9f3e43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs @@ -36,7 +36,7 @@ public sealed partial class PatternAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("pattern")] public string Pattern { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -115,10 +115,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs index f1209cb4c89..67f82afb636 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs @@ -32,7 +32,6 @@ 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")] @@ -77,18 +76,18 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("patterns"); JsonSerializer.Serialize(writer, PatternsValue, options); - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } writer.WritePropertyName("type"); writer.WriteStringValue("pattern_capture"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs index d7d185eedec..cee6b17e03a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs @@ -99,10 +99,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern_replace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs index 5ea37ee2460..91d325d6ee8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs @@ -114,10 +114,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern_replace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs index 8f0e84db919..2f456ab9bfc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs @@ -103,10 +103,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("pattern"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs index 8c8e9b29e91..27d285b9184 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs @@ -132,10 +132,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RuleTypeValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("phonetic"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs index f30bd95634c..ed6517dd305 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("porter_stem"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs index 06f3ba61a24..e829f7d9dfd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ScriptValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("predicate_token_filter"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs index af877d0cb81..e36c4de5ebc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("remove_duplicates"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs index 4c538b31407..75aebacd6ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("reverse"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs index f1488aa4fb1..5ed8c0b8ff2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs @@ -32,9 +32,9 @@ 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; } + public object? MaxShingleSize { get; set; } [JsonInclude, JsonPropertyName("min_shingle_size")] - public Union? MinShingleSize { get; set; } + public object? MinShingleSize { get; set; } [JsonInclude, JsonPropertyName("output_unigrams")] public bool? OutputUnigrams { get; set; } [JsonInclude, JsonPropertyName("output_unigrams_if_no_shingles")] @@ -58,8 +58,8 @@ public ShingleTokenFilterDescriptor() : base() } private string? FillerTokenValue { get; set; } - private Union? MaxShingleSizeValue { get; set; } - private Union? MinShingleSizeValue { get; set; } + private object? MaxShingleSizeValue { get; set; } + private object? MinShingleSizeValue { get; set; } private bool? OutputUnigramsValue { get; set; } private bool? OutputUnigramsIfNoShinglesValue { get; set; } private string? TokenSeparatorValue { get; set; } @@ -71,13 +71,13 @@ public ShingleTokenFilterDescriptor FillerToken(string? fillerToken) return Self; } - public ShingleTokenFilterDescriptor MaxShingleSize(Union? maxShingleSize) + public ShingleTokenFilterDescriptor MaxShingleSize(object? maxShingleSize) { MaxShingleSizeValue = maxShingleSize; return Self; } - public ShingleTokenFilterDescriptor MinShingleSize(Union? minShingleSize) + public ShingleTokenFilterDescriptor MinShingleSize(object? minShingleSize) { MinShingleSizeValue = minShingleSize; return Self; @@ -148,10 +148,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("shingle"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs index 0857fa7486c..fc512489019 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("simple"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs index a9f9d85d43e..f816558cc40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs @@ -32,7 +32,7 @@ public sealed partial class SnowballAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("language")] public Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Language { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -85,10 +85,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("snowball"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs index f3e0d8125e7..ae4f644db7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs @@ -69,10 +69,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, LanguageValue, options); writer.WritePropertyName("type"); writer.WriteStringValue("snowball"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs index 863dbf79c91..f89bcc5f1ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs @@ -32,7 +32,7 @@ public sealed partial class StandardAnalyzer : IAnalyzer [JsonInclude, JsonPropertyName("max_token_length")] public int? MaxTokenLength { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("type")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs index 87341d22ee4..b7ef3635a6c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("standard"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs index 009b388f58e..51898a85c7d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs @@ -88,10 +88,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stemmer_override"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs index 1a2a34737e1..b92fc84576f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs @@ -67,10 +67,10 @@ public override void Write(Utf8JsonWriter writer, StemmerTokenFilter value, Json writer.WritePropertyName("type"); writer.WriteStringValue("stemmer"); - if (value.Version is not null) + if (!string.IsNullOrEmpty(value.Version)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, value.Version, options); + writer.WriteStringValue(value.Version); } writer.WriteEndObject(); @@ -82,7 +82,6 @@ public sealed partial class StemmerTokenFilter : ITokenFilter { public string? Language { get; set; } - [JsonInclude, JsonPropertyName("type")] public string Type => "stemmer"; public string? Version { get; set; } @@ -122,10 +121,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stemmer"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs index fbfbee35b59..9467b26a75b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; public sealed partial class StopAnalyzer : IAnalyzer { [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -89,10 +89,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stop"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs index 7107419568b..d1093f2ebef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs @@ -34,7 +34,7 @@ public sealed partial class StopTokenFilter : ITokenFilter [JsonInclude, JsonPropertyName("remove_trailing")] public bool? RemoveTrailing { get; set; } [JsonInclude, JsonPropertyName("stopwords")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Stopwords { get; set; } [JsonInclude, JsonPropertyName("stopwords_path")] public string? StopwordsPath { get; set; } @@ -119,10 +119,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("stop"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs index 037736ce58d..3e875ef59b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs @@ -163,10 +163,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(UpdateableValue.Value); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs index 5639db9e508..2dac054af31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs @@ -163,10 +163,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(UpdateableValue.Value); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs index 3be22f1fb97..2fa0d6a043c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs @@ -66,146 +66,146 @@ public TokenFiltersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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 IcuTransform(string tokenFilterName) => AssignVariant(tokenFilterName, null); - public TokenFiltersDescriptor IcuTransform(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); + 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(tokenFilterName, null); + public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, Action configure) => AssignVariant(tokenFilterName, configure); public TokenFiltersDescriptor WordDelimiter(string tokenFilterName, WordDelimiterTokenFilter wordDelimiterTokenFilter) => AssignVariant(tokenFilterName, wordDelimiterTokenFilter); } @@ -223,100 +223,100 @@ public override ITokenFilter Read(ref Utf8JsonReader reader, Type typeToConvert, switch (type) { + case "asciifolding": + return JsonSerializer.Deserialize(ref reader, options); + case "common_grams": + return JsonSerializer.Deserialize(ref reader, options); + case "condition": + return JsonSerializer.Deserialize(ref reader, options); + case "delimited_payload": + return JsonSerializer.Deserialize(ref reader, options); 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); + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "elision": + return JsonSerializer.Deserialize(ref reader, options); + case "fingerprint": + return JsonSerializer.Deserialize(ref reader, options); + case "hunspell": + return JsonSerializer.Deserialize(ref reader, options); + case "hyphenation_decompounder": + return JsonSerializer.Deserialize(ref reader, options); case "icu_collation": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "icu_folding": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_normalizer": + return JsonSerializer.Deserialize(ref reader, options); + case "icu_transform": + return JsonSerializer.Deserialize(ref reader, options); + case "keep_types": + return JsonSerializer.Deserialize(ref reader, options); + case "keep": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword_marker": + return JsonSerializer.Deserialize(ref reader, options); + case "kstem": + return JsonSerializer.Deserialize(ref reader, options); case "kuromoji_part_of_speech": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); case "kuromoji_readingform": - return JsonSerializer.Deserialize(ref reader, options); + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "limit": + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "multiplexer": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_part_of_speech": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_capture": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern_replace": + return JsonSerializer.Deserialize(ref reader, options); + case "phonetic": + return JsonSerializer.Deserialize(ref reader, options); + case "porter_stem": + return JsonSerializer.Deserialize(ref reader, options); + case "predicate_token_filter": + return JsonSerializer.Deserialize(ref reader, options); + case "remove_duplicates": + return JsonSerializer.Deserialize(ref reader, options); + case "reverse": + return JsonSerializer.Deserialize(ref reader, options); + case "shingle": + return JsonSerializer.Deserialize(ref reader, options); + case "snowball": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer_override": + return JsonSerializer.Deserialize(ref reader, options); + case "stemmer": + return JsonSerializer.Deserialize(ref reader, options); + case "stop": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "synonym": + return JsonSerializer.Deserialize(ref reader, options); + case "trim": + return JsonSerializer.Deserialize(ref reader, options); + case "truncate": + return JsonSerializer.Deserialize(ref reader, options); + case "unique": + return JsonSerializer.Deserialize(ref reader, options); + case "uppercase": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter_graph": + return JsonSerializer.Deserialize(ref reader, options); + case "word_delimiter": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenFilter)); return null; @@ -333,146 +333,146 @@ public override void Write(Utf8JsonWriter writer, ITokenFilter value, JsonSerial switch (value.Type) { - case "dictionary_decompounder": - JsonSerializer.Serialize(writer, value, typeof(DictionaryDecompounderTokenFilter), options); + case "asciifolding": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter), options); return; - case "phonetic": - JsonSerializer.Serialize(writer, value, typeof(PhoneticTokenFilter), options); + case "common_grams": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter), options); return; - case "icu_transform": - JsonSerializer.Serialize(writer, value, typeof(IcuTransformTokenFilter), options); + case "condition": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter), options); return; - case "icu_normalizer": - JsonSerializer.Serialize(writer, value, typeof(IcuNormalizationTokenFilter), options); + case "delimited_payload": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter), options); return; - case "icu_folding": - JsonSerializer.Serialize(writer, value, typeof(IcuFoldingTokenFilter), options); + case "dictionary_decompounder": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter), options); return; - case "icu_collation": - JsonSerializer.Serialize(writer, value, typeof(IcuCollationTokenFilter), options); + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter), options); return; - case "kuromoji_part_of_speech": - JsonSerializer.Serialize(writer, value, typeof(KuromojiPartOfSpeechTokenFilter), options); + case "elision": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter), options); return; - case "kuromoji_readingform": - JsonSerializer.Serialize(writer, value, typeof(KuromojiReadingFormTokenFilter), options); + case "fingerprint": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter), options); return; - case "kuromoji_stemmer": - JsonSerializer.Serialize(writer, value, typeof(KuromojiStemmerTokenFilter), options); + case "hunspell": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter), options); return; - case "word_delimiter": - JsonSerializer.Serialize(writer, value, typeof(WordDelimiterTokenFilter), options); + case "hyphenation_decompounder": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter), options); return; - case "word_delimiter_graph": - JsonSerializer.Serialize(writer, value, typeof(WordDelimiterGraphTokenFilter), options); + case "icu_collation": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter), options); return; - case "uppercase": - JsonSerializer.Serialize(writer, value, typeof(UppercaseTokenFilter), options); + case "icu_folding": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter), options); return; - case "unique": - JsonSerializer.Serialize(writer, value, typeof(UniqueTokenFilter), options); + case "icu_normalizer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter), options); return; - case "truncate": - JsonSerializer.Serialize(writer, value, typeof(TruncateTokenFilter), options); + case "icu_transform": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter), options); return; - case "trim": - JsonSerializer.Serialize(writer, value, typeof(TrimTokenFilter), options); + case "keep_types": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter), options); return; - case "synonym": - JsonSerializer.Serialize(writer, value, typeof(SynonymTokenFilter), options); + case "keep": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter), options); return; - case "synonym_graph": - JsonSerializer.Serialize(writer, value, typeof(SynonymGraphTokenFilter), options); + case "keyword_marker": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter), options); return; - case "stop": - JsonSerializer.Serialize(writer, value, typeof(StopTokenFilter), options); + case "kstem": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter), options); return; - case "stemmer": - JsonSerializer.Serialize(writer, value, typeof(StemmerTokenFilter), options); + case "kuromoji_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter), options); return; - case "stemmer_override": - JsonSerializer.Serialize(writer, value, typeof(StemmerOverrideTokenFilter), options); + case "kuromoji_readingform": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter), options); return; - case "snowball": - JsonSerializer.Serialize(writer, value, typeof(SnowballTokenFilter), options); + case "kuromoji_stemmer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter), options); return; - case "shingle": - JsonSerializer.Serialize(writer, value, typeof(ShingleTokenFilter), options); + case "length": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter), options); return; - case "reverse": - JsonSerializer.Serialize(writer, value, typeof(ReverseTokenFilter), options); + case "limit": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter), options); return; - case "remove_duplicates": - JsonSerializer.Serialize(writer, value, typeof(RemoveDuplicatesTokenFilter), options); + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter), options); return; - case "predicate_token_filter": - JsonSerializer.Serialize(writer, value, typeof(PredicateTokenFilter), options); + case "multiplexer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter), options); return; - case "porter_stem": - JsonSerializer.Serialize(writer, value, typeof(PorterStemTokenFilter), options); + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter), options); return; - case "pattern_replace": - JsonSerializer.Serialize(writer, value, typeof(PatternReplaceTokenFilter), options); + case "nori_part_of_speech": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter), options); return; case "pattern_capture": - JsonSerializer.Serialize(writer, value, typeof(PatternCaptureTokenFilter), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter), options); return; - case "nori_part_of_speech": - JsonSerializer.Serialize(writer, value, typeof(NoriPartOfSpeechTokenFilter), options); + case "pattern_replace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter), options); return; - case "ngram": - JsonSerializer.Serialize(writer, value, typeof(NGramTokenFilter), options); + case "phonetic": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter), options); return; - case "multiplexer": - JsonSerializer.Serialize(writer, value, typeof(MultiplexerTokenFilter), options); + case "porter_stem": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter), options); return; - case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenFilter), options); + case "predicate_token_filter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter), options); return; - case "limit": - JsonSerializer.Serialize(writer, value, typeof(LimitTokenCountTokenFilter), options); + case "remove_duplicates": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter), options); return; - case "length": - JsonSerializer.Serialize(writer, value, typeof(LengthTokenFilter), options); + case "reverse": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter), options); return; - case "kstem": - JsonSerializer.Serialize(writer, value, typeof(KStemTokenFilter), options); + case "shingle": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter), options); return; - case "keyword_marker": - JsonSerializer.Serialize(writer, value, typeof(KeywordMarkerTokenFilter), options); + case "snowball": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter), options); return; - case "keep": - JsonSerializer.Serialize(writer, value, typeof(KeepWordsTokenFilter), options); + case "stemmer_override": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter), options); return; - case "keep_types": - JsonSerializer.Serialize(writer, value, typeof(KeepTypesTokenFilter), options); + case "stemmer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter), options); return; - case "hyphenation_decompounder": - JsonSerializer.Serialize(writer, value, typeof(HyphenationDecompounderTokenFilter), options); + case "stop": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter), options); return; - case "hunspell": - JsonSerializer.Serialize(writer, value, typeof(HunspellTokenFilter), options); + case "synonym_graph": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter), options); return; - case "fingerprint": - JsonSerializer.Serialize(writer, value, typeof(FingerprintTokenFilter), options); + case "synonym": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter), options); return; - case "elision": - JsonSerializer.Serialize(writer, value, typeof(ElisionTokenFilter), options); + case "trim": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter), options); return; - case "edge_ngram": - JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenFilter), options); + case "truncate": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter), options); return; - case "delimited_payload": - JsonSerializer.Serialize(writer, value, typeof(DelimitedPayloadTokenFilter), options); + case "unique": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter), options); return; - case "condition": - JsonSerializer.Serialize(writer, value, typeof(ConditionTokenFilter), options); + case "uppercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter), options); return; - case "common_grams": - JsonSerializer.Serialize(writer, value, typeof(CommonGramsTokenFilter), options); + case "word_delimiter_graph": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter), options); return; - case "asciifolding": - JsonSerializer.Serialize(writer, value, typeof(AsciiFoldingTokenFilter), options); + case "word_delimiter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter), options); return; default: var type = value.GetType(); @@ -485,5 +485,5 @@ public override void Write(Utf8JsonWriter writer, ITokenFilter value, JsonSerial [JsonConverter(typeof(TokenFilterInterfaceConverter))] public partial interface ITokenFilter { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs index 5a34f298d3e..8ea8d16b137 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs @@ -66,47 +66,47 @@ public TokenizersDescriptor() : base(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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => 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) => AssignVariant(tokenizerName, null); + public TokenizersDescriptor Whitespace(string tokenizerName, Action configure) => AssignVariant(tokenizerName, configure); public TokenizersDescriptor Whitespace(string tokenizerName, WhitespaceTokenizer whitespaceTokenizer) => AssignVariant(tokenizerName, whitespaceTokenizer); } @@ -124,34 +124,34 @@ public override ITokenizer Read(ref Utf8JsonReader reader, Type typeToConvert, J switch (type) { + case "char_group": + return JsonSerializer.Deserialize(ref reader, options); + case "edge_ngram": + return JsonSerializer.Deserialize(ref reader, options); case "icu_tokenizer": - return JsonSerializer.Deserialize(ref reader, options); - case "pattern": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "lowercase": + return JsonSerializer.Deserialize(ref reader, options); + case "ngram": + return JsonSerializer.Deserialize(ref reader, options); + case "nori_tokenizer": + return JsonSerializer.Deserialize(ref reader, options); + case "path_hierarchy": + return JsonSerializer.Deserialize(ref reader, options); + case "pattern": + return JsonSerializer.Deserialize(ref reader, options); + case "standard": + return JsonSerializer.Deserialize(ref reader, options); + case "uax_url_email": + return JsonSerializer.Deserialize(ref reader, options); + case "whitespace": + return JsonSerializer.Deserialize(ref reader, options); default: ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ITokenizer)); return null; @@ -168,47 +168,47 @@ public override void Write(Utf8JsonWriter writer, ITokenizer value, JsonSerializ switch (value.Type) { + case "char_group": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer), options); + return; + case "edge_ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer), options); + return; case "icu_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(IcuTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer), options); return; - case "pattern": - JsonSerializer.Serialize(writer, value, typeof(PatternTokenizer), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer), options); return; case "kuromoji_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(KuromojiTokenizer), options); - return; - case "whitespace": - JsonSerializer.Serialize(writer, value, typeof(WhitespaceTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer), options); return; - case "uax_url_email": - JsonSerializer.Serialize(writer, value, typeof(UaxEmailUrlTokenizer), options); + case "letter": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer), options); return; - case "standard": - JsonSerializer.Serialize(writer, value, typeof(StandardTokenizer), options); + case "lowercase": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer), options); return; - case "path_hierarchy": - JsonSerializer.Serialize(writer, value, typeof(PathHierarchyTokenizer), options); + case "ngram": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer), options); return; case "nori_tokenizer": - JsonSerializer.Serialize(writer, value, typeof(NoriTokenizer), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer), options); return; - case "ngram": - JsonSerializer.Serialize(writer, value, typeof(NGramTokenizer), options); - return; - case "lowercase": - JsonSerializer.Serialize(writer, value, typeof(LowercaseTokenizer), options); + case "path_hierarchy": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer), options); return; - case "letter": - JsonSerializer.Serialize(writer, value, typeof(LetterTokenizer), options); + case "pattern": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordTokenizer), options); + case "standard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer), options); return; - case "edge_ngram": - JsonSerializer.Serialize(writer, value, typeof(EdgeNGramTokenizer), options); + case "uax_url_email": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer), options); return; - case "char_group": - JsonSerializer.Serialize(writer, value, typeof(CharGroupTokenizer), options); + case "whitespace": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer), options); return; default: var type = value.GetType(); @@ -221,5 +221,5 @@ public override void Write(Utf8JsonWriter writer, ITokenizer value, JsonSerializ [JsonConverter(typeof(TokenizerInterfaceConverter))] public partial interface ITokenizer { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs index e1066d5241f..fea04ac53fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("trim"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs index b91335e93f4..ce8dda3b294 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("truncate"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs index c6a76716b56..b51b1851ad8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("uax_url_email"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs index a41a21b947a..c6dc02b2ffa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("unique"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs index 6fe4c2fb1ef..225c48188d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("uppercase"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs index 2015785b04b..c7a4c564cc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs @@ -57,10 +57,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue("whitespace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs index 29ded0ca48a..720ceb36794 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs @@ -73,10 +73,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("type"); writer.WriteStringValue("whitespace"); - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs index c621584507d..fdf70c03155 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs @@ -44,7 +44,6 @@ public sealed partial class WordDelimiterGraphTokenFilter : ITokenFilter [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; } @@ -234,10 +233,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreKeywordsValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (ProtectedWordsValue is not null) @@ -284,10 +283,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TypeTablePathValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs index 7c7dc7ea3a9..b58d41ff412 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs @@ -40,7 +40,6 @@ public sealed partial class WordDelimiterTokenFilter : ITokenFilter [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; } @@ -204,10 +203,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(GenerateWordPartsValue.Value); } - if (PreserveOriginalValue is not null) + if (PreserveOriginalValue.HasValue) { writer.WritePropertyName("preserve_original"); - JsonSerializer.Serialize(writer, PreserveOriginalValue, options); + writer.WriteBooleanValue(PreserveOriginalValue.Value); } if (ProtectedWordsValue is not null) @@ -254,10 +253,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TypeTablePathValue); } - if (VersionValue is not null) + if (!string.IsNullOrEmpty(VersionValue)) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteStringValue(VersionValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs index 964f6a44071..0f15a14c2ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs @@ -29,22 +29,13 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch; public sealed partial class AsyncSearch { - [JsonInclude, JsonPropertyName("_clusters")] - public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; } - [JsonInclude, JsonPropertyName("_scroll_id")] - public Elastic.Clients.Elasticsearch.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.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.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; } [JsonInclude, JsonPropertyName("fields")] public IReadOnlyDictionary? Fields { get; init; } [JsonInclude, JsonPropertyName("hits")] @@ -61,6 +52,14 @@ public sealed partial class AsyncSearch public string? PitId { get; init; } [JsonInclude, JsonPropertyName("profile")] public Elastic.Clients.Elasticsearch.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.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.ShardStatistics Shards { get; init; } [JsonInclude, JsonPropertyName("suggest")] public Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary? Suggest { get; init; } [JsonInclude, JsonPropertyName("terminated_early")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs index dd80e84263d..dd2a8b0060d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class ByteSize : Union { - public ByteSize(long byteSize) : base(byteSize) + public ByteSize(long Bytesize) : base(Bytesize) { } - public ByteSize(string byteSize) : base(byteSize) + public ByteSize(string Bytesize) : base(Bytesize) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs index e7a0fdc3f90..17bced9a419 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs @@ -59,6 +59,12 @@ public sealed partial class CharFilterTypes [JsonInclude, JsonPropertyName("built_in_tokenizers")] public IReadOnlyCollection BuiltInTokenizers { get; init; } + /// + /// Contains statistics about character filter types used in selected nodes. + /// + [JsonInclude, JsonPropertyName("char_filter_types")] + public IReadOnlyCollection CharFilterTypes2 { get; init; } + /// /// Contains statistics about token filter types used in selected nodes. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs new file mode 100644 index 00000000000..65848f2a1e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class ComponentTemplate +{ + [JsonInclude, JsonPropertyName("component_template")] + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode ComponentTemplateNode { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs new file mode 100644 index 00000000000..c59818c659b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class ComponentTemplateNode +{ + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary Template { get; init; } + [JsonInclude, JsonPropertyName("version")] + public long? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs new file mode 100644 index 00000000000..62b3163daa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class ComponentTemplateSummary +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyDictionary? Aliases { get; init; } + [JsonInclude, JsonPropertyName("lifecycle")] + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + [JsonInclude, JsonPropertyName("mappings")] + public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? Mappings { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + [JsonInclude, JsonPropertyName("settings")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings))] + 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/_Generated/Types/ClusterDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs index 535f945911e..84645104030 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs @@ -29,12 +29,12 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class ClusterDetails { - [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } [JsonInclude, JsonPropertyName("failures")] public IReadOnlyCollection? Failures { get; init; } [JsonInclude, JsonPropertyName("indices")] public string Indices { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } [JsonInclude, JsonPropertyName("status")] public Elastic.Clients.Elasticsearch.ClusterSearchStatus Status { get; init; } [JsonInclude, JsonPropertyName("timed_out")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs index ed04a72839a..94ff7034f3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs @@ -19,7 +19,6 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport.Products.Elasticsearch; using System; using System.Collections.Generic; using System.Linq.Expressions; @@ -28,8 +27,18 @@ namespace Elastic.Clients.Elasticsearch.Core.Bulk; -public abstract partial class ResponseItem +public partial class ResponseItem { + /// + /// Contains additional information about the failed operation.
The parameter is only returned for failed operations.
+ ///
+ [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("forced_refresh")] + public bool? ForcedRefresh { get; init; } + [JsonInclude, JsonPropertyName("get")] + public Elastic.Clients.Elasticsearch.InlineGet>? Get { get; init; } + /// /// The document ID associated with the operation. /// @@ -48,6 +57,12 @@ public abstract partial class ResponseItem [JsonInclude, JsonPropertyName("_primary_term")] public long? PrimaryTerm { get; init; } + /// + /// Result of the operation.
Successful values are `created`, `deleted`, and `updated`.
+ ///
+ [JsonInclude, JsonPropertyName("result")] + public string? Result { get; init; } + /// /// The sequence number assigned to the document for the operation.
Sequence numbers are used to ensure an older version of a document doesn’t overwrite a newer version.
///
@@ -60,31 +75,15 @@ public abstract partial class ResponseItem [JsonInclude, JsonPropertyName("_shards")] public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } - /// - /// The document version associated with the operation.
The document version is incremented each time the document is updated.
- ///
- [JsonInclude, JsonPropertyName("_version")] - public long? Version { get; init; } - - /// - /// Contains additional information about the failed operation.
The parameter is only returned for failed operations.
- ///
- [JsonInclude, JsonPropertyName("error")] - public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } - [JsonInclude, JsonPropertyName("forced_refresh")] - public bool? ForcedRefresh { get; init; } - [JsonInclude, JsonPropertyName("get")] - public Elastic.Clients.Elasticsearch.InlineGet? Get { get; init; } - - /// - /// Result of the operation.
Successful values are `created`, `deleted`, and `updated`.
- ///
- [JsonInclude, JsonPropertyName("result")] - public string? Result { get; init; } - /// /// HTTP status code returned for the operation. /// [JsonInclude, JsonPropertyName("status")] public int Status { get; init; } + + /// + /// The document version associated with the operation.
The document version is incremented each time the document is updated.
+ ///
+ [JsonInclude, JsonPropertyName("_version")] + public long? Version { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs index 44378f44ce3..2e7722c3218 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs @@ -30,13 +30,17 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; +/// +/// Text or location that we want similar documents for or a lookup to a document's field for the text. +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Context : Union { - public Context(string category) : base(category) + public Context(string Category) : base(Category) { } - public Context(Elastic.Clients.Elasticsearch.GeoLocation location) : base(location) + public Context(Elastic.Clients.Elasticsearch.GeoLocation Location) : base(Location) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs index e6bf3fddf25..ba84e5a9626 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs @@ -39,7 +39,8 @@ public sealed partial class FieldCapability /// 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.Indices? Indices { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? 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. @@ -57,25 +58,27 @@ public sealed partial class FieldCapability /// 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; } + 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.Indices? NonAggregatableIndices { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? 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; } + 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.Indices? NonSearchableIndices { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? NonSearchableIndices { get; init; } /// /// Whether this field is indexed for search on all indices. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs index 75cc69175b5..a831345349e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs @@ -29,6 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Core.Get; public sealed partial class GetResult { + [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.FieldValues? Fields { get; init; } + [JsonInclude, JsonPropertyName("found")] + public bool Found { get; init; } [JsonInclude, JsonPropertyName("_id")] public string Id { get; init; } [JsonInclude, JsonPropertyName("_index")] @@ -40,12 +44,7 @@ public sealed partial class GetResult [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.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/_Generated/Types/Core/HealthReport/Diagnosis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs new file mode 100644 index 00000000000..8199bac4cc7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class Diagnosis +{ + [JsonInclude, JsonPropertyName("action")] + public string Action { get; init; } + [JsonInclude, JsonPropertyName("affected_resources")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources AffectedResources { get; init; } + [JsonInclude, JsonPropertyName("cause")] + public string Cause { get; init; } + [JsonInclude, JsonPropertyName("help_url")] + public string HelpUrl { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs new file mode 100644 index 00000000000..389fd578f42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class DiagnosisAffectedResources +{ + [JsonInclude, JsonPropertyName("feature_states")] + public IReadOnlyCollection? FeatureStates { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Indices { get; init; } + [JsonInclude, JsonPropertyName("nodes")] + public IReadOnlyCollection? Nodes { get; init; } + [JsonInclude, JsonPropertyName("slm_policies")] + public IReadOnlyCollection? SlmPolicies { get; init; } + [JsonInclude, JsonPropertyName("snapshot_repositories")] + public IReadOnlyCollection? SnapshotRepositories { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs new file mode 100644 index 00000000000..94dd2069b99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// DISK +/// +public sealed partial class DiskIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs new file mode 100644 index 00000000000..987522cb0e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class DiskIndicatorDetails +{ + [JsonInclude, JsonPropertyName("indices_with_readonly_block")] + public long IndicesWithReadonlyBlock { get; init; } + [JsonInclude, JsonPropertyName("nodes_over_flood_stage_watermark")] + public long NodesOverFloodStageWatermark { get; init; } + [JsonInclude, JsonPropertyName("nodes_over_high_watermark")] + public long NodesOverHighWatermark { get; init; } + [JsonInclude, JsonPropertyName("nodes_with_enough_disk_space")] + public long NodesWithEnoughDiskSpace { get; init; } + [JsonInclude, JsonPropertyName("nodes_with_unknown_disk_status")] + public long NodesWithUnknownDiskStatus { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs new file mode 100644 index 00000000000..a0b048add39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// ILM +/// +public sealed partial class IlmIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs new file mode 100644 index 00000000000..27afca3f702 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class IlmIndicatorDetails +{ + [JsonInclude, JsonPropertyName("ilm_status")] + public Elastic.Clients.Elasticsearch.LifecycleOperationMode IlmStatus { get; init; } + [JsonInclude, JsonPropertyName("policies")] + public long Policies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs new file mode 100644 index 00000000000..47efec4fe6f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class Impact +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("impact_areas")] + public IReadOnlyCollection ImpactAreas { get; init; } + [JsonInclude, JsonPropertyName("severity")] + public int Severity { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcardsConverter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcardsConverter.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs index 1c7a0abf5a1..57ad299b3fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcardsConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs @@ -17,19 +17,20 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Core; using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.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; +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed class ExpandWildcardsConverter : SingleOrManyCollectionConverter +public sealed partial class IndicatorNode { + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string? NodeId { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs new file mode 100644 index 00000000000..bf8620279de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class Indicators +{ + [JsonInclude, JsonPropertyName("disk")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator? Disk { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator? Ilm { get; init; } + [JsonInclude, JsonPropertyName("master_is_stable")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator? MasterIsStable { get; init; } + [JsonInclude, JsonPropertyName("repository_integrity")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator? RepositoryIntegrity { get; init; } + [JsonInclude, JsonPropertyName("shards_availability")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator? ShardsAvailability { get; init; } + [JsonInclude, JsonPropertyName("shards_capacity")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator? ShardsCapacity { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator? Slm { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs new file mode 100644 index 00000000000..e3b581d3eb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// MASTER_IS_STABLE +/// +public sealed partial class MasterIsStableIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs new file mode 100644 index 00000000000..ee9d1cc6dbe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class MasterIsStableIndicatorClusterFormationNode +{ + [JsonInclude, JsonPropertyName("cluster_formation_message")] + public string ClusterFormationMessage { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs new file mode 100644 index 00000000000..b1fe8a040b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class MasterIsStableIndicatorDetails +{ + [JsonInclude, JsonPropertyName("cluster_formation")] + public IReadOnlyCollection? ClusterFormation { get; init; } + [JsonInclude, JsonPropertyName("current_master")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode CurrentMaster { get; init; } + [JsonInclude, JsonPropertyName("exception_fetching_history")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory? ExceptionFetchingHistory { get; init; } + [JsonInclude, JsonPropertyName("recent_masters")] + public IReadOnlyCollection RecentMasters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregateOrderConverter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregateOrderConverter.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs index 6540f0fcf98..28d5bd932f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregateOrderConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs @@ -17,19 +17,20 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Core; using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.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; +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed class AggregateOrderConverter : SingleOrManyCollectionConverter> +public sealed partial class MasterIsStableIndicatorExceptionFetchingHistory { + [JsonInclude, JsonPropertyName("message")] + public string Message { get; init; } + [JsonInclude, JsonPropertyName("stack_trace")] + public string StackTrace { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs new file mode 100644 index 00000000000..b0aa9374480 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// REPOSITORY_INTEGRITY +/// +public sealed partial class RepositoryIntegrityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs new file mode 100644 index 00000000000..bb4c9ae83b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class RepositoryIntegrityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("corrupted")] + public IReadOnlyCollection? Corrupted { get; init; } + [JsonInclude, JsonPropertyName("corrupted_repositories")] + public long? CorruptedRepositories { get; init; } + [JsonInclude, JsonPropertyName("total_repositories")] + public long? TotalRepositories { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs new file mode 100644 index 00000000000..05a9717ab1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// SHARDS_AVAILABILITY +/// +public sealed partial class ShardsAvailabilityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs new file mode 100644 index 00000000000..78443b36fab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class ShardsAvailabilityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("creating_primaries")] + public long CreatingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("initializing_primaries")] + public long InitializingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("initializing_replicas")] + public long InitializingReplicas { get; init; } + [JsonInclude, JsonPropertyName("restarting_primaries")] + public long RestartingPrimaries { get; init; } + [JsonInclude, JsonPropertyName("restarting_replicas")] + public long RestartingReplicas { get; init; } + [JsonInclude, JsonPropertyName("started_primaries")] + public long StartedPrimaries { get; init; } + [JsonInclude, JsonPropertyName("started_replicas")] + public long StartedReplicas { get; init; } + [JsonInclude, JsonPropertyName("unassigned_primaries")] + public long UnassignedPrimaries { get; init; } + [JsonInclude, JsonPropertyName("unassigned_replicas")] + public long UnassignedReplicas { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs new file mode 100644 index 00000000000..5bd41d86ba9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// SHARDS_CAPACITY +/// +public sealed partial class ShardsCapacityIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs new file mode 100644 index 00000000000..c3fdd0dfb3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class ShardsCapacityIndicatorDetails +{ + [JsonInclude, JsonPropertyName("data")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail Data { get; init; } + [JsonInclude, JsonPropertyName("frozen")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail Frozen { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs new file mode 100644 index 00000000000..4ef74d5717a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class ShardsCapacityIndicatorTierDetail +{ + [JsonInclude, JsonPropertyName("current_used_shards")] + public int? CurrentUsedShards { get; init; } + [JsonInclude, JsonPropertyName("max_shards_in_cluster")] + public int MaxShardsInCluster { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs new file mode 100644 index 00000000000..7247adddb53 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +/// +/// SLM +/// +public sealed partial class SlmIndicator +{ + [JsonInclude, JsonPropertyName("details")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails? Details { get; init; } + [JsonInclude, JsonPropertyName("diagnosis")] + public IReadOnlyCollection? Diagnosis { get; init; } + [JsonInclude, JsonPropertyName("impacts")] + public IReadOnlyCollection? Impacts { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus Status { get; init; } + [JsonInclude, JsonPropertyName("symptom")] + public string Symptom { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs new file mode 100644 index 00000000000..3e68e484cee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class SlmIndicatorDetails +{ + [JsonInclude, JsonPropertyName("policies")] + public long Policies { get; init; } + [JsonInclude, JsonPropertyName("slm_status")] + public Elastic.Clients.Elasticsearch.LifecycleOperationMode SlmStatus { get; init; } + [JsonInclude, JsonPropertyName("unhealthy_policies")] + public Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies UnhealthyPolicies { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs new file mode 100644 index 00000000000..95faa59e1c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +public sealed partial class SlmIndicatorUnhealthyPolicies +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("invocations_since_last_success")] + public IReadOnlyDictionary? InvocationsSinceLastSuccess { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs index d29b1c04386..e0ebbbe017b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs @@ -29,10 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Core.MGet; public sealed partial class MultiGetError { + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause Error { get; init; } [JsonInclude, JsonPropertyName("_id")] public string Id { get; init; } [JsonInclude, JsonPropertyName("_index")] public string Index { get; init; } - [JsonInclude, JsonPropertyName("error")] - public Elastic.Clients.Elasticsearch.ErrorCause Error { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs index e9e22af0acb..4552a7f8d4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs @@ -41,18 +41,18 @@ public sealed partial class MultiGetOperation [JsonInclude, JsonPropertyName("_index")] public Elastic.Clients.Elasticsearch.IndexName? Index { get; set; } - /// - /// If `false`, excludes all _source fields. - /// - [JsonInclude, JsonPropertyName("_source")] - public Elastic.Clients.Elasticsearch.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.Routing? Routing { get; set; } + /// + /// If `false`, excludes all _source fields. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } + /// /// The stored fields you want to retrieve. /// @@ -64,6 +64,124 @@ public sealed partial class MultiGetOperation public Elastic.Clients.Elasticsearch.VersionType? VersionType { get; set; } } +public sealed partial class MultiGetOperationDescriptor : SerializableDescriptor> +{ + internal MultiGetOperationDescriptor(Action> configure) => configure.Invoke(this); + + public MultiGetOperationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Id IdValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } + private long? VersionValue { get; set; } + private Elastic.Clients.Elasticsearch.VersionType? VersionTypeValue { get; set; } + + /// + /// The unique document ID. + /// + public MultiGetOperationDescriptor Id(Elastic.Clients.Elasticsearch.Id id) + { + IdValue = id; + return Self; + } + + /// + /// The index that contains the document. + /// + public MultiGetOperationDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? index) + { + IndexValue = index; + 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.Routing? routing) + { + RoutingValue = routing; + return Self; + } + + /// + /// If `false`, excludes all _source fields. + /// + public MultiGetOperationDescriptor Source(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? source) + { + SourceValue = source; + return Self; + } + + /// + /// The stored fields you want to retrieve. + /// + public MultiGetOperationDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fields? storedFields) + { + StoredFieldsValue = storedFields; + return Self; + } + + public MultiGetOperationDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + public MultiGetOperationDescriptor VersionType(Elastic.Clients.Elasticsearch.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 (RoutingValue is not null) + { + writer.WritePropertyName("routing"); + JsonSerializer.Serialize(writer, RoutingValue, options); + } + + if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + if (StoredFieldsValue is not null) + { + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + if (VersionTypeValue is not null) + { + writer.WritePropertyName("version_type"); + JsonSerializer.Serialize(writer, VersionTypeValue, options); + } + + writer.WriteEndObject(); + } +} + public sealed partial class MultiGetOperationDescriptor : SerializableDescriptor { internal MultiGetOperationDescriptor(Action configure) => configure.Invoke(this); @@ -166,10 +284,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, StoredFieldsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs index 2e8f80e0748..48bf0448faf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs @@ -29,14 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; public sealed partial class MultiSearchItem { - [JsonInclude, JsonPropertyName("_clusters")] - public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; } - [JsonInclude, JsonPropertyName("_scroll_id")] - public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } - [JsonInclude, JsonPropertyName("_shards")] - public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } [JsonInclude, JsonPropertyName("aggregations")] public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("_clusters")] + public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; } [JsonInclude, JsonPropertyName("fields")] public IReadOnlyDictionary? Fields { get; init; } [JsonInclude, JsonPropertyName("hits")] @@ -49,6 +45,10 @@ public sealed partial class MultiSearchItem public string? PitId { get; init; } [JsonInclude, JsonPropertyName("profile")] public Elastic.Clients.Elasticsearch.Core.Search.Profile? Profile { get; init; } + [JsonInclude, JsonPropertyName("_scroll_id")] + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } [JsonInclude, JsonPropertyName("status")] public int? Status { get; init; } [JsonInclude, JsonPropertyName("suggest")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs index 7dc38f2e201..a3f21bdd0fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs @@ -33,7 +33,37 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve { if (reader.TokenType != JsonTokenType.StartObject) throw new JsonException("Unexpected JSON detected."); - var variant = new MultisearchBody(); + IReadOnlyDictionary? aggregations = default; + Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse = default; + IReadOnlyCollection? docvalueFields = default; + bool? explain = default; + IReadOnlyDictionary? ext = default; + IReadOnlyCollection? fields = default; + int? from = default; + Elastic.Clients.Elasticsearch.Core.Search.Highlight? highlight = default; + IReadOnlyCollection>? indicesBoost = default; + IReadOnlyCollection? knn = default; + double? minScore = default; + Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? pit = default; + Elastic.Clients.Elasticsearch.QueryDsl.Query? postFilter = default; + bool? profile = default; + Elastic.Clients.Elasticsearch.QueryDsl.Query? query = default; + IReadOnlyCollection? rescore = default; + IReadOnlyDictionary? runtimeMappings = default; + IReadOnlyDictionary? scriptFields = default; + IReadOnlyCollection? searchAfter = default; + bool? seqNoPrimaryTerm = default; + int? size = default; + IReadOnlyCollection? sort = default; + Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? source = default; + IReadOnlyCollection? stats = default; + Elastic.Clients.Elasticsearch.Fields? storedFields = default; + Elastic.Clients.Elasticsearch.Core.Search.Suggester? suggest = default; + long? terminateAfter = default; + string? timeout = default; + bool? trackScores = default; + Elastic.Clients.Elasticsearch.Core.Search.TrackHits? trackTotalHits = default; + bool? version = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType == JsonTokenType.PropertyName) @@ -41,2465 +71,321 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve var property = reader.GetString(); if (property == "aggregations" || property == "aggs") { - variant.Aggregations = JsonSerializer.Deserialize(ref reader, options); + aggregations = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "collapse") { - variant.Collapse = JsonSerializer.Deserialize(ref reader, options); + collapse = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "docvalue_fields") { - variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options); + docvalueFields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "explain") { - variant.Explain = JsonSerializer.Deserialize(ref reader, options); + explain = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "ext") { - variant.Ext = JsonSerializer.Deserialize?>(ref reader, options); + ext = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "fields") { - variant.Fields = JsonSerializer.Deserialize?>(ref reader, options); + fields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "from") { - variant.From = JsonSerializer.Deserialize(ref reader, options); + from = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "highlight") { - variant.Highlight = JsonSerializer.Deserialize(ref reader, options); + highlight = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "indices_boost") { - variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); + indicesBoost = JsonSerializer.Deserialize>?>(ref reader, options); continue; } if (property == "knn") { - variant.Knn = JsonSerializer.Deserialize?>(ref reader, options); + knn = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "min_score") { - variant.MinScore = JsonSerializer.Deserialize(ref reader, options); + minScore = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "pit") { - variant.Pit = JsonSerializer.Deserialize(ref reader, options); + pit = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "post_filter") { - variant.PostFilter = JsonSerializer.Deserialize(ref reader, options); + postFilter = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "profile") { - variant.Profile = JsonSerializer.Deserialize(ref reader, options); + profile = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "query") { - variant.Query = JsonSerializer.Deserialize(ref reader, options); + query = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "rescore") { - variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options); + rescore = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "runtime_mappings") { - variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + runtimeMappings = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "script_fields") { - variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options); + scriptFields = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "search_after") { - variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + searchAfter = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "seq_no_primary_term") { - variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); + seqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "size") { - variant.Size = JsonSerializer.Deserialize(ref reader, options); + size = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "sort") { - variant.Sort = JsonSerializer.Deserialize?>(ref reader, options); + sort = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "_source") { - variant.Source = JsonSerializer.Deserialize(ref reader, options); + source = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "stats") { - variant.Stats = JsonSerializer.Deserialize?>(ref reader, options); + stats = JsonSerializer.Deserialize?>(ref reader, options); continue; } if (property == "stored_fields") { - variant.StoredFields = JsonSerializer.Deserialize(ref reader, options); + storedFields = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "suggest") { - variant.Suggest = JsonSerializer.Deserialize(ref reader, options); + suggest = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "terminate_after") { - variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options); + terminateAfter = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "timeout") { - variant.Timeout = JsonSerializer.Deserialize(ref reader, options); + timeout = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "track_scores") { - variant.TrackScores = JsonSerializer.Deserialize(ref reader, options); + trackScores = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "track_total_hits") { - variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options); + trackTotalHits = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "version") { - variant.Version = JsonSerializer.Deserialize(ref reader, options); + version = JsonSerializer.Deserialize(ref reader, options); continue; } } } - return variant; + return new MultisearchBody { Aggregations = aggregations, Collapse = collapse, DocvalueFields = docvalueFields, Explain = explain, Ext = ext, Fields = fields, From = from, Highlight = highlight, IndicesBoost = indicesBoost, Knn = knn, MinScore = minScore, Pit = pit, PostFilter = postFilter, Profile = profile, Query = query, Rescore = rescore, RuntimeMappings = runtimeMappings, ScriptFields = scriptFields, SearchAfter = searchAfter, SeqNoPrimaryTerm = seqNoPrimaryTerm, Size = size, Sort = sort, Source = source, Stats = stats, StoredFields = storedFields, Suggest = suggest, TerminateAfter = terminateAfter, Timeout = timeout, TrackScores = trackScores, TrackTotalHits = trackTotalHits, Version = version }; } public override void Write(Utf8JsonWriter writer, MultisearchBody 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.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.Source is not null) - { - writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, value.Source, 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(); + throw new NotImplementedException("'MultisearchBody' is a readonly type, used only on responses and does not support being written to JSON."); } } [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.Core.Search.SourceConfig? Source { get; set; } - public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } - public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; } + public IReadOnlyDictionary? Aggregations { get; init; } + public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; init; } /// /// 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; } + public IReadOnlyCollection? DocvalueFields { get; init; } /// /// If true, returns detailed information about score computation as part of a hit. /// - public bool? Explain { get; set; } + public bool? Explain { get; init; } /// /// Configuration of search extensions defined by Elasticsearch plugins. /// - public IDictionary? Ext { get; set; } + public IReadOnlyDictionary? Ext { get; init; } /// /// 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; } + public IReadOnlyCollection? Fields { get; init; } /// /// 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.Core.Search.Highlight? Highlight { get; set; } + public int? From { get; init; } + public Elastic.Clients.Elasticsearch.Core.Search.Highlight? Highlight { get; init; } /// /// Boosts the _score of documents from specified indices. /// - public ICollection>? IndicesBoost { get; set; } + public IReadOnlyCollection>? IndicesBoost { get; init; } /// /// Defines the approximate kNN search to run. /// - public ICollection? Knn { get; set; } + public IReadOnlyCollection? Knn { get; init; } /// /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
///
- public double? MinScore { get; set; } + public double? MinScore { get; init; } /// /// 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.Core.Search.PointInTimeReference? Pit { get; set; } - public Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilter { get; set; } - public bool? Profile { get; set; } + public Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? Pit { get; init; } + public Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilter { get; init; } + public bool? Profile { get; init; } /// /// Defines the search definition using the Query DSL. /// - public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } - public ICollection? Rescore { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; init; } + public IReadOnlyCollection? Rescore { get; init; } /// /// 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; } + public IReadOnlyDictionary? RuntimeMappings { get; init; } /// /// Retrieve a script evaluation (based on different fields) for each hit. /// - public IDictionary? ScriptFields { get; set; } - public ICollection? SearchAfter { get; set; } + public IReadOnlyDictionary? ScriptFields { get; init; } + public IReadOnlyCollection? SearchAfter { get; init; } /// /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
///
- public bool? SeqNoPrimaryTerm { get; set; } + public bool? SeqNoPrimaryTerm { get; init; } /// /// 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; } + public int? Size { get; init; } + public IReadOnlyCollection? Sort { get; init; } + + /// + /// 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.Core.Search.SourceConfig? Source { get; init; } /// /// 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; } + public IReadOnlyCollection? Stats { get; init; } /// /// 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.Fields? StoredFields { get; set; } - public Elastic.Clients.Elasticsearch.Core.Search.Suggester? Suggest { get; set; } + public Elastic.Clients.Elasticsearch.Fields? StoredFields { get; init; } + public Elastic.Clients.Elasticsearch.Core.Search.Suggester? Suggest { get; init; } /// /// 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; } + public long? TerminateAfter { get; init; } /// /// 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; } + public string? Timeout { get; init; } /// /// If true, calculate and return document scores, even if the scores are not used for sorting. /// - public bool? TrackScores { get; set; } + public bool? TrackScores { get; init; } /// /// 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.Core.Search.TrackHits? TrackTotalHits { get; set; } + public Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHits { get; init; } /// /// 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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action> AggregationsDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.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 bool? ExplainValue { get; set; } - private IDictionary? ExtValue { get; set; } - private ICollection? FieldsValue { get; set; } - private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } - private Action> FieldsDescriptorAction { get; set; } - private Action>[] FieldsDescriptorActions { get; set; } - private int? FromValue { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } - private ICollection>? IndicesBoostValue { get; set; } - private ICollection? KnnValue { get; set; } - private KnnQueryDescriptor KnnDescriptor { get; set; } - private Action> KnnDescriptorAction { get; set; } - private Action>[] KnnDescriptorActions { get; set; } - private double? MinScoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action> PostFilterDescriptorAction { get; set; } - private bool? ProfileValue { get; set; } - private Elastic.Clients.Elasticsearch.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 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? SortValue { get; set; } - private SortOptionsDescriptor SortDescriptor { get; set; } - private Action> SortDescriptorAction { get; set; } - private Action>[] SortDescriptorActions { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } - private ICollection? StatsValue { get; set; } - private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } - private Elastic.Clients.Elasticsearch.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.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } - private bool? VersionValue { get; set; } - - public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.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.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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - public MultisearchBodyDescriptor Highlight(Elastic.Clients.Elasticsearch.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; - } - - /// - /// Boosts the _score of documents from specified indices. - /// - public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) - { - IndicesBoostValue = indicesBoost; - 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; - } - - /// - /// 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.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 PostFilter(Elastic.Clients.Elasticsearch.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; - } - - public MultisearchBodyDescriptor Profile(bool? profile = true) - { - ProfileValue = profile; - return Self; - } - - /// - /// Defines the search definition using the Query DSL. - /// - public MultisearchBodyDescriptor Query(Elastic.Clients.Elasticsearch.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; - } - - /// - /// 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; - } - - 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.Core.Search.SourceConfig? source) - { - SourceValue = source; - 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.Fields? storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.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.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.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 (ExplainValue.HasValue) - { - writer.WritePropertyName("explain"); - writer.WriteBooleanValue(ExplainValue.Value); - } - - if (ExtValue is not null) - { - writer.WritePropertyName("ext"); - JsonSerializer.Serialize(writer, ExtValue, 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 (FromValue.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(FromValue.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 Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); - } - else if (HighlightValue is not null) - { - writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, HighlightValue, options); - } - - if (IndicesBoostValue is not null) - { - writer.WritePropertyName("indices_boost"); - JsonSerializer.Serialize(writer, IndicesBoostValue, 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 (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 (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 (ProfileValue.HasValue) - { - writer.WritePropertyName("profile"); - writer.WriteBooleanValue(ProfileValue.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 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 (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 (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 (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.Aggregations.AggregationDictionary? AggregationsValue { get; set; } - private Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; } - private Action AggregationsDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.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 bool? ExplainValue { get; set; } - private IDictionary? ExtValue { get; set; } - private ICollection? FieldsValue { get; set; } - private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; } - private Action FieldsDescriptorAction { get; set; } - private Action[] FieldsDescriptorActions { get; set; } - private int? FromValue { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } - private ICollection>? IndicesBoostValue { get; set; } - private ICollection? KnnValue { get; set; } - private KnnQueryDescriptor KnnDescriptor { get; set; } - private Action KnnDescriptorAction { get; set; } - private Action[] KnnDescriptorActions { get; set; } - private double? MinScoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; } - private Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; } - private Action PitDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; } - private QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; } - private Action PostFilterDescriptorAction { get; set; } - private bool? ProfileValue { get; set; } - private Elastic.Clients.Elasticsearch.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 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? SortValue { get; set; } - private SortOptionsDescriptor SortDescriptor { get; set; } - private Action SortDescriptorAction { get; set; } - private Action[] SortDescriptorActions { get; set; } - private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } - private ICollection? StatsValue { get; set; } - private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } - private Elastic.Clients.Elasticsearch.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.Core.Search.TrackHits? TrackTotalHitsValue { get; set; } - private bool? VersionValue { get; set; } - - public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) - { - AggregationsDescriptor = null; - AggregationsDescriptorAction = null; - AggregationsValue = aggregations; - return Self; - } - - public MultisearchBodyDescriptor Aggregations(Elastic.Clients.Elasticsearch.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.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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - /// - /// 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; - } - - public MultisearchBodyDescriptor Highlight(Elastic.Clients.Elasticsearch.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; - } - - /// - /// Boosts the _score of documents from specified indices. - /// - public MultisearchBodyDescriptor IndicesBoost(ICollection>? indicesBoost) - { - IndicesBoostValue = indicesBoost; - 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; - } - - /// - /// 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.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 PostFilter(Elastic.Clients.Elasticsearch.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; - } - - public MultisearchBodyDescriptor Profile(bool? profile = true) - { - ProfileValue = profile; - return Self; - } - - /// - /// Defines the search definition using the Query DSL. - /// - public MultisearchBodyDescriptor Query(Elastic.Clients.Elasticsearch.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; - } - - /// - /// 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; - } - - 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.Core.Search.SourceConfig? source) - { - SourceValue = source; - 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.Fields? storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.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.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.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 (ExplainValue.HasValue) - { - writer.WritePropertyName("explain"); - writer.WriteBooleanValue(ExplainValue.Value); - } - - if (ExtValue is not null) - { - writer.WritePropertyName("ext"); - JsonSerializer.Serialize(writer, ExtValue, 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 (FromValue.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(FromValue.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 Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); - } - else if (HighlightValue is not null) - { - writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, HighlightValue, options); - } - - if (IndicesBoostValue is not null) - { - writer.WritePropertyName("indices_boost"); - JsonSerializer.Serialize(writer, IndicesBoostValue, 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 (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 (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 (ProfileValue.HasValue) - { - writer.WritePropertyName("profile"); - writer.WriteBooleanValue(ProfileValue.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 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 (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 (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 (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 bool? Version { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs index 92983a6e028..b36d01f74fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs @@ -33,188 +33,26 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; public sealed partial class MultisearchHeader { [JsonInclude, JsonPropertyName("allow_no_indices")] - public bool? AllowNoIndices { get; set; } + public bool? AllowNoIndices { get; init; } [JsonInclude, JsonPropertyName("allow_partial_search_results")] - public bool? AllowPartialSearchResults { get; set; } + public bool? AllowPartialSearchResults { get; init; } [JsonInclude, JsonPropertyName("ccs_minimize_roundtrips")] - public bool? CcsMinimizeRoundtrips { get; set; } + public bool? CcsMinimizeRoundtrips { get; init; } [JsonInclude, JsonPropertyName("expand_wildcards")] - [JsonConverter(typeof(ExpandWildcardsConverter))] - public ICollection? ExpandWildcards { get; set; } + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.ExpandWildcard))] + public IReadOnlyCollection? ExpandWildcards { get; init; } [JsonInclude, JsonPropertyName("ignore_throttled")] - public bool? IgnoreThrottled { get; set; } + public bool? IgnoreThrottled { get; init; } [JsonInclude, JsonPropertyName("ignore_unavailable")] - public bool? IgnoreUnavailable { get; set; } + public bool? IgnoreUnavailable { get; init; } [JsonInclude, JsonPropertyName("index")] - public Elastic.Clients.Elasticsearch.Indices? Index { get; set; } + public Elastic.Clients.Elasticsearch.Indices? Indices { get; init; } [JsonInclude, JsonPropertyName("preference")] - public string? Preference { get; set; } + public string? Preference { get; init; } [JsonInclude, JsonPropertyName("request_cache")] - public bool? RequestCache { get; set; } + public bool? RequestCache { get; init; } [JsonInclude, JsonPropertyName("routing")] - public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } + public Elastic.Clients.Elasticsearch.Routing? Routing { get; init; } [JsonInclude, JsonPropertyName("search_type")] - public Elastic.Clients.Elasticsearch.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.Indices? IndexValue { get; set; } - private string? PreferenceValue { get; set; } - private bool? RequestCacheValue { get; set; } - private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } - private Elastic.Clients.Elasticsearch.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.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.Routing? routing) - { - RoutingValue = routing; - return Self; - } - - public MultisearchHeaderDescriptor SearchType(Elastic.Clients.Elasticsearch.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(); - } + public Elastic.Clients.Elasticsearch.SearchType? SearchType { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs index 1c99389536c..32dc96175e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs @@ -33,125 +33,29 @@ public sealed partial class TemplateConfig /// If `true`, returns detailed information about score calculation as part of each hit. ///
[JsonInclude, JsonPropertyName("explain")] - public bool? Explain { get; set; } + public bool? Explain { get; init; } /// /// ID of the search template to use. If no source is specified,
this parameter is required.
///
[JsonInclude, JsonPropertyName("id")] - public Elastic.Clients.Elasticsearch.Id? Id { get; set; } + public Elastic.Clients.Elasticsearch.Id? Id { get; init; } /// /// Key-value pairs used to replace Mustache variables in the template.
The key is the variable name.
The value is the variable value.
///
[JsonInclude, JsonPropertyName("params")] - public IDictionary? Params { get; set; } + public IReadOnlyDictionary? Params { get; init; } /// /// If `true`, the query execution is profiled. /// [JsonInclude, JsonPropertyName("profile")] - public bool? Profile { get; set; } + public bool? Profile { get; init; } /// /// 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.Id? IdValue { get; set; } - private IDictionary? ParamsValue { get; set; } - private bool? ProfileValue { get; set; } - private string? SourceValue { get; set; } - - /// - /// If `true`, returns detailed information about score calculation as part of each hit. - /// - 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.Id? id) - { - IdValue = id; - return Self; - } - - /// - /// Key-value pairs used to replace Mustache variables in the template.
The key is the variable name.
The value is the variable value.
- ///
- public TemplateConfigDescriptor Params(Func, FluentDictionary> selector) - { - ParamsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - /// - /// If `true`, the query execution is profiled. - /// - 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(); - } + public string? Source { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs index 75dcae5c74b..413f920653b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs @@ -29,42 +29,42 @@ namespace Elastic.Clients.Elasticsearch.Core.Mtermvectors; public sealed partial class MultiTermVectorsOperation { - /// - /// The ID of the document. - /// - [JsonInclude, JsonPropertyName("_id")] - public Elastic.Clients.Elasticsearch.Id Id { get; set; } - - /// - /// The index of the document. - /// - [JsonInclude, JsonPropertyName("_index")] - public Elastic.Clients.Elasticsearch.IndexName? Index { get; set; } - /// /// An artificial document (a document not present in the index) for which you want to retrieve term vectors. /// [JsonInclude, JsonPropertyName("doc")] public object? Doc { get; set; } - /// - /// If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. - /// - [JsonInclude, JsonPropertyName("field_statistics")] - public bool? FieldStatistics { get; set; } - /// /// Comma-separated list or wildcard expressions of fields to include in the statistics.
Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
///
[JsonInclude, JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Fields? Fields { get; set; } + /// + /// If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. + /// + [JsonInclude, JsonPropertyName("field_statistics")] + public bool? FieldStatistics { get; set; } + /// /// Filter terms based on their tf-idf scores. /// [JsonInclude, JsonPropertyName("filter")] public Elastic.Clients.Elasticsearch.Core.TermVectors.Filter? Filter { get; set; } + /// + /// The ID of the document. + /// + [JsonInclude, JsonPropertyName("_id")] + public Elastic.Clients.Elasticsearch.Id Id { get; set; } + + /// + /// The index of the document. + /// + [JsonInclude, JsonPropertyName("_index")] + public Elastic.Clients.Elasticsearch.IndexName? Index { get; set; } + /// /// If `true`, the response includes term offsets. /// @@ -120,8 +120,8 @@ public MultiTermVectorsOperationDescriptor() : base() private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private bool? FieldStatisticsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.TermVectors.Filter? FilterValue { get; set; } - private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id IdValue { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private bool? OffsetsValue { get; set; } @@ -170,7 +170,7 @@ public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Ela return Self; } - public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -178,7 +178,7 @@ public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.Fi return Self; } - public MultiTermVectorsOperationDescriptor Filter(Action configure) + public MultiTermVectorsOperationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -296,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -342,10 +342,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(TermStatisticsValue.Value); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -370,8 +370,8 @@ public MultiTermVectorsOperationDescriptor() : base() private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private bool? FieldStatisticsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.TermVectors.Filter? FilterValue { get; set; } - private Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id IdValue { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private bool? OffsetsValue { get; set; } @@ -420,7 +420,7 @@ public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescriptor descriptor) + public MultiTermVectorsOperationDescriptor Filter(Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -428,7 +428,7 @@ public MultiTermVectorsOperationDescriptor Filter(Core.TermVectors.FilterDescrip return Self; } - public MultiTermVectorsOperationDescriptor Filter(Action configure) + public MultiTermVectorsOperationDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -546,7 +546,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.TermVectors.FilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -592,10 +592,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(TermStatisticsValue.Value); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs index 5f38533babf..ade82399c74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs @@ -29,19 +29,19 @@ namespace Elastic.Clients.Elasticsearch.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.ErrorCause? Error { 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("term_vectors")] [ReadOnlyFieldDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.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/_Generated/Types/Core/MultiGetResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs index a40b1033bd3..3db3670ab7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch.Core.MGet; public sealed partial class MultiGetResponseItem : Union, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError> { - public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Core.Get.GetResult result) : base(result) + public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Core.Get.GetResult Result) : base(Result) { } - public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError failure) : base(failure) + public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError Failure) : base(Failure) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs index 2fcb7cfb8e5..e4d5c8f2dcb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; public sealed partial class MultiSearchResponseItem : Union, Elastic.Clients.Elasticsearch.ErrorResponseBase> { - public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem result) : base(result) + public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem Result) : base(Result) { } - public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.ErrorResponseBase failure) : base(failure) + public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.ErrorResponseBase Failure) : base(Failure) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs index 780d43d6333..2ef7de65e07 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs @@ -50,20 +50,20 @@ public RankEvalMetricDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? DcgValue { get; set; } - private RankEvalMetricDiscountedCumulativeGainDescriptor DcgDescriptor { get; set; } - private Action DcgDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGainDescriptor DcgDescriptor { get; set; } + private Action DcgDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank? ExpectedReciprocalRankValue { get; set; } - private RankEvalMetricExpectedReciprocalRankDescriptor ExpectedReciprocalRankDescriptor { get; set; } - private Action ExpectedReciprocalRankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRankDescriptor ExpectedReciprocalRankDescriptor { get; set; } + private Action ExpectedReciprocalRankDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank? MeanReciprocalRankValue { get; set; } - private RankEvalMetricMeanReciprocalRankDescriptor MeanReciprocalRankDescriptor { get; set; } - private Action MeanReciprocalRankDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRankDescriptor MeanReciprocalRankDescriptor { get; set; } + private Action MeanReciprocalRankDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision? PrecisionValue { get; set; } - private RankEvalMetricPrecisionDescriptor PrecisionDescriptor { get; set; } - private Action PrecisionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecisionDescriptor PrecisionDescriptor { get; set; } + private Action PrecisionDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall? RecallValue { get; set; } - private RankEvalMetricRecallDescriptor RecallDescriptor { get; set; } - private Action RecallDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecallDescriptor RecallDescriptor { get; set; } + private Action RecallDescriptorAction { get; set; } public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain? dcg) { @@ -73,7 +73,7 @@ public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Core.RankEval. return Self; } - public RankEvalMetricDescriptor Dcg(RankEvalMetricDiscountedCumulativeGainDescriptor descriptor) + public RankEvalMetricDescriptor Dcg(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGainDescriptor descriptor) { DcgValue = null; DcgDescriptorAction = null; @@ -81,7 +81,7 @@ public RankEvalMetricDescriptor Dcg(RankEvalMetricDiscountedCumulativeGainDescri return Self; } - public RankEvalMetricDescriptor Dcg(Action configure) + public RankEvalMetricDescriptor Dcg(Action configure) { DcgValue = null; DcgDescriptor = null; @@ -97,7 +97,7 @@ public RankEvalMetricDescriptor ExpectedReciprocalRank(Elastic.Clients.Elasticse return Self; } - public RankEvalMetricDescriptor ExpectedReciprocalRank(RankEvalMetricExpectedReciprocalRankDescriptor descriptor) + public RankEvalMetricDescriptor ExpectedReciprocalRank(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRankDescriptor descriptor) { ExpectedReciprocalRankValue = null; ExpectedReciprocalRankDescriptorAction = null; @@ -105,7 +105,7 @@ public RankEvalMetricDescriptor ExpectedReciprocalRank(RankEvalMetricExpectedRec return Self; } - public RankEvalMetricDescriptor ExpectedReciprocalRank(Action configure) + public RankEvalMetricDescriptor ExpectedReciprocalRank(Action configure) { ExpectedReciprocalRankValue = null; ExpectedReciprocalRankDescriptor = null; @@ -121,7 +121,7 @@ public RankEvalMetricDescriptor MeanReciprocalRank(Elastic.Clients.Elasticsearch return Self; } - public RankEvalMetricDescriptor MeanReciprocalRank(RankEvalMetricMeanReciprocalRankDescriptor descriptor) + public RankEvalMetricDescriptor MeanReciprocalRank(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRankDescriptor descriptor) { MeanReciprocalRankValue = null; MeanReciprocalRankDescriptorAction = null; @@ -129,7 +129,7 @@ public RankEvalMetricDescriptor MeanReciprocalRank(RankEvalMetricMeanReciprocalR return Self; } - public RankEvalMetricDescriptor MeanReciprocalRank(Action configure) + public RankEvalMetricDescriptor MeanReciprocalRank(Action configure) { MeanReciprocalRankValue = null; MeanReciprocalRankDescriptor = null; @@ -145,7 +145,7 @@ public RankEvalMetricDescriptor Precision(Elastic.Clients.Elasticsearch.Core.Ran return Self; } - public RankEvalMetricDescriptor Precision(RankEvalMetricPrecisionDescriptor descriptor) + public RankEvalMetricDescriptor Precision(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecisionDescriptor descriptor) { PrecisionValue = null; PrecisionDescriptorAction = null; @@ -153,7 +153,7 @@ public RankEvalMetricDescriptor Precision(RankEvalMetricPrecisionDescriptor desc return Self; } - public RankEvalMetricDescriptor Precision(Action configure) + public RankEvalMetricDescriptor Precision(Action configure) { PrecisionValue = null; PrecisionDescriptor = null; @@ -169,7 +169,7 @@ public RankEvalMetricDescriptor Recall(Elastic.Clients.Elasticsearch.Core.RankEv return Self; } - public RankEvalMetricDescriptor Recall(RankEvalMetricRecallDescriptor descriptor) + public RankEvalMetricDescriptor Recall(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecallDescriptor descriptor) { RecallValue = null; RecallDescriptorAction = null; @@ -177,7 +177,7 @@ public RankEvalMetricDescriptor Recall(RankEvalMetricRecallDescriptor descriptor return Self; } - public RankEvalMetricDescriptor Recall(Action configure) + public RankEvalMetricDescriptor Recall(Action configure) { RecallValue = null; RecallDescriptor = null; @@ -196,7 +196,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DcgDescriptorAction is not null) { writer.WritePropertyName("dcg"); - JsonSerializer.Serialize(writer, new RankEvalMetricDiscountedCumulativeGainDescriptor(DcgDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGainDescriptor(DcgDescriptorAction), options); } else if (DcgValue is not null) { @@ -212,7 +212,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExpectedReciprocalRankDescriptorAction is not null) { writer.WritePropertyName("expected_reciprocal_rank"); - JsonSerializer.Serialize(writer, new RankEvalMetricExpectedReciprocalRankDescriptor(ExpectedReciprocalRankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRankDescriptor(ExpectedReciprocalRankDescriptorAction), options); } else if (ExpectedReciprocalRankValue is not null) { @@ -228,7 +228,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MeanReciprocalRankDescriptorAction is not null) { writer.WritePropertyName("mean_reciprocal_rank"); - JsonSerializer.Serialize(writer, new RankEvalMetricMeanReciprocalRankDescriptor(MeanReciprocalRankDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRankDescriptor(MeanReciprocalRankDescriptorAction), options); } else if (MeanReciprocalRankValue is not null) { @@ -244,7 +244,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PrecisionDescriptorAction is not null) { writer.WritePropertyName("precision"); - JsonSerializer.Serialize(writer, new RankEvalMetricPrecisionDescriptor(PrecisionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecisionDescriptor(PrecisionDescriptorAction), options); } else if (PrecisionValue is not null) { @@ -260,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RecallDescriptorAction is not null) { writer.WritePropertyName("recall"); - JsonSerializer.Serialize(writer, new RankEvalMetricRecallDescriptor(RecallDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecallDescriptor(RecallDescriptorAction), options); } else if (RecallValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs index d56e8f586fe..cbc5b3add80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs @@ -29,9 +29,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; /// /// Discounted cumulative gain (DCG) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricDiscountedCumulativeGain { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } @@ -44,6 +48,7 @@ public sealed partial class RankEvalMetricDiscountedCumulativeGain /// /// Discounted cumulative gain (DCG) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricDiscountedCumulativeGainDescriptor : SerializableDescriptor { @@ -56,6 +61,9 @@ public RankEvalMetricDiscountedCumulativeGainDescriptor() : base() private int? kValue { get; set; } private bool? NormalizeValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricDiscountedCumulativeGainDescriptor k(int? k) { kValue = k; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs index 528b711f9f1..37813085642 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs @@ -29,9 +29,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; /// /// Expected Reciprocal Rank (ERR) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricExpectedReciprocalRank { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } @@ -44,6 +48,7 @@ public sealed partial class RankEvalMetricExpectedReciprocalRank /// /// Expected Reciprocal Rank (ERR) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricExpectedReciprocalRankDescriptor : SerializableDescriptor { @@ -56,6 +61,9 @@ public RankEvalMetricExpectedReciprocalRankDescriptor() : base() private int? kValue { get; set; } private int MaximumRelevanceValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricExpectedReciprocalRankDescriptor k(int? k) { kValue = k; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs index d42789e0c36..15a3c5d5f49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs @@ -29,17 +29,26 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; /// /// Mean Reciprocal Rank +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricMeanReciprocalRank { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Mean Reciprocal Rank +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricMeanReciprocalRankDescriptor : SerializableDescriptor { @@ -52,12 +61,18 @@ public RankEvalMetricMeanReciprocalRankDescriptor() : base() private int? kValue { get; set; } private int? RelevantRatingThresholdValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricMeanReciprocalRankDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricMeanReciprocalRankDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs index c2bb9b96d60..9c12837f219 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; /// /// Precision at K (P@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricPrecision { @@ -37,14 +38,23 @@ public sealed partial class RankEvalMetricPrecision ///
[JsonInclude, JsonPropertyName("ignore_unlabeled")] public bool? IgnoreUnlabeled { get; set; } + + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Precision at K (P@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricPrecisionDescriptor : SerializableDescriptor { @@ -67,12 +77,18 @@ public RankEvalMetricPrecisionDescriptor IgnoreUnlabeled(bool? ignoreUnlabeled = return Self; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricPrecisionDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricPrecisionDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs index 9e67178418f..7c589b4cf50 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs @@ -29,17 +29,26 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; /// /// Recall at K (R@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricRecall { + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// [JsonInclude, JsonPropertyName("k")] public int? k { get; set; } + + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// [JsonInclude, JsonPropertyName("relevant_rating_threshold")] public int? RelevantRatingThreshold { get; set; } } /// /// Recall at K (R@k) +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class RankEvalMetricRecallDescriptor : SerializableDescriptor { @@ -52,12 +61,18 @@ public RankEvalMetricRecallDescriptor() : base() private int? kValue { get; set; } private int? RelevantRatingThresholdValue { get; set; } + /// + /// Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + /// public RankEvalMetricRecallDescriptor k(int? k) { kValue = k; return Self; } + /// + /// Sets the rating threshold above which documents are considered to be "relevant". + /// public RankEvalMetricRecallDescriptor RelevantRatingThreshold(int? relevantRatingThreshold) { RelevantRatingThresholdValue = relevantRatingThreshold; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs index c8c46254adc..687bd0ffd08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs @@ -44,8 +44,8 @@ public RankEvalQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private int? SizeValue { get; set; } public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query query) @@ -56,7 +56,7 @@ public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.Qu return Self; } - public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -64,7 +64,7 @@ public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public RankEvalQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -89,7 +89,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -116,8 +116,8 @@ public RankEvalQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private int? SizeValue { get; set; } public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query query) @@ -128,7 +128,7 @@ public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Quer return Self; } - public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RankEvalQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -136,7 +136,7 @@ public RankEvalQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public RankEvalQueryDescriptor Query(Action configure) + public RankEvalQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs index 0e33dbad247..0ddce6ace19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs @@ -71,12 +71,12 @@ public RankEvalRequestItemDescriptor() : base() private Elastic.Clients.Elasticsearch.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.Core.RankEval.DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery? RequestValue { get; set; } - private RankEvalQueryDescriptor RequestDescriptor { get; set; } - private Action> RequestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action> RequestDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id? TemplateIdValue { get; set; } /// @@ -109,7 +109,7 @@ public RankEvalRequestItemDescriptor Ratings(ICollection Ratings(DocumentRatingDescriptor descriptor) + public RankEvalRequestItemDescriptor Ratings(Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingDescriptor descriptor) { RatingsValue = null; RatingsDescriptorAction = null; @@ -118,7 +118,7 @@ public RankEvalRequestItemDescriptor Ratings(DocumentRatingDescriptor return Self; } - public RankEvalRequestItemDescriptor Ratings(Action configure) + public RankEvalRequestItemDescriptor Ratings(Action configure) { RatingsValue = null; RatingsDescriptor = null; @@ -127,7 +127,7 @@ public RankEvalRequestItemDescriptor Ratings(Action Ratings(params Action[] configure) + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) { RatingsValue = null; RatingsDescriptor = null; @@ -147,7 +147,7 @@ public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elastics return Self; } - public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor descriptor) { RequestValue = null; RequestDescriptorAction = null; @@ -155,7 +155,7 @@ public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor< return Self; } - public RankEvalRequestItemDescriptor Request(Action> configure) + public RankEvalRequestItemDescriptor Request(Action> configure) { RequestValue = null; RequestDescriptor = null; @@ -194,7 +194,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ratings"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingDescriptor(RatingsDescriptorAction), options); writer.WriteEndArray(); } else if (RatingsDescriptorActions is not null) @@ -203,7 +203,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RatingsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingDescriptor(action), options); } writer.WriteEndArray(); @@ -222,7 +222,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RequestDescriptorAction is not null) { writer.WritePropertyName("request"); - JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor(RequestDescriptorAction), options); } else if (RequestValue is not null) { @@ -251,12 +251,12 @@ public RankEvalRequestItemDescriptor() : base() private Elastic.Clients.Elasticsearch.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.Core.RankEval.DocumentRatingDescriptor RatingsDescriptor { get; set; } + private Action RatingsDescriptorAction { get; set; } + private Action[] RatingsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery? RequestValue { get; set; } - private RankEvalQueryDescriptor RequestDescriptor { get; set; } - private Action RequestDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor RequestDescriptor { get; set; } + private Action RequestDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id? TemplateIdValue { get; set; } /// @@ -289,7 +289,7 @@ public RankEvalRequestItemDescriptor Ratings(ICollection configure) + public RankEvalRequestItemDescriptor Ratings(Action configure) { RatingsValue = null; RatingsDescriptor = null; @@ -307,7 +307,7 @@ public RankEvalRequestItemDescriptor Ratings(Action co return Self; } - public RankEvalRequestItemDescriptor Ratings(params Action[] configure) + public RankEvalRequestItemDescriptor Ratings(params Action[] configure) { RatingsValue = null; RatingsDescriptor = null; @@ -327,7 +327,7 @@ public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Core. return Self; } - public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) + public RankEvalRequestItemDescriptor Request(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor descriptor) { RequestValue = null; RequestDescriptorAction = null; @@ -335,7 +335,7 @@ public RankEvalRequestItemDescriptor Request(RankEvalQueryDescriptor descriptor) return Self; } - public RankEvalRequestItemDescriptor Request(Action configure) + public RankEvalRequestItemDescriptor Request(Action configure) { RequestValue = null; RequestDescriptor = null; @@ -374,7 +374,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("ratings"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(RatingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingDescriptor(RatingsDescriptorAction), options); writer.WriteEndArray(); } else if (RatingsDescriptorActions is not null) @@ -383,7 +383,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RatingsDescriptorActions) { - JsonSerializer.Serialize(writer, new DocumentRatingDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingDescriptor(action), options); } writer.WriteEndArray(); @@ -402,7 +402,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RequestDescriptorAction is not null) { writer.WritePropertyName("request"); - JsonSerializer.Serialize(writer, new RankEvalQueryDescriptor(RequestDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryDescriptor(RequestDescriptorAction), options); } else if (RequestValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs index a1c8d2c9995..2e9f3c34a5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs @@ -151,11 +151,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("host"); - JsonSerializer.Serialize(writer, HostValue, options); - if (PasswordValue is not null) + writer.WriteStringValue(HostValue); + if (!string.IsNullOrEmpty(PasswordValue)) { writer.WritePropertyName("password"); - JsonSerializer.Serialize(writer, PasswordValue, options); + writer.WriteStringValue(PasswordValue); } if (SocketTimeoutValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs index ba9577ba953..bc84ae9f20c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs @@ -29,17 +29,11 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex; public sealed partial class Source { - /// - /// If `true` reindexes all source fields.
Set to a list to reindex select fields.
- ///
- [JsonInclude, JsonPropertyName("_source")] - public Elastic.Clients.Elasticsearch.Fields? SourceFields { get; set; } - /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
[JsonInclude, JsonPropertyName("index")] - public Elastic.Clients.Elasticsearch.Indices Index { get; set; } + public Elastic.Clients.Elasticsearch.Indices Indices { get; set; } /// /// Specifies the documents to reindex using the Query DSL. @@ -69,6 +63,12 @@ public sealed partial class Source [JsonInclude, JsonPropertyName("sort")] [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } + + /// + /// If `true` reindexes all source fields.
Set to a list to reindex select fields.
+ ///
+ [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Fields? SourceFields { get; set; } } public sealed partial class SourceDescriptor : SerializableDescriptor> @@ -79,30 +79,30 @@ public SourceDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Indices IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource? RemoteValue { get; set; } - private RemoteSourceDescriptor RemoteDescriptor { get; set; } - private Action RemoteDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor RemoteDescriptor { get; set; } + private Action RemoteDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action> SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Fields? SourceFieldsValue { get; set; } /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
- public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Indices index) + public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) { - IndexValue = index; + IndicesValue = indices; return Self; } @@ -117,7 +117,7 @@ public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl. return Self; } - public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -125,7 +125,7 @@ public SourceDescriptor Query(QueryDsl.QueryDescriptor des return Self; } - public SourceDescriptor Query(Action> configure) + public SourceDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -144,7 +144,7 @@ public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Core.Rei return Self; } - public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) + public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor descriptor) { RemoteValue = null; RemoteDescriptorAction = null; @@ -152,7 +152,7 @@ public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) return Self; } - public SourceDescriptor Remote(Action configure) + public SourceDescriptor Remote(Action configure) { RemoteValue = null; RemoteDescriptor = null; @@ -160,9 +160,9 @@ public SourceDescriptor Remote(Action configu return Self; } - public SourceDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public SourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -186,7 +186,7 @@ public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScr return Self; } - public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) + public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -194,7 +194,7 @@ public SourceDescriptor Slice(SlicedScrollDescriptor descr return Self; } - public SourceDescriptor Slice(Action> configure) + public SourceDescriptor Slice(Action> configure) { SliceValue = null; SliceDescriptor = null; @@ -211,7 +211,7 @@ public SourceDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public SourceDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -220,7 +220,7 @@ public SourceDescriptor Sort(SortOptionsDescriptor descrip return Self; } - public SourceDescriptor Sort(Action> configure) + public SourceDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -229,7 +229,7 @@ public SourceDescriptor Sort(Action> return Self; } - public SourceDescriptor Sort(params Action>[] configure) + public SourceDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -251,7 +251,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexValue, options); + JsonSerializer.Serialize(writer, IndicesValue, options); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -260,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -276,7 +276,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RemoteDescriptorAction is not null) { writer.WritePropertyName("remote"); - JsonSerializer.Serialize(writer, new RemoteSourceDescriptor(RemoteDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor(RemoteDescriptorAction), options); } else if (RemoteValue is not null) { @@ -304,7 +304,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -320,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -329,7 +329,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -359,30 +359,30 @@ public SourceDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Indices IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource? RemoteValue { get; set; } - private RemoteSourceDescriptor RemoteDescriptor { get; set; } - private Action RemoteDescriptorAction { get; set; } - private IDictionary? RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor RemoteDescriptor { get; set; } + private Action RemoteDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } private int? SizeValue { get; set; } private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; } - private SlicedScrollDescriptor SliceDescriptor { get; set; } - private Action SliceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Fields? SourceFieldsValue { get; set; } /// /// The name of the data stream, index, or alias you are copying from.
Accepts a comma-separated list to reindex from multiple sources.
///
- public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Indices index) + public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) { - IndexValue = index; + IndicesValue = indices; return Self; } @@ -397,7 +397,7 @@ public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? quer return Self; } - public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -405,7 +405,7 @@ public SourceDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public SourceDescriptor Query(Action configure) + public SourceDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -424,7 +424,7 @@ public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Core.Reindex.Remote return Self; } - public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) + public SourceDescriptor Remote(Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor descriptor) { RemoteValue = null; RemoteDescriptorAction = null; @@ -432,7 +432,7 @@ public SourceDescriptor Remote(RemoteSourceDescriptor descriptor) return Self; } - public SourceDescriptor Remote(Action configure) + public SourceDescriptor Remote(Action configure) { RemoteValue = null; RemoteDescriptor = null; @@ -440,9 +440,9 @@ public SourceDescriptor Remote(Action configure) return Self; } - public SourceDescriptor RuntimeMappings(Func, FluentDictionary> selector) + public SourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) { - RuntimeMappingsValue = selector?.Invoke(new FluentDictionary()); + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -466,7 +466,7 @@ public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScroll? slice) return Self; } - public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) + public SourceDescriptor Slice(Elastic.Clients.Elasticsearch.SlicedScrollDescriptor descriptor) { SliceValue = null; SliceDescriptorAction = null; @@ -474,7 +474,7 @@ public SourceDescriptor Slice(SlicedScrollDescriptor descriptor) return Self; } - public SourceDescriptor Slice(Action configure) + public SourceDescriptor Slice(Action configure) { SliceValue = null; SliceDescriptor = null; @@ -491,7 +491,7 @@ public SourceDescriptor Sort(ICollection configure) + public SourceDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -509,7 +509,7 @@ public SourceDescriptor Sort(Action configure) return Self; } - public SourceDescriptor Sort(params Action[] configure) + public SourceDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -531,7 +531,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, IndexValue, options); + JsonSerializer.Serialize(writer, IndicesValue, options); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -540,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -556,7 +556,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RemoteDescriptorAction is not null) { writer.WritePropertyName("remote"); - JsonSerializer.Serialize(writer, new RemoteSourceDescriptor(RemoteDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor(RemoteDescriptorAction), options); } else if (RemoteValue is not null) { @@ -584,7 +584,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SliceDescriptorAction is not null) { writer.WritePropertyName("slice"); - JsonSerializer.Serialize(writer, new SlicedScrollDescriptor(SliceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SlicedScrollDescriptor(SliceDescriptorAction), options); } else if (SliceValue is not null) { @@ -600,7 +600,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -609,7 +609,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs index d6549686c39..c2c8d0e3a6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs @@ -36,7 +36,7 @@ public sealed partial class ReindexTask [JsonInclude, JsonPropertyName("description")] public string Description { get; init; } [JsonInclude, JsonPropertyName("headers")] - public IReadOnlyDictionary> Headers { get; init; } + public IReadOnlyDictionary>> Headers { get; init; } [JsonInclude, JsonPropertyName("id")] public long Id { get; init; } [JsonInclude, JsonPropertyName("node")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs new file mode 100644 index 00000000000..b42ab101517 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs @@ -0,0 +1,221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute; + +public sealed partial class PainlessContextSetup +{ + /// + /// Document that’s temporarily indexed in-memory and accessible from the script. + /// + [JsonInclude, JsonPropertyName("document")] + public object Document { get; set; } + + /// + /// Index containing a mapping that’s compatible with the indexed document.
You may specify a remote index by prefixing the index with the remote cluster alias.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName Index { get; set; } + + /// + /// Use this parameter to specify a query for computing a score. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } +} + +public sealed partial class PainlessContextSetupDescriptor : SerializableDescriptor> +{ + internal PainlessContextSetupDescriptor(Action> configure) => configure.Invoke(this); + + public PainlessContextSetupDescriptor() : base() + { + } + + private object DocumentValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + + /// + /// Document that’s temporarily indexed in-memory and accessible from the script. + /// + public PainlessContextSetupDescriptor Document(object document) + { + DocumentValue = document; + return Self; + } + + /// + /// Index containing a mapping that’s compatible with the indexed document.
You may specify a remote index by prefixing the index with the remote cluster alias.
+ ///
+ public PainlessContextSetupDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Use this parameter to specify a query for computing a score. + /// + public PainlessContextSetupDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PainlessContextSetupDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PainlessContextSetupDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("document"); + JsonSerializer.Serialize(writer, DocumentValue, options); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PainlessContextSetupDescriptor : SerializableDescriptor +{ + internal PainlessContextSetupDescriptor(Action configure) => configure.Invoke(this); + + public PainlessContextSetupDescriptor() : base() + { + } + + private object DocumentValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + + /// + /// Document that’s temporarily indexed in-memory and accessible from the script. + /// + public PainlessContextSetupDescriptor Document(object document) + { + DocumentValue = document; + return Self; + } + + /// + /// Index containing a mapping that’s compatible with the indexed document.
You may specify a remote index by prefixing the index with the remote cluster alias.
+ ///
+ public PainlessContextSetupDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Use this parameter to specify a query for computing a score. + /// + public PainlessContextSetupDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public PainlessContextSetupDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public PainlessContextSetupDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("document"); + JsonSerializer.Serialize(writer, DocumentValue, options); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(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/_Generated/Types/Core/Search/CompletionSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs new file mode 100644 index 00000000000..c294fa934bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class CompletionSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [GenericConverter(typeof(SingleOrManyCollectionConverter<>), unwrap: true)] + public IReadOnlyCollection> Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs new file mode 100644 index 00000000000..dee2194a8f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class CompletionSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("contexts")] + public IReadOnlyDictionary>? Contexts { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("_id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("_index")] + public string? Index { get; init; } + [JsonInclude, JsonPropertyName("_routing")] + public string? Routing { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double? Score { get; init; } + [JsonInclude, JsonPropertyName("_score")] + public double? Score0 { get; init; } + [JsonInclude, JsonPropertyName("_source")] + public TDocument? Source { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs index f8add53ced8..a9b9195ce03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class CompletionSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } @@ -36,7 +39,11 @@ public sealed partial class CompletionSuggester /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. ///
[JsonInclude, JsonPropertyName("contexts")] - public IDictionary>? Contexts { get; set; } + public IDictionary>>? Contexts { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } @@ -51,6 +58,10 @@ public sealed partial class CompletionSuggester ///
[JsonInclude, JsonPropertyName("regex")] public Elastic.Clients.Elasticsearch.Core.Search.RegexOptions? Regex { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -60,7 +71,7 @@ public sealed partial class CompletionSuggester [JsonInclude, JsonPropertyName("skip_duplicates")] public bool? SkipDuplicates { get; set; } - public static implicit operator FieldSuggester(CompletionSuggester completionSuggester) => Core.Search.FieldSuggester.Completion(completionSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester(CompletionSuggester completionSuggester) => Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester.Completion(completionSuggester); } public sealed partial class CompletionSuggesterDescriptor : SerializableDescriptor> @@ -72,17 +83,20 @@ public CompletionSuggesterDescriptor() : base() } private string? AnalyzerValue { get; set; } - private IDictionary>? ContextsValue { get; set; } + private IDictionary>>? ContextsValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness? FuzzyValue { get; set; } - private SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } - private Action FuzzyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } + private Action FuzzyDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.RegexOptions? RegexValue { get; set; } - private RegexOptionsDescriptor RegexDescriptor { get; set; } - private Action RegexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } private int? SizeValue { get; set; } private bool? SkipDuplicatesValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public CompletionSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -92,24 +106,39 @@ public CompletionSuggesterDescriptor Analyzer(string? analyzer) /// /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. /// - public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + public CompletionSuggesterDescriptor Contexts(Func>>, FluentDictionary>>> selector) { - ContextsValue = selector?.Invoke(new FluentDictionary>()); + ContextsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public CompletionSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Enables fuzziness, meaning you can have a typo in your search and still get results back. /// @@ -121,7 +150,7 @@ public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsea return Self; } - public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor descriptor) { FuzzyValue = null; FuzzyDescriptorAction = null; @@ -129,7 +158,7 @@ public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor return Self; } - public CompletionSuggesterDescriptor Fuzzy(Action configure) + public CompletionSuggesterDescriptor Fuzzy(Action configure) { FuzzyValue = null; FuzzyDescriptor = null; @@ -148,7 +177,7 @@ public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsea return Self; } - public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor descriptor) { RegexValue = null; RegexDescriptorAction = null; @@ -156,7 +185,7 @@ public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor des return Self; } - public CompletionSuggesterDescriptor Regex(Action configure) + public CompletionSuggesterDescriptor Regex(Action configure) { RegexValue = null; RegexDescriptor = null; @@ -164,6 +193,9 @@ public CompletionSuggesterDescriptor Regex(Action + /// The maximum corrections to be returned per suggest text token. + ///
public CompletionSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -204,7 +236,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FuzzyDescriptorAction is not null) { writer.WritePropertyName("fuzzy"); - JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); } else if (FuzzyValue is not null) { @@ -220,7 +252,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RegexDescriptorAction is not null) { writer.WritePropertyName("regex"); - JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor(RegexDescriptorAction), options); } else if (RegexValue is not null) { @@ -253,17 +285,20 @@ public CompletionSuggesterDescriptor() : base() } private string? AnalyzerValue { get; set; } - private IDictionary>? ContextsValue { get; set; } + private IDictionary>>? ContextsValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness? FuzzyValue { get; set; } - private SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } - private Action FuzzyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor FuzzyDescriptor { get; set; } + private Action FuzzyDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.RegexOptions? RegexValue { get; set; } - private RegexOptionsDescriptor RegexDescriptor { get; set; } - private Action RegexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor RegexDescriptor { get; set; } + private Action RegexDescriptorAction { get; set; } private int? SizeValue { get; set; } private bool? SkipDuplicatesValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public CompletionSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -273,24 +308,33 @@ public CompletionSuggesterDescriptor Analyzer(string? analyzer) /// /// A value, geo point object, or a geo hash string to filter or boost the suggestion on. /// - public CompletionSuggesterDescriptor Contexts(Func>, FluentDictionary>> selector) + public CompletionSuggesterDescriptor Contexts(Func>>, FluentDictionary>>> selector) { - ContextsValue = selector?.Invoke(new FluentDictionary>()); + ContextsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public CompletionSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -308,7 +352,7 @@ public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Core.Se return Self; } - public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor) + public CompletionSuggesterDescriptor Fuzzy(Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor descriptor) { FuzzyValue = null; FuzzyDescriptorAction = null; @@ -316,7 +360,7 @@ public CompletionSuggesterDescriptor Fuzzy(SuggestFuzzinessDescriptor descriptor return Self; } - public CompletionSuggesterDescriptor Fuzzy(Action configure) + public CompletionSuggesterDescriptor Fuzzy(Action configure) { FuzzyValue = null; FuzzyDescriptor = null; @@ -335,7 +379,7 @@ public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Core.Se return Self; } - public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) + public CompletionSuggesterDescriptor Regex(Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor descriptor) { RegexValue = null; RegexDescriptorAction = null; @@ -343,7 +387,7 @@ public CompletionSuggesterDescriptor Regex(RegexOptionsDescriptor descriptor) return Self; } - public CompletionSuggesterDescriptor Regex(Action configure) + public CompletionSuggesterDescriptor Regex(Action configure) { RegexValue = null; RegexDescriptor = null; @@ -351,6 +395,9 @@ public CompletionSuggesterDescriptor Regex(Action config return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public CompletionSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -391,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FuzzyDescriptorAction is not null) { writer.WritePropertyName("fuzzy"); - JsonSerializer.Serialize(writer, new SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessDescriptor(FuzzyDescriptorAction), options); } else if (FuzzyValue is not null) { @@ -407,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RegexDescriptorAction is not null) { writer.WritePropertyName("regex"); - JsonSerializer.Serialize(writer, new RegexOptionsDescriptor(RegexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsDescriptor(RegexDescriptorAction), options); } else if (RegexValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs index 139fbf4918c..1591eeb4831 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs @@ -134,6 +134,15 @@ public DirectGeneratorDescriptor Field(Expression + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// + public DirectGeneratorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The maximum edit distance candidate suggestions can have in order to be considered as a suggestion.
Can only be `1` or `2`.
///
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs index a184cec384e..a9c14add668 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs @@ -61,13 +61,13 @@ public FieldCollapseDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action> CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action> CollapseDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } + private Action>[] InnerHitsDescriptorActions { get; set; } private int? MaxConcurrentGroupSearchesValue { get; set; } public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse) @@ -78,7 +78,7 @@ public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch return Self; } - public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -86,7 +86,7 @@ public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor Collapse(Action> configure) + public FieldCollapseDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -112,6 +112,15 @@ public FieldCollapseDescriptor Field(Expression + /// The field to collapse the result set on + /// + public FieldCollapseDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The number of inner hits and their sort order /// @@ -124,7 +133,7 @@ public FieldCollapseDescriptor InnerHits(ICollection InnerHits(InnerHitsDescriptor descriptor) + public FieldCollapseDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -133,7 +142,7 @@ public FieldCollapseDescriptor InnerHits(InnerHitsDescriptor InnerHits(Action> configure) + public FieldCollapseDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -142,7 +151,7 @@ public FieldCollapseDescriptor InnerHits(Action InnerHits(params Action>[] configure) + public FieldCollapseDescriptor InnerHits(params Action>[] configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -171,7 +180,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -189,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsDescriptorActions is not null) { @@ -198,7 +207,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in InnerHitsDescriptorActions) { - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(action), options); } if (InnerHitsDescriptorActions.Length > 1) @@ -229,13 +238,13 @@ public FieldCollapseDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; } + private Action CollapseDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { 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.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } + private Action[] InnerHitsDescriptorActions { get; set; } private int? MaxConcurrentGroupSearchesValue { get; set; } public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse) @@ -246,7 +255,7 @@ public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Searc return Self; } - public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) + public FieldCollapseDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -254,7 +263,7 @@ public FieldCollapseDescriptor Collapse(FieldCollapseDescriptor descriptor) return Self; } - public FieldCollapseDescriptor Collapse(Action configure) + public FieldCollapseDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -301,7 +310,7 @@ public FieldCollapseDescriptor InnerHits(ICollection configure) + public FieldCollapseDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -319,7 +328,7 @@ public FieldCollapseDescriptor InnerHits(Action configure) return Self; } - public FieldCollapseDescriptor InnerHits(params Action[] configure) + public FieldCollapseDescriptor InnerHits(params Action[] configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -348,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -366,7 +375,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsDescriptorActions is not null) { @@ -375,7 +384,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in InnerHitsDescriptorActions) { - JsonSerializer.Serialize(writer, new InnerHitsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(action), options); } if (InnerHitsDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs index f7d41edff3e..ab6c4a5f6c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -66,6 +67,18 @@ internal FieldSuggester(string variantName, object variant) /// [JsonInclude, JsonPropertyName("text")] public string? Text { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class FieldSuggesterConverter : JsonConverter @@ -167,7 +180,7 @@ public override void Write(Utf8JsonWriter writer, FieldSuggester value, JsonSeri writer.WriteStringValue(value.Text); } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -250,12 +263,12 @@ public FieldSuggesterDescriptor Text(string? 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"); + public FieldSuggesterDescriptor Completion(Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action> configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action> configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(Elastic.Clients.Elasticsearch.Core.Search.TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action> configure) => Set(configure, "term"); protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { @@ -357,15 +370,12 @@ public FieldSuggesterDescriptor Text(string? 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"); + public FieldSuggesterDescriptor Completion(Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester completionSuggester) => Set(completionSuggester, "completion"); + public FieldSuggesterDescriptor Completion(Action configure) => Set(configure, "completion"); + public FieldSuggesterDescriptor Phrase(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester phraseSuggester) => Set(phraseSuggester, "phrase"); + public FieldSuggesterDescriptor Phrase(Action configure) => Set(configure, "phrase"); + public FieldSuggesterDescriptor Term(Elastic.Clients.Elasticsearch.Core.Search.TermSuggester termSuggester) => Set(termSuggester, "term"); + public FieldSuggesterDescriptor Term(Action configure) => Set(configure, "term"); protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs index 5cd1efa23bd..3c2039c54f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs @@ -29,48 +29,109 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class Highlight { + /// + /// A string that contains each boundary character. + /// [JsonInclude, JsonPropertyName("boundary_chars")] public string? BoundaryChars { get; set; } + + /// + /// How far to scan for boundary characters. + /// [JsonInclude, JsonPropertyName("boundary_max_scan")] public int? BoundaryMaxScan { get; set; } + + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner")] public Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner_locale")] public string? BoundaryScannerLocale { get; set; } [JsonInclude, JsonPropertyName("encoder")] public Elastic.Clients.Elasticsearch.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; } + + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
[JsonInclude, JsonPropertyName("fragmenter")] public Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } + + /// + /// The size of the highlighted fragment in characters. + /// + [JsonInclude, JsonPropertyName("fragment_size")] + public int? FragmentSize { get; set; } [JsonInclude, JsonPropertyName("highlight_filter")] public bool? HighlightFilter { get; set; } + + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
[JsonInclude, JsonPropertyName("highlight_query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQuery { get; set; } + + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
[JsonInclude, JsonPropertyName("max_analyzed_offset")] public int? MaxAnalyzedOffset { get; set; } [JsonInclude, JsonPropertyName("max_fragment_length")] public int? MaxFragmentLength { get; set; } + + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// [JsonInclude, JsonPropertyName("no_match_size")] public int? NoMatchSize { get; set; } + + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
[JsonInclude, JsonPropertyName("number_of_fragments")] public int? NumberOfFragments { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
[JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? Order { get; set; } + + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("phrase_limit")] public int? PhraseLimit { get; set; } + + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("post_tags")] public ICollection? PostTags { get; set; } + + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("pre_tags")] public ICollection? PreTags { get; set; } + + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
[JsonInclude, JsonPropertyName("require_field_match")] public bool? RequireFieldMatch { get; set; } + + /// + /// Set to `styled` to use the built-in tag schema. + /// [JsonInclude, JsonPropertyName("tags_schema")] public Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -90,14 +151,13 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } private string? BoundaryScannerLocaleValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? EncoderValue { get; set; } - private IDictionary FieldsValue { get; set; } - private bool? ForceSourceValue { get; set; } + private IDictionary> FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQueryValue { get; set; } - private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } - private Action> HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } private int? NoMatchSizeValue { get; set; } @@ -111,24 +171,36 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? TypeValue { get; set; } + /// + /// A string that contains each boundary character. + /// public HighlightDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; @@ -141,24 +213,24 @@ public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Core return Self; } - public HighlightDescriptor Fields(Func, FluentDictionary> selector) - { - FieldsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public HighlightDescriptor ForceSource(bool? forceSource = true) + public HighlightDescriptor Fields(Func>, FluentDescriptorDictionary>> selector) { - ForceSourceValue = forceSource; + FieldsValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -171,6 +243,9 @@ public HighlightDescriptor HighlightFilter(bool? highlightFilter = tr return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -179,7 +254,7 @@ public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsear return Self; } - public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -187,7 +262,7 @@ public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor HighlightQuery(Action> configure) + public HighlightDescriptor HighlightQuery(Action> configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -195,6 +270,9 @@ public HighlightDescriptor HighlightQuery(Action + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ /// public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -207,12 +285,18 @@ public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -225,36 +309,54 @@ public HighlightDescriptor Options(Func + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ /// public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -302,12 +404,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("fields"); JsonSerializer.Serialize(writer, FieldsValue, options); - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -334,7 +430,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { @@ -431,14 +527,13 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } private string? BoundaryScannerLocaleValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? EncoderValue { get; set; } - private IDictionary FieldsValue { get; set; } - private bool? ForceSourceValue { get; set; } + private IDictionary FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQueryValue { get; set; } - private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } - private Action HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } private int? NoMatchSizeValue { get; set; } @@ -452,24 +547,36 @@ public HighlightDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? TypeValue { get; set; } + /// + /// A string that contains each boundary character. + /// public HighlightDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; @@ -482,24 +589,24 @@ public HighlightDescriptor Encoder(Elastic.Clients.Elasticsearch.Core.Search.Hig return Self; } - public HighlightDescriptor Fields(Func, FluentDictionary> selector) - { - FieldsValue = selector?.Invoke(new FluentDictionary()); - return Self; - } - - public HighlightDescriptor ForceSource(bool? forceSource = true) + public HighlightDescriptor Fields(Func, FluentDescriptorDictionary> selector) { - ForceSourceValue = forceSource; + FieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -512,6 +619,9 @@ public HighlightDescriptor HighlightFilter(bool? highlightFilter = true) return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -520,7 +630,7 @@ public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl return Self; } - public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -528,7 +638,7 @@ public HighlightDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) return Self; } - public HighlightDescriptor HighlightQuery(Action configure) + public HighlightDescriptor HighlightQuery(Action configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -536,6 +646,9 @@ public HighlightDescriptor HighlightQuery(Action confi return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -548,12 +661,18 @@ public HighlightDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -566,36 +685,54 @@ public HighlightDescriptor Options(Func, Fluent return Self; } + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
public HighlightDescriptor Order(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -643,12 +780,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WritePropertyName("fields"); JsonSerializer.Serialize(writer, FieldsValue, options); - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -675,7 +806,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs index 402fd147905..67eee637d19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs @@ -30,49 +30,111 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class HighlightField { [JsonInclude, JsonPropertyName("analyzer")] - public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } + public Elastic.Clients.Elasticsearch.Analysis.IAnalyzer? Analyzer { get; set; } + + /// + /// A string that contains each boundary character. + /// [JsonInclude, JsonPropertyName("boundary_chars")] public string? BoundaryChars { get; set; } + + /// + /// How far to scan for boundary characters. + /// [JsonInclude, JsonPropertyName("boundary_max_scan")] public int? BoundaryMaxScan { get; set; } + + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner")] public Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScanner { get; set; } + + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
[JsonInclude, JsonPropertyName("boundary_scanner_locale")] public string? BoundaryScannerLocale { get; set; } - [JsonInclude, JsonPropertyName("force_source")] - public bool? ForceSource { get; set; } + + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
+ [JsonInclude, JsonPropertyName("fragmenter")] + public Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } [JsonInclude, JsonPropertyName("fragment_offset")] public int? FragmentOffset { get; set; } + + /// + /// The size of the highlighted fragment in characters. + /// [JsonInclude, JsonPropertyName("fragment_size")] public int? FragmentSize { get; set; } - [JsonInclude, JsonPropertyName("fragmenter")] - public Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? Fragmenter { get; set; } [JsonInclude, JsonPropertyName("highlight_filter")] public bool? HighlightFilter { get; set; } + + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
[JsonInclude, JsonPropertyName("highlight_query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQuery { get; set; } [JsonInclude, JsonPropertyName("matched_fields")] public Elastic.Clients.Elasticsearch.Fields? MatchedFields { get; set; } + + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
[JsonInclude, JsonPropertyName("max_analyzed_offset")] public int? MaxAnalyzedOffset { get; set; } [JsonInclude, JsonPropertyName("max_fragment_length")] public int? MaxFragmentLength { get; set; } + + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// [JsonInclude, JsonPropertyName("no_match_size")] public int? NoMatchSize { get; set; } + + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
[JsonInclude, JsonPropertyName("number_of_fragments")] public int? NumberOfFragments { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
[JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? Order { get; set; } + + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
[JsonInclude, JsonPropertyName("phrase_limit")] public int? PhraseLimit { get; set; } + + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("post_tags")] public ICollection? PostTags { get; set; } + + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
[JsonInclude, JsonPropertyName("pre_tags")] public ICollection? PreTags { get; set; } + + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
[JsonInclude, JsonPropertyName("require_field_match")] public bool? RequireFieldMatch { get; set; } + + /// + /// Set to `styled` to use the built-in tag schema. + /// [JsonInclude, JsonPropertyName("tags_schema")] public Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchema { get; set; } [JsonInclude, JsonPropertyName("type")] @@ -87,19 +149,18 @@ public HighlightFieldDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Analysis.Analyzers? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.IAnalyzer? AnalyzerValue { get; set; } private string? BoundaryCharsValue { get; set; } private int? BoundaryMaxScanValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } private string? BoundaryScannerLocaleValue { get; set; } - private bool? ForceSourceValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentOffsetValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQueryValue { get; set; } - private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } - private Action> HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action> HighlightQueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Fields? MatchedFieldsValue { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } @@ -114,42 +175,51 @@ public HighlightFieldDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? TypeValue { get; set; } - public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Analysis.Analyzers? analyzer) + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// A string that contains each boundary character. + /// public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; return Self; } - public HighlightFieldDescriptor ForceSource(bool? forceSource = true) - { - ForceSourceValue = forceSource; - return Self; - } - + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; @@ -162,6 +232,9 @@ public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightFieldDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -174,6 +247,9 @@ public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -182,7 +258,7 @@ public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasti return Self; } - public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -190,7 +266,7 @@ public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescript return Self; } - public HighlightFieldDescriptor HighlightQuery(Action> configure) + public HighlightFieldDescriptor HighlightQuery(Action> configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -204,6 +280,9 @@ public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elastic return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -216,12 +295,18 @@ public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLen return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -234,36 +319,54 @@ public HighlightFieldDescriptor Options(Func + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ /// public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -309,12 +412,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(BoundaryScannerLocaleValue); } - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -347,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { @@ -445,19 +542,18 @@ public HighlightFieldDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Analysis.Analyzers? AnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.IAnalyzer? AnalyzerValue { get; set; } private string? BoundaryCharsValue { get; set; } private int? BoundaryMaxScanValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? BoundaryScannerValue { get; set; } private string? BoundaryScannerLocaleValue { get; set; } - private bool? ForceSourceValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? FragmenterValue { get; set; } private int? FragmentOffsetValue { get; set; } private int? FragmentSizeValue { get; set; } private bool? HighlightFilterValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? HighlightQueryValue { get; set; } - private QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } - private Action HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor HighlightQueryDescriptor { get; set; } + private Action HighlightQueryDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Fields? MatchedFieldsValue { get; set; } private int? MaxAnalyzedOffsetValue { get; set; } private int? MaxFragmentLengthValue { get; set; } @@ -472,42 +568,51 @@ public HighlightFieldDescriptor() : base() private Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? TagsSchemaValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? TypeValue { get; set; } - public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Analysis.Analyzers? analyzer) + public HighlightFieldDescriptor Analyzer(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// A string that contains each boundary character. + /// public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; return Self; } + /// + /// How far to scan for boundary characters. + /// public HighlightFieldDescriptor BoundaryMaxScan(int? boundaryMaxScan) { BoundaryMaxScanValue = boundaryMaxScan; return Self; } + /// + /// Specifies how to break the highlighted fragments: chars, sentence, or word.
Only valid for the unified and fvh highlighters.
Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor BoundaryScanner(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? boundaryScanner) { BoundaryScannerValue = boundaryScanner; return Self; } + /// + /// Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
+ ///
public HighlightFieldDescriptor BoundaryScannerLocale(string? boundaryScannerLocale) { BoundaryScannerLocaleValue = boundaryScannerLocale; return Self; } - public HighlightFieldDescriptor ForceSource(bool? forceSource = true) - { - ForceSourceValue = forceSource; - return Self; - } - + /// + /// Specifies how text should be broken up in highlight snippets: `simple` or `span`.
Only valid for the `plain` highlighter.
+ ///
public HighlightFieldDescriptor Fragmenter(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? fragmenter) { FragmenterValue = fragmenter; @@ -520,6 +625,9 @@ public HighlightFieldDescriptor FragmentOffset(int? fragmentOffset) return Self; } + /// + /// The size of the highlighted fragment in characters. + /// public HighlightFieldDescriptor FragmentSize(int? fragmentSize) { FragmentSizeValue = fragmentSize; @@ -532,6 +640,9 @@ public HighlightFieldDescriptor HighlightFilter(bool? highlightFilter = true) return Self; } + /// + /// Highlight matches for a query other than the search query.
This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
+ ///
public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.Query? highlightQuery) { HighlightQueryDescriptor = null; @@ -540,7 +651,7 @@ public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.Que return Self; } - public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descriptor) + public HighlightFieldDescriptor HighlightQuery(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { HighlightQueryValue = null; HighlightQueryDescriptorAction = null; @@ -548,7 +659,7 @@ public HighlightFieldDescriptor HighlightQuery(QueryDsl.QueryDescriptor descript return Self; } - public HighlightFieldDescriptor HighlightQuery(Action configure) + public HighlightFieldDescriptor HighlightQuery(Action configure) { HighlightQueryValue = null; HighlightQueryDescriptor = null; @@ -562,6 +673,9 @@ public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elasticsearch.Fiel return Self; } + /// + /// If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it’s set to lower value than the query setting.
+ ///
public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -574,12 +688,18 @@ public HighlightFieldDescriptor MaxFragmentLength(int? maxFragmentLength) return Self; } + /// + /// The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. + /// public HighlightFieldDescriptor NoMatchSize(int? noMatchSize) { NoMatchSizeValue = noMatchSize; return Self; } + /// + /// The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
+ ///
public HighlightFieldDescriptor NumberOfFragments(int? numberOfFragments) { NumberOfFragmentsValue = numberOfFragments; @@ -592,36 +712,54 @@ public HighlightFieldDescriptor Options(Func, F return Self; } + /// + /// Sorts highlighted fragments by score when set to `score`.
By default, fragments will be output in the order they appear in the field (order: `none`).
Setting this option to `score` will output the most relevant fragments first.
Each highlighter applies its own logic to compute relevancy scores.
+ ///
public HighlightFieldDescriptor Order(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? order) { OrderValue = order; return Self; } + /// + /// Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
+ ///
public HighlightFieldDescriptor PhraseLimit(int? phraseLimit) { PhraseLimitValue = phraseLimit; return Self; } + /// + /// Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PostTags(ICollection? postTags) { PostTagsValue = postTags; return Self; } + /// + /// Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `` and `` tags.
+ ///
public HighlightFieldDescriptor PreTags(ICollection? preTags) { PreTagsValue = preTags; return Self; } + /// + /// By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
+ ///
public HighlightFieldDescriptor RequireFieldMatch(bool? requireFieldMatch = true) { RequireFieldMatchValue = requireFieldMatch; return Self; } + /// + /// Set to `styled` to use the built-in tag schema. + /// public HighlightFieldDescriptor TagsSchema(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? tagsSchema) { TagsSchemaValue = tagsSchema; @@ -667,12 +805,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(BoundaryScannerLocaleValue); } - if (ForceSourceValue.HasValue) - { - writer.WritePropertyName("force_source"); - writer.WriteBooleanValue(ForceSourceValue.Value); - } - if (FragmenterValue is not null) { writer.WritePropertyName("fragmenter"); @@ -705,7 +837,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightQueryDescriptorAction is not null) { writer.WritePropertyName("highlight_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(HighlightQueryDescriptorAction), options); } else if (HighlightQueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs index 62955edaddf..3429c70092f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs @@ -31,12 +31,22 @@ public sealed partial class Hit { [JsonInclude, JsonPropertyName("_explanation")] public Elastic.Clients.Elasticsearch.Core.Explain.Explanation? Explanation { get; init; } + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary? Fields { get; init; } + [JsonInclude, JsonPropertyName("highlight")] + public IReadOnlyDictionary>? Highlight { get; init; } [JsonInclude, JsonPropertyName("_id")] public string Id { get; init; } [JsonInclude, JsonPropertyName("_ignored")] public IReadOnlyCollection? Ignored { get; init; } + [JsonInclude, JsonPropertyName("ignored_field_values")] + public IReadOnlyDictionary>? IgnoredFieldValues { get; init; } [JsonInclude, JsonPropertyName("_index")] public string Index { get; init; } + [JsonInclude, JsonPropertyName("inner_hits")] + public IReadOnlyDictionary? InnerHits { get; init; } + [JsonInclude, JsonPropertyName("matched_queries")] + public IReadOnlyCollection? MatchedQueries { get; init; } [JsonInclude, JsonPropertyName("_nested")] public Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity? Nested { get; init; } [JsonInclude, JsonPropertyName("_node")] @@ -51,21 +61,10 @@ public sealed partial class Hit public long? SeqNo { get; init; } [JsonInclude, JsonPropertyName("_shard")] public string? Shard { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public IReadOnlyCollection? Sort { 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/_Generated/Types/Core/Search/HitsMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs index c9b097e69f6..91fd4e06a0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs @@ -38,5 +38,5 @@ public sealed partial class HitsMetadata /// Total hit count information, present only if `track_total_hits` wasn't `false` in the search request. /// [JsonInclude, JsonPropertyName("total")] - public Elastic.Clients.Elasticsearch.Core.Search.TotalHits? Total { get; init; } + public Union? Total { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs index dcf68273f0c..16b1a958d9c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs @@ -29,8 +29,6 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class InnerHits { - [JsonInclude, JsonPropertyName("_source")] - public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } [JsonInclude, JsonPropertyName("collapse")] public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; } [JsonInclude, JsonPropertyName("docvalue_fields")] @@ -72,8 +70,10 @@ public sealed partial class InnerHits [JsonInclude, JsonPropertyName("sort")] [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))] public ICollection? Sort { get; set; } - [JsonInclude, JsonPropertyName("stored_field")] - public Elastic.Clients.Elasticsearch.Fields? StoredField { get; set; } + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } + [JsonInclude, JsonPropertyName("stored_fields")] + public Elastic.Clients.Elasticsearch.Fields? StoredFields { get; set; } [JsonInclude, JsonPropertyName("track_scores")] public bool? TrackScores { get; set; } [JsonInclude, JsonPropertyName("version")] @@ -89,29 +89,29 @@ public InnerHitsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action> CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action> DocvalueFieldsDescriptorAction { get; set; } + private Action>[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private HighlightDescriptor HighlightDescriptor { get; set; } - private Action> HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action> HighlightDescriptorAction { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } + private Action>[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } - private Elastic.Clients.Elasticsearch.Fields? StoredFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } private bool? VersionValue { get; set; } @@ -123,7 +123,7 @@ public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Cor return Self; } - public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -131,7 +131,7 @@ public InnerHitsDescriptor Collapse(FieldCollapseDescriptor Collapse(Action> configure) + public InnerHitsDescriptor Collapse(Action> configure) { CollapseValue = null; CollapseDescriptor = null; @@ -148,7 +148,7 @@ public InnerHitsDescriptor DocvalueFields(ICollection DocvalueFields(QueryDsl.FieldAndFormatDescriptor descriptor) + public InnerHitsDescriptor DocvalueFields(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor descriptor) { DocvalueFieldsValue = null; DocvalueFieldsDescriptorAction = null; @@ -157,7 +157,7 @@ public InnerHitsDescriptor DocvalueFields(QueryDsl.FieldAndFormatDesc return Self; } - public InnerHitsDescriptor DocvalueFields(Action> configure) + public InnerHitsDescriptor DocvalueFields(Action> configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -166,7 +166,7 @@ public InnerHitsDescriptor DocvalueFields(Action DocvalueFields(params Action>[] configure) + public InnerHitsDescriptor DocvalueFields(params Action>[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -204,7 +204,7 @@ public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Co return Self; } - public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -212,7 +212,7 @@ public InnerHitsDescriptor Highlight(HighlightDescriptor d return Self; } - public InnerHitsDescriptor Highlight(Action> configure) + public InnerHitsDescriptor Highlight(Action> configure) { HighlightValue = null; HighlightDescriptor = null; @@ -235,9 +235,9 @@ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Name? n return Self; } - public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + public InnerHitsDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -268,7 +268,7 @@ public InnerHitsDescriptor Sort(ICollection Sort(SortOptionsDescriptor descriptor) + public InnerHitsDescriptor Sort(Elastic.Clients.Elasticsearch.SortOptionsDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -277,7 +277,7 @@ public InnerHitsDescriptor Sort(SortOptionsDescriptor desc return Self; } - public InnerHitsDescriptor Sort(Action> configure) + public InnerHitsDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -286,7 +286,7 @@ public InnerHitsDescriptor Sort(Action Sort(params Action>[] configure) + public InnerHitsDescriptor Sort(params Action>[] configure) { SortValue = null; SortDescriptor = null; @@ -301,9 +301,9 @@ public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Core. return Self; } - public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Fields? storedField) + public InnerHitsDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fields? storedFields) { - StoredFieldValue = storedField; + StoredFieldsValue = storedFields; return Self; } @@ -330,7 +330,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -349,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -358,7 +358,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -395,7 +395,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -441,7 +441,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -450,7 +450,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -468,10 +468,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SourceValue, options); } - if (StoredFieldValue is not null) + if (StoredFieldsValue is not null) { - writer.WritePropertyName("stored_field"); - JsonSerializer.Serialize(writer, StoredFieldValue, options); + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); } if (TrackScoresValue.HasValue) @@ -499,29 +499,29 @@ public InnerHitsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; } - private FieldCollapseDescriptor CollapseDescriptor { get; set; } - private Action CollapseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; } + private Action DocvalueFieldsDescriptorAction { get; set; } + private Action[] DocvalueFieldsDescriptorActions { get; set; } private bool? ExplainValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? FieldsValue { get; set; } private int? FromValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; } - private HighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } - private IDictionary? ScriptFieldsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } private int? SizeValue { 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.SortOptionsDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } + private Action[] SortDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; } - private Elastic.Clients.Elasticsearch.Fields? StoredFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; } private bool? TrackScoresValue { get; set; } private bool? VersionValue { get; set; } @@ -533,7 +533,7 @@ public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.Fi return Self; } - public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) + public InnerHitsDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor) { CollapseValue = null; CollapseDescriptorAction = null; @@ -541,7 +541,7 @@ public InnerHitsDescriptor Collapse(FieldCollapseDescriptor descriptor) return Self; } - public InnerHitsDescriptor Collapse(Action configure) + public InnerHitsDescriptor Collapse(Action configure) { CollapseValue = null; CollapseDescriptor = null; @@ -558,7 +558,7 @@ public InnerHitsDescriptor DocvalueFields(ICollection configure) + public InnerHitsDescriptor DocvalueFields(Action configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -576,7 +576,7 @@ public InnerHitsDescriptor DocvalueFields(Action[] configure) + public InnerHitsDescriptor DocvalueFields(params Action[] configure) { DocvalueFieldsValue = null; DocvalueFieldsDescriptor = null; @@ -614,7 +614,7 @@ public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.H return Self; } - public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) + public InnerHitsDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -622,7 +622,7 @@ public InnerHitsDescriptor Highlight(HighlightDescriptor descriptor) return Self; } - public InnerHitsDescriptor Highlight(Action configure) + public InnerHitsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -645,9 +645,9 @@ public InnerHitsDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) return Self; } - public InnerHitsDescriptor ScriptFields(Func, FluentDictionary> selector) + public InnerHitsDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) { - ScriptFieldsValue = selector?.Invoke(new FluentDictionary()); + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -678,7 +678,7 @@ public InnerHitsDescriptor Sort(ICollection configure) + public InnerHitsDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -696,7 +696,7 @@ public InnerHitsDescriptor Sort(Action configure) return Self; } - public InnerHitsDescriptor Sort(params Action[] configure) + public InnerHitsDescriptor Sort(params Action[] configure) { SortValue = null; SortDescriptor = null; @@ -711,9 +711,9 @@ public InnerHitsDescriptor Source(Elastic.Clients.Elasticsearch.Core.Search.Sour return Self; } - public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Fields? storedField) + public InnerHitsDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fields? storedFields) { - StoredFieldValue = storedField; + StoredFieldsValue = storedFields; return Self; } @@ -740,7 +740,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollapseDescriptorAction is not null) { writer.WritePropertyName("collapse"); - JsonSerializer.Serialize(writer, new FieldCollapseDescriptor(CollapseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor(CollapseDescriptorAction), options); } else if (CollapseValue is not null) { @@ -759,7 +759,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("docvalue_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(DocvalueFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (DocvalueFieldsDescriptorActions is not null) @@ -768,7 +768,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DocvalueFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.FieldAndFormatDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor(action), options); } writer.WriteEndArray(); @@ -805,7 +805,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new HighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -851,7 +851,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(SortDescriptorAction), options); } else if (SortDescriptorActions is not null) { @@ -860,7 +860,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in SortDescriptorActions) { - JsonSerializer.Serialize(writer, new SortOptionsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.SortOptionsDescriptor(action), options); } if (SortDescriptorActions.Length > 1) @@ -878,10 +878,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SourceValue, options); } - if (StoredFieldValue is not null) + if (StoredFieldsValue is not null) { - writer.WritePropertyName("stored_field"); - JsonSerializer.Serialize(writer, StoredFieldValue, options); + writer.WritePropertyName("stored_fields"); + JsonSerializer.Serialize(writer, StoredFieldsValue, options); } if (TrackScoresValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs index 1389b2ab874..9d4bc0f501a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs @@ -35,7 +35,7 @@ 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 static implicit operator Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel(LaplaceSmoothingModel laplaceSmoothingModel) => Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel.Laplace(laplaceSmoothingModel); } public sealed partial class LaplaceSmoothingModelDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs index e20a03f1d05..4461774acae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs @@ -36,7 +36,7 @@ public sealed partial class LinearInterpolationSmoothingModel [JsonInclude, JsonPropertyName("unigram_lambda")] public double UnigramLambda { get; set; } - public static implicit operator SmoothingModel(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Core.Search.SmoothingModel.LinearInterpolation(linearInterpolationSmoothingModel); + public static implicit operator Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel(LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel.LinearInterpolation(linearInterpolationSmoothingModel); } public sealed partial class LinearInterpolationSmoothingModelDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs index eda9147767c..e4de6e163e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs @@ -29,10 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class NestedIdentity { - [JsonInclude, JsonPropertyName("_nested")] - public Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity? Nested { get; init; } [JsonInclude, JsonPropertyName("field")] public string Field { get; init; } + [JsonInclude, JsonPropertyName("_nested")] + public Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity? Nested { get; init; } [JsonInclude, JsonPropertyName("offset")] public int Offset { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs new file mode 100644 index 00000000000..d00e32970ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class PhraseSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption))] + public IReadOnlyCollection Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs index 8e8fba06b3d..08714bfc153 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs @@ -59,8 +59,8 @@ public PhraseSuggestCollateDescriptor() : base() private IDictionary? ParamsValue { get; set; } private bool? PruneValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery QueryValue { get; set; } - private PhraseSuggestCollateQueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } /// /// Parameters to use if the query is templated. @@ -91,7 +91,7 @@ public PhraseSuggestCollateDescriptor Query(Elastic.Clients.Elasticsearch.Core.S return Self; } - public PhraseSuggestCollateDescriptor Query(PhraseSuggestCollateQueryDescriptor descriptor) + public PhraseSuggestCollateDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -99,7 +99,7 @@ public PhraseSuggestCollateDescriptor Query(PhraseSuggestCollateQueryDescriptor return Self; } - public PhraseSuggestCollateDescriptor Query(Action configure) + public PhraseSuggestCollateDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -130,7 +130,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs new file mode 100644 index 00000000000..2cbd7b9d532 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class PhraseSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("highlighted")] + public string? Highlighted { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double Score { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs index 70cb6c8376c..5ec2ea6a966 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class PhraseSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } @@ -49,6 +52,10 @@ public sealed partial class PhraseSuggester ///
[JsonInclude, JsonPropertyName("direct_generator")] public ICollection? DirectGenerator { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } [JsonInclude, JsonPropertyName("force_unigrams")] @@ -89,6 +96,10 @@ public sealed partial class PhraseSuggester /// [JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -106,7 +117,7 @@ public sealed partial class PhraseSuggester [JsonInclude, JsonPropertyName("token_limit")] public int? TokenLimit { get; set; } - public static implicit operator FieldSuggester(PhraseSuggester phraseSuggester) => Core.Search.FieldSuggester.Phrase(phraseSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester(PhraseSuggester phraseSuggester) => Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester.Phrase(phraseSuggester); } public sealed partial class PhraseSuggesterDescriptor : SerializableDescriptor> @@ -119,30 +130,33 @@ public PhraseSuggesterDescriptor() : base() private string? AnalyzerValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate? CollateValue { get; set; } - private PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } - private Action CollateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } private double? ConfidenceValue { get; set; } private ICollection? DirectGeneratorValue { get; set; } - private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } - private Action> DirectGeneratorDescriptorAction { get; set; } - private Action>[] DirectGeneratorDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action> DirectGeneratorDescriptorAction { get; set; } + private Action>[] DirectGeneratorDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? ForceUnigramsValue { get; set; } private int? GramSizeValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight? HighlightValue { get; set; } - private PhraseSuggestHighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.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.Core.Search.SmoothingModel? SmoothingValue { get; set; } - private SmoothingModelDescriptor SmoothingDescriptor { get; set; } - private Action SmoothingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } private string? TextValue { get; set; } private int? TokenLimitValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public PhraseSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -160,7 +174,7 @@ public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearc return Self; } - public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor descriptor) { CollateValue = null; CollateDescriptorAction = null; @@ -168,7 +182,7 @@ public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescript return Self; } - public PhraseSuggesterDescriptor Collate(Action configure) + public PhraseSuggesterDescriptor Collate(Action configure) { CollateValue = null; CollateDescriptor = null; @@ -197,7 +211,7 @@ public PhraseSuggesterDescriptor DirectGenerator(ICollection DirectGenerator(DirectGeneratorDescriptor descriptor) + public PhraseSuggesterDescriptor DirectGenerator(Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor descriptor) { DirectGeneratorValue = null; DirectGeneratorDescriptorAction = null; @@ -206,7 +220,7 @@ public PhraseSuggesterDescriptor DirectGenerator(DirectGeneratorDescr return Self; } - public PhraseSuggesterDescriptor DirectGenerator(Action> configure) + public PhraseSuggesterDescriptor DirectGenerator(Action> configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -215,7 +229,7 @@ public PhraseSuggesterDescriptor DirectGenerator(Action DirectGenerator(params Action>[] configure) + public PhraseSuggesterDescriptor DirectGenerator(params Action>[] configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -224,18 +238,33 @@ public PhraseSuggesterDescriptor DirectGenerator(params Action + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public PhraseSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PhraseSuggesterDescriptor ForceUnigrams(bool? forceUnigrams = true) { ForceUnigramsValue = forceUnigrams; @@ -262,7 +291,7 @@ public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsea return Self; } - public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -270,7 +299,7 @@ public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDesc return Self; } - public PhraseSuggesterDescriptor Highlight(Action configure) + public PhraseSuggesterDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -314,6 +343,9 @@ public PhraseSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public PhraseSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -331,7 +363,7 @@ public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsea return Self; } - public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor descriptor) { SmoothingValue = null; SmoothingDescriptorAction = null; @@ -339,7 +371,7 @@ public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor d return Self; } - public PhraseSuggesterDescriptor Smoothing(Action configure) + public PhraseSuggesterDescriptor Smoothing(Action configure) { SmoothingValue = null; SmoothingDescriptor = null; @@ -379,7 +411,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollateDescriptorAction is not null) { writer.WritePropertyName("collate"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); } else if (CollateValue is not null) { @@ -404,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("direct_generator"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); writer.WriteEndArray(); } else if (DirectGeneratorDescriptorActions is not null) @@ -413,7 +445,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DirectGeneratorDescriptorActions) { - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor(action), options); } writer.WriteEndArray(); @@ -446,7 +478,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -492,7 +524,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SmoothingDescriptorAction is not null) { writer.WritePropertyName("smoothing"); - JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor(SmoothingDescriptorAction), options); } else if (SmoothingValue is not null) { @@ -526,30 +558,33 @@ public PhraseSuggesterDescriptor() : base() private string? AnalyzerValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate? CollateValue { get; set; } - private PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } - private Action CollateDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor CollateDescriptor { get; set; } + private Action CollateDescriptorAction { get; set; } private double? ConfidenceValue { get; set; } private ICollection? DirectGeneratorValue { get; set; } - private DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } - private Action DirectGeneratorDescriptorAction { get; set; } - private Action[] DirectGeneratorDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor DirectGeneratorDescriptor { get; set; } + private Action DirectGeneratorDescriptorAction { get; set; } + private Action[] DirectGeneratorDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? ForceUnigramsValue { get; set; } private int? GramSizeValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight? HighlightValue { get; set; } - private PhraseSuggestHighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.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.Core.Search.SmoothingModel? SmoothingValue { get; set; } - private SmoothingModelDescriptor SmoothingDescriptor { get; set; } - private Action SmoothingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor SmoothingDescriptor { get; set; } + private Action SmoothingDescriptorAction { get; set; } private string? TextValue { get; set; } private int? TokenLimitValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public PhraseSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; @@ -567,7 +602,7 @@ public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Core.Sear return Self; } - public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descriptor) + public PhraseSuggesterDescriptor Collate(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor descriptor) { CollateValue = null; CollateDescriptorAction = null; @@ -575,7 +610,7 @@ public PhraseSuggesterDescriptor Collate(PhraseSuggestCollateDescriptor descript return Self; } - public PhraseSuggesterDescriptor Collate(Action configure) + public PhraseSuggesterDescriptor Collate(Action configure) { CollateValue = null; CollateDescriptor = null; @@ -604,7 +639,7 @@ public PhraseSuggesterDescriptor DirectGenerator(ICollection configure) + public PhraseSuggesterDescriptor DirectGenerator(Action configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -622,7 +657,7 @@ public PhraseSuggesterDescriptor DirectGenerator(Action[] configure) + public PhraseSuggesterDescriptor DirectGenerator(params Action[] configure) { DirectGeneratorValue = null; DirectGeneratorDescriptor = null; @@ -631,18 +666,27 @@ public PhraseSuggesterDescriptor DirectGenerator(params Action + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ /// public PhraseSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public PhraseSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -675,7 +719,7 @@ public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Se return Self; } - public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor descriptor) + public PhraseSuggesterDescriptor Highlight(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -683,7 +727,7 @@ public PhraseSuggesterDescriptor Highlight(PhraseSuggestHighlightDescriptor desc return Self; } - public PhraseSuggesterDescriptor Highlight(Action configure) + public PhraseSuggesterDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -727,6 +771,9 @@ public PhraseSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public PhraseSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -744,7 +791,7 @@ public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Core.Se return Self; } - public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) + public PhraseSuggesterDescriptor Smoothing(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor descriptor) { SmoothingValue = null; SmoothingDescriptorAction = null; @@ -752,7 +799,7 @@ public PhraseSuggesterDescriptor Smoothing(SmoothingModelDescriptor descriptor) return Self; } - public PhraseSuggesterDescriptor Smoothing(Action configure) + public PhraseSuggesterDescriptor Smoothing(Action configure) { SmoothingValue = null; SmoothingDescriptor = null; @@ -792,7 +839,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CollateDescriptorAction is not null) { writer.WritePropertyName("collate"); - JsonSerializer.Serialize(writer, new PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateDescriptor(CollateDescriptorAction), options); } else if (CollateValue is not null) { @@ -817,7 +864,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("direct_generator"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor(DirectGeneratorDescriptorAction), options); writer.WriteEndArray(); } else if (DirectGeneratorDescriptorActions is not null) @@ -826,7 +873,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in DirectGeneratorDescriptorActions) { - JsonSerializer.Serialize(writer, new DirectGeneratorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorDescriptor(action), options); } writer.WriteEndArray(); @@ -859,7 +906,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -905,7 +952,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SmoothingDescriptorAction is not null) { writer.WritePropertyName("smoothing"); - JsonSerializer.Serialize(writer, new SmoothingModelDescriptor(SmoothingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelDescriptor(SmoothingDescriptorAction), options); } else if (SmoothingValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs index 0f3a61a953d..46b8536c9c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs @@ -33,7 +33,7 @@ public sealed partial class RegexOptions /// Optional operators for the regular expression. /// [JsonInclude, JsonPropertyName("flags")] - public Union? Flags { get; set; } + public object? Flags { get; set; } /// /// Maximum number of automaton states required for the query. @@ -50,13 +50,13 @@ public RegexOptionsDescriptor() : base() { } - private Union? FlagsValue { get; set; } + private object? FlagsValue { get; set; } private int? MaxDeterminizedStatesValue { get; set; } /// /// Optional operators for the regular expression. /// - public RegexOptionsDescriptor Flags(Union? flags) + public RegexOptionsDescriptor Flags(object? flags) { FlagsValue = flags; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs index 96ad9760416..f398005c17b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs @@ -44,8 +44,8 @@ public RescoreDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery QueryValue { get; set; } - private RescoreQueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private int? WindowSizeValue { get; set; } public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery query) @@ -56,7 +56,7 @@ public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Sea return Self; } - public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -64,7 +64,7 @@ public RescoreDescriptor Query(RescoreQueryDescriptor desc return Self; } - public RescoreDescriptor Query(Action> configure) + public RescoreDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -89,7 +89,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor(QueryDescriptorAction), options); } else { @@ -116,8 +116,8 @@ public RescoreDescriptor() : base() } private Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery QueryValue { get; set; } - private RescoreQueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private int? WindowSizeValue { get; set; } public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery query) @@ -128,7 +128,7 @@ public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.Rescore return Self; } - public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) + public RescoreDescriptor Query(Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -136,7 +136,7 @@ public RescoreDescriptor Query(RescoreQueryDescriptor descriptor) return Self; } - public RescoreDescriptor Query(Action configure) + public RescoreDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new RescoreQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs index 5e0be4614be..2923fd99d06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs @@ -29,18 +29,18 @@ namespace Elastic.Clients.Elasticsearch.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.QueryDsl.Query Query { get; set; } + /// + /// Relative importance of the original query versus the rescore query. + /// + [JsonInclude, JsonPropertyName("query_weight")] + public double? QueryWeight { get; set; } + /// /// Relative importance of the rescore query versus the original query. /// @@ -63,8 +63,8 @@ public RescoreQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private double? QueryWeightValue { get; set; } private double? RescoreQueryWeightValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? ScoreModeValue { get; set; } @@ -80,7 +80,7 @@ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.Que return Self; } - public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -88,7 +88,7 @@ public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor Query(Action> configure) + public RescoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -134,7 +134,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("rescore_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -173,8 +173,8 @@ public RescoreQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private double? QueryWeightValue { get; set; } private double? RescoreQueryWeightValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? ScoreModeValue { get; set; } @@ -190,7 +190,7 @@ public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query return Self; } - public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public RescoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -198,7 +198,7 @@ public RescoreQueryDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public RescoreQueryDescriptor Query(Action configure) + public RescoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -244,7 +244,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("rescore_query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs index b344d7eee76..210c8a79115 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -48,6 +49,18 @@ internal SmoothingModel(string variantName, object variant) public static SmoothingModel Laplace(Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => new SmoothingModel("laplace", laplaceSmoothingModel); public static SmoothingModel LinearInterpolation(Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => new SmoothingModel("linear_interpolation", linearInterpolationSmoothingModel); public static SmoothingModel StupidBackoff(Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => new SmoothingModel("stupid_backoff", stupidBackoffSmoothingModel); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class SmoothingModelConverter : JsonConverter @@ -59,42 +72,55 @@ public override SmoothingModel Read(ref Utf8JsonReader reader, Type typeToConver throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "laplace") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SmoothingModel(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "linear_interpolation") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new SmoothingModel(propertyName, variant); - } + if (propertyName == "laplace") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "stupid_backoff") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SmoothingModel(propertyName, variant); + if (propertyName == "linear_interpolation") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "stupid_backoff") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'SmoothingModel' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new SmoothingModel(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, SmoothingModel value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -146,31 +172,29 @@ private SmoothingModelDescriptor Set(object variant, string variantNa 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"); + public SmoothingModelDescriptor Laplace(Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(Elastic.Clients.Elasticsearch.Core.Search.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -206,31 +230,29 @@ private SmoothingModelDescriptor Set(object variant, string variantName) 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"); + public SmoothingModelDescriptor Laplace(Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel laplaceSmoothingModel) => Set(laplaceSmoothingModel, "laplace"); + public SmoothingModelDescriptor Laplace(Action configure) => Set(configure, "laplace"); + public SmoothingModelDescriptor LinearInterpolation(Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel linearInterpolationSmoothingModel) => Set(linearInterpolationSmoothingModel, "linear_interpolation"); + public SmoothingModelDescriptor LinearInterpolation(Action configure) => Set(configure, "linear_interpolation"); + public SmoothingModelDescriptor StupidBackoff(Elastic.Clients.Elasticsearch.Core.Search.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs index 9954ce3d2d4..64dbc8a8257 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs @@ -82,6 +82,48 @@ public sealed partial class SourceFilter public Elastic.Clients.Elasticsearch.Fields? Includes { get; set; } } +public sealed partial class SourceFilterDescriptor : SerializableDescriptor> +{ + internal SourceFilterDescriptor(Action> configure) => configure.Invoke(this); + + public SourceFilterDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields? ExcludesValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? IncludesValue { get; set; } + + public SourceFilterDescriptor Excludes(Elastic.Clients.Elasticsearch.Fields? excludes) + { + ExcludesValue = excludes; + return Self; + } + + public SourceFilterDescriptor Includes(Elastic.Clients.Elasticsearch.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(); + } +} + public sealed partial class SourceFilterDescriptor : SerializableDescriptor { internal SourceFilterDescriptor(Action configure) => configure.Invoke(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs index a9cab28c5e6..85e73ba2a51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs @@ -35,7 +35,7 @@ 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 static implicit operator Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel(StupidBackoffSmoothingModel stupidBackoffSmoothingModel) => Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel.StupidBackoff(stupidBackoffSmoothingModel); } public sealed partial class StupidBackoffSmoothingModelDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs new file mode 100644 index 00000000000..3cde4af0f69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.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.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public partial interface ISuggest +{ +} + +[GenericConverter(typeof(SuggestDictionaryConverter<>), unwrap: true)] +public partial class SuggestDictionary : IsAReadOnlyDictionary> +{ + public SuggestDictionary(IReadOnlyDictionary> backingDictionary) : base(backingDictionary) + { + } + + public IReadOnlyCollection>? GetCompletion(string key) => TryGet>(key); + public IReadOnlyCollection? GetPhrase(string key) => TryGet(key); + public IReadOnlyCollection? GetTerm(string key) => TryGet(key); + private IReadOnlyCollection? TryGet(string key) where T : class, ISuggest => BackingDictionary.TryGetValue(key, out var value) ? value.Cast().ToArray() : null; +} + +internal sealed partial class SuggestDictionaryConverter : JsonConverter> +{ + public override SuggestDictionary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var dictionary = new Dictionary>(); + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType != JsonTokenType.PropertyName) + throw new JsonException($"Expected {JsonTokenType.PropertyName} but read {reader.TokenType}."); + var name = reader.GetString(); + reader.Read(); + ReadItem(ref reader, options, dictionary, name); + } + + return new SuggestDictionary(dictionary); + } + + public override void Write(Utf8JsonWriter writer, SuggestDictionary value, JsonSerializerOptions options) + { + throw new NotImplementedException("'SuggestDictionary' is a readonly type, used only on responses and does not support being written to JSON."); + } + + public static void ReadItem(ref Utf8JsonReader reader, JsonSerializerOptions options, Dictionary> dictionary, string name) + { + var nameParts = name.Split('#'); + if (nameParts.Length != 2) + throw new JsonException($"Unable to parse typed-key '{name}'."); + var type = nameParts[0]; + switch (type) + { + case "completion": + { + var item = JsonSerializer.Deserialize>>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "phrase": + { + var item = JsonSerializer.Deserialize>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + case "term": + { + var item = JsonSerializer.Deserialize>(ref reader, options); + dictionary.Add(nameParts[1], item); + break; + } + + default: + throw new NotSupportedException($"The tagged variant '{type}' is currently not supported."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs index b3b2a8885fd..92796cf62dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs @@ -47,8 +47,8 @@ public override Suggester Read(ref Utf8JsonReader reader, Type typeToConvert, Js } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } @@ -59,7 +59,7 @@ public override Suggester Read(ref Utf8JsonReader reader, Type typeToConvert, Js public override void Write(Utf8JsonWriter writer, Suggester value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.Suggesters != null) + if (value.Suggesters is not null) { foreach (var additionalProperty in value.Suggesters) { @@ -81,6 +81,9 @@ public override void Write(Utf8JsonWriter writer, Suggester value, JsonSerialize [JsonConverter(typeof(SuggesterConverter))] public sealed partial class Suggester { + /// + /// The named suggesters + /// public IDictionary Suggesters { get; set; } /// @@ -89,6 +92,57 @@ public sealed partial class Suggester 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; } + + /// + /// The named suggesters + /// + public SuggesterDescriptor Suggesters(Func>, FluentDescriptorDictionary>> selector) + { + SuggestersValue = selector?.Invoke(new FluentDescriptorDictionary>()); + 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 is not null) + { + foreach (var additionalProperty in SuggestersValue) + { + writer.WritePropertyName(additionalProperty.Key); + JsonSerializer.Serialize(writer, additionalProperty.Value, options); + } + } + + writer.WriteEndObject(); + } +} + public sealed partial class SuggesterDescriptor : SerializableDescriptor { internal SuggesterDescriptor(Action configure) => configure.Invoke(this); @@ -97,12 +151,15 @@ public SuggesterDescriptor() : base() { } - private IDictionary SuggestersValue { get; set; } + private IDictionary SuggestersValue { get; set; } private string? TextValue { get; set; } - public SuggesterDescriptor Suggesters(Func, FluentDictionary> selector) + /// + /// The named suggesters + /// + public SuggesterDescriptor Suggesters(Func, FluentDescriptorDictionary> selector) { - SuggestersValue = selector?.Invoke(new FluentDictionary()); + SuggestersValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -124,7 +181,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(TextValue); } - if (SuggestersValue != null) + if (SuggestersValue is not null) { foreach (var additionalProperty in SuggestersValue) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs new file mode 100644 index 00000000000..c7a1b48092c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class TermSuggest : ISuggest +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } + [JsonInclude, JsonPropertyName("options")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption))] + public IReadOnlyCollection Options { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs new file mode 100644 index 00000000000..7e9a68f6618 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +public sealed partial class TermSuggestOption +{ + [JsonInclude, JsonPropertyName("collate_match")] + public bool? CollateMatch { get; init; } + [JsonInclude, JsonPropertyName("freq")] + public long Freq { get; init; } + [JsonInclude, JsonPropertyName("highlighted")] + public string? Highlighted { get; init; } + [JsonInclude, JsonPropertyName("score")] + public double Score { get; init; } + [JsonInclude, JsonPropertyName("text")] + public string Text { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs index ce92260d28d..8f5493f7326 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs @@ -29,8 +29,15 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; public sealed partial class TermSuggester { + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
[JsonInclude, JsonPropertyName("analyzer")] public string? Analyzer { get; set; } + + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } [JsonInclude, JsonPropertyName("lowercase_terms")] @@ -77,6 +84,10 @@ public sealed partial class TermSuggester ///
[JsonInclude, JsonPropertyName("shard_size")] public int? ShardSize { get; set; } + + /// + /// The maximum corrections to be returned per suggest text token. + /// [JsonInclude, JsonPropertyName("size")] public int? Size { get; set; } @@ -104,7 +115,7 @@ public sealed partial class TermSuggester [JsonInclude, JsonPropertyName("text")] public string? Text { get; set; } - public static implicit operator FieldSuggester(TermSuggester termSuggester) => Core.Search.FieldSuggester.Term(termSuggester); + public static implicit operator Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester(TermSuggester termSuggester) => Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester.Term(termSuggester); } public sealed partial class TermSuggesterDescriptor : SerializableDescriptor> @@ -131,24 +142,42 @@ public TermSuggesterDescriptor() : base() private Elastic.Clients.Elasticsearch.SuggestMode? SuggestModeValue { get; set; } private string? TextValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public TermSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
+ public TermSuggesterDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermSuggesterDescriptor LowercaseTerms(bool? lowercaseTerms = true) { LowercaseTermsValue = lowercaseTerms; @@ -218,6 +247,9 @@ public TermSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public TermSuggesterDescriptor Size(int? size) { SizeValue = size; @@ -377,24 +409,36 @@ public TermSuggesterDescriptor() : base() private Elastic.Clients.Elasticsearch.SuggestMode? SuggestModeValue { get; set; } private string? TextValue { get; set; } + /// + /// The analyzer to analyze the suggest text with.
Defaults to the search analyzer of the suggest field.
+ ///
public TermSuggesterDescriptor Analyzer(string? analyzer) { AnalyzerValue = analyzer; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; return Self; } + /// + /// The field to fetch the candidate suggestions from.
Needs to be set globally or per suggestion.
+ ///
public TermSuggesterDescriptor Field(Expression> field) { FieldValue = field; @@ -470,6 +514,9 @@ public TermSuggesterDescriptor ShardSize(int? shardSize) return Self; } + /// + /// The maximum corrections to be returned per suggest text token. + /// public TermSuggesterDescriptor Size(int? size) { SizeValue = size; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs index 68a030fd325..b14b40a42d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Core.SearchShards; public sealed partial class ShardStoreIndex { [JsonInclude, JsonPropertyName("aliases")] - public IReadOnlyCollection? Aliases { get; init; } + public IReadOnlyCollection? Aliases { get; init; } [JsonInclude, JsonPropertyName("filter")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? Filter { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs index c4ea0fe9d1c..955cd0de4f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; +/// +/// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. +/// public sealed partial class SourceConfig : Union { - public SourceConfig(bool fetch) : base(fetch) + public SourceConfig(bool Fetch) : base(Fetch) { } - public SourceConfig(Elastic.Clients.Elasticsearch.Core.Search.SourceFilter filter) : base(filter) + public SourceConfig(Elastic.Clients.Elasticsearch.Core.Search.SourceFilter Filter) : base(Filter) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs index 4048a18def2..9640a20a0cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; +/// +/// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
Used as a query parameter along with the `_source_includes` and `_source_excludes` parameters.
+///
public sealed partial class SourceConfigParam : Union { - public SourceConfigParam(bool fetch) : base(fetch) + public SourceConfigParam(bool Fetch) : base(Fetch) { } - public SourceConfigParam(Elastic.Clients.Elasticsearch.Fields fields) : base(fields) + public SourceConfigParam(Elastic.Clients.Elasticsearch.Fields Fields) : base(Fields) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs index a55d100efed..d10b1238bae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; +/// +/// 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 sealed partial class TrackHits : Union { - public TrackHits(bool enabled) : base(enabled) + public TrackHits(bool Enabled) : base(Enabled) { } - public TrackHits(int count) : base(count) + public TrackHits(int Count) : base(Count) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs new file mode 100644 index 00000000000..50cd3855639 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class AutoFollowPattern +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("pattern")] + public Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary Pattern { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs new file mode 100644 index 00000000000..93228b4c4fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class AutoFollowPatternSummary +{ + [JsonInclude, JsonPropertyName("active")] + public bool Active { get; init; } + + /// + /// The name of follower index. + /// + [JsonInclude, JsonPropertyName("follow_index_pattern")] + public string? FollowIndexPattern { get; init; } + + /// + /// An array of simple index patterns that can be used to exclude indices from being auto-followed. + /// + [JsonInclude, JsonPropertyName("leader_index_exclusion_patterns")] + public IReadOnlyCollection LeaderIndexExclusionPatterns { get; init; } + + /// + /// An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field. + /// + [JsonInclude, JsonPropertyName("leader_index_patterns")] + public IReadOnlyCollection LeaderIndexPatterns { get; init; } + + /// + /// The maximum number of outstanding reads requests from the remote cluster. + /// + [JsonInclude, JsonPropertyName("max_outstanding_read_requests")] + public int MaxOutstandingReadRequests { get; init; } + + /// + /// The remote cluster containing the leader indices to match against. + /// + [JsonInclude, JsonPropertyName("remote_cluster")] + public string RemoteCluster { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs new file mode 100644 index 00000000000..fb98faedc6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class AutoFollowStats +{ + [JsonInclude, JsonPropertyName("auto_followed_clusters")] + public IReadOnlyCollection AutoFollowedClusters { get; init; } + [JsonInclude, JsonPropertyName("number_of_failed_follow_indices")] + public long NumberOfFailedFollowIndices { get; init; } + [JsonInclude, JsonPropertyName("number_of_failed_remote_cluster_state_requests")] + public long NumberOfFailedRemoteClusterStateRequests { get; init; } + [JsonInclude, JsonPropertyName("number_of_successful_follow_indices")] + public long NumberOfSuccessfulFollowIndices { get; init; } + [JsonInclude, JsonPropertyName("recent_auto_follow_errors")] + public IReadOnlyCollection RecentAutoFollowErrors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs new file mode 100644 index 00000000000..7d0f31c5d2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class AutoFollowedCluster +{ + [JsonInclude, JsonPropertyName("cluster_name")] + public string ClusterName { get; init; } + [JsonInclude, JsonPropertyName("last_seen_metadata_version")] + public long LastSeenMetadataVersion { get; init; } + [JsonInclude, JsonPropertyName("time_since_last_check_millis")] + public long TimeSinceLastCheckMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs new file mode 100644 index 00000000000..f0a6e69d15d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowIndexStats +{ + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyCollection Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FeaturesConverter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/FeaturesConverter.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs index 18e3ec507e6..25583f2567b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FeaturesConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs @@ -17,19 +17,18 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Core; using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.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; +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed class FeaturesConverter : SingleOrManyCollectionConverter +public sealed partial class FollowStats { + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs new file mode 100644 index 00000000000..f7ac41cadec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowerIndex +{ + [JsonInclude, JsonPropertyName("follower_index")] + public string FollowerIndexValue { get; init; } + [JsonInclude, JsonPropertyName("leader_index")] + public string LeaderIndex { get; init; } + [JsonInclude, JsonPropertyName("parameters")] + public Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters? Parameters { get; init; } + [JsonInclude, JsonPropertyName("remote_cluster")] + public string RemoteCluster { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexStatus Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs new file mode 100644 index 00000000000..06ff51f8ada --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class FollowerIndexParameters +{ + [JsonInclude, JsonPropertyName("max_outstanding_read_requests")] + public int MaxOutstandingReadRequests { get; init; } + [JsonInclude, JsonPropertyName("max_outstanding_write_requests")] + public int MaxOutstandingWriteRequests { get; init; } + [JsonInclude, JsonPropertyName("max_read_request_operation_count")] + public int MaxReadRequestOperationCount { get; init; } + [JsonInclude, JsonPropertyName("max_read_request_size")] + public string MaxReadRequestSize { get; init; } + [JsonInclude, JsonPropertyName("max_retry_delay")] + public Elastic.Clients.Elasticsearch.Duration MaxRetryDelay { get; init; } + [JsonInclude, JsonPropertyName("max_write_buffer_count")] + public int MaxWriteBufferCount { get; init; } + [JsonInclude, JsonPropertyName("max_write_buffer_size")] + public string MaxWriteBufferSize { get; init; } + [JsonInclude, JsonPropertyName("max_write_request_operation_count")] + public int MaxWriteRequestOperationCount { get; init; } + [JsonInclude, JsonPropertyName("max_write_request_size")] + public string MaxWriteRequestSize { get; init; } + [JsonInclude, JsonPropertyName("read_poll_timeout")] + public Elastic.Clients.Elasticsearch.Duration ReadPollTimeout { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs new file mode 100644 index 00000000000..ecddd169e73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class ReadException +{ + [JsonInclude, JsonPropertyName("exception")] + public Elastic.Clients.Elasticsearch.ErrorCause Exception { get; init; } + [JsonInclude, JsonPropertyName("from_seq_no")] + public long FromSeqNo { get; init; } + [JsonInclude, JsonPropertyName("retries")] + public int Retries { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs new file mode 100644 index 00000000000..c14f686d4c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +public sealed partial class ShardStats +{ + [JsonInclude, JsonPropertyName("bytes_read")] + public long BytesRead { get; init; } + [JsonInclude, JsonPropertyName("failed_read_requests")] + public long FailedReadRequests { get; init; } + [JsonInclude, JsonPropertyName("failed_write_requests")] + public long FailedWriteRequests { get; init; } + [JsonInclude, JsonPropertyName("fatal_exception")] + public Elastic.Clients.Elasticsearch.ErrorCause? FatalException { get; init; } + [JsonInclude, JsonPropertyName("follower_aliases_version")] + public long FollowerAliasesVersion { get; init; } + [JsonInclude, JsonPropertyName("follower_global_checkpoint")] + public long FollowerGlobalCheckpoint { get; init; } + [JsonInclude, JsonPropertyName("follower_index")] + public string FollowerIndex { get; init; } + [JsonInclude, JsonPropertyName("follower_mapping_version")] + public long FollowerMappingVersion { get; init; } + [JsonInclude, JsonPropertyName("follower_max_seq_no")] + public long FollowerMaxSeqNo { get; init; } + [JsonInclude, JsonPropertyName("follower_settings_version")] + public long FollowerSettingsVersion { get; init; } + [JsonInclude, JsonPropertyName("last_requested_seq_no")] + public long LastRequestedSeqNo { get; init; } + [JsonInclude, JsonPropertyName("leader_global_checkpoint")] + public long LeaderGlobalCheckpoint { get; init; } + [JsonInclude, JsonPropertyName("leader_index")] + public string LeaderIndex { get; init; } + [JsonInclude, JsonPropertyName("leader_max_seq_no")] + public long LeaderMaxSeqNo { get; init; } + [JsonInclude, JsonPropertyName("operations_read")] + public long OperationsRead { get; init; } + [JsonInclude, JsonPropertyName("operations_written")] + public long OperationsWritten { get; init; } + [JsonInclude, JsonPropertyName("outstanding_read_requests")] + public int OutstandingReadRequests { get; init; } + [JsonInclude, JsonPropertyName("outstanding_write_requests")] + public int OutstandingWriteRequests { get; init; } + [JsonInclude, JsonPropertyName("read_exceptions")] + public IReadOnlyCollection ReadExceptions { get; init; } + [JsonInclude, JsonPropertyName("remote_cluster")] + public string RemoteCluster { get; init; } + [JsonInclude, JsonPropertyName("shard_id")] + public int ShardId { get; init; } + [JsonInclude, JsonPropertyName("successful_read_requests")] + public long SuccessfulReadRequests { get; init; } + [JsonInclude, JsonPropertyName("successful_write_requests")] + public long SuccessfulWriteRequests { get; init; } + [JsonInclude, JsonPropertyName("time_since_last_read")] + public Elastic.Clients.Elasticsearch.Duration? TimeSinceLastRead { get; init; } + [JsonInclude, JsonPropertyName("time_since_last_read_millis")] + public long TimeSinceLastReadMillis { get; init; } + [JsonInclude, JsonPropertyName("total_read_remote_exec_time")] + public Elastic.Clients.Elasticsearch.Duration? TotalReadRemoteExecTime { get; init; } + [JsonInclude, JsonPropertyName("total_read_remote_exec_time_millis")] + public long TotalReadRemoteExecTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("total_read_time")] + public Elastic.Clients.Elasticsearch.Duration? TotalReadTime { get; init; } + [JsonInclude, JsonPropertyName("total_read_time_millis")] + public long TotalReadTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("total_write_time")] + public Elastic.Clients.Elasticsearch.Duration? TotalWriteTime { get; init; } + [JsonInclude, JsonPropertyName("total_write_time_millis")] + public long TotalWriteTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("write_buffer_operation_count")] + public long WriteBufferOperationCount { get; init; } + [JsonInclude, JsonPropertyName("write_buffer_size_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize WriteBufferSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs index 4f03b75408e..5dc8b54516f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs @@ -36,5 +36,6 @@ public sealed partial class DanglingIndex [JsonInclude, JsonPropertyName("index_uuid")] public string IndexUuid { get; init; } [JsonInclude, JsonPropertyName("node_ids")] - public Elastic.Clients.Elasticsearch.Ids NodeIds { get; init; } + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection NodeIds { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs new file mode 100644 index 00000000000..998131b05e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +/// +/// Reduced (minimal) info ElasticsearchVersion +/// +public sealed partial class ElasticsearchVersionMinInfo +{ + [JsonInclude, JsonPropertyName("build_flavor")] + public string BuildFlavor { 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/_Generated/Types/EmptyObject.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs index 0a52b484c77..159260b6097 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs @@ -47,5 +47,7 @@ public EmptyObjectDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs index 95b7a193bec..33f827ae764 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs @@ -40,7 +40,7 @@ public sealed partial class EnrichPolicy [JsonInclude, JsonPropertyName("name")] public Elastic.Clients.Elasticsearch.Name? Name { get; set; } [JsonInclude, JsonPropertyName("query")] - public string? Query { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } } public sealed partial class EnrichPolicyDescriptor : SerializableDescriptor> @@ -56,7 +56,9 @@ public EnrichPolicyDescriptor() : base() private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } private Elastic.Clients.Elasticsearch.Field MatchFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } - private string? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) { @@ -88,18 +90,42 @@ public EnrichPolicyDescriptor MatchField(Expression MatchField(Expression> matchField) + { + MatchFieldValue = matchField; + return Self; + } + public EnrichPolicyDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) { NameValue = name; return Self; } - public EnrichPolicyDescriptor Query(string? query) + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) { + QueryDescriptor = null; + QueryDescriptorAction = null; QueryValue = query; return Self; } + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EnrichPolicyDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -121,10 +147,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); } - if (!string.IsNullOrEmpty(QueryValue)) + if (QueryDescriptor is not null) { writer.WritePropertyName("query"); - writer.WriteStringValue(QueryValue); + JsonSerializer.Serialize(writer, QueryDescriptor, options); + } + else if (QueryDescriptorAction is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); } writer.WriteEndObject(); @@ -144,7 +180,9 @@ public EnrichPolicyDescriptor() : base() private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } private Elastic.Clients.Elasticsearch.Field MatchFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Name? NameValue { get; set; } - private string? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } public EnrichPolicyDescriptor ElasticsearchVersion(string? elasticsearchVersion) { @@ -188,12 +226,30 @@ public EnrichPolicyDescriptor Name(Elastic.Clients.Elasticsearch.Name? name) return Self; } - public EnrichPolicyDescriptor Query(string? query) + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) { + QueryDescriptor = null; + QueryDescriptorAction = null; QueryValue = query; return Self; } + public EnrichPolicyDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public EnrichPolicyDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -215,10 +271,20 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, NameValue, options); } - if (!string.IsNullOrEmpty(QueryValue)) + 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) { writer.WritePropertyName("query"); - writer.WriteStringValue(QueryValue); + JsonSerializer.Serialize(writer, QueryValue, options); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs index 9298d4e11d3..7d5d1fe4fc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs @@ -30,5 +30,5 @@ namespace Elastic.Clients.Elasticsearch.Enrich; public sealed partial class EnrichSummary { [JsonInclude, JsonPropertyName("config")] - public KeyValuePair Config { get; init; } + public IReadOnlyDictionary Config { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs index f8c27eb1444..3436e218500 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Aggregations; @@ -82,7 +82,8 @@ public override CalendarInterval Read(ref Utf8JsonReader reader, Type typeToConv return CalendarInterval.Day; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CalendarInterval value, JsonSerializerOptions options) @@ -168,7 +169,8 @@ public override CardinalityExecutionMode Read(ref Utf8JsonReader reader, Type ty return CardinalityExecutionMode.Direct; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CardinalityExecutionMode value, JsonSerializerOptions options) @@ -231,7 +233,8 @@ public override GapPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, Js return GapPolicy.InsertZeros; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GapPolicy value, JsonSerializerOptions options) @@ -291,7 +294,8 @@ public override MinimumInterval Read(ref Utf8JsonReader reader, Type typeToConve return MinimumInterval.Day; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MinimumInterval value, JsonSerializerOptions options) @@ -348,7 +352,8 @@ public override MissingOrder Read(ref Utf8JsonReader reader, Type typeToConvert, return MissingOrder.Default; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MissingOrder value, JsonSerializerOptions options) @@ -370,6 +375,94 @@ public override void Write(Utf8JsonWriter writer, MissingOrder value, JsonSerial } } +[JsonConverter(typeof(NormalizeMethodConverter))] +public enum NormalizeMethod +{ + /// + /// This method normalizes such that each value represents how far it is from the mean relative to the standard deviation. + /// + [EnumMember(Value = "z-score")] + ZScore, + /// + /// This method normalizes such that each value is exponentiated and relative to the sum of the exponents of the original values. + /// + [EnumMember(Value = "softmax")] + Softmax, + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 100, with the rest normalized linearly in-between. + /// + [EnumMember(Value = "rescale_0_100")] + Rescale0100, + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 1, with the rest normalized linearly in-between. + /// + [EnumMember(Value = "rescale_0_1")] + Rescale01, + /// + /// This method normalizes each value so that it represents a percentage of the total sum it attributes to. + /// + [EnumMember(Value = "percent_of_sum")] + PercentOfSum, + /// + /// This method normalizes such that each value is normalized by how much it differs from the average. + /// + [EnumMember(Value = "mean")] + Mean +} + +internal sealed class NormalizeMethodConverter : JsonConverter +{ + public override NormalizeMethod Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "z-score": + return NormalizeMethod.ZScore; + case "softmax": + return NormalizeMethod.Softmax; + case "rescale_0_100": + return NormalizeMethod.Rescale0100; + case "rescale_0_1": + return NormalizeMethod.Rescale01; + case "percent_of_sum": + return NormalizeMethod.PercentOfSum; + case "mean": + return NormalizeMethod.Mean; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, NormalizeMethod value, JsonSerializerOptions options) + { + switch (value) + { + case NormalizeMethod.ZScore: + writer.WriteStringValue("z-score"); + return; + case NormalizeMethod.Softmax: + writer.WriteStringValue("softmax"); + return; + case NormalizeMethod.Rescale0100: + writer.WriteStringValue("rescale_0_100"); + return; + case NormalizeMethod.Rescale01: + writer.WriteStringValue("rescale_0_1"); + return; + case NormalizeMethod.PercentOfSum: + writer.WriteStringValue("percent_of_sum"); + return; + case NormalizeMethod.Mean: + writer.WriteStringValue("mean"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(RateModeConverter))] public enum RateMode { @@ -398,7 +491,8 @@ public override RateMode Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return RateMode.Sum; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RateMode value, JsonSerializerOptions options) @@ -452,7 +546,8 @@ public override SamplerAggregationExecutionHint Read(ref Utf8JsonReader reader, return SamplerAggregationExecutionHint.BytesHash; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SamplerAggregationExecutionHint value, JsonSerializerOptions options) @@ -502,7 +597,8 @@ public override TermsAggregationCollectMode Read(ref Utf8JsonReader reader, Type return TermsAggregationCollectMode.BreadthFirst; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermsAggregationCollectMode value, JsonSerializerOptions options) @@ -551,7 +647,8 @@ public override TermsAggregationExecutionHint Read(ref Utf8JsonReader reader, Ty return TermsAggregationExecutionHint.GlobalOrdinals; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermsAggregationExecutionHint value, JsonSerializerOptions options) @@ -611,7 +708,8 @@ public override TTestType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return TTestType.Heteroscedastic; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TTestType value, JsonSerializerOptions options) @@ -687,7 +785,8 @@ public override ValueType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ValueType.Boolean; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ValueType value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs index 98749056ebd..dae02bf828f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Analysis; @@ -54,7 +54,8 @@ public override DelimitedPayloadEncoding Read(ref Utf8JsonReader reader, Type ty return DelimitedPayloadEncoding.Float; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DelimitedPayloadEncoding value, JsonSerializerOptions options) @@ -98,7 +99,8 @@ public override EdgeNGramSide Read(ref Utf8JsonReader reader, Type typeToConvert return EdgeNGramSide.Back; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, EdgeNGramSide value, JsonSerializerOptions options) @@ -139,7 +141,8 @@ public override IcuCollationAlternate Read(ref Utf8JsonReader reader, Type typeT return IcuCollationAlternate.NonIgnorable; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationAlternate value, JsonSerializerOptions options) @@ -180,7 +183,8 @@ public override IcuCollationCaseFirst Read(ref Utf8JsonReader reader, Type typeT return IcuCollationCaseFirst.Lower; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationCaseFirst value, JsonSerializerOptions options) @@ -221,7 +225,8 @@ public override IcuCollationDecomposition Read(ref Utf8JsonReader reader, Type t return IcuCollationDecomposition.Identical; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationDecomposition value, JsonSerializerOptions options) @@ -274,7 +279,8 @@ public override IcuCollationStrength Read(ref Utf8JsonReader reader, Type typeTo return IcuCollationStrength.Identical; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuCollationStrength value, JsonSerializerOptions options) @@ -324,7 +330,8 @@ public override IcuNormalizationMode Read(ref Utf8JsonReader reader, Type typeTo return IcuNormalizationMode.Compose; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuNormalizationMode value, JsonSerializerOptions options) @@ -369,7 +376,8 @@ public override IcuNormalizationType Read(ref Utf8JsonReader reader, Type typeTo return IcuNormalizationType.Nfc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuNormalizationType value, JsonSerializerOptions options) @@ -413,7 +421,8 @@ public override IcuTransformDirection Read(ref Utf8JsonReader reader, Type typeT return IcuTransformDirection.Forward; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IcuTransformDirection value, JsonSerializerOptions options) @@ -454,7 +463,8 @@ public override KeepTypesMode Read(ref Utf8JsonReader reader, Type typeToConvert return KeepTypesMode.Exclude; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, KeepTypesMode value, JsonSerializerOptions options) @@ -499,7 +509,8 @@ public override KuromojiTokenizationMode Read(ref Utf8JsonReader reader, Type ty return KuromojiTokenizationMode.Extended; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, KuromojiTokenizationMode value, JsonSerializerOptions options) @@ -671,7 +682,8 @@ public override Language Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Language.Arabic; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Language value, JsonSerializerOptions options) @@ -812,7 +824,8 @@ public override NoriDecompoundMode Read(ref Utf8JsonReader reader, Type typeToCo return NoriDecompoundMode.Discard; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NoriDecompoundMode value, JsonSerializerOptions options) @@ -896,7 +909,8 @@ public override PhoneticEncoder Read(ref Utf8JsonReader reader, Type typeToConve return PhoneticEncoder.BeiderMorse; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticEncoder value, JsonSerializerOptions options) @@ -1007,7 +1021,8 @@ public override PhoneticLanguage Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticLanguage.Any; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticLanguage value, JsonSerializerOptions options) @@ -1082,7 +1097,8 @@ public override PhoneticNameType Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticNameType.Ashkenazi; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticNameType value, JsonSerializerOptions options) @@ -1126,7 +1142,8 @@ public override PhoneticRuleType Read(ref Utf8JsonReader reader, Type typeToConv return PhoneticRuleType.Approx; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PhoneticRuleType value, JsonSerializerOptions options) @@ -1247,7 +1264,8 @@ public override SnowballLanguage Read(ref Utf8JsonReader reader, Type typeToConv return SnowballLanguage.Armenian; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SnowballLanguage value, JsonSerializerOptions options) @@ -1348,7 +1366,8 @@ public override SynonymFormat Read(ref Utf8JsonReader reader, Type typeToConvert return SynonymFormat.Solr; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SynonymFormat value, JsonSerializerOptions options) @@ -1405,7 +1424,8 @@ public override TokenChar Read(ref Utf8JsonReader reader, Type typeToConvert, Js return TokenChar.Custom; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TokenChar value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs index ecab64c449e..f8a92c8f479 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Cluster; @@ -58,7 +58,8 @@ public override AllocationExplainDecision Read(ref Utf8JsonReader reader, Type t return AllocationExplainDecision.Always; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, AllocationExplainDecision value, JsonSerializerOptions options) @@ -129,7 +130,8 @@ public override Decision Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Decision.AllocationDelayed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Decision value, JsonSerializerOptions options) @@ -240,7 +242,8 @@ public override UnassignedInformationReason Read(ref Utf8JsonReader reader, Type return UnassignedInformationReason.AllocationFailed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, UnassignedInformationReason value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs new file mode 100644 index 00000000000..c3bc56ecfd4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.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.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +[JsonConverter(typeof(ImpactAreaConverter))] +public enum ImpactArea +{ + [EnumMember(Value = "search")] + Search, + [EnumMember(Value = "ingest")] + Ingest, + [EnumMember(Value = "deployment_management")] + DeploymentManagement, + [EnumMember(Value = "backup")] + Backup +} + +internal sealed class ImpactAreaConverter : JsonConverter +{ + public override ImpactArea Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "search": + return ImpactArea.Search; + case "ingest": + return ImpactArea.Ingest; + case "deployment_management": + return ImpactArea.DeploymentManagement; + case "backup": + return ImpactArea.Backup; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ImpactArea value, JsonSerializerOptions options) + { + switch (value) + { + case ImpactArea.Search: + writer.WriteStringValue("search"); + return; + case ImpactArea.Ingest: + writer.WriteStringValue("ingest"); + return; + case ImpactArea.DeploymentManagement: + writer.WriteStringValue("deployment_management"); + return; + case ImpactArea.Backup: + writer.WriteStringValue("backup"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IndicatorHealthStatusConverter))] +public enum IndicatorHealthStatus +{ + [EnumMember(Value = "yellow")] + Yellow, + [EnumMember(Value = "unknown")] + Unknown, + [EnumMember(Value = "red")] + Red, + [EnumMember(Value = "green")] + Green +} + +internal sealed class IndicatorHealthStatusConverter : JsonConverter +{ + public override IndicatorHealthStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yellow": + return IndicatorHealthStatus.Yellow; + case "unknown": + return IndicatorHealthStatus.Unknown; + case "red": + return IndicatorHealthStatus.Red; + case "green": + return IndicatorHealthStatus.Green; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, IndicatorHealthStatus value, JsonSerializerOptions options) + { + switch (value) + { + case IndicatorHealthStatus.Yellow: + writer.WriteStringValue("yellow"); + return; + case IndicatorHealthStatus.Unknown: + writer.WriteStringValue("unknown"); + return; + case IndicatorHealthStatus.Red: + writer.WriteStringValue("red"); + return; + case IndicatorHealthStatus.Green: + writer.WriteStringValue("green"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs index 11e5f488104..b37e6c1cf59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Core.Search; @@ -63,7 +63,8 @@ public override BoundaryScanner Read(ref Utf8JsonReader reader, Type typeToConve return BoundaryScanner.Chars; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, BoundaryScanner value, JsonSerializerOptions options) @@ -107,7 +108,8 @@ public override HighlighterEncoder Read(ref Utf8JsonReader reader, Type typeToCo return HighlighterEncoder.Default; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterEncoder value, JsonSerializerOptions options) @@ -148,7 +150,8 @@ public override HighlighterFragmenter Read(ref Utf8JsonReader reader, Type typeT return HighlighterFragmenter.Simple; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterFragmenter value, JsonSerializerOptions options) @@ -185,7 +188,8 @@ public override HighlighterOrder Read(ref Utf8JsonReader reader, Type typeToConv return HighlighterOrder.Score; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterOrder value, JsonSerializerOptions options) @@ -219,7 +223,8 @@ public override HighlighterTagsSchema Read(ref Utf8JsonReader reader, Type typeT return HighlighterTagsSchema.Styled; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HighlighterTagsSchema value, JsonSerializerOptions options) @@ -321,7 +326,8 @@ public override ScoreMode Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ScoreMode value, JsonSerializerOptions options) @@ -398,7 +404,8 @@ public override StringDistance Read(ref Utf8JsonReader reader, Type typeToConver return StringDistance.DamerauLevenshtein; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, StringDistance value, JsonSerializerOptions options) @@ -454,7 +461,8 @@ public override SuggestSort Read(ref Utf8JsonReader reader, Type typeToConvert, return SuggestSort.Frequency; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SuggestSort value, JsonSerializerOptions options) @@ -501,7 +509,8 @@ public override TotalHitsRelation Read(ref Utf8JsonReader reader, Type typeToCon return TotalHitsRelation.Eq; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TotalHitsRelation value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs new file mode 100644 index 00000000000..ba5a373ae24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.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.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchMvt; + +[JsonConverter(typeof(GridAggregationTypeConverter))] +public enum GridAggregationType +{ + [EnumMember(Value = "geotile")] + Geotile, + [EnumMember(Value = "geohex")] + Geohex +} + +internal sealed class GridAggregationTypeConverter : JsonConverter +{ + public override GridAggregationType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "geotile": + return GridAggregationType.Geotile; + case "geohex": + return GridAggregationType.Geohex; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, GridAggregationType value, JsonSerializerOptions options) + { + switch (value) + { + case GridAggregationType.Geotile: + writer.WriteStringValue("geotile"); + return; + case GridAggregationType.Geohex: + writer.WriteStringValue("geohex"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(GridTypeConverter))] +public enum GridType +{ + [EnumMember(Value = "point")] + Point, + [EnumMember(Value = "grid")] + Grid, + [EnumMember(Value = "centroid")] + Centroid +} + +internal sealed class GridTypeConverter : JsonConverter +{ + public override GridType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "point": + return GridType.Point; + case "grid": + return GridType.Grid; + case "centroid": + return GridType.Centroid; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, GridType value, JsonSerializerOptions options) + { + switch (value) + { + case GridType.Point: + writer.WriteStringValue("point"); + return; + case GridType.Grid: + writer.WriteStringValue("grid"); + return; + case GridType.Centroid: + writer.WriteStringValue("centroid"); + 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/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs similarity index 56% rename from src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs index bd5061fb692..b7c7782a161 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Enums/Enums.Ml.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs @@ -17,58 +17,52 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; 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; +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -[JsonConverter(typeof(TokenizationTruncateConverter))] -public enum TokenizationTruncate +[JsonConverter(typeof(FollowerIndexStatusConverter))] +public enum FollowerIndexStatus { - [EnumMember(Value = "second")] - Second, - [EnumMember(Value = "none")] - None, - [EnumMember(Value = "first")] - First + [EnumMember(Value = "paused")] + Paused, + [EnumMember(Value = "active")] + Active } -internal sealed class TokenizationTruncateConverter : JsonConverter +internal sealed class FollowerIndexStatusConverter : JsonConverter { - public override TokenizationTruncate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override FollowerIndexStatus 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; + case "paused": + return FollowerIndexStatus.Paused; + case "active": + return FollowerIndexStatus.Active; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } - public override void Write(Utf8JsonWriter writer, TokenizationTruncate value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, FollowerIndexStatus value, JsonSerializerOptions options) { switch (value) { - case TokenizationTruncate.Second: - writer.WriteStringValue("second"); - return; - case TokenizationTruncate.None: - writer.WriteStringValue("none"); + case FollowerIndexStatus.Paused: + writer.WriteStringValue("paused"); return; - case TokenizationTruncate.First: - writer.WriteStringValue("first"); + case FollowerIndexStatus.Active: + writer.WriteStringValue("active"); return; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs index b056250c416..e515e745ac1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Enrich; @@ -58,7 +58,8 @@ public override EnrichPolicyPhase Read(ref Utf8JsonReader reader, Type typeToCon return EnrichPolicyPhase.Complete; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, EnrichPolicyPhase value, JsonSerializerOptions options) @@ -109,7 +110,8 @@ public override PolicyType Read(ref Utf8JsonReader reader, Type typeToConvert, J return PolicyType.GeoMatch; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, PolicyType value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs index 72788434ca0..3db6d5e445a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Eql; @@ -56,7 +56,8 @@ public override ResultPosition Read(ref Utf8JsonReader reader, Type typeToConver return ResultPosition.Head; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ResultPosition value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs index 50564eb15b3..13f2a771681 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.IndexManagement; @@ -54,7 +54,8 @@ public override Feature Read(ref Utf8JsonReader reader, Type typeToConvert, Json return Feature.Aliases; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Feature value, JsonSerializerOptions options) @@ -102,7 +103,8 @@ public override IndexCheckOnStartup Read(ref Utf8JsonReader reader, Type typeToC return IndexCheckOnStartup.Checksum; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexCheckOnStartup value, JsonSerializerOptions options) @@ -146,7 +148,8 @@ public override IndexMetadataState Read(ref Utf8JsonReader reader, Type typeToCo return IndexMetadataState.Close; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexMetadataState value, JsonSerializerOptions options) @@ -195,7 +198,8 @@ public override IndexRoutingAllocationOptions Read(ref Utf8JsonReader reader, Ty return IndexRoutingAllocationOptions.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexRoutingAllocationOptions value, JsonSerializerOptions options) @@ -250,7 +254,8 @@ public override IndexRoutingRebalanceOptions Read(ref Utf8JsonReader reader, Typ return IndexRoutingRebalanceOptions.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexRoutingRebalanceOptions value, JsonSerializerOptions options) @@ -275,6 +280,55 @@ public override void Write(Utf8JsonWriter writer, IndexRoutingRebalanceOptions v } } +[JsonConverter(typeof(ManagedByConverter))] +public enum ManagedBy +{ + [EnumMember(Value = "Unmanaged")] + Unmanaged, + [EnumMember(Value = "Index Lifecycle Management")] + Ilm, + [EnumMember(Value = "Data stream lifecycle")] + Datastream +} + +internal sealed class ManagedByConverter : JsonConverter +{ + public override ManagedBy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "Unmanaged": + return ManagedBy.Unmanaged; + case "Index Lifecycle Management": + return ManagedBy.Ilm; + case "Data stream lifecycle": + return ManagedBy.Datastream; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ManagedBy value, JsonSerializerOptions options) + { + switch (value) + { + case ManagedBy.Unmanaged: + writer.WriteStringValue("Unmanaged"); + return; + case ManagedBy.Ilm: + writer.WriteStringValue("Index Lifecycle Management"); + return; + case ManagedBy.Datastream: + writer.WriteStringValue("Data stream lifecycle"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(NumericFielddataFormatConverter))] public enum NumericFielddataFormat { @@ -297,7 +351,8 @@ public override NumericFielddataFormat Read(ref Utf8JsonReader reader, Type type return NumericFielddataFormat.Array; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NumericFielddataFormat value, JsonSerializerOptions options) @@ -338,7 +393,8 @@ public override SegmentSortMissing Read(ref Utf8JsonReader reader, Type typeToCo return SegmentSortMissing.First; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortMissing value, JsonSerializerOptions options) @@ -381,7 +437,8 @@ public override SegmentSortMode Read(ref Utf8JsonReader reader, Type typeToConve return SegmentSortMode.Max; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortMode value, JsonSerializerOptions options) @@ -424,7 +481,8 @@ public override SegmentSortOrder Read(ref Utf8JsonReader reader, Type typeToConv return SegmentSortOrder.Asc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SegmentSortOrder value, JsonSerializerOptions options) @@ -473,7 +531,8 @@ public override ShardRoutingState Read(ref Utf8JsonReader reader, Type typeToCon return ShardRoutingState.Initializing; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ShardRoutingState value, JsonSerializerOptions options) @@ -498,6 +557,123 @@ public override void Write(Utf8JsonWriter writer, ShardRoutingState value, JsonS } } +[JsonConverter(typeof(ShardStoreAllocationConverter))] +public enum ShardStoreAllocation +{ + [EnumMember(Value = "unused")] + Unused, + [EnumMember(Value = "replica")] + Replica, + [EnumMember(Value = "primary")] + Primary +} + +internal sealed class ShardStoreAllocationConverter : JsonConverter +{ + public override ShardStoreAllocation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "unused": + return ShardStoreAllocation.Unused; + case "replica": + return ShardStoreAllocation.Replica; + case "primary": + return ShardStoreAllocation.Primary; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ShardStoreAllocation value, JsonSerializerOptions options) + { + switch (value) + { + case ShardStoreAllocation.Unused: + writer.WriteStringValue("unused"); + return; + case ShardStoreAllocation.Replica: + writer.WriteStringValue("replica"); + return; + case ShardStoreAllocation.Primary: + writer.WriteStringValue("primary"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ShardStoreStatusConverter))] +public enum ShardStoreStatus +{ + /// + /// One or more replica shards are unassigned. + /// + [EnumMember(Value = "yellow")] + Yellow, + /// + /// The primary shard is unassigned. + /// + [EnumMember(Value = "red")] + Red, + /// + /// The primary shard and all replica shards are assigned. + /// + [EnumMember(Value = "green")] + Green, + /// + /// Return all shards, regardless of health status. + /// + [EnumMember(Value = "all")] + All +} + +internal sealed class ShardStoreStatusConverter : JsonConverter +{ + public override ShardStoreStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "yellow": + return ShardStoreStatus.Yellow; + case "red": + return ShardStoreStatus.Red; + case "green": + return ShardStoreStatus.Green; + case "all": + return ShardStoreStatus.All; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ShardStoreStatus value, JsonSerializerOptions options) + { + switch (value) + { + case ShardStoreStatus.Yellow: + writer.WriteStringValue("yellow"); + return; + case ShardStoreStatus.Red: + writer.WriteStringValue("red"); + return; + case ShardStoreStatus.Green: + writer.WriteStringValue("green"); + return; + case ShardStoreStatus.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(EnumStructConverter))] public readonly partial struct StorageType : IEnumStruct { @@ -570,7 +746,8 @@ public override TranslogDurability Read(ref Utf8JsonReader reader, Type typeToCo return TranslogDurability.Async; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TranslogDurability value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs new file mode 100644 index 00000000000..3771a812b20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.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.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[JsonConverter(typeof(TaskTypeConverter))] +public enum TaskType +{ + [EnumMember(Value = "text_embedding")] + TextEmbedding, + [EnumMember(Value = "sparse_embedding")] + SparseEmbedding +} + +internal sealed class TaskTypeConverter : JsonConverter +{ + public override TaskType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "text_embedding": + return TaskType.TextEmbedding; + case "sparse_embedding": + return TaskType.SparseEmbedding; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, TaskType value, JsonSerializerOptions options) + { + switch (value) + { + case TaskType.TextEmbedding: + writer.WriteStringValue("text_embedding"); + return; + case TaskType.SparseEmbedding: + writer.WriteStringValue("sparse_embedding"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs index d88b78749af..2bc8f8cd44d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Ingest; @@ -70,7 +70,8 @@ public override ConvertType Read(ref Utf8JsonReader reader, Type typeToConvert, return ConvertType.Auto; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ConvertType value, JsonSerializerOptions options) @@ -132,7 +133,8 @@ public override JsonProcessorConflictStrategy Read(ref Utf8JsonReader reader, Ty return JsonProcessorConflictStrategy.Merge; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, JsonProcessorConflictStrategy value, JsonSerializerOptions options) @@ -173,7 +175,8 @@ public override ShapeType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return ShapeType.GeoShape; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ShapeType value, JsonSerializerOptions options) @@ -246,7 +249,8 @@ public override UserAgentProperty Read(ref Utf8JsonReader reader, Type typeToCon return UserAgentProperty.Build; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, UserAgentProperty value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs new file mode 100644 index 00000000000..00f97d8b1e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.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.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +[JsonConverter(typeof(LicenseStatusConverter))] +public enum LicenseStatus +{ + [EnumMember(Value = "valid")] + Valid, + [EnumMember(Value = "invalid")] + Invalid, + [EnumMember(Value = "expired")] + Expired, + [EnumMember(Value = "active")] + Active +} + +internal sealed class LicenseStatusConverter : JsonConverter +{ + public override LicenseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "valid": + return LicenseStatus.Valid; + case "invalid": + return LicenseStatus.Invalid; + case "expired": + return LicenseStatus.Expired; + case "active": + return LicenseStatus.Active; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LicenseStatus value, JsonSerializerOptions options) + { + switch (value) + { + case LicenseStatus.Valid: + writer.WriteStringValue("valid"); + return; + case LicenseStatus.Invalid: + writer.WriteStringValue("invalid"); + return; + case LicenseStatus.Expired: + writer.WriteStringValue("expired"); + return; + case LicenseStatus.Active: + writer.WriteStringValue("active"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(LicenseTypeConverter))] +public enum LicenseType +{ + [EnumMember(Value = "trial")] + Trial, + [EnumMember(Value = "standard")] + Standard, + [EnumMember(Value = "silver")] + Silver, + [EnumMember(Value = "platinum")] + Platinum, + [EnumMember(Value = "missing")] + Missing, + [EnumMember(Value = "gold")] + Gold, + [EnumMember(Value = "enterprise")] + Enterprise, + [EnumMember(Value = "dev")] + Dev, + [EnumMember(Value = "basic")] + Basic +} + +internal sealed class LicenseTypeConverter : JsonConverter +{ + public override LicenseType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "trial": + return LicenseType.Trial; + case "standard": + return LicenseType.Standard; + case "silver": + return LicenseType.Silver; + case "platinum": + return LicenseType.Platinum; + case "missing": + return LicenseType.Missing; + case "gold": + return LicenseType.Gold; + case "enterprise": + return LicenseType.Enterprise; + case "dev": + return LicenseType.Dev; + case "basic": + return LicenseType.Basic; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LicenseType value, JsonSerializerOptions options) + { + switch (value) + { + case LicenseType.Trial: + writer.WriteStringValue("trial"); + return; + case LicenseType.Standard: + writer.WriteStringValue("standard"); + return; + case LicenseType.Silver: + writer.WriteStringValue("silver"); + return; + case LicenseType.Platinum: + writer.WriteStringValue("platinum"); + return; + case LicenseType.Missing: + writer.WriteStringValue("missing"); + return; + case LicenseType.Gold: + writer.WriteStringValue("gold"); + return; + case LicenseType.Enterprise: + writer.WriteStringValue("enterprise"); + return; + case LicenseType.Dev: + writer.WriteStringValue("dev"); + return; + case LicenseType.Basic: + writer.WriteStringValue("basic"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs new file mode 100644 index 00000000000..fb792f55fc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs @@ -0,0 +1,1206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[JsonConverter(typeof(AppliesToConverter))] +public enum AppliesTo +{ + [EnumMember(Value = "typical")] + Typical, + [EnumMember(Value = "time")] + Time, + [EnumMember(Value = "diff_from_typical")] + DiffFromTypical, + [EnumMember(Value = "actual")] + Actual +} + +internal sealed class AppliesToConverter : JsonConverter +{ + public override AppliesTo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "typical": + return AppliesTo.Typical; + case "time": + return AppliesTo.Time; + case "diff_from_typical": + return AppliesTo.DiffFromTypical; + case "actual": + return AppliesTo.Actual; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, AppliesTo value, JsonSerializerOptions options) + { + switch (value) + { + case AppliesTo.Typical: + writer.WriteStringValue("typical"); + return; + case AppliesTo.Time: + writer.WriteStringValue("time"); + return; + case AppliesTo.DiffFromTypical: + writer.WriteStringValue("diff_from_typical"); + return; + case AppliesTo.Actual: + writer.WriteStringValue("actual"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(CategorizationStatusConverter))] +public enum CategorizationStatus +{ + [EnumMember(Value = "warn")] + Warn, + [EnumMember(Value = "ok")] + Ok +} + +internal sealed class CategorizationStatusConverter : JsonConverter +{ + public override CategorizationStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "warn": + return CategorizationStatus.Warn; + case "ok": + return CategorizationStatus.Ok; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, CategorizationStatus value, JsonSerializerOptions options) + { + switch (value) + { + case CategorizationStatus.Warn: + writer.WriteStringValue("warn"); + return; + case CategorizationStatus.Ok: + writer.WriteStringValue("ok"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ChunkingModeConverter))] +public enum ChunkingMode +{ + [EnumMember(Value = "off")] + Off, + [EnumMember(Value = "manual")] + Manual, + [EnumMember(Value = "auto")] + Auto +} + +internal sealed class ChunkingModeConverter : JsonConverter +{ + public override ChunkingMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "off": + return ChunkingMode.Off; + case "manual": + return ChunkingMode.Manual; + case "auto": + return ChunkingMode.Auto; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ChunkingMode value, JsonSerializerOptions options) + { + switch (value) + { + case ChunkingMode.Off: + writer.WriteStringValue("off"); + return; + case ChunkingMode.Manual: + writer.WriteStringValue("manual"); + return; + case ChunkingMode.Auto: + writer.WriteStringValue("auto"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ConditionOperatorConverter))] +public enum ConditionOperator +{ + [EnumMember(Value = "lte")] + Lte, + [EnumMember(Value = "lt")] + Lt, + [EnumMember(Value = "gte")] + Gte, + [EnumMember(Value = "gt")] + Gt +} + +internal sealed class ConditionOperatorConverter : JsonConverter +{ + public override ConditionOperator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "lte": + return ConditionOperator.Lte; + case "lt": + return ConditionOperator.Lt; + case "gte": + return ConditionOperator.Gte; + case "gt": + return ConditionOperator.Gt; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ConditionOperator value, JsonSerializerOptions options) + { + switch (value) + { + case ConditionOperator.Lte: + writer.WriteStringValue("lte"); + return; + case ConditionOperator.Lt: + writer.WriteStringValue("lt"); + return; + case ConditionOperator.Gte: + writer.WriteStringValue("gte"); + return; + case ConditionOperator.Gt: + writer.WriteStringValue("gt"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DatafeedStateConverter))] +public enum DatafeedState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started +} + +internal sealed class DatafeedStateConverter : JsonConverter +{ + public override DatafeedState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DatafeedState.Stopping; + case "stopped": + return DatafeedState.Stopped; + case "starting": + return DatafeedState.Starting; + case "started": + return DatafeedState.Started; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DatafeedState value, JsonSerializerOptions options) + { + switch (value) + { + case DatafeedState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DatafeedState.Stopped: + writer.WriteStringValue("stopped"); + return; + case DatafeedState.Starting: + writer.WriteStringValue("starting"); + return; + case DatafeedState.Started: + writer.WriteStringValue("started"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DataframeStateConverter))] +public enum DataframeState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class DataframeStateConverter : JsonConverter +{ + public override DataframeState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DataframeState.Stopping; + case "stopped": + return DataframeState.Stopped; + case "starting": + return DataframeState.Starting; + case "started": + return DataframeState.Started; + case "failed": + return DataframeState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DataframeState value, JsonSerializerOptions options) + { + switch (value) + { + case DataframeState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DataframeState.Stopped: + writer.WriteStringValue("stopped"); + return; + case DataframeState.Starting: + writer.WriteStringValue("starting"); + return; + case DataframeState.Started: + writer.WriteStringValue("started"); + return; + case DataframeState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentAllocationStateConverter))] +public enum DeploymentAllocationState +{ + /// + /// Trained model deployment is starting but it is not yet deployed on any nodes. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The trained model is started on at least one node. + /// + [EnumMember(Value = "started")] + Started, + /// + /// Trained model deployment has started on all valid nodes. + /// + [EnumMember(Value = "fully_allocated")] + FullyAllocated +} + +internal sealed class DeploymentAllocationStateConverter : JsonConverter +{ + public override DeploymentAllocationState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "starting": + return DeploymentAllocationState.Starting; + case "started": + return DeploymentAllocationState.Started; + case "fully_allocated": + return DeploymentAllocationState.FullyAllocated; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentAllocationState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentAllocationState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentAllocationState.Started: + writer.WriteStringValue("started"); + return; + case DeploymentAllocationState.FullyAllocated: + writer.WriteStringValue("fully_allocated"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentAssignmentStateConverter))] +public enum DeploymentAssignmentState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "starting")] + Starting, + [EnumMember(Value = "started")] + Started, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class DeploymentAssignmentStateConverter : JsonConverter +{ + public override DeploymentAssignmentState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DeploymentAssignmentState.Stopping; + case "starting": + return DeploymentAssignmentState.Starting; + case "started": + return DeploymentAssignmentState.Started; + case "failed": + return DeploymentAssignmentState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentAssignmentState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentAssignmentState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DeploymentAssignmentState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentAssignmentState.Started: + writer.WriteStringValue("started"); + return; + case DeploymentAssignmentState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(DeploymentStateConverter))] +public enum DeploymentState +{ + /// + /// The deployment is preparing to stop and deallocate the model from the relevant nodes. + /// + [EnumMember(Value = "stopping")] + Stopping, + /// + /// The deployment has recently started but is not yet usable; the model is not allocated on any nodes. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The deployment is usable; at least one node has the model allocated. + /// + [EnumMember(Value = "started")] + Started +} + +internal sealed class DeploymentStateConverter : JsonConverter +{ + public override DeploymentState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return DeploymentState.Stopping; + case "starting": + return DeploymentState.Starting; + case "started": + return DeploymentState.Started; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, DeploymentState value, JsonSerializerOptions options) + { + switch (value) + { + case DeploymentState.Stopping: + writer.WriteStringValue("stopping"); + return; + case DeploymentState.Starting: + writer.WriteStringValue("starting"); + return; + case DeploymentState.Started: + writer.WriteStringValue("started"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(ExcludeFrequentConverter))] +public enum ExcludeFrequent +{ + [EnumMember(Value = "over")] + Over, + [EnumMember(Value = "none")] + None, + [EnumMember(Value = "by")] + By, + [EnumMember(Value = "all")] + All +} + +internal sealed class ExcludeFrequentConverter : JsonConverter +{ + public override ExcludeFrequent Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "over": + return ExcludeFrequent.Over; + case "none": + return ExcludeFrequent.None; + case "by": + return ExcludeFrequent.By; + case "all": + return ExcludeFrequent.All; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ExcludeFrequent value, JsonSerializerOptions options) + { + switch (value) + { + case ExcludeFrequent.Over: + writer.WriteStringValue("over"); + return; + case ExcludeFrequent.None: + writer.WriteStringValue("none"); + return; + case ExcludeFrequent.By: + writer.WriteStringValue("by"); + return; + case ExcludeFrequent.All: + writer.WriteStringValue("all"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(FilterTypeConverter))] +public enum FilterType +{ + [EnumMember(Value = "include")] + Include, + [EnumMember(Value = "exclude")] + Exclude +} + +internal sealed class FilterTypeConverter : JsonConverter +{ + public override FilterType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "include": + return FilterType.Include; + case "exclude": + return FilterType.Exclude; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, FilterType value, JsonSerializerOptions options) + { + switch (value) + { + case FilterType.Include: + writer.WriteStringValue("include"); + return; + case FilterType.Exclude: + writer.WriteStringValue("exclude"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(IncludeConverter))] +public enum Include +{ + /// + /// Includes the total feature importance for the training data set. The
baseline and total feature importance values are returned in the metadata
field in the response body.
+ ///
+ [EnumMember(Value = "total_feature_importance")] + TotalFeatureImportance, + /// + /// Includes the information about hyperparameters used to train the model.
This information consists of the value, the absolute and relative
importance of the hyperparameter as well as an indicator of whether it was
specified by the user or tuned during hyperparameter optimization.
+ ///
+ [EnumMember(Value = "hyperparameters")] + Hyperparameters, + /// + /// Includes the baseline for feature importance values. + /// + [EnumMember(Value = "feature_importance_baseline")] + FeatureImportanceBaseline, + /// + /// Includes the model definition status. + /// + [EnumMember(Value = "definition_status")] + DefinitionStatus, + /// + /// Includes the model definition. + /// + [EnumMember(Value = "definition")] + Definition +} + +internal sealed class IncludeConverter : JsonConverter +{ + public override Include Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "total_feature_importance": + return Include.TotalFeatureImportance; + case "hyperparameters": + return Include.Hyperparameters; + case "feature_importance_baseline": + return Include.FeatureImportanceBaseline; + case "definition_status": + return Include.DefinitionStatus; + case "definition": + return Include.Definition; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, Include value, JsonSerializerOptions options) + { + switch (value) + { + case Include.TotalFeatureImportance: + writer.WriteStringValue("total_feature_importance"); + return; + case Include.Hyperparameters: + writer.WriteStringValue("hyperparameters"); + return; + case Include.FeatureImportanceBaseline: + writer.WriteStringValue("feature_importance_baseline"); + return; + case Include.DefinitionStatus: + writer.WriteStringValue("definition_status"); + return; + case Include.Definition: + writer.WriteStringValue("definition"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(JobBlockedReasonConverter))] +public enum JobBlockedReason +{ + [EnumMember(Value = "revert")] + Revert, + [EnumMember(Value = "reset")] + Reset, + [EnumMember(Value = "delete")] + Delete +} + +internal sealed class JobBlockedReasonConverter : JsonConverter +{ + public override JobBlockedReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "revert": + return JobBlockedReason.Revert; + case "reset": + return JobBlockedReason.Reset; + case "delete": + return JobBlockedReason.Delete; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, JobBlockedReason value, JsonSerializerOptions options) + { + switch (value) + { + case JobBlockedReason.Revert: + writer.WriteStringValue("revert"); + return; + case JobBlockedReason.Reset: + writer.WriteStringValue("reset"); + return; + case JobBlockedReason.Delete: + writer.WriteStringValue("delete"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(JobStateConverter))] +public enum JobState +{ + /// + /// The job open action is in progress and has not yet completed. + /// + [EnumMember(Value = "opening")] + Opening, + /// + /// The job is available to receive and process data. + /// + [EnumMember(Value = "opened")] + Opened, + /// + /// The job did not finish successfully due to an error.
This situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer.
If the job had irrevocably failed, it must be force closed and then deleted.
If the datafeed can be corrected, the job can be closed and then re-opened.
+ ///
+ [EnumMember(Value = "failed")] + Failed, + /// + /// The job close action is in progress and has not yet completed. A closing job cannot accept further data. + /// + [EnumMember(Value = "closing")] + Closing, + /// + /// The job finished successfully with its model state persisted. The job must be opened before it can accept further data. + /// + [EnumMember(Value = "closed")] + Closed +} + +internal sealed class JobStateConverter : JsonConverter +{ + public override JobState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "opening": + return JobState.Opening; + case "opened": + return JobState.Opened; + case "failed": + return JobState.Failed; + case "closing": + return JobState.Closing; + case "closed": + return JobState.Closed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, JobState value, JsonSerializerOptions options) + { + switch (value) + { + case JobState.Opening: + writer.WriteStringValue("opening"); + return; + case JobState.Opened: + writer.WriteStringValue("opened"); + return; + case JobState.Failed: + writer.WriteStringValue("failed"); + return; + case JobState.Closing: + writer.WriteStringValue("closing"); + return; + case JobState.Closed: + writer.WriteStringValue("closed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MemoryStatusConverter))] +public enum MemoryStatus +{ + [EnumMember(Value = "soft_limit")] + SoftLimit, + [EnumMember(Value = "ok")] + Ok, + [EnumMember(Value = "hard_limit")] + HardLimit +} + +internal sealed class MemoryStatusConverter : JsonConverter +{ + public override MemoryStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "soft_limit": + return MemoryStatus.SoftLimit; + case "ok": + return MemoryStatus.Ok; + case "hard_limit": + return MemoryStatus.HardLimit; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, MemoryStatus value, JsonSerializerOptions options) + { + switch (value) + { + case MemoryStatus.SoftLimit: + writer.WriteStringValue("soft_limit"); + return; + case MemoryStatus.Ok: + writer.WriteStringValue("ok"); + return; + case MemoryStatus.HardLimit: + writer.WriteStringValue("hard_limit"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RoutingStateConverter))] +public enum RoutingState +{ + /// + /// The trained model is being deallocated from this node. + /// + [EnumMember(Value = "stopping")] + Stopping, + /// + /// The trained model is fully deallocated from this node. + /// + [EnumMember(Value = "stopped")] + Stopped, + /// + /// The trained model is attempting to allocate on this node; inference requests are not yet accepted. + /// + [EnumMember(Value = "starting")] + Starting, + /// + /// The trained model is allocated and ready to accept inference requests. + /// + [EnumMember(Value = "started")] + Started, + /// + /// The allocation attempt failed. + /// + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class RoutingStateConverter : JsonConverter +{ + public override RoutingState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return RoutingState.Stopping; + case "stopped": + return RoutingState.Stopped; + case "starting": + return RoutingState.Starting; + case "started": + return RoutingState.Started; + case "failed": + return RoutingState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, RoutingState value, JsonSerializerOptions options) + { + switch (value) + { + case RoutingState.Stopping: + writer.WriteStringValue("stopping"); + return; + case RoutingState.Stopped: + writer.WriteStringValue("stopped"); + return; + case RoutingState.Starting: + writer.WriteStringValue("starting"); + return; + case RoutingState.Started: + writer.WriteStringValue("started"); + return; + case RoutingState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(RuleActionConverter))] +public enum RuleAction +{ + /// + /// The result will not be created. Unless you also specify `skip_model_update`, the model will be updated as usual with the corresponding series value. + /// + [EnumMember(Value = "skip_result")] + SkipResult, + /// + /// The value for that series will not be used to update the model. Unless you also specify `skip_result`, the results will be created as usual. This action is suitable when certain values are expected to be consistently anomalous and they affect the model in a way that negatively impacts the rest of the results. + /// + [EnumMember(Value = "skip_model_update")] + SkipModelUpdate +} + +internal sealed class RuleActionConverter : JsonConverter +{ + public override RuleAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "skip_result": + return RuleAction.SkipResult; + case "skip_model_update": + return RuleAction.SkipModelUpdate; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, RuleAction value, JsonSerializerOptions options) + { + switch (value) + { + case RuleAction.SkipResult: + writer.WriteStringValue("skip_result"); + return; + case RuleAction.SkipModelUpdate: + writer.WriteStringValue("skip_model_update"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SnapshotUpgradeStateConverter))] +public enum SnapshotUpgradeState +{ + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "saving_new_state")] + SavingNewState, + [EnumMember(Value = "loading_old_state")] + LoadingOldState, + [EnumMember(Value = "failed")] + Failed +} + +internal sealed class SnapshotUpgradeStateConverter : JsonConverter +{ + public override SnapshotUpgradeState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopped": + return SnapshotUpgradeState.Stopped; + case "saving_new_state": + return SnapshotUpgradeState.SavingNewState; + case "loading_old_state": + return SnapshotUpgradeState.LoadingOldState; + case "failed": + return SnapshotUpgradeState.Failed; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, SnapshotUpgradeState value, JsonSerializerOptions options) + { + switch (value) + { + case SnapshotUpgradeState.Stopped: + writer.WriteStringValue("stopped"); + return; + case SnapshotUpgradeState.SavingNewState: + writer.WriteStringValue("saving_new_state"); + return; + case SnapshotUpgradeState.LoadingOldState: + writer.WriteStringValue("loading_old_state"); + return; + case SnapshotUpgradeState.Failed: + writer.WriteStringValue("failed"); + return; + } + + writer.WriteNullValue(); + } +} + +[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(); + } +} + +[JsonConverter(typeof(TrainedModelTypeConverter))] +public enum TrainedModelType +{ + /// + /// The model definition is an ensemble model of decision trees. + /// + [EnumMember(Value = "tree_ensemble")] + TreeEnsemble, + /// + /// The stored definition is a PyTorch (specifically a TorchScript) model.
Currently only NLP models are supported.
+ ///
+ [EnumMember(Value = "pytorch")] + Pytorch, + /// + /// A special type reserved for language identification models. + /// + [EnumMember(Value = "lang_ident")] + LangIdent +} + +internal sealed class TrainedModelTypeConverter : JsonConverter +{ + public override TrainedModelType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "tree_ensemble": + return TrainedModelType.TreeEnsemble; + case "pytorch": + return TrainedModelType.Pytorch; + case "lang_ident": + return TrainedModelType.LangIdent; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, TrainedModelType value, JsonSerializerOptions options) + { + switch (value) + { + case TrainedModelType.TreeEnsemble: + writer.WriteStringValue("tree_ensemble"); + return; + case TrainedModelType.Pytorch: + writer.WriteStringValue("pytorch"); + return; + case TrainedModelType.LangIdent: + writer.WriteStringValue("lang_ident"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(TrainingPriorityConverter))] +public enum TrainingPriority +{ + [EnumMember(Value = "normal")] + Normal, + [EnumMember(Value = "low")] + Low +} + +internal sealed class TrainingPriorityConverter : JsonConverter +{ + public override TrainingPriority Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "normal": + return TrainingPriority.Normal; + case "low": + return TrainingPriority.Low; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, TrainingPriority value, JsonSerializerOptions options) + { + switch (value) + { + case TrainingPriority.Normal: + writer.WriteStringValue("normal"); + return; + case TrainingPriority.Low: + writer.WriteStringValue("low"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs index 085b9e87efc..b194433ef83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Mapping; @@ -58,7 +58,8 @@ public override DynamicMapping Read(ref Utf8JsonReader reader, Type typeToConver return DynamicMapping.False; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DynamicMapping value, JsonSerializerOptions options) @@ -269,7 +270,8 @@ public override FieldType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return FieldType.AggregateMetricDouble; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldType value, JsonSerializerOptions options) @@ -439,7 +441,8 @@ public override GeoOrientation Read(ref Utf8JsonReader reader, Type typeToConver return GeoOrientation.Left; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoOrientation value, JsonSerializerOptions options) @@ -480,7 +483,8 @@ public override GeoStrategy Read(ref Utf8JsonReader reader, Type typeToConvert, return GeoStrategy.Recursive; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoStrategy value, JsonSerializerOptions options) @@ -529,7 +533,8 @@ public override IndexOptions Read(ref Utf8JsonReader reader, Type typeToConvert, return IndexOptions.Docs; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IndexOptions value, JsonSerializerOptions options) @@ -576,7 +581,8 @@ public override MatchType Read(ref Utf8JsonReader reader, Type typeToConvert, Js return MatchType.Regex; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, MatchType value, JsonSerializerOptions options) @@ -617,7 +623,8 @@ public override OnScriptError Read(ref Utf8JsonReader reader, Type typeToConvert return OnScriptError.Continue; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, OnScriptError value, JsonSerializerOptions options) @@ -682,7 +689,8 @@ public override RuntimeFieldType Read(ref Utf8JsonReader reader, Type typeToConv return RuntimeFieldType.Boolean; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RuntimeFieldType value, JsonSerializerOptions options) @@ -748,7 +756,8 @@ public override SourceFieldMode Read(ref Utf8JsonReader reader, Type typeToConve return SourceFieldMode.Disabled; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SourceFieldMode value, JsonSerializerOptions options) @@ -812,7 +821,8 @@ public override TermVectorOption Read(ref Utf8JsonReader reader, Type typeToConv return TermVectorOption.No; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TermVectorOption value, JsonSerializerOptions options) @@ -880,7 +890,8 @@ public override TimeSeriesMetricType Read(ref Utf8JsonReader reader, Type typeTo return TimeSeriesMetricType.Counter; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TimeSeriesMetricType value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs index 24b8b50cec6..df0e2ad5c41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs @@ -17,17 +17,80 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch; +[JsonConverter(typeof(ClusterInfoTargetConverter))] +public enum ClusterInfoTarget +{ + [EnumMember(Value = "thread_pool")] + ThreadPool, + [EnumMember(Value = "script")] + Script, + [EnumMember(Value = "ingest")] + Ingest, + [EnumMember(Value = "http")] + Http, + [EnumMember(Value = "_all")] + All +} + +internal sealed class ClusterInfoTargetConverter : JsonConverter +{ + public override ClusterInfoTarget Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "thread_pool": + return ClusterInfoTarget.ThreadPool; + case "script": + return ClusterInfoTarget.Script; + case "ingest": + return ClusterInfoTarget.Ingest; + case "http": + return ClusterInfoTarget.Http; + case "_all": + return ClusterInfoTarget.All; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ClusterInfoTarget value, JsonSerializerOptions options) + { + switch (value) + { + case ClusterInfoTarget.ThreadPool: + writer.WriteStringValue("thread_pool"); + return; + case ClusterInfoTarget.Script: + writer.WriteStringValue("script"); + return; + case ClusterInfoTarget.Ingest: + writer.WriteStringValue("ingest"); + return; + case ClusterInfoTarget.Http: + writer.WriteStringValue("http"); + return; + case ClusterInfoTarget.All: + writer.WriteStringValue("_all"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(ClusterSearchStatusConverter))] public enum ClusterSearchStatus { @@ -62,7 +125,8 @@ public override ClusterSearchStatus Read(ref Utf8JsonReader reader, Type typeToC return ClusterSearchStatus.Failed; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ClusterSearchStatus value, JsonSerializerOptions options) @@ -118,7 +182,8 @@ public override Conflicts Read(ref Utf8JsonReader reader, Type typeToConvert, Js return Conflicts.Abort; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Conflicts value, JsonSerializerOptions options) @@ -163,7 +228,8 @@ public override DFIIndependenceMeasure Read(ref Utf8JsonReader reader, Type type return DFIIndependenceMeasure.Chisquared; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFIIndependenceMeasure value, JsonSerializerOptions options) @@ -211,7 +277,8 @@ public override DFRAfterEffect Read(ref Utf8JsonReader reader, Type typeToConver return DFRAfterEffect.b; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFRAfterEffect value, JsonSerializerOptions options) @@ -275,7 +342,8 @@ public override DFRBasicModel Read(ref Utf8JsonReader reader, Type typeToConvert return DFRBasicModel.Be; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DFRBasicModel value, JsonSerializerOptions options) @@ -359,7 +427,8 @@ public override DistanceUnit Read(ref Utf8JsonReader reader, Type typeToConvert, return DistanceUnit.Centimeters; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, DistanceUnit value, JsonSerializerOptions options) @@ -448,7 +517,8 @@ public override ExpandWildcard Read(ref Utf8JsonReader reader, Type typeToConver return ExpandWildcard.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ExpandWildcard value, JsonSerializerOptions options) @@ -506,7 +576,8 @@ public override FieldSortNumericType Read(ref Utf8JsonReader reader, Type typeTo return FieldSortNumericType.Date; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldSortNumericType value, JsonSerializerOptions options) @@ -559,7 +630,8 @@ public override GeoDistanceType Read(ref Utf8JsonReader reader, Type typeToConve return GeoDistanceType.Arc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoDistanceType value, JsonSerializerOptions options) @@ -620,7 +692,8 @@ public override GeoShapeRelation Read(ref Utf8JsonReader reader, Type typeToConv return GeoShapeRelation.Contains; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoShapeRelation value, JsonSerializerOptions options) @@ -683,7 +756,8 @@ public override HealthStatus Read(ref Utf8JsonReader reader, Type typeToConvert, return HealthStatus.Green; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, HealthStatus value, JsonSerializerOptions options) @@ -727,7 +801,8 @@ public override IBDistribution Read(ref Utf8JsonReader reader, Type typeToConver return IBDistribution.Ll; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IBDistribution value, JsonSerializerOptions options) @@ -768,7 +843,8 @@ public override IBLambda Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return IBLambda.Df; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, IBLambda value, JsonSerializerOptions options) @@ -813,7 +889,8 @@ public override Level Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe return Level.Cluster; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Level value, JsonSerializerOptions options) @@ -835,6 +912,55 @@ public override void Write(Utf8JsonWriter writer, Level value, JsonSerializerOpt } } +[JsonConverter(typeof(LifecycleOperationModeConverter))] +public enum LifecycleOperationMode +{ + [EnumMember(Value = "STOPPING")] + Stopping, + [EnumMember(Value = "STOPPED")] + Stopped, + [EnumMember(Value = "RUNNING")] + Running +} + +internal sealed class LifecycleOperationModeConverter : JsonConverter +{ + public override LifecycleOperationMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "STOPPING": + return LifecycleOperationMode.Stopping; + case "STOPPED": + return LifecycleOperationMode.Stopped; + case "RUNNING": + return LifecycleOperationMode.Running; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, LifecycleOperationMode value, JsonSerializerOptions options) + { + switch (value) + { + case LifecycleOperationMode.Stopping: + writer.WriteStringValue("STOPPING"); + return; + case LifecycleOperationMode.Stopped: + writer.WriteStringValue("STOPPED"); + return; + case LifecycleOperationMode.Running: + writer.WriteStringValue("RUNNING"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(NodeRoleConverter))] public enum NodeRole { @@ -905,7 +1031,8 @@ public override NodeRole Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return NodeRole.Client; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, NodeRole value, JsonSerializerOptions options) @@ -994,7 +1121,8 @@ public override Normalization Read(ref Utf8JsonReader reader, Type typeToConvert return Normalization.H1; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Normalization value, JsonSerializerOptions options) @@ -1056,7 +1184,8 @@ public override Result Read(ref Utf8JsonReader reader, Type typeToConvert, JsonS return Result.Created; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) @@ -1152,7 +1281,8 @@ public override ScriptSortType Read(ref Utf8JsonReader reader, Type typeToConver return ScriptSortType.Number; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ScriptSortType value, JsonSerializerOptions options) @@ -1202,7 +1332,8 @@ public override SearchType Read(ref Utf8JsonReader reader, Type typeToConvert, J return SearchType.DfsQueryThenFetch; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SearchType value, JsonSerializerOptions options) @@ -1242,7 +1373,8 @@ public override SlicesCalculation Read(ref Utf8JsonReader reader, Type typeToCon return SlicesCalculation.Auto; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SlicesCalculation value, JsonSerializerOptions options) @@ -1292,7 +1424,8 @@ public override SortMode Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return SortMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SortMode value, JsonSerializerOptions options) @@ -1348,7 +1481,8 @@ public override SortOrder Read(ref Utf8JsonReader reader, Type typeToConvert, Js return SortOrder.Asc; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SortOrder value, JsonSerializerOptions options) @@ -1402,7 +1536,8 @@ public override SuggestMode Read(ref Utf8JsonReader reader, Type typeToConvert, return SuggestMode.Always; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, SuggestMode value, JsonSerializerOptions options) @@ -1424,6 +1559,69 @@ public override void Write(Utf8JsonWriter writer, SuggestMode value, JsonSeriali } } +[JsonConverter(typeof(ThreadTypeConverter))] +public enum ThreadType +{ + [EnumMember(Value = "wait")] + Wait, + [EnumMember(Value = "mem")] + Mem, + [EnumMember(Value = "gpu")] + Gpu, + [EnumMember(Value = "cpu")] + Cpu, + [EnumMember(Value = "block")] + Block +} + +internal sealed class ThreadTypeConverter : JsonConverter +{ + public override ThreadType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "wait": + return ThreadType.Wait; + case "mem": + return ThreadType.Mem; + case "gpu": + return ThreadType.Gpu; + case "cpu": + return ThreadType.Cpu; + case "block": + return ThreadType.Block; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ThreadType value, JsonSerializerOptions options) + { + switch (value) + { + case ThreadType.Wait: + writer.WriteStringValue("wait"); + return; + case ThreadType.Mem: + writer.WriteStringValue("mem"); + return; + case ThreadType.Gpu: + writer.WriteStringValue("gpu"); + return; + case ThreadType.Cpu: + writer.WriteStringValue("cpu"); + return; + case ThreadType.Block: + writer.WriteStringValue("block"); + return; + } + + writer.WriteNullValue(); + } +} + [JsonConverter(typeof(TimeUnitConverter))] public enum TimeUnit { @@ -1431,12 +1629,12 @@ public enum TimeUnit Seconds, [EnumMember(Value = "nanos")] Nanoseconds, + [EnumMember(Value = "m")] + Minutes, [EnumMember(Value = "ms")] Milliseconds, [EnumMember(Value = "micros")] Microseconds, - [EnumMember(Value = "m")] - Minutes, [EnumMember(Value = "h")] Hours, [EnumMember(Value = "d")] @@ -1454,19 +1652,20 @@ public override TimeUnit Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return TimeUnit.Seconds; case "nanos": return TimeUnit.Nanoseconds; + case "m": + return TimeUnit.Minutes; 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; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TimeUnit value, JsonSerializerOptions options) @@ -1479,15 +1678,15 @@ public override void Write(Utf8JsonWriter writer, TimeUnit value, JsonSerializer case TimeUnit.Nanoseconds: writer.WriteStringValue("nanos"); return; + case TimeUnit.Minutes: + writer.WriteStringValue("m"); + 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; @@ -1539,7 +1738,8 @@ public override VersionType Read(ref Utf8JsonReader reader, Type typeToConvert, return VersionType.External; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, VersionType value, JsonSerializerOptions options) @@ -1602,7 +1802,8 @@ public override WaitForEvents Read(ref Utf8JsonReader reader, Type typeToConvert return WaitForEvents.High; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, WaitForEvents value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs index f917171c292..aa614d766cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.QueryDsl; @@ -62,7 +62,8 @@ public override ChildScoreMode Read(ref Utf8JsonReader reader, Type typeToConver return ChildScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ChildScoreMode value, JsonSerializerOptions options) @@ -112,7 +113,8 @@ public override CombinedFieldsOperator Read(ref Utf8JsonReader reader, Type type return CombinedFieldsOperator.And; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CombinedFieldsOperator value, JsonSerializerOptions options) @@ -159,7 +161,8 @@ public override CombinedFieldsZeroTerms Read(ref Utf8JsonReader reader, Type typ return CombinedFieldsZeroTerms.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, CombinedFieldsZeroTerms value, JsonSerializerOptions options) @@ -262,7 +265,8 @@ public override FieldValueFactorModifier Read(ref Utf8JsonReader reader, Type ty return FieldValueFactorModifier.Ln; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FieldValueFactorModifier value, JsonSerializerOptions options) @@ -361,7 +365,8 @@ public override FunctionBoostMode Read(ref Utf8JsonReader reader, Type typeToCon return FunctionBoostMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FunctionBoostMode value, JsonSerializerOptions options) @@ -448,7 +453,8 @@ public override FunctionScoreMode Read(ref Utf8JsonReader reader, Type typeToCon return FunctionScoreMode.Avg; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, FunctionScoreMode value, JsonSerializerOptions options) @@ -511,7 +517,8 @@ public override GeoValidationMethod Read(ref Utf8JsonReader reader, Type typeToC return GeoValidationMethod.Coerce; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, JsonSerializerOptions options) @@ -557,7 +564,8 @@ public override Operator Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return Operator.And; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, Operator value, JsonSerializerOptions options) @@ -611,7 +619,8 @@ public override RangeRelation Read(ref Utf8JsonReader reader, Type typeToConvert return RangeRelation.Contains; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, RangeRelation value, JsonSerializerOptions options) @@ -633,9 +642,9 @@ public override void Write(Utf8JsonWriter writer, RangeRelation value, JsonSeria } } -[JsonConverter(typeof(SimpleQueryStringFlagsConverter))] +[JsonConverter(typeof(SimpleQueryStringFlagConverter))] [Flags] -public enum SimpleQueryStringFlags +public enum SimpleQueryStringFlag { /// /// Enables whitespace as split characters. @@ -704,9 +713,9 @@ public enum SimpleQueryStringFlags All = 1 << 12 } -internal sealed class SimpleQueryStringFlagsConverter : JsonConverter +internal sealed class SimpleQueryStringFlagConverter : JsonConverter { - public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override SimpleQueryStringFlag Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var s = reader.GetString(); if (string.IsNullOrEmpty(s)) @@ -715,24 +724,24 @@ public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type type } var flags = s.Split('|'); - var result = default(SimpleQueryStringFlags); + var result = default(SimpleQueryStringFlag); 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, + "WHITESPACE" => SimpleQueryStringFlag.Whitespace, + "SLOP" => SimpleQueryStringFlag.Slop, + "PREFIX" => SimpleQueryStringFlag.Prefix, + "PRECEDENCE" => SimpleQueryStringFlag.Precedence, + "PHRASE" => SimpleQueryStringFlag.Phrase, + "OR" => SimpleQueryStringFlag.Or, + "NOT" => SimpleQueryStringFlag.Not, + "NONE" => SimpleQueryStringFlag.None, + "NEAR" => SimpleQueryStringFlag.Near, + "FUZZY" => SimpleQueryStringFlag.Fuzzy, + "ESCAPE" => SimpleQueryStringFlag.Escape, + "AND" => SimpleQueryStringFlag.And, + "ALL" => SimpleQueryStringFlag.All, _ => throw new JsonException($"Invalid flag value '{flag}' for type '{typeToConvert.Name}'.") }; } @@ -740,7 +749,7 @@ public override SimpleQueryStringFlags Read(ref Utf8JsonReader reader, Type type return result; } - public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlags value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlag value, JsonSerializerOptions options) { if (value == default) { @@ -749,31 +758,31 @@ public override void Write(Utf8JsonWriter writer, SimpleQueryStringFlags value, } var sb = new StringBuilder(); - if (value.HasFlag(SimpleQueryStringFlags.Whitespace)) + if (value.HasFlag(SimpleQueryStringFlag.Whitespace)) sb.Append("WHITESPACE|"); - if (value.HasFlag(SimpleQueryStringFlags.Slop)) + if (value.HasFlag(SimpleQueryStringFlag.Slop)) sb.Append("SLOP|"); - if (value.HasFlag(SimpleQueryStringFlags.Prefix)) + if (value.HasFlag(SimpleQueryStringFlag.Prefix)) sb.Append("PREFIX|"); - if (value.HasFlag(SimpleQueryStringFlags.Precedence)) + if (value.HasFlag(SimpleQueryStringFlag.Precedence)) sb.Append("PRECEDENCE|"); - if (value.HasFlag(SimpleQueryStringFlags.Phrase)) + if (value.HasFlag(SimpleQueryStringFlag.Phrase)) sb.Append("PHRASE|"); - if (value.HasFlag(SimpleQueryStringFlags.Or)) + if (value.HasFlag(SimpleQueryStringFlag.Or)) sb.Append("OR|"); - if (value.HasFlag(SimpleQueryStringFlags.Not)) + if (value.HasFlag(SimpleQueryStringFlag.Not)) sb.Append("NOT|"); - if (value.HasFlag(SimpleQueryStringFlags.None)) + if (value.HasFlag(SimpleQueryStringFlag.None)) sb.Append("NONE|"); - if (value.HasFlag(SimpleQueryStringFlags.Near)) + if (value.HasFlag(SimpleQueryStringFlag.Near)) sb.Append("NEAR|"); - if (value.HasFlag(SimpleQueryStringFlags.Fuzzy)) + if (value.HasFlag(SimpleQueryStringFlag.Fuzzy)) sb.Append("FUZZY|"); - if (value.HasFlag(SimpleQueryStringFlags.Escape)) + if (value.HasFlag(SimpleQueryStringFlag.Escape)) sb.Append("ESCAPE|"); - if (value.HasFlag(SimpleQueryStringFlags.And)) + if (value.HasFlag(SimpleQueryStringFlag.And)) sb.Append("AND|"); - if (value.HasFlag(SimpleQueryStringFlags.All)) + if (value.HasFlag(SimpleQueryStringFlag.All)) sb.Append("ALL|"); if (sb.Length == 0) { @@ -842,7 +851,8 @@ public override TextQueryType Read(ref Utf8JsonReader reader, Type typeToConvert return TextQueryType.BestFields; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, TextQueryType value, JsonSerializerOptions options) @@ -901,7 +911,8 @@ public override ZeroTermsQuery Read(ref Utf8JsonReader reader, Type typeToConver return ZeroTermsQuery.All; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ZeroTermsQuery value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs new file mode 100644 index 00000000000..a3ecf1dde11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRuleset.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +[JsonConverter(typeof(QueryRuleCriteriaTypeConverter))] +public enum QueryRuleCriteriaType +{ + [EnumMember(Value = "suffix")] + Suffix, + [EnumMember(Value = "prefix")] + Prefix, + [EnumMember(Value = "lte")] + Lte, + [EnumMember(Value = "lt")] + Lt, + [EnumMember(Value = "gte")] + Gte, + [EnumMember(Value = "gt")] + Gt, + [EnumMember(Value = "global")] + Global, + [EnumMember(Value = "exact_fuzzy")] + ExactFuzzy, + [EnumMember(Value = "exact")] + Exact, + [EnumMember(Value = "contains")] + Contains +} + +internal sealed class QueryRuleCriteriaTypeConverter : JsonConverter +{ + public override QueryRuleCriteriaType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "suffix": + return QueryRuleCriteriaType.Suffix; + case "prefix": + return QueryRuleCriteriaType.Prefix; + case "lte": + return QueryRuleCriteriaType.Lte; + case "lt": + return QueryRuleCriteriaType.Lt; + case "gte": + return QueryRuleCriteriaType.Gte; + case "gt": + return QueryRuleCriteriaType.Gt; + case "global": + return QueryRuleCriteriaType.Global; + case "exact_fuzzy": + return QueryRuleCriteriaType.ExactFuzzy; + case "exact": + return QueryRuleCriteriaType.Exact; + case "contains": + return QueryRuleCriteriaType.Contains; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, QueryRuleCriteriaType value, JsonSerializerOptions options) + { + switch (value) + { + case QueryRuleCriteriaType.Suffix: + writer.WriteStringValue("suffix"); + return; + case QueryRuleCriteriaType.Prefix: + writer.WriteStringValue("prefix"); + return; + case QueryRuleCriteriaType.Lte: + writer.WriteStringValue("lte"); + return; + case QueryRuleCriteriaType.Lt: + writer.WriteStringValue("lt"); + return; + case QueryRuleCriteriaType.Gte: + writer.WriteStringValue("gte"); + return; + case QueryRuleCriteriaType.Gt: + writer.WriteStringValue("gt"); + return; + case QueryRuleCriteriaType.Global: + writer.WriteStringValue("global"); + return; + case QueryRuleCriteriaType.ExactFuzzy: + writer.WriteStringValue("exact_fuzzy"); + return; + case QueryRuleCriteriaType.Exact: + writer.WriteStringValue("exact"); + return; + case QueryRuleCriteriaType.Contains: + writer.WriteStringValue("contains"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(QueryRuleTypeConverter))] +public enum QueryRuleType +{ + [EnumMember(Value = "pinned")] + Pinned +} + +internal sealed class QueryRuleTypeConverter : JsonConverter +{ + public override QueryRuleType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "pinned": + return QueryRuleType.Pinned; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, QueryRuleType value, JsonSerializerOptions options) + { + switch (value) + { + case QueryRuleType.Pinned: + writer.WriteStringValue("pinned"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs new file mode 100644 index 00000000000..21d54ddc082 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs @@ -0,0 +1,155 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +[JsonConverter(typeof(IndexingJobStateConverter))] +public enum IndexingJobState +{ + [EnumMember(Value = "stopping")] + Stopping, + [EnumMember(Value = "stopped")] + Stopped, + [EnumMember(Value = "started")] + Started, + [EnumMember(Value = "indexing")] + Indexing, + [EnumMember(Value = "aborting")] + Aborting +} + +internal sealed class IndexingJobStateConverter : JsonConverter +{ + public override IndexingJobState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "stopping": + return IndexingJobState.Stopping; + case "stopped": + return IndexingJobState.Stopped; + case "started": + return IndexingJobState.Started; + case "indexing": + return IndexingJobState.Indexing; + case "aborting": + return IndexingJobState.Aborting; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, IndexingJobState value, JsonSerializerOptions options) + { + switch (value) + { + case IndexingJobState.Stopping: + writer.WriteStringValue("stopping"); + return; + case IndexingJobState.Stopped: + writer.WriteStringValue("stopped"); + return; + case IndexingJobState.Started: + writer.WriteStringValue("started"); + return; + case IndexingJobState.Indexing: + writer.WriteStringValue("indexing"); + return; + case IndexingJobState.Aborting: + writer.WriteStringValue("aborting"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(MetricConverter))] +public enum Metric +{ + [EnumMember(Value = "value_count")] + ValueCount, + [EnumMember(Value = "sum")] + Sum, + [EnumMember(Value = "min")] + Min, + [EnumMember(Value = "max")] + Max, + [EnumMember(Value = "avg")] + Avg +} + +internal sealed class MetricConverter : JsonConverter +{ + public override Metric Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "value_count": + return Metric.ValueCount; + case "sum": + return Metric.Sum; + case "min": + return Metric.Min; + case "max": + return Metric.Max; + case "avg": + return Metric.Avg; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, Metric value, JsonSerializerOptions options) + { + switch (value) + { + case Metric.ValueCount: + writer.WriteStringValue("value_count"); + return; + case Metric.Sum: + writer.WriteStringValue("sum"); + return; + case Metric.Min: + writer.WriteStringValue("min"); + return; + case Metric.Max: + writer.WriteStringValue("max"); + return; + case Metric.Avg: + writer.WriteStringValue("avg"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs similarity index 61% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs index 6394358209d..347c56fa44b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs @@ -17,58 +17,59 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -[JsonConverter(typeof(TokenizationTruncateConverter))] -public enum TokenizationTruncate +[JsonConverter(typeof(StatsLevelConverter))] +public enum StatsLevel { - [EnumMember(Value = "second")] - Second, - [EnumMember(Value = "none")] - None, - [EnumMember(Value = "first")] - First + [EnumMember(Value = "shards")] + Shards, + [EnumMember(Value = "indices")] + Indices, + [EnumMember(Value = "cluster")] + Cluster } -internal sealed class TokenizationTruncateConverter : JsonConverter +internal sealed class StatsLevelConverter : JsonConverter { - public override TokenizationTruncate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override StatsLevel 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; + case "shards": + return StatsLevel.Shards; + case "indices": + return StatsLevel.Indices; + case "cluster": + return StatsLevel.Cluster; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } - public override void Write(Utf8JsonWriter writer, TokenizationTruncate value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, StatsLevel value, JsonSerializerOptions options) { switch (value) { - case TokenizationTruncate.Second: - writer.WriteStringValue("second"); + case StatsLevel.Shards: + writer.WriteStringValue("shards"); return; - case TokenizationTruncate.None: - writer.WriteStringValue("none"); + case StatsLevel.Indices: + writer.WriteStringValue("indices"); return; - case TokenizationTruncate.First: - writer.WriteStringValue("first"); + case StatsLevel.Cluster: + writer.WriteStringValue("cluster"); return; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs new file mode 100644 index 00000000000..3a75691f980 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs @@ -0,0 +1,184 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; +using System; +using System.Runtime.Serialization; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +[JsonConverter(typeof(ShardsStatsStageConverter))] +public enum ShardsStatsStage +{ + /// + /// Number of shards in the snapshot that are in the started stage of being stored in the repository. + /// + [EnumMember(Value = "STARTED")] + Started, + /// + /// Number of shards in the snapshot that are in the initializing stage of being stored in the repository. + /// + [EnumMember(Value = "INIT")] + Init, + /// + /// Number of shards in the snapshot that are in the finalizing stage of being stored in the repository. + /// + [EnumMember(Value = "FINALIZE")] + Finalize, + /// + /// Number of shards in the snapshot that were not successfully stored in the repository. + /// + [EnumMember(Value = "FAILURE")] + Failure, + /// + /// Number of shards in the snapshot that were successfully stored in the repository. + /// + [EnumMember(Value = "DONE")] + Done +} + +internal sealed class ShardsStatsStageConverter : JsonConverter +{ + public override ShardsStatsStage Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "STARTED": + return ShardsStatsStage.Started; + case "INIT": + return ShardsStatsStage.Init; + case "FINALIZE": + return ShardsStatsStage.Finalize; + case "FAILURE": + return ShardsStatsStage.Failure; + case "DONE": + return ShardsStatsStage.Done; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, ShardsStatsStage value, JsonSerializerOptions options) + { + switch (value) + { + case ShardsStatsStage.Started: + writer.WriteStringValue("STARTED"); + return; + case ShardsStatsStage.Init: + writer.WriteStringValue("INIT"); + return; + case ShardsStatsStage.Finalize: + writer.WriteStringValue("FINALIZE"); + return; + case ShardsStatsStage.Failure: + writer.WriteStringValue("FAILURE"); + return; + case ShardsStatsStage.Done: + writer.WriteStringValue("DONE"); + return; + } + + writer.WriteNullValue(); + } +} + +[JsonConverter(typeof(SnapshotSortConverter))] +public enum SnapshotSort +{ + [EnumMember(Value = "start_time")] + StartTime, + [EnumMember(Value = "shard_count")] + ShardCount, + [EnumMember(Value = "repository")] + Repository, + [EnumMember(Value = "name")] + Name, + [EnumMember(Value = "index_count")] + IndexCount, + [EnumMember(Value = "failed_shard_count")] + FailedShardCount, + [EnumMember(Value = "duration")] + Duration +} + +internal sealed class SnapshotSortConverter : JsonConverter +{ + public override SnapshotSort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "start_time": + return SnapshotSort.StartTime; + case "shard_count": + return SnapshotSort.ShardCount; + case "repository": + return SnapshotSort.Repository; + case "name": + return SnapshotSort.Name; + case "index_count": + return SnapshotSort.IndexCount; + case "failed_shard_count": + return SnapshotSort.FailedShardCount; + case "duration": + return SnapshotSort.Duration; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, SnapshotSort value, JsonSerializerOptions options) + { + switch (value) + { + case SnapshotSort.StartTime: + writer.WriteStringValue("start_time"); + return; + case SnapshotSort.ShardCount: + writer.WriteStringValue("shard_count"); + return; + case SnapshotSort.Repository: + writer.WriteStringValue("repository"); + return; + case SnapshotSort.Name: + writer.WriteStringValue("name"); + return; + case SnapshotSort.IndexCount: + writer.WriteStringValue("index_count"); + return; + case SnapshotSort.FailedShardCount: + writer.WriteStringValue("failed_shard_count"); + return; + case SnapshotSort.Duration: + writer.WriteStringValue("duration"); + return; + } + + writer.WriteNullValue(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs index 995fcb42db6..fae9e44b256 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Tasks; @@ -63,7 +63,8 @@ public override GroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, Json return GroupBy.Nodes; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, GroupBy value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs index 9a0bbb72673..fdb9af07820 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs @@ -17,14 +17,14 @@ #nullable restore +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Serialization; +using Elastic.Transport; using System; using System.Runtime.Serialization; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.Core; -using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport; namespace Elastic.Clients.Elasticsearch.Watcher; @@ -58,7 +58,8 @@ public override ActionStatusOptions Read(ref Utf8JsonReader reader, Type typeToC return ActionStatusOptions.Failure; } - ThrowHelper.ThrowJsonException(); return default; + ThrowHelper.ThrowJsonException(); + return default; } public override void Write(Utf8JsonWriter writer, ActionStatusOptions value, JsonSerializerOptions options) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs index ef89e85f249..dd051df2614 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs @@ -29,6 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Eql; public sealed partial class HitsEvent { + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] + public IReadOnlyDictionary>? Fields { get; init; } + /// /// Unique identifier for the event. This ID is only unique within the index. /// @@ -46,7 +50,4 @@ public sealed partial class HitsEvent /// [JsonInclude, JsonPropertyName("_source")] public TEvent Source { get; init; } - [JsonInclude, JsonPropertyName("fields")] - [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] - public IReadOnlyDictionary>? Fields { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs index 9f3a54959c4..07bc0e4616e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs @@ -82,12 +82,12 @@ public override ErrorCause Read(ref Utf8JsonReader reader, Type typeToConvert, J } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } - return new ErrorCause { CausedBy = causedBy, Reason = reason, RootCause = rootCause, StackTrace = stackTrace, Suppressed = suppressed, Type = type, Metadata = additionalProperties }; + return new ErrorCause { CausedBy = causedBy, Metadata = additionalProperties, Reason = reason, RootCause = rootCause, StackTrace = stackTrace, Suppressed = suppressed, Type = type }; } public override void Write(Utf8JsonWriter writer, ErrorCause value, JsonSerializerOptions options) @@ -96,13 +96,17 @@ public override void Write(Utf8JsonWriter writer, ErrorCause value, JsonSerializ } } -[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.
///
+[JsonConverter(typeof(ErrorCauseConverter))] public sealed partial class ErrorCause { public Elastic.Clients.Elasticsearch.ErrorCause? CausedBy { get; init; } + + /// + /// Additional details about the error + /// public IReadOnlyDictionary Metadata { get; init; } /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs index 6382f2122cb..2a0aa2d99f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs @@ -19,7 +19,6 @@ using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.Serialization; -using Elastic.Transport.Products.Elasticsearch; using System; using System.Collections.Generic; using System.Linq.Expressions; @@ -31,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch; /// /// The response returned by Elasticsearch when request execution did not succeed. /// -public abstract partial class ErrorResponseBase +public sealed partial class ErrorResponseBase { [JsonInclude, JsonPropertyName("error")] public Elastic.Clients.Elasticsearch.ErrorCause Error { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs new file mode 100644 index 00000000000..f81694a06c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features; + +public sealed partial class Feature +{ + [JsonInclude, JsonPropertyName("description")] + public string Description { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs index b15a8dd16cb..669d99a22ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs @@ -32,7 +32,7 @@ public sealed partial class FieldSort [JsonInclude, JsonPropertyName("format")] public string? Format { get; set; } [JsonInclude, JsonPropertyName("missing")] - public FieldValue? Missing { get; set; } + public Elastic.Clients.Elasticsearch.FieldValue? Missing { get; set; } [JsonInclude, JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.SortMode? Mode { get; set; } [JsonInclude, JsonPropertyName("nested")] @@ -54,11 +54,11 @@ public FieldSortDescriptor() : base() } private string? FormatValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.FieldSortNumericType? NumericTypeValue { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldType? UnmappedTypeValue { get; set; } @@ -69,7 +69,7 @@ public FieldSortDescriptor Format(string? format) return Self; } - public FieldSortDescriptor Missing(FieldValue? missing) + public FieldSortDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -89,7 +89,7 @@ public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.Neste return Self; } - public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -97,7 +97,7 @@ public FieldSortDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public FieldSortDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -152,7 +152,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -191,11 +191,11 @@ public FieldSortDescriptor() : base() } private string? FormatValue { get; set; } - private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? MissingValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.FieldSortNumericType? NumericTypeValue { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldType? UnmappedTypeValue { get; set; } @@ -206,7 +206,7 @@ public FieldSortDescriptor Format(string? format) return Self; } - public FieldSortDescriptor Missing(FieldValue? missing) + public FieldSortDescriptor Missing(Elastic.Clients.Elasticsearch.FieldValue? missing) { MissingValue = missing; return Self; @@ -226,7 +226,7 @@ public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValue? return Self; } - public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public FieldSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -234,7 +234,7 @@ public FieldSortDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public FieldSortDescriptor Nested(Action configure) + public FieldSortDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -289,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs index 44471ecc66d..8b1381781fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Fuzziness : Union { - public Fuzziness(string fuzziness) : base(fuzziness) + public Fuzziness(string Fuzziness) : base(Fuzziness) { } - public Fuzziness(int fuzziness) : base(fuzziness) + public Fuzziness(int Fuzziness) : base(Fuzziness) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs index 3aaa947dc4e..399c7f54356 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs @@ -138,7 +138,7 @@ public sealed partial class GeoDistanceSort public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } public Elastic.Clients.Elasticsearch.DistanceUnit? Unit { get; set; } - public static implicit operator SortOptions(GeoDistanceSort geoDistanceSort) => SortOptions.GeoDistance(geoDistanceSort); + public static implicit operator Elastic.Clients.Elasticsearch.SortOptions(GeoDistanceSort geoDistanceSort) => Elastic.Clients.Elasticsearch.SortOptions.GeoDistance(geoDistanceSort); } public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor> @@ -150,12 +150,12 @@ public GeoDistanceSortDescriptor() : base() } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private ICollection LocationValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private ICollection LocationValue { get; set; } public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) { @@ -163,27 +163,27 @@ public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elastic return Self; } - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.SortMode? mode) + public GeoDistanceSortDescriptor Field(Expression> field) { - ModeValue = mode; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + public GeoDistanceSortDescriptor Field(Expression> field) { - OrderValue = order; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - UnitValue = unit; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -193,15 +193,21 @@ public GeoDistanceSortDescriptor Location(ICollection Field(Elastic.Clients.Elasticsearch.Field field) + public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.SortMode? mode) { - FieldValue = field; + ModeValue = mode; return Self; } - public GeoDistanceSortDescriptor Field(Expression> field) + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) { - FieldValue = field; + OrderValue = order; + return Self; + } + + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) + { + UnitValue = unit; return Self; } @@ -258,12 +264,12 @@ public GeoDistanceSortDescriptor() : base() } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private ICollection LocationValue { get; set; } private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private ICollection LocationValue { get; set; } public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) { @@ -271,27 +277,27 @@ public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoD return Self; } - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceSortDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.SortMode? mode) + public GeoDistanceSortDescriptor Field(Expression> field) { - ModeValue = mode; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) + public GeoDistanceSortDescriptor Field(Expression> field) { - OrderValue = order; + FieldValue = field; return Self; } - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) + public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - UnitValue = unit; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -301,21 +307,21 @@ public GeoDistanceSortDescriptor Location(ICollection(Expression> field) + public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) { - FieldValue = field; + OrderValue = order; return Self; } - public GeoDistanceSortDescriptor Field(Expression> field) + public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) { - FieldValue = field; + UnitValue = unit; return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs index 3ee65168b82..0606ef6dc53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs @@ -53,7 +53,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("geohash"); - JsonSerializer.Serialize(writer, GeohashValue, options); + writer.WriteStringValue(GeohashValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs index 1e9b850410e..5a676ecb138 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs @@ -134,9 +134,8 @@ internal sealed class GeoLocationConverter : MultiItemUnionConverter { { GeoLocation.Kind.LatitudeLongitude, typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocation) }, { GeoLocation.Kind.Geohash, typeof(Elastic.Clients.Elasticsearch.GeoHashLocation) }, { GeoLocation.Kind.Coordinates, typeof(double[]) }, { GeoLocation.Kind.Text, typeof(string) } }; - _factories = new Dictionary> { { typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocation), o => GeoLocation.LatitudeLongitude((Elastic.Clients.Elasticsearch.LatLonGeoLocation)o) }, { typeof(Elastic.Clients.Elasticsearch.GeoHashLocation), o => GeoLocation.Geohash((Elastic.Clients.Elasticsearch.GeoHashLocation)o) }, { typeof(double[]), o => GeoLocation.Coordinates((double[])o) }, { typeof(string), o => GeoLocation.Text((string)o) } }; + _types = new Dictionary { { GeoLocation.Kind.LatitudeLongitude, typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocation) }, { GeoLocation.Kind.Geohash, typeof(Elastic.Clients.Elasticsearch.GeoHashLocation) } }; + _factories = new Dictionary> { { typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocation), o => GeoLocation.LatitudeLongitude((Elastic.Clients.Elasticsearch.LatLonGeoLocation)o) }, { typeof(Elastic.Clients.Elasticsearch.GeoHashLocation), o => GeoLocation.Geohash((Elastic.Clients.Elasticsearch.GeoHashLocation)o) } }; _uniquePropertyToType = new Dictionary { { "lat", typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocation) }, { "geohash", typeof(Elastic.Clients.Elasticsearch.GeoHashLocation) } }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs index f511de2038a..36df32d2914 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch; +/// +/// A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". +/// public sealed partial class GeohashPrecision : Union { - public GeohashPrecision(double geohash_length) : base(geohash_length) + public GeohashPrecision(double GeohashLength) : base(GeohashLength) { } - public GeohashPrecision(string distance) : base(distance) + public GeohashPrecision(string Distance) : base(Distance) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs index 2d27e3bf5a7..d85d33d5d2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs @@ -63,8 +63,8 @@ public ExploreControlsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Graph.SampleDiversity? SampleDiversityValue { get; set; } - private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } - private Action> SampleDiversityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + private Action> SampleDiversityDescriptorAction { get; set; } private int? SampleSizeValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } private bool UseSignificanceValue { get; set; } @@ -80,7 +80,7 @@ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elas return Self; } - public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor descriptor) { SampleDiversityValue = null; SampleDiversityDescriptorAction = null; @@ -88,7 +88,7 @@ public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescr return Self; } - public ExploreControlsDescriptor SampleDiversity(Action> configure) + public ExploreControlsDescriptor SampleDiversity(Action> configure) { SampleDiversityValue = null; SampleDiversityDescriptor = null; @@ -134,7 +134,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SampleDiversityDescriptorAction is not null) { writer.WritePropertyName("sample_diversity"); - JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); } else if (SampleDiversityValue is not null) { @@ -169,8 +169,8 @@ public ExploreControlsDescriptor() : base() } private Elastic.Clients.Elasticsearch.Graph.SampleDiversity? SampleDiversityValue { get; set; } - private SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } - private Action SampleDiversityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor SampleDiversityDescriptor { get; set; } + private Action SampleDiversityDescriptorAction { get; set; } private int? SampleSizeValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? TimeoutValue { get; set; } private bool UseSignificanceValue { get; set; } @@ -186,7 +186,7 @@ public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.G return Self; } - public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descriptor) + public ExploreControlsDescriptor SampleDiversity(Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor descriptor) { SampleDiversityValue = null; SampleDiversityDescriptorAction = null; @@ -194,7 +194,7 @@ public ExploreControlsDescriptor SampleDiversity(SampleDiversityDescriptor descr return Self; } - public ExploreControlsDescriptor SampleDiversity(Action configure) + public ExploreControlsDescriptor SampleDiversity(Action configure) { SampleDiversityValue = null; SampleDiversityDescriptor = null; @@ -240,7 +240,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SampleDiversityDescriptorAction is not null) { writer.WritePropertyName("sample_diversity"); - JsonSerializer.Serialize(writer, new SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.SampleDiversityDescriptor(SampleDiversityDescriptorAction), options); } else if (SampleDiversityValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs index ee47408b499..8d5480f9ef8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs @@ -57,15 +57,15 @@ public HopDescriptor() : base() } private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } - private HopDescriptor ConnectionsDescriptor { get; set; } - private Action> ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.HopDescriptor ConnectionsDescriptor { get; set; } + private Action> ConnectionsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } + private Elastic.Clients.Elasticsearch.Graph.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. @@ -78,7 +78,7 @@ public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph. return Self; } - public HopDescriptor Connections(HopDescriptor descriptor) + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -86,7 +86,7 @@ public HopDescriptor Connections(HopDescriptor descriptor) return Self; } - public HopDescriptor Connections(Action> configure) + public HopDescriptor Connections(Action> configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -105,7 +105,7 @@ public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Que return Self; } - public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -113,7 +113,7 @@ public HopDescriptor Query(QueryDsl.QueryDescriptor descri return Self; } - public HopDescriptor Query(Action> configure) + public HopDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -133,7 +133,7 @@ public HopDescriptor Vertices(ICollection Vertices(VertexDefinitionDescriptor descriptor) + public HopDescriptor Vertices(Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor descriptor) { VerticesValue = null; VerticesDescriptorAction = null; @@ -142,7 +142,7 @@ public HopDescriptor Vertices(VertexDefinitionDescriptor d return Self; } - public HopDescriptor Vertices(Action> configure) + public HopDescriptor Vertices(Action> configure) { VerticesValue = null; VerticesDescriptor = null; @@ -151,7 +151,7 @@ public HopDescriptor Vertices(Action Vertices(params Action>[] configure) + public HopDescriptor Vertices(params Action>[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -171,7 +171,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -187,7 +187,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -206,7 +206,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -215,7 +215,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); @@ -239,15 +239,15 @@ public HopDescriptor() : base() } private Elastic.Clients.Elasticsearch.Graph.Hop? ConnectionsValue { get; set; } - private HopDescriptor ConnectionsDescriptor { get; set; } - private Action ConnectionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Graph.HopDescriptor ConnectionsDescriptor { get; set; } + private Action ConnectionsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDsl.QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.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; } + private Elastic.Clients.Elasticsearch.Graph.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. @@ -260,7 +260,7 @@ public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.Hop? connec return Self; } - public HopDescriptor Connections(HopDescriptor descriptor) + public HopDescriptor Connections(Elastic.Clients.Elasticsearch.Graph.HopDescriptor descriptor) { ConnectionsValue = null; ConnectionsDescriptorAction = null; @@ -268,7 +268,7 @@ public HopDescriptor Connections(HopDescriptor descriptor) return Self; } - public HopDescriptor Connections(Action configure) + public HopDescriptor Connections(Action configure) { ConnectionsValue = null; ConnectionsDescriptor = null; @@ -287,7 +287,7 @@ public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query query) return Self; } - public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) + public HopDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -295,7 +295,7 @@ public HopDescriptor Query(QueryDsl.QueryDescriptor descriptor) return Self; } - public HopDescriptor Query(Action configure) + public HopDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -315,7 +315,7 @@ public HopDescriptor Vertices(ICollection configure) + public HopDescriptor Vertices(Action configure) { VerticesValue = null; VerticesDescriptor = null; @@ -333,7 +333,7 @@ public HopDescriptor Vertices(Action configure) return Self; } - public HopDescriptor Vertices(params Action[] configure) + public HopDescriptor Vertices(params Action[] configure) { VerticesValue = null; VerticesDescriptor = null; @@ -353,7 +353,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConnectionsDescriptorAction is not null) { writer.WritePropertyName("connections"); - JsonSerializer.Serialize(writer, new HopDescriptor(ConnectionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.HopDescriptor(ConnectionsDescriptorAction), options); } else if (ConnectionsValue is not null) { @@ -369,7 +369,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -388,7 +388,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("vertices"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(VerticesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(VerticesDescriptorAction), options); writer.WriteEndArray(); } else if (VerticesDescriptorActions is not null) @@ -397,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in VerticesDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexDefinitionDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexDefinitionDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs index 96f02b50c45..d8c24e165bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs @@ -58,6 +58,12 @@ public SampleDiversityDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SampleDiversityDescriptor MaxDocsPerValue(int maxDocsPerValue) { MaxDocsPerValueValue = maxDocsPerValue; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs index 3b67b039c63..ba863d2919e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs @@ -77,9 +77,9 @@ public VertexDefinitionDescriptor() : base() private ICollection? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Graph.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; } @@ -111,6 +111,15 @@ public VertexDefinitionDescriptor Field(Expression + /// 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. /// @@ -123,7 +132,7 @@ public VertexDefinitionDescriptor Include(ICollection Include(VertexIncludeDescriptor descriptor) + public VertexDefinitionDescriptor Include(Elastic.Clients.Elasticsearch.Graph.VertexIncludeDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -132,7 +141,7 @@ public VertexDefinitionDescriptor Include(VertexIncludeDescriptor des return Self; } - public VertexDefinitionDescriptor Include(Action configure) + public VertexDefinitionDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -141,7 +150,7 @@ public VertexDefinitionDescriptor Include(Action Include(params Action[] configure) + public VertexDefinitionDescriptor Include(params Action[] configure) { IncludeValue = null; IncludeDescriptor = null; @@ -199,7 +208,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("include"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexIncludeDescriptor(IncludeDescriptorAction), options); writer.WriteEndArray(); } else if (IncludeDescriptorActions is not null) @@ -208,7 +217,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IncludeDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexIncludeDescriptor(action), options); } writer.WriteEndArray(); @@ -252,9 +261,9 @@ public VertexDefinitionDescriptor() : base() private ICollection? ExcludeValue { get; set; } private Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Graph.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; } @@ -307,7 +316,7 @@ public VertexDefinitionDescriptor Include(ICollection configure) + public VertexDefinitionDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -325,7 +334,7 @@ public VertexDefinitionDescriptor Include(Action config return Self; } - public VertexDefinitionDescriptor Include(params Action[] configure) + public VertexDefinitionDescriptor Include(params Action[] configure) { IncludeValue = null; IncludeDescriptor = null; @@ -383,7 +392,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("include"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexIncludeDescriptor(IncludeDescriptorAction), options); writer.WriteEndArray(); } else if (IncludeDescriptorActions is not null) @@ -392,7 +401,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IncludeDescriptorActions) { - JsonSerializer.Serialize(writer, new VertexIncludeDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Graph.VertexIncludeDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Configurations.g.cs new file mode 100644 index 00000000000..76ef9a806c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Configurations.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class Configurations +{ + [JsonInclude, JsonPropertyName("forcemerge")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfiguration? Forcemerge { get; set; } + [JsonInclude, JsonPropertyName("rollover")] + public Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions? Rollover { get; set; } + [JsonInclude, JsonPropertyName("shrink")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfiguration? Shrink { get; set; } +} + +public sealed partial class ConfigurationsDescriptor : SerializableDescriptor +{ + internal ConfigurationsDescriptor(Action configure) => configure.Invoke(this); + + public ConfigurationsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfiguration? ForcemergeValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfigurationDescriptor ForcemergeDescriptor { get; set; } + private Action ForcemergeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions? RolloverValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor RolloverDescriptor { get; set; } + private Action RolloverDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfiguration? ShrinkValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfigurationDescriptor ShrinkDescriptor { get; set; } + private Action ShrinkDescriptorAction { get; set; } + + public ConfigurationsDescriptor Forcemerge(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfiguration? forcemerge) + { + ForcemergeDescriptor = null; + ForcemergeDescriptorAction = null; + ForcemergeValue = forcemerge; + return Self; + } + + public ConfigurationsDescriptor Forcemerge(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfigurationDescriptor descriptor) + { + ForcemergeValue = null; + ForcemergeDescriptorAction = null; + ForcemergeDescriptor = descriptor; + return Self; + } + + public ConfigurationsDescriptor Forcemerge(Action configure) + { + ForcemergeValue = null; + ForcemergeDescriptor = null; + ForcemergeDescriptorAction = configure; + return Self; + } + + public ConfigurationsDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions? rollover) + { + RolloverDescriptor = null; + RolloverDescriptorAction = null; + RolloverValue = rollover; + return Self; + } + + public ConfigurationsDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor descriptor) + { + RolloverValue = null; + RolloverDescriptorAction = null; + RolloverDescriptor = descriptor; + return Self; + } + + public ConfigurationsDescriptor Rollover(Action configure) + { + RolloverValue = null; + RolloverDescriptor = null; + RolloverDescriptorAction = configure; + return Self; + } + + public ConfigurationsDescriptor Shrink(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfiguration? shrink) + { + ShrinkDescriptor = null; + ShrinkDescriptorAction = null; + ShrinkValue = shrink; + return Self; + } + + public ConfigurationsDescriptor Shrink(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfigurationDescriptor descriptor) + { + ShrinkValue = null; + ShrinkDescriptorAction = null; + ShrinkDescriptor = descriptor; + return Self; + } + + public ConfigurationsDescriptor Shrink(Action configure) + { + ShrinkValue = null; + ShrinkDescriptor = null; + ShrinkDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ForcemergeDescriptor is not null) + { + writer.WritePropertyName("forcemerge"); + JsonSerializer.Serialize(writer, ForcemergeDescriptor, options); + } + else if (ForcemergeDescriptorAction is not null) + { + writer.WritePropertyName("forcemerge"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeConfigurationDescriptor(ForcemergeDescriptorAction), options); + } + else if (ForcemergeValue is not null) + { + writer.WritePropertyName("forcemerge"); + JsonSerializer.Serialize(writer, ForcemergeValue, options); + } + + if (RolloverDescriptor is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverDescriptor, options); + } + else if (RolloverDescriptorAction is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor(RolloverDescriptorAction), options); + } + else if (RolloverValue is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverValue, options); + } + + if (ShrinkDescriptor is not null) + { + writer.WritePropertyName("shrink"); + JsonSerializer.Serialize(writer, ShrinkDescriptor, options); + } + else if (ShrinkDescriptorAction is not null) + { + writer.WritePropertyName("shrink"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkConfigurationDescriptor(ShrinkDescriptorAction), options); + } + else if (ShrinkValue is not null) + { + writer.WritePropertyName("shrink"); + JsonSerializer.Serialize(writer, ShrinkValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.g.cs new file mode 100644 index 00000000000..d6240e98eb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeConfiguration.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class ForceMergeConfiguration +{ + [JsonInclude, JsonPropertyName("max_num_segments")] + public int MaxNumSegments { get; set; } +} + +public sealed partial class ForceMergeConfigurationDescriptor : SerializableDescriptor +{ + internal ForceMergeConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public ForceMergeConfigurationDescriptor() : base() + { + } + + private int MaxNumSegmentsValue { get; set; } + + public ForceMergeConfigurationDescriptor MaxNumSegments(int maxNumSegments) + { + MaxNumSegmentsValue = maxNumSegments; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("max_num_segments"); + writer.WriteNumberValue(MaxNumSegmentsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs new file mode 100644 index 00000000000..e1676136b51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class IlmPolicy +{ + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + [JsonInclude, JsonPropertyName("phases")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases Phases { get; set; } +} + +public sealed partial class IlmPolicyDescriptor : SerializableDescriptor +{ + internal IlmPolicyDescriptor(Action configure) => configure.Invoke(this); + + public IlmPolicyDescriptor() : base() + { + } + + private IDictionary? MetaValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases PhasesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhasesDescriptor PhasesDescriptor { get; set; } + private Action PhasesDescriptorAction { get; set; } + + public IlmPolicyDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + public IlmPolicyDescriptor Phases(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases phases) + { + PhasesDescriptor = null; + PhasesDescriptorAction = null; + PhasesValue = phases; + return Self; + } + + public IlmPolicyDescriptor Phases(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhasesDescriptor descriptor) + { + PhasesValue = null; + PhasesDescriptorAction = null; + PhasesDescriptor = descriptor; + return Self; + } + + public IlmPolicyDescriptor Phases(Action configure) + { + PhasesValue = null; + PhasesDescriptor = null; + PhasesDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PhasesDescriptor is not null) + { + writer.WritePropertyName("phases"); + JsonSerializer.Serialize(writer, PhasesDescriptor, options); + } + else if (PhasesDescriptorAction is not null) + { + writer.WritePropertyName("phases"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhasesDescriptor(PhasesDescriptorAction), options); + } + else + { + writer.WritePropertyName("phases"); + JsonSerializer.Serialize(writer, PhasesValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs new file mode 100644 index 00000000000..cfe7b62dd3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class Lifecycle +{ + [JsonInclude, JsonPropertyName("modified_date")] + public DateTimeOffset ModifiedDate { get; init; } + [JsonInclude, JsonPropertyName("policy")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy Policy { get; init; } + [JsonInclude, JsonPropertyName("version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs new file mode 100644 index 00000000000..eafd6acfe68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class Phase +{ + [JsonInclude, JsonPropertyName("actions")] + public object? Actions { get; set; } + [JsonInclude, JsonPropertyName("configurations")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Configurations? Configurations { get; set; } + [JsonInclude, JsonPropertyName("min_age")] + public Union? MinAge { get; set; } +} + +public sealed partial class PhaseDescriptor : SerializableDescriptor +{ + internal PhaseDescriptor(Action configure) => configure.Invoke(this); + + public PhaseDescriptor() : base() + { + } + + private object? ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Configurations? ConfigurationsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ConfigurationsDescriptor ConfigurationsDescriptor { get; set; } + private Action ConfigurationsDescriptorAction { get; set; } + private Union? MinAgeValue { get; set; } + + public PhaseDescriptor Actions(object? actions) + { + ActionsValue = actions; + return Self; + } + + public PhaseDescriptor Configurations(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Configurations? configurations) + { + ConfigurationsDescriptor = null; + ConfigurationsDescriptorAction = null; + ConfigurationsValue = configurations; + return Self; + } + + public PhaseDescriptor Configurations(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ConfigurationsDescriptor descriptor) + { + ConfigurationsValue = null; + ConfigurationsDescriptorAction = null; + ConfigurationsDescriptor = descriptor; + return Self; + } + + public PhaseDescriptor Configurations(Action configure) + { + ConfigurationsValue = null; + ConfigurationsDescriptor = null; + ConfigurationsDescriptorAction = configure; + return Self; + } + + public PhaseDescriptor MinAge(Union? minAge) + { + MinAgeValue = minAge; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (ConfigurationsDescriptor is not null) + { + writer.WritePropertyName("configurations"); + JsonSerializer.Serialize(writer, ConfigurationsDescriptor, options); + } + else if (ConfigurationsDescriptorAction is not null) + { + writer.WritePropertyName("configurations"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ConfigurationsDescriptor(ConfigurationsDescriptorAction), options); + } + else if (ConfigurationsValue is not null) + { + writer.WritePropertyName("configurations"); + JsonSerializer.Serialize(writer, ConfigurationsValue, options); + } + + if (MinAgeValue is not null) + { + writer.WritePropertyName("min_age"); + JsonSerializer.Serialize(writer, MinAgeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs new file mode 100644 index 00000000000..3f4557b59bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class Phases +{ + [JsonInclude, JsonPropertyName("cold")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? Cold { get; set; } + [JsonInclude, JsonPropertyName("delete")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? Delete { get; set; } + [JsonInclude, JsonPropertyName("frozen")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? Frozen { get; set; } + [JsonInclude, JsonPropertyName("hot")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? Hot { get; set; } + [JsonInclude, JsonPropertyName("warm")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? Warm { get; set; } +} + +public sealed partial class PhasesDescriptor : SerializableDescriptor +{ + internal PhasesDescriptor(Action configure) => configure.Invoke(this); + + public PhasesDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? ColdValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor ColdDescriptor { get; set; } + private Action ColdDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? DeleteValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor DeleteDescriptor { get; set; } + private Action DeleteDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? FrozenValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor FrozenDescriptor { get; set; } + private Action FrozenDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? HotValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor HotDescriptor { get; set; } + private Action HotDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? WarmValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor WarmDescriptor { get; set; } + private Action WarmDescriptorAction { get; set; } + + public PhasesDescriptor Cold(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? cold) + { + ColdDescriptor = null; + ColdDescriptorAction = null; + ColdValue = cold; + return Self; + } + + public PhasesDescriptor Cold(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor descriptor) + { + ColdValue = null; + ColdDescriptorAction = null; + ColdDescriptor = descriptor; + return Self; + } + + public PhasesDescriptor Cold(Action configure) + { + ColdValue = null; + ColdDescriptor = null; + ColdDescriptorAction = configure; + return Self; + } + + public PhasesDescriptor Delete(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? delete) + { + DeleteDescriptor = null; + DeleteDescriptorAction = null; + DeleteValue = delete; + return Self; + } + + public PhasesDescriptor Delete(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor descriptor) + { + DeleteValue = null; + DeleteDescriptorAction = null; + DeleteDescriptor = descriptor; + return Self; + } + + public PhasesDescriptor Delete(Action configure) + { + DeleteValue = null; + DeleteDescriptor = null; + DeleteDescriptorAction = configure; + return Self; + } + + public PhasesDescriptor Frozen(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? frozen) + { + FrozenDescriptor = null; + FrozenDescriptorAction = null; + FrozenValue = frozen; + return Self; + } + + public PhasesDescriptor Frozen(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor descriptor) + { + FrozenValue = null; + FrozenDescriptorAction = null; + FrozenDescriptor = descriptor; + return Self; + } + + public PhasesDescriptor Frozen(Action configure) + { + FrozenValue = null; + FrozenDescriptor = null; + FrozenDescriptorAction = configure; + return Self; + } + + public PhasesDescriptor Hot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? hot) + { + HotDescriptor = null; + HotDescriptorAction = null; + HotValue = hot; + return Self; + } + + public PhasesDescriptor Hot(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor descriptor) + { + HotValue = null; + HotDescriptorAction = null; + HotDescriptor = descriptor; + return Self; + } + + public PhasesDescriptor Hot(Action configure) + { + HotValue = null; + HotDescriptor = null; + HotDescriptorAction = configure; + return Self; + } + + public PhasesDescriptor Warm(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase? warm) + { + WarmDescriptor = null; + WarmDescriptorAction = null; + WarmValue = warm; + return Self; + } + + public PhasesDescriptor Warm(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor descriptor) + { + WarmValue = null; + WarmDescriptorAction = null; + WarmDescriptor = descriptor; + return Self; + } + + public PhasesDescriptor Warm(Action configure) + { + WarmValue = null; + WarmDescriptor = null; + WarmDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ColdDescriptor is not null) + { + writer.WritePropertyName("cold"); + JsonSerializer.Serialize(writer, ColdDescriptor, options); + } + else if (ColdDescriptorAction is not null) + { + writer.WritePropertyName("cold"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor(ColdDescriptorAction), options); + } + else if (ColdValue is not null) + { + writer.WritePropertyName("cold"); + JsonSerializer.Serialize(writer, ColdValue, options); + } + + if (DeleteDescriptor is not null) + { + writer.WritePropertyName("delete"); + JsonSerializer.Serialize(writer, DeleteDescriptor, options); + } + else if (DeleteDescriptorAction is not null) + { + writer.WritePropertyName("delete"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor(DeleteDescriptorAction), options); + } + else if (DeleteValue is not null) + { + writer.WritePropertyName("delete"); + JsonSerializer.Serialize(writer, DeleteValue, options); + } + + if (FrozenDescriptor is not null) + { + writer.WritePropertyName("frozen"); + JsonSerializer.Serialize(writer, FrozenDescriptor, options); + } + else if (FrozenDescriptorAction is not null) + { + writer.WritePropertyName("frozen"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor(FrozenDescriptorAction), options); + } + else if (FrozenValue is not null) + { + writer.WritePropertyName("frozen"); + JsonSerializer.Serialize(writer, FrozenValue, options); + } + + if (HotDescriptor is not null) + { + writer.WritePropertyName("hot"); + JsonSerializer.Serialize(writer, HotDescriptor, options); + } + else if (HotDescriptorAction is not null) + { + writer.WritePropertyName("hot"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor(HotDescriptorAction), options); + } + else if (HotValue is not null) + { + writer.WritePropertyName("hot"); + JsonSerializer.Serialize(writer, HotValue, options); + } + + if (WarmDescriptor is not null) + { + writer.WritePropertyName("warm"); + JsonSerializer.Serialize(writer, WarmDescriptor, options); + } + else if (WarmDescriptorAction is not null) + { + writer.WritePropertyName("warm"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseDescriptor(WarmDescriptorAction), options); + } + else if (WarmValue is not null) + { + writer.WritePropertyName("warm"); + JsonSerializer.Serialize(writer, WarmValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.g.cs new file mode 100644 index 00000000000..698e7afd924 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkConfiguration.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class ShrinkConfiguration +{ + [JsonInclude, JsonPropertyName("number_of_shards")] + public int NumberOfShards { get; set; } +} + +public sealed partial class ShrinkConfigurationDescriptor : SerializableDescriptor +{ + internal ShrinkConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public ShrinkConfigurationDescriptor() : base() + { + } + + private int NumberOfShardsValue { get; set; } + + public ShrinkConfigurationDescriptor NumberOfShards(int numberOfShards) + { + NumberOfShardsValue = numberOfShards; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("number_of_shards"); + writer.WriteNumberValue(NumberOfShardsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs new file mode 100644 index 00000000000..8924b0ef17a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; + +public sealed partial class StepKey +{ + [JsonInclude, JsonPropertyName("action")] + public string Action { get; set; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; set; } + [JsonInclude, JsonPropertyName("phase")] + public string Phase { get; set; } +} + +public sealed partial class StepKeyDescriptor : SerializableDescriptor +{ + internal StepKeyDescriptor(Action configure) => configure.Invoke(this); + + public StepKeyDescriptor() : base() + { + } + + private string ActionValue { get; set; } + private string NameValue { get; set; } + private string PhaseValue { get; set; } + + public StepKeyDescriptor Action(string action) + { + ActionValue = action; + return Self; + } + + public StepKeyDescriptor Name(string name) + { + NameValue = name; + return Self; + } + + public StepKeyDescriptor Phase(string phase) + { + PhaseValue = phase; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("action"); + writer.WriteStringValue(ActionValue); + writer.WritePropertyName("name"); + writer.WriteStringValue(NameValue); + writer.WritePropertyName("phase"); + writer.WriteStringValue(PhaseValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Action.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Action.g.cs deleted file mode 100644 index 6c820bae693..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Action.g.cs +++ /dev/null @@ -1,237 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.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.IndexManagement.AddAction addAction) => new Action("add", addAction); - public static Action Remove(Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction removeAction) => new Action("remove", removeAction); - public static Action RemoveIndex(Elastic.Clients.Elasticsearch.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.IndexManagement.AddAction)value.Variant, options); - break; - case "remove": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction)value.Variant, options); - break; - case "remove_index": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.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/_Generated/Types/IndexManagement/AddAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs index dafd354a813..a19b36de1b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs @@ -96,7 +96,7 @@ public sealed partial class AddAction [JsonInclude, JsonPropertyName("search_routing")] public Elastic.Clients.Elasticsearch.Routing? SearchRouting { get; set; } - public static implicit operator Action(AddAction addAction) => IndexManagement.Action.Add(addAction); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction(AddAction addAction) => Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction.Add(addAction); } public sealed partial class AddActionDescriptor : SerializableDescriptor> @@ -110,8 +110,8 @@ public AddActionDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexAlias? AliasValue { get; set; } private ICollection? AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } @@ -150,7 +150,7 @@ public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.Query return Self; } - public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -158,7 +158,7 @@ public AddActionDescriptor Filter(QueryDsl.QueryDescriptor return Self; } - public AddActionDescriptor Filter(Action> configure) + public AddActionDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -261,7 +261,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -332,8 +332,8 @@ public AddActionDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexAlias? AliasValue { get; set; } private ICollection? AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } @@ -372,7 +372,7 @@ public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? return Self; } - public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AddActionDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -380,7 +380,7 @@ public AddActionDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public AddActionDescriptor Filter(Action configure) + public AddActionDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -483,7 +483,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs index 6e48a4487fc..c28d915ab18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs @@ -75,8 +75,8 @@ public AliasDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private bool? IsHiddenValue { get; set; } private bool? IsWriteIndexValue { get; set; } @@ -94,7 +94,7 @@ public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl. return Self; } - public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -102,7 +102,7 @@ public AliasDescriptor Filter(QueryDsl.QueryDescriptor des return Self; } - public AliasDescriptor Filter(Action> configure) + public AliasDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -166,7 +166,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -217,8 +217,8 @@ public AliasDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Routing? IndexRoutingValue { get; set; } private bool? IsHiddenValue { get; set; } private bool? IsWriteIndexValue { get; set; } @@ -236,7 +236,7 @@ public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filt return Self; } - public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public AliasDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -244,7 +244,7 @@ public AliasDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public AliasDescriptor Filter(Action configure) + public AliasDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -308,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs new file mode 100644 index 00000000000..1fb99221aa0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class AnalyzeDetail +{ + [JsonInclude, JsonPropertyName("analyzer")] + public Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail? Analyzer { get; init; } + [JsonInclude, JsonPropertyName("charfilters")] + public IReadOnlyCollection? Charfilters { get; init; } + [JsonInclude, JsonPropertyName("custom_analyzer")] + public bool CustomAnalyzer { get; init; } + [JsonInclude, JsonPropertyName("tokenfilters")] + public IReadOnlyCollection? Tokenfilters { get; init; } + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail? Tokenizer { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs new file mode 100644 index 00000000000..364b16cd57e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class AnalyzeToken +{ + [JsonInclude, JsonPropertyName("end_offset")] + public long EndOffset { get; init; } + [JsonInclude, JsonPropertyName("position")] + public long Position { get; init; } + [JsonInclude, JsonPropertyName("positionLength")] + public long? Positionlength { get; init; } + [JsonInclude, JsonPropertyName("start_offset")] + public long StartOffset { get; init; } + [JsonInclude, JsonPropertyName("token")] + public string Token { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs new file mode 100644 index 00000000000..8ffc54c9817 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class AnalyzerDetail +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection Tokens { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs new file mode 100644 index 00000000000..a54cc2bcde6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class CharFilterDetail +{ + [JsonInclude, JsonPropertyName("filtered_text")] + public IReadOnlyCollection FilteredText { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs index 4ec50652edb..2c6eeeaff25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs @@ -29,12 +29,6 @@ namespace Elastic.Clients.Elasticsearch.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. /// @@ -71,6 +65,12 @@ public sealed partial class DataStream [JsonInclude, JsonPropertyName("lifecycle")] public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + /// + /// 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; } + /// /// Name of the data stream. /// @@ -81,7 +81,7 @@ public sealed partial class DataStream /// Name of the lifecycle system that'll manage the next generation of the data stream. ///
[JsonInclude, JsonPropertyName("next_generation_managed_by")] - public string NextGenerationManagedBy { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy NextGenerationManagedBy { get; init; } /// /// Indicates if ILM should take precedence over DSL in case both are configured to managed this data stream. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs index 1a533d18a4b..8f458d9304d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs @@ -51,7 +51,7 @@ public sealed partial class DataStreamIndex /// Name of the lifecycle system that's currently managing this backing index. /// [JsonInclude, JsonPropertyName("managed_by")] - public string ManagedBy { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy ManagedBy { get; init; } /// /// Indicates if ILM should take precedence over DSL in case both are configured to manage this index. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs index 8a0aff82a8f..f40327a800e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -51,8 +51,8 @@ public DataStreamLifecycleDescriptor() : base() private Elastic.Clients.Elasticsearch.Duration? DataRetentionValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } - private DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } - private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { get; set; } public DataStreamLifecycleDescriptor DataRetention(Elastic.Clients.Elasticsearch.Duration? dataRetention) { @@ -68,7 +68,7 @@ public DataStreamLifecycleDescriptor Downsampling(Elastic.Clients.Elasticsearch. return Self; } - public DataStreamLifecycleDescriptor Downsampling(DataStreamLifecycleDownsamplingDescriptor descriptor) + public DataStreamLifecycleDescriptor Downsampling(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) { DownsamplingValue = null; DownsamplingDescriptorAction = null; @@ -76,7 +76,7 @@ public DataStreamLifecycleDescriptor Downsampling(DataStreamLifecycleDownsamplin return Self; } - public DataStreamLifecycleDescriptor Downsampling(Action configure) + public DataStreamLifecycleDescriptor Downsampling(Action configure) { DownsamplingValue = null; DownsamplingDescriptor = null; @@ -101,7 +101,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DownsamplingDescriptorAction is not null) { writer.WritePropertyName("downsampling"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); } else if (DownsamplingValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs index 237fcb01a1d..a8f7ae5585c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs @@ -45,9 +45,9 @@ public DataStreamLifecycleDownsamplingDescriptor() : base() } private ICollection RoundsValue { get; set; } - private DownsamplingRoundDescriptor RoundsDescriptor { get; set; } - private Action RoundsDescriptorAction { get; set; } - private Action[] RoundsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor RoundsDescriptor { get; set; } + private Action RoundsDescriptorAction { get; set; } + private Action[] RoundsDescriptorActions { get; set; } /// /// The list of downsampling rounds to execute as part of this downsampling configuration @@ -61,7 +61,7 @@ public DataStreamLifecycleDownsamplingDescriptor Rounds(ICollection configure) + public DataStreamLifecycleDownsamplingDescriptor Rounds(Action configure) { RoundsValue = null; RoundsDescriptor = null; @@ -79,7 +79,7 @@ public DataStreamLifecycleDownsamplingDescriptor Rounds(Action[] configure) + public DataStreamLifecycleDownsamplingDescriptor Rounds(params Action[] configure) { RoundsValue = null; RoundsDescriptor = null; @@ -102,7 +102,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("rounds"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new DownsamplingRoundDescriptor(RoundsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor(RoundsDescriptorAction), options); writer.WriteEndArray(); } else if (RoundsDescriptorActions is not null) @@ -111,7 +111,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in RoundsDescriptorActions) { - JsonSerializer.Serialize(writer, new DownsamplingRoundDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs index 41fef444c36..8b858e71b2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs @@ -30,23 +30,169 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class DataStreamLifecycleRolloverConditions { [JsonInclude, JsonPropertyName("max_age")] - public string? MaxAge { get; init; } + public string? MaxAge { get; set; } [JsonInclude, JsonPropertyName("max_docs")] - public long? MaxDocs { get; init; } + public long? MaxDocs { get; set; } [JsonInclude, JsonPropertyName("max_primary_shard_docs")] - public long? MaxPrimaryShardDocs { get; init; } + public long? MaxPrimaryShardDocs { get; set; } [JsonInclude, JsonPropertyName("max_primary_shard_size")] - public Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSize { get; init; } + public Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSize { get; set; } [JsonInclude, JsonPropertyName("max_size")] - public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; init; } + public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; } [JsonInclude, JsonPropertyName("min_age")] - public Elastic.Clients.Elasticsearch.Duration? MinAge { get; init; } + public Elastic.Clients.Elasticsearch.Duration? MinAge { get; set; } [JsonInclude, JsonPropertyName("min_docs")] - public long? MinDocs { get; init; } + public long? MinDocs { get; set; } [JsonInclude, JsonPropertyName("min_primary_shard_docs")] - public long? MinPrimaryShardDocs { get; init; } + public long? MinPrimaryShardDocs { get; set; } [JsonInclude, JsonPropertyName("min_primary_shard_size")] - public Elastic.Clients.Elasticsearch.ByteSize? MinPrimaryShardSize { get; init; } + public Elastic.Clients.Elasticsearch.ByteSize? MinPrimaryShardSize { get; set; } [JsonInclude, JsonPropertyName("min_size")] - public Elastic.Clients.Elasticsearch.ByteSize? MinSize { get; init; } + public Elastic.Clients.Elasticsearch.ByteSize? MinSize { get; set; } +} + +public sealed partial class DataStreamLifecycleRolloverConditionsDescriptor : SerializableDescriptor +{ + internal DataStreamLifecycleRolloverConditionsDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamLifecycleRolloverConditionsDescriptor() : base() + { + } + + private string? MaxAgeValue { get; set; } + private long? MaxDocsValue { get; set; } + private long? MaxPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MinAgeValue { get; set; } + private long? MinDocsValue { get; set; } + private long? MinPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MinPrimaryShardSizeValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MinSizeValue { get; set; } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxAge(string? maxAge) + { + MaxAgeValue = maxAge; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxDocs(long? maxDocs) + { + MaxDocsValue = maxDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardDocs(long? maxPrimaryShardDocs) + { + MaxPrimaryShardDocsValue = maxPrimaryShardDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elasticsearch.ByteSize? maxPrimaryShardSize) + { + MaxPrimaryShardSizeValue = maxPrimaryShardSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? maxSize) + { + MaxSizeValue = maxSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinAge(Elastic.Clients.Elasticsearch.Duration? minAge) + { + MinAgeValue = minAge; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinDocs(long? minDocs) + { + MinDocsValue = minDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardDocs(long? minPrimaryShardDocs) + { + MinPrimaryShardDocsValue = minPrimaryShardDocs; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardSize(Elastic.Clients.Elasticsearch.ByteSize? minPrimaryShardSize) + { + MinPrimaryShardSizeValue = minPrimaryShardSize; + return Self; + } + + public DataStreamLifecycleRolloverConditionsDescriptor MinSize(Elastic.Clients.Elasticsearch.ByteSize? minSize) + { + MinSizeValue = minSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(MaxAgeValue)) + { + writer.WritePropertyName("max_age"); + writer.WriteStringValue(MaxAgeValue); + } + + 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 (MaxSizeValue is not null) + { + writer.WritePropertyName("max_size"); + JsonSerializer.Serialize(writer, MaxSizeValue, options); + } + + 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 (MinSizeValue is not null) + { + writer.WritePropertyName("min_size"); + JsonSerializer.Serialize(writer, MinSizeValue, options); + } + + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs index c1ad26bb94e..6abf40f7723 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs @@ -36,17 +36,144 @@ public sealed partial class DataStreamLifecycleWithRollover /// 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.Duration? DataRetention { get; init; } + public Elastic.Clients.Elasticsearch.Duration? DataRetention { get; set; } /// /// The downsampling configuration to execute for the managed backing index after rollover. /// [JsonInclude, JsonPropertyName("downsampling")] - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? Downsampling { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? Downsampling { get; set; } /// /// 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.IndexManagement.DataStreamLifecycleRolloverConditions? Rollover { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? Rollover { get; set; } +} + +/// +/// Data lifecycle with rollover can be used to display the configuration including the default rollover conditions,
if asked.
+///
+public sealed partial class DataStreamLifecycleWithRolloverDescriptor : SerializableDescriptor +{ + internal DataStreamLifecycleWithRolloverDescriptor(Action configure) => configure.Invoke(this); + + public DataStreamLifecycleWithRolloverDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? DataRetentionValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? DownsamplingValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor DownsamplingDescriptor { get; set; } + private Action DownsamplingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? RolloverValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor RolloverDescriptor { get; set; } + private Action RolloverDescriptorAction { 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 DataStreamLifecycleWithRolloverDescriptor DataRetention(Elastic.Clients.Elasticsearch.Duration? dataRetention) + { + DataRetentionValue = dataRetention; + return Self; + } + + /// + /// The downsampling configuration to execute for the managed backing index after rollover. + /// + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling? downsampling) + { + DownsamplingDescriptor = null; + DownsamplingDescriptorAction = null; + DownsamplingValue = downsampling; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor descriptor) + { + DownsamplingValue = null; + DownsamplingDescriptorAction = null; + DownsamplingDescriptor = descriptor; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Downsampling(Action configure) + { + DownsamplingValue = null; + DownsamplingDescriptor = null; + DownsamplingDescriptorAction = configure; + return Self; + } + + /// + /// 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.
+ ///
+ public DataStreamLifecycleWithRolloverDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? rollover) + { + RolloverDescriptor = null; + RolloverDescriptorAction = null; + RolloverValue = rollover; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor descriptor) + { + RolloverValue = null; + RolloverDescriptorAction = null; + RolloverDescriptor = descriptor; + return Self; + } + + public DataStreamLifecycleWithRolloverDescriptor Rollover(Action configure) + { + RolloverValue = null; + RolloverDescriptor = null; + RolloverDescriptorAction = configure; + 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); + } + + if (DownsamplingDescriptor is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, DownsamplingDescriptor, options); + } + else if (DownsamplingDescriptorAction is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingDescriptor(DownsamplingDescriptorAction), options); + } + else if (DownsamplingValue is not null) + { + writer.WritePropertyName("downsampling"); + JsonSerializer.Serialize(writer, DownsamplingValue, options); + } + + if (RolloverDescriptor is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverDescriptor, options); + } + else if (RolloverDescriptorAction is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor(RolloverDescriptorAction), options); + } + else if (RolloverValue is not null) + { + writer.WritePropertyName("rollover"); + JsonSerializer.Serialize(writer, RolloverValue, options); + } + + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs new file mode 100644 index 00000000000..26e30d448d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class DataStreamsStatsItem +{ + /// + /// Current number of backing indices for the data stream. + /// + [JsonInclude, JsonPropertyName("backing_indices")] + public int BackingIndices { get; init; } + + /// + /// Name of the data stream. + /// + [JsonInclude, JsonPropertyName("data_stream")] + public string DataStream { get; init; } + + /// + /// The data stream’s highest `@timestamp` value, converted to milliseconds since the Unix epoch.
NOTE: This timestamp is provided as a best effort.
The data stream may contain `@timestamp` values higher than this if one or more of the following conditions are met:
The stream contains closed backing indices;
Backing indices with a lower generation contain higher `@timestamp` values.
+ ///
+ [JsonInclude, JsonPropertyName("maximum_timestamp")] + public long MaximumTimestamp { get; init; } + + /// + /// Total size of all shards for the data stream’s backing indices.
This parameter is only returned if the `human` query parameter is `true`.
+ ///
+ [JsonInclude, JsonPropertyName("store_size")] + public Elastic.Clients.Elasticsearch.ByteSize? StoreSize { get; init; } + + /// + /// Total size, in bytes, of all shards for the data stream’s backing indices. + /// + [JsonInclude, JsonPropertyName("store_size_bytes")] + public long StoreSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs index d20d3b3f663..3e5c4e518f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs @@ -59,7 +59,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("fixed_interval"); - JsonSerializer.Serialize(writer, FixedIntervalValue, options); + writer.WriteStringValue(FixedIntervalValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs index 2f429938aca..6d4164323bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs @@ -52,8 +52,8 @@ public DownsamplingRoundDescriptor() : base() private Elastic.Clients.Elasticsearch.Duration AfterValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig ConfigValue { get; set; } - private DownsampleConfigDescriptor ConfigDescriptor { get; set; } - private Action ConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor ConfigDescriptor { get; set; } + private Action ConfigDescriptorAction { get; set; } /// /// The duration since rollover when this downsampling round should execute @@ -75,7 +75,7 @@ public DownsamplingRoundDescriptor Config(Elastic.Clients.Elasticsearch.IndexMan return Self; } - public DownsamplingRoundDescriptor Config(DownsampleConfigDescriptor descriptor) + public DownsamplingRoundDescriptor Config(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor descriptor) { ConfigValue = null; ConfigDescriptorAction = null; @@ -83,7 +83,7 @@ public DownsamplingRoundDescriptor Config(DownsampleConfigDescriptor descriptor) return Self; } - public DownsamplingRoundDescriptor Config(Action configure) + public DownsamplingRoundDescriptor Config(Action configure) { ConfigValue = null; ConfigDescriptor = null; @@ -104,7 +104,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ConfigDescriptorAction is not null) { writer.WritePropertyName("config"); - JsonSerializer.Serialize(writer, new DownsampleConfigDescriptor(ConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigDescriptor(ConfigDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs new file mode 100644 index 00000000000..b3c5e49d986 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +internal sealed partial class ExplainAnalyzeTokenConverter : JsonConverter +{ + public override ExplainAnalyzeToken Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + string bytes = default; + long endOffset = default; + bool? keyword = default; + long position = default; + long positionlength = default; + long startOffset = default; + long termfrequency = default; + string token = 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 == "bytes") + { + bytes = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "end_offset") + { + endOffset = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "keyword") + { + keyword = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "position") + { + position = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "positionLength") + { + positionlength = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "start_offset") + { + startOffset = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "termFrequency") + { + termfrequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "token") + { + token = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "type") + { + type = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new ExplainAnalyzeToken { Attributes = additionalProperties, Bytes = bytes, EndOffset = endOffset, Keyword = keyword, Position = position, Positionlength = positionlength, StartOffset = startOffset, Termfrequency = termfrequency, Token = token, Type = type }; + } + + public override void Write(Utf8JsonWriter writer, ExplainAnalyzeToken value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ExplainAnalyzeToken' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ExplainAnalyzeTokenConverter))] +public sealed partial class ExplainAnalyzeToken +{ + /// + /// Additional tokenizer-specific attributes + /// + public IReadOnlyDictionary Attributes { get; init; } + public string Bytes { get; init; } + public long EndOffset { get; init; } + public bool? Keyword { get; init; } + public long Position { get; init; } + public long Positionlength { get; init; } + public long StartOffset { get; init; } + public long Termfrequency { get; init; } + public string Token { get; init; } + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs index d535d05f2a0..6b7d1eaacf4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs @@ -37,7 +37,7 @@ public sealed partial class FielddataFrequencyFilter public int MinSegmentSize { get; set; } } -public sealed partial class FielddataFrequencyFilterDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class FielddataFrequencyFilterDescriptor : SerializableDescriptor { internal FielddataFrequencyFilterDescriptor(Action configure) => configure.Invoke(this); @@ -78,11 +78,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/IndexManagement/FileDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs new file mode 100644 index 00000000000..c6041e3f6fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class FileDetails +{ + [JsonInclude, JsonPropertyName("length")] + public long Length { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs new file mode 100644 index 00000000000..a71afabe4d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndexAndDataStreamAction +{ + /// + /// Data stream targeted by the action. + /// + [JsonInclude, JsonPropertyName("data_stream")] + public Elastic.Clients.Elasticsearch.DataStreamName DataStream { get; set; } + + /// + /// Index for the action. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName Index { get; set; } +} + +public sealed partial class IndexAndDataStreamActionDescriptor : SerializableDescriptor +{ + internal IndexAndDataStreamActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexAndDataStreamActionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.DataStreamName DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + + /// + /// Data stream targeted by the action. + /// + public IndexAndDataStreamActionDescriptor DataStream(Elastic.Clients.Elasticsearch.DataStreamName dataStream) + { + DataStreamValue = dataStream; + return Self; + } + + /// + /// Index for the action. + /// + public IndexAndDataStreamActionDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs new file mode 100644 index 00000000000..0ed71058805 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.IndexManagement; + +[JsonConverter(typeof(IndexModifyDataStreamActionConverter))] +public sealed partial class IndexModifyDataStreamAction +{ + internal IndexModifyDataStreamAction(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 IndexModifyDataStreamAction AddBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => new IndexModifyDataStreamAction("add_backing_index", indexAndDataStreamAction); + public static IndexModifyDataStreamAction RemoveBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => new IndexModifyDataStreamAction("remove_backing_index", indexAndDataStreamAction); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class IndexModifyDataStreamActionConverter : JsonConverter +{ + public override IndexModifyDataStreamAction 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; + 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 == "add_backing_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove_backing_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IndexModifyDataStreamAction' from the response."); + } + + reader.Read(); + var result = new IndexModifyDataStreamAction(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, IndexModifyDataStreamAction 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_backing_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, options); + break; + case "remove_backing_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexModifyDataStreamActionDescriptor : SerializableDescriptor> +{ + internal IndexModifyDataStreamActionDescriptor(Action> configure) => configure.Invoke(this); + + public IndexModifyDataStreamActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexModifyDataStreamActionDescriptor 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 IndexModifyDataStreamActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Action configure) => Set(configure, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "remove_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Action configure) => Set(configure, "remove_backing_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 IndexModifyDataStreamActionDescriptor : SerializableDescriptor +{ + internal IndexModifyDataStreamActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexModifyDataStreamActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexModifyDataStreamActionDescriptor 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 IndexModifyDataStreamActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor AddBackingIndex(Action configure) => Set(configure, "add_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction indexAndDataStreamAction) => Set(indexAndDataStreamAction, "remove_backing_index"); + public IndexModifyDataStreamActionDescriptor RemoveBackingIndex(Action configure) => Set(configure, "remove_backing_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/IndexManagement/IndexRouting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs index 12b9b3185ad..6066c294f5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs @@ -44,11 +44,11 @@ public IndexRoutingDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation? AllocationValue { get; set; } - private IndexRoutingAllocationDescriptor AllocationDescriptor { get; set; } - private Action AllocationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDescriptor AllocationDescriptor { get; set; } + private Action AllocationDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance? RebalanceValue { get; set; } - private IndexRoutingRebalanceDescriptor RebalanceDescriptor { get; set; } - private Action RebalanceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceDescriptor RebalanceDescriptor { get; set; } + private Action RebalanceDescriptorAction { get; set; } public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation? allocation) { @@ -58,7 +58,7 @@ public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.IndexMana return Self; } - public IndexRoutingDescriptor Allocation(IndexRoutingAllocationDescriptor descriptor) + public IndexRoutingDescriptor Allocation(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDescriptor descriptor) { AllocationValue = null; AllocationDescriptorAction = null; @@ -66,7 +66,7 @@ public IndexRoutingDescriptor Allocation(IndexRoutingAllocationDescriptor descri return Self; } - public IndexRoutingDescriptor Allocation(Action configure) + public IndexRoutingDescriptor Allocation(Action configure) { AllocationValue = null; AllocationDescriptor = null; @@ -82,7 +82,7 @@ public IndexRoutingDescriptor Rebalance(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public IndexRoutingDescriptor Rebalance(IndexRoutingRebalanceDescriptor descriptor) + public IndexRoutingDescriptor Rebalance(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceDescriptor descriptor) { RebalanceValue = null; RebalanceDescriptorAction = null; @@ -90,7 +90,7 @@ public IndexRoutingDescriptor Rebalance(IndexRoutingRebalanceDescriptor descript return Self; } - public IndexRoutingDescriptor Rebalance(Action configure) + public IndexRoutingDescriptor Rebalance(Action configure) { RebalanceValue = null; RebalanceDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllocationDescriptorAction is not null) { writer.WritePropertyName("allocation"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationDescriptor(AllocationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDescriptor(AllocationDescriptorAction), options); } else if (AllocationValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RebalanceDescriptorAction is not null) { writer.WritePropertyName("rebalance"); - JsonSerializer.Serialize(writer, new IndexRoutingRebalanceDescriptor(RebalanceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceDescriptor(RebalanceDescriptorAction), options); } else if (RebalanceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs index 8632087a75e..c94c53f3909 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs @@ -48,15 +48,15 @@ public IndexRoutingAllocationDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk? DiskValue { get; set; } - private IndexRoutingAllocationDiskDescriptor DiskDescriptor { get; set; } - private Action DiskDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDiskDescriptor DiskDescriptor { get; set; } + private Action DiskDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions? EnableValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude? IncludeValue { get; set; } - private IndexRoutingAllocationIncludeDescriptor IncludeDescriptor { get; set; } - private Action IncludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationIncludeDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery? InitialRecoveryValue { get; set; } - private IndexRoutingAllocationInitialRecoveryDescriptor InitialRecoveryDescriptor { get; set; } - private Action InitialRecoveryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor InitialRecoveryDescriptor { get; set; } + private Action InitialRecoveryDescriptorAction { get; set; } public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk? disk) { @@ -66,7 +66,7 @@ public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.Index return Self; } - public IndexRoutingAllocationDescriptor Disk(IndexRoutingAllocationDiskDescriptor descriptor) + public IndexRoutingAllocationDescriptor Disk(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDiskDescriptor descriptor) { DiskValue = null; DiskDescriptorAction = null; @@ -74,7 +74,7 @@ public IndexRoutingAllocationDescriptor Disk(IndexRoutingAllocationDiskDescripto return Self; } - public IndexRoutingAllocationDescriptor Disk(Action configure) + public IndexRoutingAllocationDescriptor Disk(Action configure) { DiskValue = null; DiskDescriptor = null; @@ -96,7 +96,7 @@ public IndexRoutingAllocationDescriptor Include(Elastic.Clients.Elasticsearch.In return Self; } - public IndexRoutingAllocationDescriptor Include(IndexRoutingAllocationIncludeDescriptor descriptor) + public IndexRoutingAllocationDescriptor Include(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationIncludeDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -104,7 +104,7 @@ public IndexRoutingAllocationDescriptor Include(IndexRoutingAllocationIncludeDes return Self; } - public IndexRoutingAllocationDescriptor Include(Action configure) + public IndexRoutingAllocationDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -120,7 +120,7 @@ public IndexRoutingAllocationDescriptor InitialRecovery(Elastic.Clients.Elastics return Self; } - public IndexRoutingAllocationDescriptor InitialRecovery(IndexRoutingAllocationInitialRecoveryDescriptor descriptor) + public IndexRoutingAllocationDescriptor InitialRecovery(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor descriptor) { InitialRecoveryValue = null; InitialRecoveryDescriptorAction = null; @@ -128,7 +128,7 @@ public IndexRoutingAllocationDescriptor InitialRecovery(IndexRoutingAllocationIn return Self; } - public IndexRoutingAllocationDescriptor InitialRecovery(Action configure) + public IndexRoutingAllocationDescriptor InitialRecovery(Action configure) { InitialRecoveryValue = null; InitialRecoveryDescriptor = null; @@ -147,7 +147,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DiskDescriptorAction is not null) { writer.WritePropertyName("disk"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationDiskDescriptor(DiskDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDiskDescriptor(DiskDescriptorAction), options); } else if (DiskValue is not null) { @@ -169,7 +169,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationIncludeDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationIncludeDescriptor(IncludeDescriptorAction), options); } else if (IncludeValue is not null) { @@ -185,7 +185,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InitialRecoveryDescriptorAction is not null) { writer.WritePropertyName("initial_recovery"); - JsonSerializer.Serialize(writer, new IndexRoutingAllocationInitialRecoveryDescriptor(InitialRecoveryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecoveryDescriptor(InitialRecoveryDescriptorAction), options); } else if (InitialRecoveryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs index b82d8e8c416..365324aa133 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class IndexRoutingAllocationDisk { [JsonInclude, JsonPropertyName("threshold_enabled")] - public Union? ThresholdEnabled { get; set; } + public object? ThresholdEnabled { get; set; } } public sealed partial class IndexRoutingAllocationDiskDescriptor : SerializableDescriptor @@ -41,9 +41,9 @@ public IndexRoutingAllocationDiskDescriptor() : base() { } - private Union? ThresholdEnabledValue { get; set; } + private object? ThresholdEnabledValue { get; set; } - public IndexRoutingAllocationDiskDescriptor ThresholdEnabled(Union? thresholdEnabled) + public IndexRoutingAllocationDiskDescriptor ThresholdEnabled(object? thresholdEnabled) { ThresholdEnabledValue = thresholdEnabled; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs new file mode 100644 index 00000000000..179034d33c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndexSegment +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary>> Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs index eef7e58ba53..bd8c575e677 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs @@ -30,19 +30,14 @@ namespace Elastic.Clients.Elasticsearch.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; } } @@ -93,34 +88,34 @@ public IndexSettingBlocksDescriptor Write(bool? write = true) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MetadataValue is not null) + if (MetadataValue.HasValue) { writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, MetadataValue, options); + writer.WriteBooleanValue(MetadataValue.Value); } - if (ReadValue is not null) + if (ReadValue.HasValue) { writer.WritePropertyName("read"); - JsonSerializer.Serialize(writer, ReadValue, options); + writer.WriteBooleanValue(ReadValue.Value); } - if (ReadOnlyValue is not null) + if (ReadOnlyValue.HasValue) { writer.WritePropertyName("read_only"); - JsonSerializer.Serialize(writer, ReadOnlyValue, options); + writer.WriteBooleanValue(ReadOnlyValue.Value); } - if (ReadOnlyAllowDeleteValue is not null) + if (ReadOnlyAllowDeleteValue.HasValue) { writer.WritePropertyName("read_only_allow_delete"); - JsonSerializer.Serialize(writer, ReadOnlyAllowDeleteValue, options); + writer.WriteBooleanValue(ReadOnlyAllowDeleteValue.Value); } - if (WriteValue is not null) + if (WriteValue.HasValue) { writer.WritePropertyName("write"); - JsonSerializer.Serialize(writer, WriteValue, options); + writer.WriteBooleanValue(WriteValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs index 4dd2d92cf68..9571bb04a77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs @@ -78,7 +78,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "creation_date") { - variant.CreationDate = StringifiedLongConverter.ReadStringifiedLong(ref reader); + variant.CreationDate = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -102,7 +102,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "format") { - variant.Format = JsonSerializer.Deserialize?>(ref reader, options); + variant.Format = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -114,7 +114,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "hidden") { - variant.Hidden = JsonSerializer.Deserialize?>(ref reader, options); + variant.Hidden = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -240,7 +240,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "number_of_replicas") { - variant.NumberOfReplicas = JsonSerializer.Deserialize?>(ref reader, options); + variant.NumberOfReplicas = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -252,13 +252,13 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "number_of_shards") { - variant.NumberOfShards = JsonSerializer.Deserialize?>(ref reader, options); + variant.NumberOfShards = JsonSerializer.Deserialize(ref reader, options); continue; } if (property == "priority") { - variant.Priority = JsonSerializer.Deserialize?>(ref reader, options); + variant.Priority = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -294,7 +294,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "routing_partition_size") { - variant.RoutingPartitionSize = StringifiedIntegerConverter.ReadStringifiedInteger(ref reader); + variant.RoutingPartitionSize = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -318,7 +318,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "similarity") { - variant.Similarity = JsonSerializer.Deserialize(ref reader, options); + variant.Similarity = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -366,7 +366,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "verified_before_close") { - variant.VerifiedBeforeClose = JsonSerializer.Deserialize?>(ref reader, options); + variant.VerifiedBeforeClose = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -377,8 +377,8 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } @@ -389,7 +389,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.OtherSettings != null) + if (value.OtherSettings is not null) { foreach (var additionalProperty in value.OtherSettings) { @@ -434,10 +434,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria writer.WriteStringValue(value.Codec); } - if (value.CreationDate is not null) + if (value.CreationDate.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, value.CreationDate, options); + writer.WriteNumberValue(value.CreationDate.Value); } if (value.CreationDateString is not null) @@ -446,16 +446,16 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.CreationDateString, options); } - if (value.DefaultPipeline is not null) + if (!string.IsNullOrEmpty(value.DefaultPipeline)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, value.DefaultPipeline, options); + writer.WriteStringValue(value.DefaultPipeline); } - if (value.FinalPipeline is not null) + if (!string.IsNullOrEmpty(value.FinalPipeline)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, value.FinalPipeline, options); + writer.WriteStringValue(value.FinalPipeline); } if (value.Format is not null) @@ -650,10 +650,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.Routing, options); } - if (value.RoutingPartitionSize is not null) + if (value.RoutingPartitionSize.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, value.RoutingPartitionSize, options); + writer.WriteNumberValue(value.RoutingPartitionSize.Value); } if (value.RoutingPath is not null) @@ -716,10 +716,10 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria JsonSerializer.Serialize(writer, value.Translog, options); } - if (value.Uuid is not null) + if (!string.IsNullOrEmpty(value.Uuid)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, value.Uuid, options); + writer.WriteStringValue(value.Uuid); } if (value.VerifiedBeforeClose is not null) @@ -738,6 +738,9 @@ public override void Write(Utf8JsonWriter writer, IndexSettings value, JsonSeria } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(IndexSettingsConverter))] public sealed partial class IndexSettings { @@ -751,14 +754,13 @@ public sealed partial class IndexSettings public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks? Blocks { get; set; } public Elastic.Clients.Elasticsearch.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 object? Format { get; set; } public Elastic.Clients.Elasticsearch.Duration? GcDeletes { get; set; } - public Union? Hidden { get; set; } + public object? Hidden { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight? Highlight { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? Index { get; set; } @@ -787,17 +789,20 @@ public sealed partial class IndexSettings public int? MaxTermsCount { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.Merge? Merge { get; set; } public string? Mode { get; set; } - public Union? NumberOfReplicas { get; set; } + public object? NumberOfReplicas { get; set; } public int? NumberOfRoutingShards { get; set; } - public Union? NumberOfShards { get; set; } + public object? NumberOfShards { get; set; } + + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IDictionary OtherSettings { get; set; } - public Union? Priority { get; set; } + public object? Priority { get; set; } public Elastic.Clients.Elasticsearch.Name? ProvidedName { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.Queries? Queries { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString? QueryString { get; set; } public Elastic.Clients.Elasticsearch.Duration? RefreshInterval { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting? Routing { get; set; } - [JsonConverter(typeof(StringifiedIntegerConverter))] public int? RoutingPartitionSize { get; set; } public ICollection? RoutingPath { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch? Search { get; set; } @@ -806,7 +811,7 @@ public sealed partial class IndexSettings /// /// Configure custom similarity settings to customize how search results are scored. /// - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarity? Similarity { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities? Similarity { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes? SoftDeletes { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort? Sort { get; set; } @@ -818,10 +823,13 @@ public sealed partial class IndexSettings public int? TopMetricsMaxSize { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.Translog? Translog { get; set; } public string? Uuid { get; set; } - public Union? VerifiedBeforeClose { get; set; } + public object? VerifiedBeforeClose { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning? Version { get; set; } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class IndexSettingsDescriptor : SerializableDescriptor> { internal IndexSettingsDescriptor(Action> configure) => configure.Invoke(this); @@ -831,43 +839,43 @@ public IndexSettingsDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis? AnalysisValue { get; set; } - private IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } - private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze? AnalyzeValue { get; set; } - private SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } - private Action AnalyzeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } + private Action AnalyzeDescriptorAction { get; set; } private string? AutoExpandReplicasValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks? BlocksValue { get; set; } - private IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } - private Action BlocksDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } + private Action BlocksDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.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 object? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? GcDeletesValue { get; set; } - private Union? HiddenValue { get; set; } + private object? HiddenValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight? HighlightValue { get; set; } - private SettingsHighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? IndexValue { get; set; } - private IndexSettingsDescriptor IndexDescriptor { get; set; } - private Action> IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action> IndexDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } - private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } - private Action IndexingPressureDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } + private Action IndexingPressureDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } - private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } - private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } - private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private bool? LoadFixedBitsetFiltersEagerlyValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings? MappingValue { get; set; } - private MappingLimitSettingsDescriptor MappingDescriptor { get; set; } - private Action MappingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } private int? MaxDocvalueFieldsSearchValue { get; set; } private int? MaxInnerResultWindowValue { get; set; } private int? MaxNgramDiffValue { get; set; } @@ -880,57 +888,55 @@ public IndexSettingsDescriptor() : base() private int? MaxSlicesPerScrollValue { get; set; } private int? MaxTermsCountValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Merge? MergeValue { get; set; } - private MergeDescriptor MergeDescriptor { get; set; } - private Action MergeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } private string? ModeValue { get; set; } - private Union? NumberOfReplicasValue { get; set; } + private object? NumberOfReplicasValue { get; set; } private int? NumberOfRoutingShardsValue { get; set; } - private Union? NumberOfShardsValue { get; set; } + private object? NumberOfShardsValue { get; set; } private IDictionary OtherSettingsValue { get; set; } - private Union? PriorityValue { get; set; } + private object? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Name? ProvidedNameValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Queries? QueriesValue { get; set; } - private QueriesDescriptor QueriesDescriptor { get; set; } - private Action QueriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString? QueryStringValue { get; set; } - private SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } - private Action QueryStringDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } + private Action QueryStringDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Duration? RefreshIntervalValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting? RoutingValue { get; set; } - private IndexRoutingDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } private int? RoutingPartitionSizeValue { get; set; } private ICollection? RoutingPathValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch? SearchValue { get; set; } - private SettingsSearchDescriptor SearchDescriptor { get; set; } - private Action SearchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action> SettingsDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarity? SimilarityValue { get; set; } - private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } - private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities? SimilarityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes? SoftDeletesValue { get; set; } - private SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } - private Action SoftDeletesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort? SortValue { get; set; } - private IndexSegmentSortDescriptor SortDescriptor { get; set; } - private Action> SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action> SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Storage? StoreValue { get; set; } - private StorageDescriptor StoreDescriptor { get; set; } - private Action StoreDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor StoreDescriptor { get; set; } + private Action StoreDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries? TimeSeriesValue { get; set; } - private IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } - private Action TimeSeriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } + private Action TimeSeriesDescriptorAction { get; set; } private int? TopMetricsMaxSizeValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Translog? TranslogValue { get; set; } - private TranslogDescriptor TranslogDescriptor { get; set; } - private Action TranslogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } private string? UuidValue { get; set; } - private Union? VerifiedBeforeCloseValue { get; set; } + private object? VerifiedBeforeCloseValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning? VersionValue { get; set; } - private IndexVersioningDescriptor VersionDescriptor { get; set; } - private Action VersionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis? analysis) { @@ -940,7 +946,7 @@ public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor descriptor) { AnalysisValue = null; AnalysisDescriptorAction = null; @@ -948,7 +954,7 @@ public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescript return Self; } - public IndexSettingsDescriptor Analysis(Action configure) + public IndexSettingsDescriptor Analysis(Action configure) { AnalysisValue = null; AnalysisDescriptor = null; @@ -967,7 +973,7 @@ public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor descriptor) { AnalyzeValue = null; AnalyzeDescriptorAction = null; @@ -975,7 +981,7 @@ public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor desc return Self; } - public IndexSettingsDescriptor Analyze(Action configure) + public IndexSettingsDescriptor Analyze(Action configure) { AnalyzeValue = null; AnalyzeDescriptor = null; @@ -997,7 +1003,7 @@ public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.I return Self; } - public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor descriptor) { BlocksValue = null; BlocksDescriptorAction = null; @@ -1005,7 +1011,7 @@ public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor de return Self; } - public IndexSettingsDescriptor Blocks(Action configure) + public IndexSettingsDescriptor Blocks(Action configure) { BlocksValue = null; BlocksDescriptor = null; @@ -1049,7 +1055,7 @@ public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) return Self; } - public IndexSettingsDescriptor Format(Union? format) + public IndexSettingsDescriptor Format(object? format) { FormatValue = format; return Self; @@ -1061,7 +1067,7 @@ public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Hidden(Union? hidden) + public IndexSettingsDescriptor Hidden(object? hidden) { HiddenValue = hidden; return Self; @@ -1075,7 +1081,7 @@ public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -1083,7 +1089,7 @@ public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor return Self; } - public IndexSettingsDescriptor Highlight(Action configure) + public IndexSettingsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -1099,7 +1105,7 @@ public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.In return Self; } - public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -1107,7 +1113,7 @@ public IndexSettingsDescriptor Index(IndexSettingsDescriptor Index(Action> configure) + public IndexSettingsDescriptor Index(Action> configure) { IndexValue = null; IndexDescriptor = null; @@ -1126,7 +1132,7 @@ public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elast return Self; } - public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor descriptor) { IndexingPressureValue = null; IndexingPressureDescriptorAction = null; @@ -1134,7 +1140,7 @@ public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescr return Self; } - public IndexSettingsDescriptor IndexingPressure(Action configure) + public IndexSettingsDescriptor IndexingPressure(Action configure) { IndexingPressureValue = null; IndexingPressureDescriptor = null; @@ -1150,7 +1156,7 @@ public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasti return Self; } - public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor descriptor) { IndexingSlowlogValue = null; IndexingSlowlogDescriptorAction = null; @@ -1158,7 +1164,7 @@ public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSetting return Self; } - public IndexSettingsDescriptor IndexingSlowlog(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -1174,7 +1180,7 @@ public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -1182,7 +1188,7 @@ public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescri return Self; } - public IndexSettingsDescriptor Lifecycle(Action configure) + public IndexSettingsDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -1207,7 +1213,7 @@ public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor descriptor) { MappingValue = null; MappingDescriptorAction = null; @@ -1215,7 +1221,7 @@ public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor return Self; } - public IndexSettingsDescriptor Mapping(Action configure) + public IndexSettingsDescriptor Mapping(Action configure) { MappingValue = null; MappingDescriptor = null; @@ -1297,7 +1303,7 @@ public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.In return Self; } - public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor descriptor) { MergeValue = null; MergeDescriptorAction = null; @@ -1305,7 +1311,7 @@ public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Merge(Action configure) + public IndexSettingsDescriptor Merge(Action configure) { MergeValue = null; MergeDescriptor = null; @@ -1319,7 +1325,7 @@ public IndexSettingsDescriptor Mode(string? mode) return Self; } - public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + public IndexSettingsDescriptor NumberOfReplicas(object? numberOfReplicas) { NumberOfReplicasValue = numberOfReplicas; return Self; @@ -1331,19 +1337,22 @@ public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRou return Self; } - public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + public IndexSettingsDescriptor NumberOfShards(object? numberOfShards) { NumberOfShardsValue = numberOfShards; return Self; } + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) { OtherSettingsValue = selector?.Invoke(new FluentDictionary()); return Self; } - public IndexSettingsDescriptor Priority(Union? priority) + public IndexSettingsDescriptor Priority(object? priority) { PriorityValue = priority; return Self; @@ -1363,7 +1372,7 @@ public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -1371,7 +1380,7 @@ public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Queries(Action configure) + public IndexSettingsDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -1387,7 +1396,7 @@ public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsea return Self; } - public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor descriptor) { QueryStringValue = null; QueryStringDescriptorAction = null; @@ -1395,7 +1404,7 @@ public IndexSettingsDescriptor QueryString(SettingsQueryStringDescrip return Self; } - public IndexSettingsDescriptor QueryString(Action configure) + public IndexSettingsDescriptor QueryString(Action configure) { QueryStringValue = null; QueryStringDescriptor = null; @@ -1417,7 +1426,7 @@ public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -1425,7 +1434,7 @@ public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descrip return Self; } - public IndexSettingsDescriptor Routing(Action configure) + public IndexSettingsDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -1453,7 +1462,7 @@ public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.I return Self; } - public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor descriptor) { SearchValue = null; SearchDescriptorAction = null; @@ -1461,7 +1470,7 @@ public IndexSettingsDescriptor Search(SettingsSearchDescriptor descri return Self; } - public IndexSettingsDescriptor Search(Action configure) + public IndexSettingsDescriptor Search(Action configure) { SearchValue = null; SearchDescriptor = null; @@ -1477,7 +1486,7 @@ public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -1485,7 +1494,7 @@ public IndexSettingsDescriptor Settings(IndexSettingsDescriptor Settings(Action> configure) + public IndexSettingsDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -1496,27 +1505,23 @@ public IndexSettingsDescriptor Settings(Action /// Configure custom similarity settings to customize how search results are scored. /// - public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarity? similarity) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities? similarity) { - SimilarityDescriptor = null; - SimilarityDescriptorAction = null; SimilarityValue = similarity; return Self; } - public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilaritiesDescriptor descriptor) { - SimilarityValue = null; - SimilarityDescriptorAction = null; - SimilarityDescriptor = descriptor; + SimilarityValue = descriptor.PromisedValue; return Self; } - public IndexSettingsDescriptor Similarity(Action configure) + public IndexSettingsDescriptor Similarity(Action configure) { - SimilarityValue = null; - SimilarityDescriptor = null; - SimilarityDescriptorAction = configure; + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilaritiesDescriptor(); + configure?.Invoke(descriptor); + SimilarityValue = descriptor.PromisedValue; return Self; } @@ -1528,7 +1533,7 @@ public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsea return Self; } - public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor descriptor) { SoftDeletesValue = null; SoftDeletesDescriptorAction = null; @@ -1536,7 +1541,7 @@ public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor desc return Self; } - public IndexSettingsDescriptor SoftDeletes(Action configure) + public IndexSettingsDescriptor SoftDeletes(Action configure) { SoftDeletesValue = null; SoftDeletesDescriptor = null; @@ -1552,7 +1557,7 @@ public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.Ind return Self; } - public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -1560,7 +1565,7 @@ public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor Sort(Action> configure) + public IndexSettingsDescriptor Sort(Action> configure) { SortValue = null; SortDescriptor = null; @@ -1579,7 +1584,7 @@ public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.In return Self; } - public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor descriptor) { StoreValue = null; StoreDescriptorAction = null; @@ -1587,7 +1592,7 @@ public IndexSettingsDescriptor Store(StorageDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Store(Action configure) + public IndexSettingsDescriptor Store(Action configure) { StoreValue = null; StoreDescriptor = null; @@ -1603,7 +1608,7 @@ public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsear return Self; } - public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor descriptor) { TimeSeriesValue = null; TimeSeriesDescriptorAction = null; @@ -1611,7 +1616,7 @@ public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDesc return Self; } - public IndexSettingsDescriptor TimeSeries(Action configure) + public IndexSettingsDescriptor TimeSeries(Action configure) { TimeSeriesValue = null; TimeSeriesDescriptor = null; @@ -1633,7 +1638,7 @@ public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor descriptor) { TranslogValue = null; TranslogDescriptorAction = null; @@ -1641,7 +1646,7 @@ public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor return Self; } - public IndexSettingsDescriptor Translog(Action configure) + public IndexSettingsDescriptor Translog(Action configure) { TranslogValue = null; TranslogDescriptor = null; @@ -1655,7 +1660,7 @@ public IndexSettingsDescriptor Uuid(string? uuid) return Self; } - public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + public IndexSettingsDescriptor VerifiedBeforeClose(object? verifiedBeforeClose) { VerifiedBeforeCloseValue = verifiedBeforeClose; return Self; @@ -1669,7 +1674,7 @@ public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor descriptor) { VersionValue = null; VersionDescriptorAction = null; @@ -1677,7 +1682,7 @@ public IndexSettingsDescriptor Version(IndexVersioningDescriptor desc return Self; } - public IndexSettingsDescriptor Version(Action configure) + public IndexSettingsDescriptor Version(Action configure) { VersionValue = null; VersionDescriptor = null; @@ -1696,7 +1701,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalysisDescriptorAction is not null) { writer.WritePropertyName("analysis"); - JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); } else if (AnalysisValue is not null) { @@ -1712,7 +1717,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalyzeDescriptorAction is not null) { writer.WritePropertyName("analyze"); - JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); } else if (AnalyzeValue is not null) { @@ -1734,7 +1739,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BlocksDescriptorAction is not null) { writer.WritePropertyName("blocks"); - JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); } else if (BlocksValue is not null) { @@ -1754,10 +1759,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CodecValue); } - if (CreationDateValue is not null) + if (CreationDateValue.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, CreationDateValue, options); + writer.WriteNumberValue(CreationDateValue.Value); } if (CreationDateStringValue is not null) @@ -1766,16 +1771,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, CreationDateStringValue, options); } - if (DefaultPipelineValue is not null) + if (!string.IsNullOrEmpty(DefaultPipelineValue)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + writer.WriteStringValue(DefaultPipelineValue); } - if (FinalPipelineValue is not null) + if (!string.IsNullOrEmpty(FinalPipelineValue)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, FinalPipelineValue, options); + writer.WriteStringValue(FinalPipelineValue); } if (FormatValue is not null) @@ -1804,7 +1809,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -1820,7 +1825,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { @@ -1836,7 +1841,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingPressureDescriptorAction is not null) { writer.WritePropertyName("indexing_pressure"); - JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); } else if (IndexingPressureValue is not null) { @@ -1852,7 +1857,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { @@ -1868,7 +1873,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -1890,7 +1895,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingDescriptorAction is not null) { writer.WritePropertyName("mapping"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor(MappingDescriptorAction), options); } else if (MappingValue is not null) { @@ -1972,7 +1977,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MergeDescriptorAction is not null) { writer.WritePropertyName("merge"); - JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor(MergeDescriptorAction), options); } else if (MergeValue is not null) { @@ -2024,7 +2029,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueriesDescriptorAction is not null) { writer.WritePropertyName("queries"); - JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor(QueriesDescriptorAction), options); } else if (QueriesValue is not null) { @@ -2040,7 +2045,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryStringDescriptorAction is not null) { writer.WritePropertyName("query_string"); - JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); } else if (QueryStringValue is not null) { @@ -2062,7 +2067,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("routing"); - JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -2070,10 +2075,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (RoutingPartitionSizeValue is not null) + if (RoutingPartitionSizeValue.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + writer.WriteNumberValue(RoutingPartitionSizeValue.Value); } if (RoutingPathValue is not null) @@ -2090,7 +2095,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SearchDescriptorAction is not null) { writer.WritePropertyName("search"); - JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor(SearchDescriptorAction), options); } else if (SearchValue is not null) { @@ -2106,7 +2111,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -2114,17 +2119,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - 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) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); JsonSerializer.Serialize(writer, SimilarityValue, options); @@ -2138,7 +2133,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SoftDeletesDescriptorAction is not null) { writer.WritePropertyName("soft_deletes"); - JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); } else if (SoftDeletesValue is not null) { @@ -2154,7 +2149,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor(SortDescriptorAction), options); } else if (SortValue is not null) { @@ -2170,7 +2165,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (StoreDescriptorAction is not null) { writer.WritePropertyName("store"); - JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor(StoreDescriptorAction), options); } else if (StoreValue is not null) { @@ -2186,7 +2181,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TimeSeriesDescriptorAction is not null) { writer.WritePropertyName("time_series"); - JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); } else if (TimeSeriesValue is not null) { @@ -2208,7 +2203,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TranslogDescriptorAction is not null) { writer.WritePropertyName("translog"); - JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor(TranslogDescriptorAction), options); } else if (TranslogValue is not null) { @@ -2216,10 +2211,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TranslogValue, options); } - if (UuidValue is not null) + if (!string.IsNullOrEmpty(UuidValue)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, UuidValue, options); + writer.WriteStringValue(UuidValue); } if (VerifiedBeforeCloseValue is not null) @@ -2236,7 +2231,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VersionDescriptorAction is not null) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor(VersionDescriptorAction), options); } else if (VersionValue is not null) { @@ -2244,7 +2239,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, VersionValue, options); } - if (OtherSettingsValue != null) + if (OtherSettingsValue is not null) { foreach (var additionalProperty in OtherSettingsValue) { @@ -2257,6 +2252,9 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } } +/// +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class IndexSettingsDescriptor : SerializableDescriptor { internal IndexSettingsDescriptor(Action configure) => configure.Invoke(this); @@ -2266,43 +2264,43 @@ public IndexSettingsDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis? AnalysisValue { get; set; } - private IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } - private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze? AnalyzeValue { get; set; } - private SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } - private Action AnalyzeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor AnalyzeDescriptor { get; set; } + private Action AnalyzeDescriptorAction { get; set; } private string? AutoExpandReplicasValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks? BlocksValue { get; set; } - private IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } - private Action BlocksDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor BlocksDescriptor { get; set; } + private Action BlocksDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.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 object? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Duration? GcDeletesValue { get; set; } - private Union? HiddenValue { get; set; } + private object? HiddenValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight? HighlightValue { get; set; } - private SettingsHighlightDescriptor HighlightDescriptor { get; set; } - private Action HighlightDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor HighlightDescriptor { get; set; } + private Action HighlightDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? IndexValue { get; set; } - private IndexSettingsDescriptor IndexDescriptor { get; set; } - private Action IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor IndexDescriptor { get; set; } + private Action IndexDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure? IndexingPressureValue { get; set; } - private IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } - private Action IndexingPressureDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor IndexingPressureDescriptor { get; set; } + private Action IndexingPressureDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings? IndexingSlowlogValue { get; set; } - private IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } - private Action IndexingSlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor IndexingSlowlogDescriptor { get; set; } + private Action IndexingSlowlogDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle? LifecycleValue { get; set; } - private IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private bool? LoadFixedBitsetFiltersEagerlyValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings? MappingValue { get; set; } - private MappingLimitSettingsDescriptor MappingDescriptor { get; set; } - private Action MappingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor MappingDescriptor { get; set; } + private Action MappingDescriptorAction { get; set; } private int? MaxDocvalueFieldsSearchValue { get; set; } private int? MaxInnerResultWindowValue { get; set; } private int? MaxNgramDiffValue { get; set; } @@ -2315,57 +2313,55 @@ public IndexSettingsDescriptor() : base() private int? MaxSlicesPerScrollValue { get; set; } private int? MaxTermsCountValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Merge? MergeValue { get; set; } - private MergeDescriptor MergeDescriptor { get; set; } - private Action MergeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor MergeDescriptor { get; set; } + private Action MergeDescriptorAction { get; set; } private string? ModeValue { get; set; } - private Union? NumberOfReplicasValue { get; set; } + private object? NumberOfReplicasValue { get; set; } private int? NumberOfRoutingShardsValue { get; set; } - private Union? NumberOfShardsValue { get; set; } + private object? NumberOfShardsValue { get; set; } private IDictionary OtherSettingsValue { get; set; } - private Union? PriorityValue { get; set; } + private object? PriorityValue { get; set; } private Elastic.Clients.Elasticsearch.Name? ProvidedNameValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Queries? QueriesValue { get; set; } - private QueriesDescriptor QueriesDescriptor { get; set; } - private Action QueriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString? QueryStringValue { get; set; } - private SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } - private Action QueryStringDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor QueryStringDescriptor { get; set; } + private Action QueryStringDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Duration? RefreshIntervalValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting? RoutingValue { get; set; } - private IndexRoutingDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } private int? RoutingPartitionSizeValue { get; set; } private ICollection? RoutingPathValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch? SearchValue { get; set; } - private SettingsSearchDescriptor SearchDescriptor { get; set; } - private Action SearchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor SearchDescriptor { get; set; } + private Action SearchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action SettingsDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarity? SimilarityValue { get; set; } - private SettingsSimilarityDescriptor SimilarityDescriptor { get; set; } - private Action SimilarityDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities? SimilarityValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes? SoftDeletesValue { get; set; } - private SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } - private Action SoftDeletesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor SoftDeletesDescriptor { get; set; } + private Action SoftDeletesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort? SortValue { get; set; } - private IndexSegmentSortDescriptor SortDescriptor { get; set; } - private Action SortDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor SortDescriptor { get; set; } + private Action SortDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Storage? StoreValue { get; set; } - private StorageDescriptor StoreDescriptor { get; set; } - private Action StoreDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor StoreDescriptor { get; set; } + private Action StoreDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries? TimeSeriesValue { get; set; } - private IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } - private Action TimeSeriesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor TimeSeriesDescriptor { get; set; } + private Action TimeSeriesDescriptorAction { get; set; } private int? TopMetricsMaxSizeValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.Translog? TranslogValue { get; set; } - private TranslogDescriptor TranslogDescriptor { get; set; } - private Action TranslogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor TranslogDescriptor { get; set; } + private Action TranslogDescriptorAction { get; set; } private string? UuidValue { get; set; } - private Union? VerifiedBeforeCloseValue { get; set; } + private object? VerifiedBeforeCloseValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning? VersionValue { get; set; } - private IndexVersioningDescriptor VersionDescriptor { get; set; } - private Action VersionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor VersionDescriptor { get; set; } + private Action VersionDescriptorAction { get; set; } public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis? analysis) { @@ -2375,7 +2371,7 @@ public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descriptor) + public IndexSettingsDescriptor Analysis(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor descriptor) { AnalysisValue = null; AnalysisDescriptorAction = null; @@ -2383,7 +2379,7 @@ public IndexSettingsDescriptor Analysis(IndexSettingsAnalysisDescriptor descript return Self; } - public IndexSettingsDescriptor Analysis(Action configure) + public IndexSettingsDescriptor Analysis(Action configure) { AnalysisValue = null; AnalysisDescriptor = null; @@ -2402,7 +2398,7 @@ public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.IndexManage return Self; } - public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) + public IndexSettingsDescriptor Analyze(Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor descriptor) { AnalyzeValue = null; AnalyzeDescriptorAction = null; @@ -2410,7 +2406,7 @@ public IndexSettingsDescriptor Analyze(SettingsAnalyzeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Analyze(Action configure) + public IndexSettingsDescriptor Analyze(Action configure) { AnalyzeValue = null; AnalyzeDescriptor = null; @@ -2432,7 +2428,7 @@ public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.IndexManagem return Self; } - public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) + public IndexSettingsDescriptor Blocks(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor descriptor) { BlocksValue = null; BlocksDescriptorAction = null; @@ -2440,7 +2436,7 @@ public IndexSettingsDescriptor Blocks(IndexSettingBlocksDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Blocks(Action configure) + public IndexSettingsDescriptor Blocks(Action configure) { BlocksValue = null; BlocksDescriptor = null; @@ -2484,7 +2480,7 @@ public IndexSettingsDescriptor FinalPipeline(string? finalPipeline) return Self; } - public IndexSettingsDescriptor Format(Union? format) + public IndexSettingsDescriptor Format(object? format) { FormatValue = format; return Self; @@ -2496,7 +2492,7 @@ public IndexSettingsDescriptor GcDeletes(Elastic.Clients.Elasticsearch.Duration? return Self; } - public IndexSettingsDescriptor Hidden(Union? hidden) + public IndexSettingsDescriptor Hidden(object? hidden) { HiddenValue = hidden; return Self; @@ -2510,7 +2506,7 @@ public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.IndexMana return Self; } - public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) + public IndexSettingsDescriptor Highlight(Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor descriptor) { HighlightValue = null; HighlightDescriptorAction = null; @@ -2518,7 +2514,7 @@ public IndexSettingsDescriptor Highlight(SettingsHighlightDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Highlight(Action configure) + public IndexSettingsDescriptor Highlight(Action configure) { HighlightValue = null; HighlightDescriptor = null; @@ -2534,7 +2530,7 @@ public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -2542,7 +2538,7 @@ public IndexSettingsDescriptor Index(IndexSettingsDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Index(Action configure) + public IndexSettingsDescriptor Index(Action configure) { IndexValue = null; IndexDescriptor = null; @@ -2561,7 +2557,7 @@ public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.In return Self; } - public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descriptor) + public IndexSettingsDescriptor IndexingPressure(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor descriptor) { IndexingPressureValue = null; IndexingPressureDescriptorAction = null; @@ -2569,7 +2565,7 @@ public IndexSettingsDescriptor IndexingPressure(IndexingPressureDescriptor descr return Self; } - public IndexSettingsDescriptor IndexingPressure(Action configure) + public IndexSettingsDescriptor IndexingPressure(Action configure) { IndexingPressureValue = null; IndexingPressureDescriptor = null; @@ -2585,7 +2581,7 @@ public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.Ind return Self; } - public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor descriptor) + public IndexSettingsDescriptor IndexingSlowlog(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor descriptor) { IndexingSlowlogValue = null; IndexingSlowlogDescriptorAction = null; @@ -2593,7 +2589,7 @@ public IndexSettingsDescriptor IndexingSlowlog(IndexingSlowlogSettingsDescriptor return Self; } - public IndexSettingsDescriptor IndexingSlowlog(Action configure) + public IndexSettingsDescriptor IndexingSlowlog(Action configure) { IndexingSlowlogValue = null; IndexingSlowlogDescriptor = null; @@ -2609,7 +2605,7 @@ public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexMana return Self; } - public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descriptor) + public IndexSettingsDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -2617,7 +2613,7 @@ public IndexSettingsDescriptor Lifecycle(IndexSettingsLifecycleDescriptor descri return Self; } - public IndexSettingsDescriptor Lifecycle(Action configure) + public IndexSettingsDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -2642,7 +2638,7 @@ public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.IndexManage return Self; } - public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor) + public IndexSettingsDescriptor Mapping(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor descriptor) { MappingValue = null; MappingDescriptorAction = null; @@ -2650,7 +2646,7 @@ public IndexSettingsDescriptor Mapping(MappingLimitSettingsDescriptor descriptor return Self; } - public IndexSettingsDescriptor Mapping(Action configure) + public IndexSettingsDescriptor Mapping(Action configure) { MappingValue = null; MappingDescriptor = null; @@ -2732,7 +2728,7 @@ public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) + public IndexSettingsDescriptor Merge(Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor descriptor) { MergeValue = null; MergeDescriptorAction = null; @@ -2740,7 +2736,7 @@ public IndexSettingsDescriptor Merge(MergeDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Merge(Action configure) + public IndexSettingsDescriptor Merge(Action configure) { MergeValue = null; MergeDescriptor = null; @@ -2754,7 +2750,7 @@ public IndexSettingsDescriptor Mode(string? mode) return Self; } - public IndexSettingsDescriptor NumberOfReplicas(Union? numberOfReplicas) + public IndexSettingsDescriptor NumberOfReplicas(object? numberOfReplicas) { NumberOfReplicasValue = numberOfReplicas; return Self; @@ -2766,19 +2762,22 @@ public IndexSettingsDescriptor NumberOfRoutingShards(int? numberOfRoutingShards) return Self; } - public IndexSettingsDescriptor NumberOfShards(Union? numberOfShards) + public IndexSettingsDescriptor NumberOfShards(object? numberOfShards) { NumberOfShardsValue = numberOfShards; return Self; } + /// + /// Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the [Elasticsearch API specification](https://github.com/elastic/elasticsearch-specification) so that they can be added in a future release + /// public IndexSettingsDescriptor OtherSettings(Func, FluentDictionary> selector) { OtherSettingsValue = selector?.Invoke(new FluentDictionary()); return Self; } - public IndexSettingsDescriptor Priority(Union? priority) + public IndexSettingsDescriptor Priority(object? priority) { PriorityValue = priority; return Self; @@ -2798,7 +2797,7 @@ public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.IndexManage return Self; } - public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) + public IndexSettingsDescriptor Queries(Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -2806,7 +2805,7 @@ public IndexSettingsDescriptor Queries(QueriesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Queries(Action configure) + public IndexSettingsDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -2822,7 +2821,7 @@ public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.IndexMa return Self; } - public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descriptor) + public IndexSettingsDescriptor QueryString(Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor descriptor) { QueryStringValue = null; QueryStringDescriptorAction = null; @@ -2830,7 +2829,7 @@ public IndexSettingsDescriptor QueryString(SettingsQueryStringDescriptor descrip return Self; } - public IndexSettingsDescriptor QueryString(Action configure) + public IndexSettingsDescriptor QueryString(Action configure) { QueryStringValue = null; QueryStringDescriptor = null; @@ -2852,7 +2851,7 @@ public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.IndexManage return Self; } - public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) + public IndexSettingsDescriptor Routing(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -2860,7 +2859,7 @@ public IndexSettingsDescriptor Routing(IndexRoutingDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Routing(Action configure) + public IndexSettingsDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -2888,7 +2887,7 @@ public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.IndexManagem return Self; } - public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) + public IndexSettingsDescriptor Search(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor descriptor) { SearchValue = null; SearchDescriptorAction = null; @@ -2896,7 +2895,7 @@ public IndexSettingsDescriptor Search(SettingsSearchDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Search(Action configure) + public IndexSettingsDescriptor Search(Action configure) { SearchValue = null; SearchDescriptor = null; @@ -2912,7 +2911,7 @@ public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexSettingsDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -2920,7 +2919,7 @@ public IndexSettingsDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Settings(Action configure) + public IndexSettingsDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -2931,27 +2930,23 @@ public IndexSettingsDescriptor Settings(Action configur /// /// Configure custom similarity settings to customize how search results are scored. /// - public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarity? similarity) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities? similarity) { - SimilarityDescriptor = null; - SimilarityDescriptorAction = null; SimilarityValue = similarity; return Self; } - public IndexSettingsDescriptor Similarity(SettingsSimilarityDescriptor descriptor) + public IndexSettingsDescriptor Similarity(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilaritiesDescriptor descriptor) { - SimilarityValue = null; - SimilarityDescriptorAction = null; - SimilarityDescriptor = descriptor; + SimilarityValue = descriptor.PromisedValue; return Self; } - public IndexSettingsDescriptor Similarity(Action configure) + public IndexSettingsDescriptor Similarity(Action configure) { - SimilarityValue = null; - SimilarityDescriptor = null; - SimilarityDescriptorAction = configure; + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilaritiesDescriptor(); + configure?.Invoke(descriptor); + SimilarityValue = descriptor.PromisedValue; return Self; } @@ -2963,7 +2958,7 @@ public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.IndexMa return Self; } - public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) + public IndexSettingsDescriptor SoftDeletes(Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor descriptor) { SoftDeletesValue = null; SoftDeletesDescriptorAction = null; @@ -2971,7 +2966,7 @@ public IndexSettingsDescriptor SoftDeletes(SoftDeletesDescriptor descriptor) return Self; } - public IndexSettingsDescriptor SoftDeletes(Action configure) + public IndexSettingsDescriptor SoftDeletes(Action configure) { SoftDeletesValue = null; SoftDeletesDescriptor = null; @@ -2987,7 +2982,7 @@ public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.IndexManagemen return Self; } - public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) + public IndexSettingsDescriptor Sort(Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor descriptor) { SortValue = null; SortDescriptorAction = null; @@ -2995,7 +2990,7 @@ public IndexSettingsDescriptor Sort(IndexSegmentSortDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Sort(Action configure) + public IndexSettingsDescriptor Sort(Action configure) { SortValue = null; SortDescriptor = null; @@ -3014,7 +3009,7 @@ public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public IndexSettingsDescriptor Store(StorageDescriptor descriptor) + public IndexSettingsDescriptor Store(Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor descriptor) { StoreValue = null; StoreDescriptorAction = null; @@ -3022,7 +3017,7 @@ public IndexSettingsDescriptor Store(StorageDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Store(Action configure) + public IndexSettingsDescriptor Store(Action configure) { StoreValue = null; StoreDescriptor = null; @@ -3038,7 +3033,7 @@ public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.IndexMan return Self; } - public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor descriptor) + public IndexSettingsDescriptor TimeSeries(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor descriptor) { TimeSeriesValue = null; TimeSeriesDescriptorAction = null; @@ -3046,7 +3041,7 @@ public IndexSettingsDescriptor TimeSeries(IndexSettingsTimeSeriesDescriptor desc return Self; } - public IndexSettingsDescriptor TimeSeries(Action configure) + public IndexSettingsDescriptor TimeSeries(Action configure) { TimeSeriesValue = null; TimeSeriesDescriptor = null; @@ -3068,7 +3063,7 @@ public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) + public IndexSettingsDescriptor Translog(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor descriptor) { TranslogValue = null; TranslogDescriptorAction = null; @@ -3076,7 +3071,7 @@ public IndexSettingsDescriptor Translog(TranslogDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Translog(Action configure) + public IndexSettingsDescriptor Translog(Action configure) { TranslogValue = null; TranslogDescriptor = null; @@ -3090,7 +3085,7 @@ public IndexSettingsDescriptor Uuid(string? uuid) return Self; } - public IndexSettingsDescriptor VerifiedBeforeClose(Union? verifiedBeforeClose) + public IndexSettingsDescriptor VerifiedBeforeClose(object? verifiedBeforeClose) { VerifiedBeforeCloseValue = verifiedBeforeClose; return Self; @@ -3104,7 +3099,7 @@ public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.IndexManage return Self; } - public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) + public IndexSettingsDescriptor Version(Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor descriptor) { VersionValue = null; VersionDescriptorAction = null; @@ -3112,7 +3107,7 @@ public IndexSettingsDescriptor Version(IndexVersioningDescriptor descriptor) return Self; } - public IndexSettingsDescriptor Version(Action configure) + public IndexSettingsDescriptor Version(Action configure) { VersionValue = null; VersionDescriptor = null; @@ -3131,7 +3126,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalysisDescriptorAction is not null) { writer.WritePropertyName("analysis"); - JsonSerializer.Serialize(writer, new IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor(AnalysisDescriptorAction), options); } else if (AnalysisValue is not null) { @@ -3147,7 +3142,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AnalyzeDescriptorAction is not null) { writer.WritePropertyName("analyze"); - JsonSerializer.Serialize(writer, new SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeDescriptor(AnalyzeDescriptorAction), options); } else if (AnalyzeValue is not null) { @@ -3169,7 +3164,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BlocksDescriptorAction is not null) { writer.WritePropertyName("blocks"); - JsonSerializer.Serialize(writer, new IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksDescriptor(BlocksDescriptorAction), options); } else if (BlocksValue is not null) { @@ -3189,10 +3184,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(CodecValue); } - if (CreationDateValue is not null) + if (CreationDateValue.HasValue) { writer.WritePropertyName("creation_date"); - JsonSerializer.Serialize(writer, CreationDateValue, options); + writer.WriteNumberValue(CreationDateValue.Value); } if (CreationDateStringValue is not null) @@ -3201,16 +3196,16 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, CreationDateStringValue, options); } - if (DefaultPipelineValue is not null) + if (!string.IsNullOrEmpty(DefaultPipelineValue)) { writer.WritePropertyName("default_pipeline"); - JsonSerializer.Serialize(writer, DefaultPipelineValue, options); + writer.WriteStringValue(DefaultPipelineValue); } - if (FinalPipelineValue is not null) + if (!string.IsNullOrEmpty(FinalPipelineValue)) { writer.WritePropertyName("final_pipeline"); - JsonSerializer.Serialize(writer, FinalPipelineValue, options); + writer.WriteStringValue(FinalPipelineValue); } if (FormatValue is not null) @@ -3239,7 +3234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (HighlightDescriptorAction is not null) { writer.WritePropertyName("highlight"); - JsonSerializer.Serialize(writer, new SettingsHighlightDescriptor(HighlightDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightDescriptor(HighlightDescriptorAction), options); } else if (HighlightValue is not null) { @@ -3255,7 +3250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { @@ -3271,7 +3266,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingPressureDescriptorAction is not null) { writer.WritePropertyName("indexing_pressure"); - JsonSerializer.Serialize(writer, new IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureDescriptor(IndexingPressureDescriptorAction), options); } else if (IndexingPressureValue is not null) { @@ -3287,7 +3282,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexingSlowlogDescriptorAction is not null) { writer.WritePropertyName("indexing.slowlog"); - JsonSerializer.Serialize(writer, new IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsDescriptor(IndexingSlowlogDescriptorAction), options); } else if (IndexingSlowlogValue is not null) { @@ -3303,7 +3298,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -3325,7 +3320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingDescriptorAction is not null) { writer.WritePropertyName("mapping"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDescriptor(MappingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDescriptor(MappingDescriptorAction), options); } else if (MappingValue is not null) { @@ -3407,7 +3402,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MergeDescriptorAction is not null) { writer.WritePropertyName("merge"); - JsonSerializer.Serialize(writer, new MergeDescriptor(MergeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MergeDescriptor(MergeDescriptorAction), options); } else if (MergeValue is not null) { @@ -3459,7 +3454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueriesDescriptorAction is not null) { writer.WritePropertyName("queries"); - JsonSerializer.Serialize(writer, new QueriesDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.QueriesDescriptor(QueriesDescriptorAction), options); } else if (QueriesValue is not null) { @@ -3475,7 +3470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryStringDescriptorAction is not null) { writer.WritePropertyName("query_string"); - JsonSerializer.Serialize(writer, new SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringDescriptor(QueryStringDescriptorAction), options); } else if (QueryStringValue is not null) { @@ -3497,7 +3492,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("routing"); - JsonSerializer.Serialize(writer, new IndexRoutingDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -3505,10 +3500,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (RoutingPartitionSizeValue is not null) + if (RoutingPartitionSizeValue.HasValue) { writer.WritePropertyName("routing_partition_size"); - JsonSerializer.Serialize(writer, RoutingPartitionSizeValue, options); + writer.WriteNumberValue(RoutingPartitionSizeValue.Value); } if (RoutingPathValue is not null) @@ -3525,7 +3520,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SearchDescriptorAction is not null) { writer.WritePropertyName("search"); - JsonSerializer.Serialize(writer, new SettingsSearchDescriptor(SearchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchDescriptor(SearchDescriptorAction), options); } else if (SearchValue is not null) { @@ -3541,7 +3536,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -3549,17 +3544,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, SettingsValue, options); } - 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) + if (SimilarityValue is not null) { writer.WritePropertyName("similarity"); JsonSerializer.Serialize(writer, SimilarityValue, options); @@ -3573,7 +3558,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SoftDeletesDescriptorAction is not null) { writer.WritePropertyName("soft_deletes"); - JsonSerializer.Serialize(writer, new SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesDescriptor(SoftDeletesDescriptorAction), options); } else if (SoftDeletesValue is not null) { @@ -3589,7 +3574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SortDescriptorAction is not null) { writer.WritePropertyName("sort"); - JsonSerializer.Serialize(writer, new IndexSegmentSortDescriptor(SortDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortDescriptor(SortDescriptorAction), options); } else if (SortValue is not null) { @@ -3605,7 +3590,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (StoreDescriptorAction is not null) { writer.WritePropertyName("store"); - JsonSerializer.Serialize(writer, new StorageDescriptor(StoreDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.StorageDescriptor(StoreDescriptorAction), options); } else if (StoreValue is not null) { @@ -3621,7 +3606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TimeSeriesDescriptorAction is not null) { writer.WritePropertyName("time_series"); - JsonSerializer.Serialize(writer, new IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesDescriptor(TimeSeriesDescriptorAction), options); } else if (TimeSeriesValue is not null) { @@ -3643,7 +3628,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TranslogDescriptorAction is not null) { writer.WritePropertyName("translog"); - JsonSerializer.Serialize(writer, new TranslogDescriptor(TranslogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.TranslogDescriptor(TranslogDescriptorAction), options); } else if (TranslogValue is not null) { @@ -3651,10 +3636,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, TranslogValue, options); } - if (UuidValue is not null) + if (!string.IsNullOrEmpty(UuidValue)) { writer.WritePropertyName("uuid"); - JsonSerializer.Serialize(writer, UuidValue, options); + writer.WriteStringValue(UuidValue); } if (VerifiedBeforeCloseValue is not null) @@ -3671,7 +3656,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VersionDescriptorAction is not null) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, new IndexVersioningDescriptor(VersionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningDescriptor(VersionDescriptorAction), options); } else if (VersionValue is not null) { @@ -3679,7 +3664,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, VersionValue, options); } - if (OtherSettingsValue != null) + if (OtherSettingsValue is not null) { foreach (var additionalProperty in OtherSettingsValue) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs index d895b0a286f..87420519fe5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs @@ -33,10 +33,10 @@ public sealed partial class IndexSettingsAnalysis public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzers { get; set; } [JsonInclude, JsonPropertyName("char_filter")] public Elastic.Clients.Elasticsearch.Analysis.CharFilters? CharFilters { get; set; } - [JsonInclude, JsonPropertyName("filter")] - public Elastic.Clients.Elasticsearch.Analysis.TokenFilters? TokenFilters { get; set; } [JsonInclude, JsonPropertyName("normalizer")] public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizers { get; set; } + [JsonInclude, JsonPropertyName("filter")] + public Elastic.Clients.Elasticsearch.Analysis.TokenFilters? TokenFilters { get; set; } [JsonInclude, JsonPropertyName("tokenizer")] public Elastic.Clients.Elasticsearch.Analysis.Tokenizers? Tokenizers { get; set; } } @@ -61,15 +61,15 @@ public IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.A return Self; } - public IndexSettingsAnalysisDescriptor Analyzers(Analysis.AnalyzersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor descriptor) { AnalyzersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Analyzers(Action configure) + public IndexSettingsAnalysisDescriptor Analyzers(Action configure) { - var descriptor = new Analysis.AnalyzersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor(); configure?.Invoke(descriptor); AnalyzersValue = descriptor.PromisedValue; return Self; @@ -81,15 +81,15 @@ public IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsAnalysisDescriptor CharFilters(Analysis.CharFiltersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch.Analysis.CharFiltersDescriptor descriptor) { CharFiltersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor CharFilters(Action configure) + public IndexSettingsAnalysisDescriptor CharFilters(Action configure) { - var descriptor = new Analysis.CharFiltersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Analysis.CharFiltersDescriptor(); configure?.Invoke(descriptor); CharFiltersValue = descriptor.PromisedValue; return Self; @@ -101,15 +101,15 @@ public IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch return Self; } - public IndexSettingsAnalysisDescriptor Normalizers(Analysis.NormalizersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch.Analysis.NormalizersDescriptor descriptor) { NormalizersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Normalizers(Action configure) + public IndexSettingsAnalysisDescriptor Normalizers(Action configure) { - var descriptor = new Analysis.NormalizersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Analysis.NormalizersDescriptor(); configure?.Invoke(descriptor); NormalizersValue = descriptor.PromisedValue; return Self; @@ -121,15 +121,15 @@ public IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearc return Self; } - public IndexSettingsAnalysisDescriptor TokenFilters(Analysis.TokenFiltersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor descriptor) { TokenFiltersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor TokenFilters(Action configure) + public IndexSettingsAnalysisDescriptor TokenFilters(Action configure) { - var descriptor = new Analysis.TokenFiltersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor(); configure?.Invoke(descriptor); TokenFiltersValue = descriptor.PromisedValue; return Self; @@ -141,15 +141,15 @@ public IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch. return Self; } - public IndexSettingsAnalysisDescriptor Tokenizers(Analysis.TokenizersDescriptor descriptor) + public IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch.Analysis.TokenizersDescriptor descriptor) { TokenizersValue = descriptor.PromisedValue; return Self; } - public IndexSettingsAnalysisDescriptor Tokenizers(Action configure) + public IndexSettingsAnalysisDescriptor Tokenizers(Action configure) { - var descriptor = new Analysis.TokenizersDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Analysis.TokenizersDescriptor(); configure?.Invoke(descriptor); TokenizersValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs index 7f5d78f1f1a..81ae8706d45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs @@ -33,7 +33,6 @@ 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; } /// @@ -77,8 +76,8 @@ public IndexSettingsLifecycleDescriptor() : base() private bool? ParseOriginationDateValue { get; set; } private string? RolloverAliasValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep? StepValue { get; set; } - private IndexSettingsLifecycleStepDescriptor StepDescriptor { get; set; } - private Action StepDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.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.
@@ -133,7 +132,7 @@ public IndexSettingsLifecycleDescriptor Step(Elastic.Clients.Elasticsearch.Index return Self; } - public IndexSettingsLifecycleDescriptor Step(IndexSettingsLifecycleStepDescriptor descriptor) + public IndexSettingsLifecycleDescriptor Step(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStepDescriptor descriptor) { StepValue = null; StepDescriptorAction = null; @@ -141,7 +140,7 @@ public IndexSettingsLifecycleDescriptor Step(IndexSettingsLifecycleStepDescripto return Self; } - public IndexSettingsLifecycleDescriptor Step(Action configure) + public IndexSettingsLifecycleDescriptor Step(Action configure) { StepValue = null; StepDescriptor = null; @@ -152,10 +151,10 @@ public IndexSettingsLifecycleDescriptor Step(Action? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.DataStreamName? DataStreamValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? DefaultsValue { get; set; } - private IndexSettingsDescriptor DefaultsDescriptor { get; set; } - private Action> DefaultsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action> DefaultsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } - public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + public IndexStateDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -97,7 +97,7 @@ public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.In return Self; } - public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { DefaultsValue = null; DefaultsDescriptorAction = null; @@ -105,7 +105,7 @@ public IndexStateDescriptor Defaults(IndexSettingsDescriptor Defaults(Action> configure) + public IndexStateDescriptor Defaults(Action> configure) { DefaultsValue = null; DefaultsDescriptor = null; @@ -124,7 +124,7 @@ public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.I return Self; } - public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -132,7 +132,7 @@ public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor d return Self; } - public IndexStateDescriptor Lifecycle(Action configure) + public IndexStateDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -148,7 +148,7 @@ public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Ma return Self; } - public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -156,7 +156,7 @@ public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor Mappings(Action> configure) + public IndexStateDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -172,7 +172,7 @@ public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.In return Self; } - public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -180,7 +180,7 @@ public IndexStateDescriptor Settings(IndexSettingsDescriptor Settings(Action> configure) + public IndexStateDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -211,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DefaultsDescriptorAction is not null) { writer.WritePropertyName("defaults"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(DefaultsDescriptorAction), options); } else if (DefaultsValue is not null) { @@ -227,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -243,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -259,7 +259,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -279,24 +279,24 @@ public IndexStateDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.DataStreamName? DataStreamValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? DefaultsValue { get; set; } - private IndexSettingsDescriptor DefaultsDescriptor { get; set; } - private Action DefaultsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor DefaultsDescriptor { get; set; } + private Action DefaultsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } - public IndexStateDescriptor Aliases(Func, FluentDictionary> selector) + public IndexStateDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -317,7 +317,7 @@ public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Defaults(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { DefaultsValue = null; DefaultsDescriptorAction = null; @@ -325,7 +325,7 @@ public IndexStateDescriptor Defaults(IndexSettingsDescriptor descriptor) return Self; } - public IndexStateDescriptor Defaults(Action configure) + public IndexStateDescriptor Defaults(Action configure) { DefaultsValue = null; DefaultsDescriptor = null; @@ -344,7 +344,7 @@ public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagem return Self; } - public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexStateDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -352,7 +352,7 @@ public IndexStateDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) return Self; } - public IndexStateDescriptor Lifecycle(Action configure) + public IndexStateDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -368,7 +368,7 @@ public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeM return Self; } - public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexStateDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -376,7 +376,7 @@ public IndexStateDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) return Self; } - public IndexStateDescriptor Mappings(Action configure) + public IndexStateDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -392,7 +392,7 @@ public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexStateDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -400,7 +400,7 @@ public IndexStateDescriptor Settings(IndexSettingsDescriptor descriptor) return Self; } - public IndexStateDescriptor Settings(Action configure) + public IndexStateDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -431,7 +431,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DefaultsDescriptorAction is not null) { writer.WritePropertyName("defaults"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(DefaultsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(DefaultsDescriptorAction), options); } else if (DefaultsValue is not null) { @@ -447,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -463,7 +463,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -479,7 +479,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs index edda6535e03..6e5ae02b7b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs @@ -29,47 +29,434 @@ namespace Elastic.Clients.Elasticsearch.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; } + public bool? AllowAutoCreate { 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 IReadOnlyCollection ComposedOf { get; init; } + public ICollection ComposedOf { 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.IndexManagement.IndexTemplateDataStreamConfiguration? DataStream { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? DataStream { get; set; } /// /// Name of the index template. /// [JsonInclude, JsonPropertyName("index_patterns")] - public IReadOnlyCollection IndexPatterns { get; init; } + public Elastic.Clients.Elasticsearch.Names IndexPatterns { 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; } /// /// 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; } + public long? Priority { get; set; } /// /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
///
[JsonInclude, JsonPropertyName("template")] - public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? Template { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? Template { 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; init; } + public long? Version { get; set; } +} + +public sealed partial class IndexTemplateDescriptor : SerializableDescriptor> +{ + internal IndexTemplateDescriptor(Action> configure) => configure.Invoke(this); + + public IndexTemplateDescriptor() : base() + { + } + + private bool? AllowAutoCreateValue { get; set; } + private ICollection ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Names IndexPatternsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor TemplateDescriptor { get; set; } + private Action> TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + public IndexTemplateDescriptor 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 IndexTemplateDescriptor 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 IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template. + /// + public IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Names indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// Optional user metadata about the index template. May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + 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 IndexTemplateDescriptor Priority(long? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor Template(Action> configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexTemplateDescriptor : SerializableDescriptor +{ + internal IndexTemplateDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateDescriptor() : base() + { + } + + private bool? AllowAutoCreateValue { get; set; } + private ICollection ComposedOfValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? DataStreamValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor DataStreamDescriptor { get; set; } + private Action DataStreamDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Names IndexPatternsValue { get; set; } + private IDictionary? MetaValue { get; set; } + private long? PriorityValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private long? VersionValue { get; set; } + + public IndexTemplateDescriptor 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 IndexTemplateDescriptor 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 IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? dataStream) + { + DataStreamDescriptor = null; + DataStreamDescriptorAction = null; + DataStreamValue = dataStream; + return Self; + } + + public IndexTemplateDescriptor DataStream(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor descriptor) + { + DataStreamValue = null; + DataStreamDescriptorAction = null; + DataStreamDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor DataStream(Action configure) + { + DataStreamValue = null; + DataStreamDescriptor = null; + DataStreamDescriptorAction = configure; + return Self; + } + + /// + /// Name of the index template. + /// + public IndexTemplateDescriptor IndexPatterns(Elastic.Clients.Elasticsearch.Names indexPatterns) + { + IndexPatternsValue = indexPatterns; + return Self; + } + + /// + /// Optional user metadata about the index template. May have any contents.
This map is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Meta(Func, FluentDictionary> selector) + { + MetaValue = selector?.Invoke(new FluentDictionary()); + 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 IndexTemplateDescriptor Priority(long? priority) + { + PriorityValue = priority; + return Self; + } + + /// + /// Template to be applied.
It may optionally include an `aliases`, `mappings`, or `settings` configuration.
+ ///
+ public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public IndexTemplateDescriptor Template(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public IndexTemplateDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Version number used to manage index templates externally.
This number is not automatically generated by Elasticsearch.
+ ///
+ public IndexTemplateDescriptor Version(long? version) + { + VersionValue = version; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowAutoCreateValue.HasValue) + { + writer.WritePropertyName("allow_auto_create"); + writer.WriteBooleanValue(AllowAutoCreateValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationDescriptor(DataStreamDescriptorAction), options); + } + else if (DataStreamValue is not null) + { + writer.WritePropertyName("data_stream"); + JsonSerializer.Serialize(writer, DataStreamValue, options); + } + + writer.WritePropertyName("index_patterns"); + JsonSerializer.Serialize(writer, IndexPatternsValue, options); + if (MetaValue is not null) + { + writer.WritePropertyName("_meta"); + JsonSerializer.Serialize(writer, MetaValue, options); + } + + if (PriorityValue.HasValue) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(PriorityValue.Value); + } + + 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 Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + if (VersionValue.HasValue) + { + writer.WritePropertyName("version"); + writer.WriteNumberValue(VersionValue.Value); + } + + writer.WriteEndObject(); + } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs index a81d35c5bd8..29b4c361c25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs @@ -33,11 +33,59 @@ public sealed partial class IndexTemplateDataStreamConfiguration /// If true, the data stream supports custom routing. ///
[JsonInclude, JsonPropertyName("allow_custom_routing")] - public bool? AllowCustomRouting { get; init; } + public bool? AllowCustomRouting { get; set; } /// /// If true, the data stream is hidden. /// [JsonInclude, JsonPropertyName("hidden")] - public bool? Hidden { get; init; } + public bool? Hidden { get; set; } +} + +public sealed partial class IndexTemplateDataStreamConfigurationDescriptor : SerializableDescriptor +{ + internal IndexTemplateDataStreamConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateDataStreamConfigurationDescriptor() : base() + { + } + + private bool? AllowCustomRoutingValue { get; set; } + private bool? HiddenValue { get; set; } + + /// + /// If true, the data stream supports custom routing. + /// + public IndexTemplateDataStreamConfigurationDescriptor AllowCustomRouting(bool? allowCustomRouting = true) + { + AllowCustomRoutingValue = allowCustomRouting; + return Self; + } + + /// + /// If true, the data stream is hidden. + /// + public IndexTemplateDataStreamConfigurationDescriptor Hidden(bool? hidden = true) + { + HiddenValue = hidden; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AllowCustomRoutingValue.HasValue) + { + writer.WritePropertyName("allow_custom_routing"); + writer.WriteBooleanValue(AllowCustomRoutingValue.Value); + } + + 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/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs index 6cb440dd3cb..80c1dabbd47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs @@ -58,23 +58,23 @@ public IndexTemplateMappingDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary> AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action> SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } /// /// 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) + public IndexTemplateMappingDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -86,7 +86,7 @@ public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elast return Self; } - public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -94,7 +94,7 @@ public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDe return Self; } - public IndexTemplateMappingDescriptor Lifecycle(Action configure) + public IndexTemplateMappingDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -113,7 +113,7 @@ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasti return Self; } - public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -121,7 +121,7 @@ public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDes return Self; } - public IndexTemplateMappingDescriptor Mappings(Action> configure) + public IndexTemplateMappingDescriptor Mappings(Action> configure) { MappingsValue = null; MappingsDescriptor = null; @@ -140,7 +140,7 @@ public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasti return Self; } - public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -148,7 +148,7 @@ public IndexTemplateMappingDescriptor Settings(IndexSettingsDescripto return Self; } - public IndexTemplateMappingDescriptor Settings(Action> configure) + public IndexTemplateMappingDescriptor Settings(Action> configure) { SettingsValue = null; SettingsDescriptor = null; @@ -173,7 +173,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -189,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -205,7 +205,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { @@ -225,23 +225,23 @@ public IndexTemplateMappingDescriptor() : base() { } - private IDictionary? AliasesValue { get; set; } + private IDictionary AliasesValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? LifecycleValue { get; set; } - private DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } - private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } - private Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } - private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } - private IndexSettingsDescriptor SettingsDescriptor { get; set; } - private Action SettingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } /// /// 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) + public IndexTemplateMappingDescriptor Aliases(Func, FluentDescriptorDictionary> selector) { - AliasesValue = selector?.Invoke(new FluentDictionary()); + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -253,7 +253,7 @@ public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.In return Self; } - public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor descriptor) + public IndexTemplateMappingDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor descriptor) { LifecycleValue = null; LifecycleDescriptorAction = null; @@ -261,7 +261,7 @@ public IndexTemplateMappingDescriptor Lifecycle(DataStreamLifecycleDescriptor de return Self; } - public IndexTemplateMappingDescriptor Lifecycle(Action configure) + public IndexTemplateMappingDescriptor Lifecycle(Action configure) { LifecycleValue = null; LifecycleDescriptor = null; @@ -280,7 +280,7 @@ public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Map return Self; } - public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor descriptor) + public IndexTemplateMappingDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) { MappingsValue = null; MappingsDescriptorAction = null; @@ -288,7 +288,7 @@ public IndexTemplateMappingDescriptor Mappings(Mapping.TypeMappingDescriptor des return Self; } - public IndexTemplateMappingDescriptor Mappings(Action configure) + public IndexTemplateMappingDescriptor Mappings(Action configure) { MappingsValue = null; MappingsDescriptor = null; @@ -307,7 +307,7 @@ public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.Ind return Self; } - public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descriptor) + public IndexTemplateMappingDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) { SettingsValue = null; SettingsDescriptorAction = null; @@ -315,7 +315,7 @@ public IndexTemplateMappingDescriptor Settings(IndexSettingsDescriptor descripto return Self; } - public IndexTemplateMappingDescriptor Settings(Action configure) + public IndexTemplateMappingDescriptor Settings(Action configure) { SettingsValue = null; SettingsDescriptor = null; @@ -340,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LifecycleDescriptorAction is not null) { writer.WritePropertyName("lifecycle"); - JsonSerializer.Serialize(writer, new DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor(LifecycleDescriptorAction), options); } else if (LifecycleValue is not null) { @@ -356,7 +356,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MappingsDescriptorAction is not null) { writer.WritePropertyName("mappings"); - JsonSerializer.Serialize(writer, new Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor(MappingsDescriptorAction), options); } else if (MappingsValue is not null) { @@ -372,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SettingsDescriptorAction is not null) { writer.WritePropertyName("settings"); - JsonSerializer.Serialize(writer, new IndexSettingsDescriptor(SettingsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); } else if (SettingsValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs index 76101931399..3396ee7b102 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs @@ -33,20 +33,353 @@ 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.IndexManagement.Alias))] - public IReadOnlyDictionary? Aliases { get; init; } + public IDictionary? Aliases { get; set; } [JsonInclude, JsonPropertyName("lifecycle")] - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? 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.Mapping.TypeMapping? Mappings { get; init; } + public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? Mappings { get; set; } /// /// Configuration options for the index. /// [JsonInclude, JsonPropertyName("settings")] - public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? Settings { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? Settings { get; set; } +} + +public sealed partial class IndexTemplateSummaryDescriptor : SerializableDescriptor> +{ + internal IndexTemplateSummaryDescriptor(Action> configure) => configure.Invoke(this); + + public IndexTemplateSummaryDescriptor() : base() + { + } + + private IDictionary> AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? LifecycleValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action> MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action> SettingsDescriptorAction { get; set; } + + /// + /// 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 IndexTemplateSummaryDescriptor Aliases(Func>, FluentDescriptorDictionary>> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Action> configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Action> configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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 (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 Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else if (SettingsValue is not null) + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexTemplateSummaryDescriptor : SerializableDescriptor +{ + internal IndexTemplateSummaryDescriptor(Action configure) => configure.Invoke(this); + + public IndexTemplateSummaryDescriptor() : base() + { + } + + private IDictionary AliasesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? LifecycleValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor LifecycleDescriptor { get; set; } + private Action LifecycleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMapping? MappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor MappingsDescriptor { get; set; } + private Action MappingsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + + /// + /// 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 IndexTemplateSummaryDescriptor Aliases(Func, FluentDescriptorDictionary> selector) + { + AliasesValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? lifecycle) + { + LifecycleDescriptor = null; + LifecycleDescriptorAction = null; + LifecycleValue = lifecycle; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor descriptor) + { + LifecycleValue = null; + LifecycleDescriptorAction = null; + LifecycleDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Lifecycle(Action configure) + { + LifecycleValue = null; + LifecycleDescriptor = null; + LifecycleDescriptorAction = configure; + return Self; + } + + /// + /// Mapping for fields in the index.
If specified, this mapping can include field names, field data types, and mapping parameters.
+ ///
+ public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMapping? mappings) + { + MappingsDescriptor = null; + MappingsDescriptorAction = null; + MappingsValue = mappings; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Elastic.Clients.Elasticsearch.Mapping.TypeMappingDescriptor descriptor) + { + MappingsValue = null; + MappingsDescriptorAction = null; + MappingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Mappings(Action configure) + { + MappingsValue = null; + MappingsDescriptor = null; + MappingsDescriptorAction = configure; + return Self; + } + + /// + /// Configuration options for the index. + /// + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public IndexTemplateSummaryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + 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 (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 Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(LifecycleDescriptorAction), options); + } + else if (LifecycleValue is not null) + { + writer.WritePropertyName("lifecycle"); + JsonSerializer.Serialize(writer, LifecycleValue, 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 Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsDescriptor(SettingsDescriptorAction), options); + } + else 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/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs new file mode 100644 index 00000000000..578799e595b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.IndexManagement; + +[JsonConverter(typeof(IndexUpdateAliasesActionConverter))] +public sealed partial class IndexUpdateAliasesAction +{ + internal IndexUpdateAliasesAction(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 IndexUpdateAliasesAction Add(Elastic.Clients.Elasticsearch.IndexManagement.AddAction addAction) => new IndexUpdateAliasesAction("add", addAction); + public static IndexUpdateAliasesAction Remove(Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction removeAction) => new IndexUpdateAliasesAction("remove", removeAction); + public static IndexUpdateAliasesAction RemoveIndex(Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction removeIndexAction) => new IndexUpdateAliasesAction("remove_index", removeIndexAction); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class IndexUpdateAliasesActionConverter : JsonConverter +{ + public override IndexUpdateAliasesAction 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; + 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 == "add") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "remove_index") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IndexUpdateAliasesAction' from the response."); + } + + reader.Read(); + var result = new IndexUpdateAliasesAction(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, IndexUpdateAliasesAction 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.IndexManagement.AddAction)value.Variant, options); + break; + case "remove": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction)value.Variant, options); + break; + case "remove_index": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class IndexUpdateAliasesActionDescriptor : SerializableDescriptor> +{ + internal IndexUpdateAliasesActionDescriptor(Action> configure) => configure.Invoke(this); + + public IndexUpdateAliasesActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexUpdateAliasesActionDescriptor 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 IndexUpdateAliasesActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexUpdateAliasesActionDescriptor Add(Elastic.Clients.Elasticsearch.IndexManagement.AddAction addAction) => Set(addAction, "add"); + public IndexUpdateAliasesActionDescriptor Add(Action> configure) => Set(configure, "add"); + public IndexUpdateAliasesActionDescriptor Remove(Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction removeAction) => Set(removeAction, "remove"); + public IndexUpdateAliasesActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 IndexUpdateAliasesActionDescriptor : SerializableDescriptor +{ + internal IndexUpdateAliasesActionDescriptor(Action configure) => configure.Invoke(this); + + public IndexUpdateAliasesActionDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private IndexUpdateAliasesActionDescriptor 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 IndexUpdateAliasesActionDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public IndexUpdateAliasesActionDescriptor Add(Elastic.Clients.Elasticsearch.IndexManagement.AddAction addAction) => Set(addAction, "add"); + public IndexUpdateAliasesActionDescriptor Add(Action configure) => Set(configure, "add"); + public IndexUpdateAliasesActionDescriptor Remove(Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction removeAction) => Set(removeAction, "remove"); + public IndexUpdateAliasesActionDescriptor Remove(Action configure) => Set(configure, "remove"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction removeIndexAction) => Set(removeIndexAction, "remove_index"); + public IndexUpdateAliasesActionDescriptor RemoveIndex(Action configure) => Set(configure, "remove_index"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/IndexManagement/IndexVersioning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs index f710b5dd0be..0ea324d4c2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs @@ -61,10 +61,10 @@ public IndexVersioningDescriptor CreatedString(string? createdString) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (CreatedValue is not null) + if (!string.IsNullOrEmpty(CreatedValue)) { writer.WritePropertyName("created"); - JsonSerializer.Serialize(writer, CreatedValue, options); + writer.WriteStringValue(CreatedValue); } if (!string.IsNullOrEmpty(CreatedStringValue)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs index d9d21ed8503..ce90dc10053 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs @@ -42,8 +42,8 @@ public IndexingPressureDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory MemoryValue { get; set; } - private IndexingPressureMemoryDescriptor MemoryDescriptor { get; set; } - private Action MemoryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemoryDescriptor MemoryDescriptor { get; set; } + private Action MemoryDescriptorAction { get; set; } public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory memory) { @@ -53,7 +53,7 @@ public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.IndexMana return Self; } - public IndexingPressureDescriptor Memory(IndexingPressureMemoryDescriptor descriptor) + public IndexingPressureDescriptor Memory(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemoryDescriptor descriptor) { MemoryValue = null; MemoryDescriptorAction = null; @@ -61,7 +61,7 @@ public IndexingPressureDescriptor Memory(IndexingPressureMemoryDescriptor descri return Self; } - public IndexingPressureDescriptor Memory(Action configure) + public IndexingPressureDescriptor Memory(Action configure) { MemoryValue = null; MemoryDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MemoryDescriptorAction is not null) { writer.WritePropertyName("memory"); - JsonSerializer.Serialize(writer, new IndexingPressureMemoryDescriptor(MemoryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemoryDescriptor(MemoryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs index 9ff49066c4b..76acfbb2c0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs @@ -51,8 +51,8 @@ public IndexingSlowlogSettingsDescriptor() : base() private bool? ReformatValue { get; set; } private int? SourceValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds? ThresholdValue { get; set; } - private IndexingSlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } - private Action ThresholdDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } public IndexingSlowlogSettingsDescriptor Level(string? level) { @@ -80,7 +80,7 @@ public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch return Self; } - public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescriptor descriptor) + public IndexingSlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholdsDescriptor descriptor) { ThresholdValue = null; ThresholdDescriptorAction = null; @@ -88,7 +88,7 @@ public IndexingSlowlogSettingsDescriptor Threshold(IndexingSlowlogTresholdsDescr return Self; } - public IndexingSlowlogSettingsDescriptor Threshold(Action configure) + public IndexingSlowlogSettingsDescriptor Threshold(Action configure) { ThresholdValue = null; ThresholdDescriptor = null; @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ThresholdDescriptorAction is not null) { writer.WritePropertyName("threshold"); - JsonSerializer.Serialize(writer, new IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); } else if (ThresholdValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs index fb1370668bc..c0ed99e6543 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs @@ -45,8 +45,8 @@ public IndexingSlowlogTresholdsDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? IndexValue { get; set; } - private SlowlogTresholdLevelsDescriptor IndexDescriptor { get; set; } - private Action IndexDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.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.
@@ -59,7 +59,7 @@ public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.In return Self; } - public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor descriptor) + public IndexingSlowlogTresholdsDescriptor Index(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { IndexValue = null; IndexDescriptorAction = null; @@ -67,7 +67,7 @@ public IndexingSlowlogTresholdsDescriptor Index(SlowlogTresholdLevelsDescriptor return Self; } - public IndexingSlowlogTresholdsDescriptor Index(Action configure) + public IndexingSlowlogTresholdsDescriptor Index(Action configure) { IndexValue = null; IndexDescriptor = null; @@ -86,7 +86,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexDescriptorAction is not null) { writer.WritePropertyName("index"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor(IndexDescriptorAction), options); } else if (IndexValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs new file mode 100644 index 00000000000..23e111c289a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndicesShardStores +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs new file mode 100644 index 00000000000..5ed18677b39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class IndicesValidationExplanation +{ + [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + [JsonInclude, JsonPropertyName("explanation")] + public string? Explanation { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("valid")] + public bool Valid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs index 2b9bac0c930..dfbd646fbd8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; /// /// Mapping Limit Settings +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class MappingLimitSettings { @@ -52,6 +53,7 @@ public sealed partial class MappingLimitSettings /// /// Mapping Limit Settings +/// Learn more about this API in the Elasticsearch documentation. /// public sealed partial class MappingLimitSettingsDescriptor : SerializableDescriptor { @@ -63,24 +65,24 @@ public MappingLimitSettingsDescriptor() : base() private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth? DepthValue { get; set; } - private MappingLimitSettingsDepthDescriptor DepthDescriptor { get; set; } - private Action DepthDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepthDescriptor DepthDescriptor { get; set; } + private Action DepthDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields? DimensionFieldsValue { get; set; } - private MappingLimitSettingsDimensionFieldsDescriptor DimensionFieldsDescriptor { get; set; } - private Action DimensionFieldsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFieldsDescriptor DimensionFieldsDescriptor { get; set; } + private Action DimensionFieldsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength? FieldNameLengthValue { get; set; } - private MappingLimitSettingsFieldNameLengthDescriptor FieldNameLengthDescriptor { get; set; } - private Action FieldNameLengthDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLengthDescriptor FieldNameLengthDescriptor { get; set; } + private Action FieldNameLengthDescriptorAction { get; set; } private bool? IgnoreMalformedValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields? NestedFieldsValue { get; set; } - private MappingLimitSettingsNestedFieldsDescriptor NestedFieldsDescriptor { get; set; } - private Action NestedFieldsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFieldsDescriptor NestedFieldsDescriptor { get; set; } + private Action NestedFieldsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects? NestedObjectsValue { get; set; } - private MappingLimitSettingsNestedObjectsDescriptor NestedObjectsDescriptor { get; set; } - private Action NestedObjectsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjectsDescriptor NestedObjectsDescriptor { get; set; } + private Action NestedObjectsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields? TotalFieldsValue { get; set; } - private MappingLimitSettingsTotalFieldsDescriptor TotalFieldsDescriptor { get; set; } - private Action TotalFieldsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor TotalFieldsDescriptor { get; set; } + private Action TotalFieldsDescriptorAction { get; set; } public MappingLimitSettingsDescriptor Coerce(bool? coerce = true) { @@ -96,7 +98,7 @@ public MappingLimitSettingsDescriptor Depth(Elastic.Clients.Elasticsearch.IndexM return Self; } - public MappingLimitSettingsDescriptor Depth(MappingLimitSettingsDepthDescriptor descriptor) + public MappingLimitSettingsDescriptor Depth(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepthDescriptor descriptor) { DepthValue = null; DepthDescriptorAction = null; @@ -104,7 +106,7 @@ public MappingLimitSettingsDescriptor Depth(MappingLimitSettingsDepthDescriptor return Self; } - public MappingLimitSettingsDescriptor Depth(Action configure) + public MappingLimitSettingsDescriptor Depth(Action configure) { DepthValue = null; DepthDescriptor = null; @@ -120,7 +122,7 @@ public MappingLimitSettingsDescriptor DimensionFields(Elastic.Clients.Elasticsea return Self; } - public MappingLimitSettingsDescriptor DimensionFields(MappingLimitSettingsDimensionFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor DimensionFields(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFieldsDescriptor descriptor) { DimensionFieldsValue = null; DimensionFieldsDescriptorAction = null; @@ -128,7 +130,7 @@ public MappingLimitSettingsDescriptor DimensionFields(MappingLimitSettingsDimens return Self; } - public MappingLimitSettingsDescriptor DimensionFields(Action configure) + public MappingLimitSettingsDescriptor DimensionFields(Action configure) { DimensionFieldsValue = null; DimensionFieldsDescriptor = null; @@ -144,7 +146,7 @@ public MappingLimitSettingsDescriptor FieldNameLength(Elastic.Clients.Elasticsea return Self; } - public MappingLimitSettingsDescriptor FieldNameLength(MappingLimitSettingsFieldNameLengthDescriptor descriptor) + public MappingLimitSettingsDescriptor FieldNameLength(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLengthDescriptor descriptor) { FieldNameLengthValue = null; FieldNameLengthDescriptorAction = null; @@ -152,7 +154,7 @@ public MappingLimitSettingsDescriptor FieldNameLength(MappingLimitSettingsFieldN return Self; } - public MappingLimitSettingsDescriptor FieldNameLength(Action configure) + public MappingLimitSettingsDescriptor FieldNameLength(Action configure) { FieldNameLengthValue = null; FieldNameLengthDescriptor = null; @@ -174,7 +176,7 @@ public MappingLimitSettingsDescriptor NestedFields(Elastic.Clients.Elasticsearch return Self; } - public MappingLimitSettingsDescriptor NestedFields(MappingLimitSettingsNestedFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor NestedFields(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFieldsDescriptor descriptor) { NestedFieldsValue = null; NestedFieldsDescriptorAction = null; @@ -182,7 +184,7 @@ public MappingLimitSettingsDescriptor NestedFields(MappingLimitSettingsNestedFie return Self; } - public MappingLimitSettingsDescriptor NestedFields(Action configure) + public MappingLimitSettingsDescriptor NestedFields(Action configure) { NestedFieldsValue = null; NestedFieldsDescriptor = null; @@ -198,7 +200,7 @@ public MappingLimitSettingsDescriptor NestedObjects(Elastic.Clients.Elasticsearc return Self; } - public MappingLimitSettingsDescriptor NestedObjects(MappingLimitSettingsNestedObjectsDescriptor descriptor) + public MappingLimitSettingsDescriptor NestedObjects(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjectsDescriptor descriptor) { NestedObjectsValue = null; NestedObjectsDescriptorAction = null; @@ -206,7 +208,7 @@ public MappingLimitSettingsDescriptor NestedObjects(MappingLimitSettingsNestedOb return Self; } - public MappingLimitSettingsDescriptor NestedObjects(Action configure) + public MappingLimitSettingsDescriptor NestedObjects(Action configure) { NestedObjectsValue = null; NestedObjectsDescriptor = null; @@ -222,7 +224,7 @@ public MappingLimitSettingsDescriptor TotalFields(Elastic.Clients.Elasticsearch. return Self; } - public MappingLimitSettingsDescriptor TotalFields(MappingLimitSettingsTotalFieldsDescriptor descriptor) + public MappingLimitSettingsDescriptor TotalFields(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor descriptor) { TotalFieldsValue = null; TotalFieldsDescriptorAction = null; @@ -230,7 +232,7 @@ public MappingLimitSettingsDescriptor TotalFields(MappingLimitSettingsTotalField return Self; } - public MappingLimitSettingsDescriptor TotalFields(Action configure) + public MappingLimitSettingsDescriptor TotalFields(Action configure) { TotalFieldsValue = null; TotalFieldsDescriptor = null; @@ -255,7 +257,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DepthDescriptorAction is not null) { writer.WritePropertyName("depth"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDepthDescriptor(DepthDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepthDescriptor(DepthDescriptorAction), options); } else if (DepthValue is not null) { @@ -271,7 +273,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DimensionFieldsDescriptorAction is not null) { writer.WritePropertyName("dimension_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsDimensionFieldsDescriptor(DimensionFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFieldsDescriptor(DimensionFieldsDescriptorAction), options); } else if (DimensionFieldsValue is not null) { @@ -287,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNameLengthDescriptorAction is not null) { writer.WritePropertyName("field_name_length"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsFieldNameLengthDescriptor(FieldNameLengthDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLengthDescriptor(FieldNameLengthDescriptorAction), options); } else if (FieldNameLengthValue is not null) { @@ -309,7 +311,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedFieldsDescriptorAction is not null) { writer.WritePropertyName("nested_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedFieldsDescriptor(NestedFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFieldsDescriptor(NestedFieldsDescriptorAction), options); } else if (NestedFieldsValue is not null) { @@ -325,7 +327,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedObjectsDescriptorAction is not null) { writer.WritePropertyName("nested_objects"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsNestedObjectsDescriptor(NestedObjectsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjectsDescriptor(NestedObjectsDescriptorAction), options); } else if (NestedObjectsValue is not null) { @@ -341,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TotalFieldsDescriptorAction is not null) { writer.WritePropertyName("total_fields"); - JsonSerializer.Serialize(writer, new MappingLimitSettingsTotalFieldsDescriptor(TotalFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFieldsDescriptor(TotalFieldsDescriptorAction), options); } else if (TotalFieldsValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs index bc0ced9904c..77498dbc373 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs @@ -42,8 +42,8 @@ public MergeDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler? SchedulerValue { get; set; } - private MergeSchedulerDescriptor SchedulerDescriptor { get; set; } - private Action SchedulerDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.MergeSchedulerDescriptor SchedulerDescriptor { get; set; } + private Action SchedulerDescriptorAction { get; set; } public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler? scheduler) { @@ -53,7 +53,7 @@ public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.IndexManagement.M return Self; } - public MergeDescriptor Scheduler(MergeSchedulerDescriptor descriptor) + public MergeDescriptor Scheduler(Elastic.Clients.Elasticsearch.IndexManagement.MergeSchedulerDescriptor descriptor) { SchedulerValue = null; SchedulerDescriptorAction = null; @@ -61,7 +61,7 @@ public MergeDescriptor Scheduler(MergeSchedulerDescriptor descriptor) return Self; } - public MergeDescriptor Scheduler(Action configure) + public MergeDescriptor Scheduler(Action configure) { SchedulerValue = null; SchedulerDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SchedulerDescriptorAction is not null) { writer.WritePropertyName("scheduler"); - JsonSerializer.Serialize(writer, new MergeSchedulerDescriptor(SchedulerDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.MergeSchedulerDescriptor(SchedulerDescriptorAction), options); } else if (SchedulerValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs index e1dcafbbe16..e933ab90b77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs @@ -30,10 +30,8 @@ namespace Elastic.Clients.Elasticsearch.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; } } @@ -63,16 +61,16 @@ public MergeSchedulerDescriptor MaxThreadCount(int? maxThreadCount) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MaxMergeCountValue is not null) + if (MaxMergeCountValue.HasValue) { writer.WritePropertyName("max_merge_count"); - JsonSerializer.Serialize(writer, MaxMergeCountValue, options); + writer.WriteNumberValue(MaxMergeCountValue.Value); } - if (MaxThreadCountValue is not null) + if (MaxThreadCountValue.HasValue) { writer.WritePropertyName("max_thread_count"); - JsonSerializer.Serialize(writer, MaxThreadCountValue, options); + writer.WriteNumberValue(MaxThreadCountValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs index 9eebccae1e9..27c17aa6dba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs @@ -33,7 +33,7 @@ public sealed partial class NumericFielddata public Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat Format { get; set; } } -public sealed partial class NumericFielddataDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class NumericFielddataDescriptor : SerializableDescriptor { internal NumericFielddataDescriptor(Action configure) => configure.Invoke(this); @@ -56,9 +56,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/IndexManagement/Queries.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs index ef70b16cddf..79df47144aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs @@ -42,8 +42,8 @@ public QueriesDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries? CacheValue { get; set; } - private CacheQueriesDescriptor CacheDescriptor { get; set; } - private Action CacheDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.CacheQueriesDescriptor CacheDescriptor { get; set; } + private Action CacheDescriptorAction { get; set; } public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries? cache) { @@ -53,7 +53,7 @@ public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.IndexManagement.Cac return Self; } - public QueriesDescriptor Cache(CacheQueriesDescriptor descriptor) + public QueriesDescriptor Cache(Elastic.Clients.Elasticsearch.IndexManagement.CacheQueriesDescriptor descriptor) { CacheValue = null; CacheDescriptorAction = null; @@ -61,7 +61,7 @@ public QueriesDescriptor Cache(CacheQueriesDescriptor descriptor) return Self; } - public QueriesDescriptor Cache(Action configure) + public QueriesDescriptor Cache(Action configure) { CacheValue = null; CacheDescriptor = null; @@ -80,7 +80,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (CacheDescriptorAction is not null) { writer.WritePropertyName("cache"); - JsonSerializer.Serialize(writer, new CacheQueriesDescriptor(CacheDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.CacheQueriesDescriptor(CacheDescriptorAction), options); } else if (CacheValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs new file mode 100644 index 00000000000..d619ee02ddd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryBytes +{ + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public Elastic.Clients.Elasticsearch.ByteSize? Recovered { get; init; } + [JsonInclude, JsonPropertyName("recovered_from_snapshot")] + public Elastic.Clients.Elasticsearch.ByteSize? RecoveredFromSnapshot { get; init; } + [JsonInclude, JsonPropertyName("recovered_from_snapshot_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize? RecoveredFromSnapshotInBytes { get; init; } + [JsonInclude, JsonPropertyName("recovered_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize RecoveredInBytes { get; init; } + [JsonInclude, JsonPropertyName("reused")] + public Elastic.Clients.Elasticsearch.ByteSize? Reused { get; init; } + [JsonInclude, JsonPropertyName("reused_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize ReusedInBytes { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.ByteSize? Total { get; init; } + [JsonInclude, JsonPropertyName("total_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs new file mode 100644 index 00000000000..a899e6a73ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryFiles +{ + [JsonInclude, JsonPropertyName("details")] + public IReadOnlyCollection? Details { get; init; } + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } + [JsonInclude, JsonPropertyName("reused")] + public long Reused { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs new file mode 100644 index 00000000000..54ebae2c15f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryIndexStatus +{ + [JsonInclude, JsonPropertyName("bytes")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes? Bytes { get; init; } + [JsonInclude, JsonPropertyName("files")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles Files { get; init; } + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes Size { get; init; } + [JsonInclude, JsonPropertyName("source_throttle_time")] + public Elastic.Clients.Elasticsearch.Duration? SourceThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("source_throttle_time_in_millis")] + public long SourceThrottleTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("target_throttle_time")] + public Elastic.Clients.Elasticsearch.Duration? TargetThrottleTime { get; init; } + [JsonInclude, JsonPropertyName("target_throttle_time_in_millis")] + public long TargetThrottleTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.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/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs new file mode 100644 index 00000000000..c654c84889d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryOrigin +{ + [JsonInclude, JsonPropertyName("bootstrap_new_history_uuid")] + public bool? BootstrapNewHistoryUuid { get; init; } + [JsonInclude, JsonPropertyName("host")] + public string? Host { get; init; } + [JsonInclude, JsonPropertyName("hostname")] + public string? Hostname { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string? Id { get; init; } + [JsonInclude, JsonPropertyName("index")] + public string? Index { get; init; } + [JsonInclude, JsonPropertyName("ip")] + public string? Ip { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; init; } + [JsonInclude, JsonPropertyName("restoreUUID")] + public string? Restoreuuid { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string? Snapshot { get; init; } + [JsonInclude, JsonPropertyName("transport_address")] + public string? TransportAddress { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs new file mode 100644 index 00000000000..a4d034dbb0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryStartStatus +{ + [JsonInclude, JsonPropertyName("check_index_time")] + public Elastic.Clients.Elasticsearch.Duration? CheckIndexTime { get; init; } + [JsonInclude, JsonPropertyName("check_index_time_in_millis")] + public long CheckIndexTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.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/_Generated/Types/IndexManagement/RecoveryStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs new file mode 100644 index 00000000000..c4796ec355d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class RecoveryStatus +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyCollection Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs new file mode 100644 index 00000000000..e0e09696cee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ReloadDetails +{ + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("reloaded_analyzers")] + public IReadOnlyCollection ReloadedAnalyzers { get; init; } + [JsonInclude, JsonPropertyName("reloaded_node_ids")] + public IReadOnlyCollection ReloadedNodeIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs new file mode 100644 index 00000000000..22e6b0f1950 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ReloadResult +{ + [JsonInclude, JsonPropertyName("reload_details")] + public IReadOnlyCollection ReloadDetails { get; init; } + [JsonInclude, JsonPropertyName("_shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs index c69247a04d7..89090e051af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs @@ -60,7 +60,7 @@ public sealed partial class RemoveAction [JsonInclude, JsonPropertyName("must_exist")] public bool? MustExist { get; set; } - public static implicit operator Action(RemoveAction removeAction) => IndexManagement.Action.Remove(removeAction); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction(RemoveAction removeAction) => Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction.Remove(removeAction); } public sealed partial class RemoveActionDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs index 149a252f99a..7d7b1586d04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs @@ -47,7 +47,7 @@ public sealed partial class RemoveIndexAction [JsonInclude, JsonPropertyName("must_exist")] public bool? MustExist { get; set; } - public static implicit operator Action(RemoveIndexAction removeIndexAction) => IndexManagement.Action.RemoveIndex(removeIndexAction); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction(RemoveIndexAction removeIndexAction) => Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction.RemoveIndex(removeIndexAction); } public sealed partial class RemoveIndexActionDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs new file mode 100644 index 00000000000..a6c8ee1555a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +/// +/// Provides information about each cluster request relevant to doing a cross-cluster search. +/// +public sealed partial class ResolveClusterInfo +{ + /// + /// Whether the remote cluster is connected to the local (querying) cluster. + /// + [JsonInclude, JsonPropertyName("connected")] + public bool Connected { get; init; } + + /// + /// Provides error messages that are likely to occur if you do a search with this index expression
on the specified cluster (e.g., lack of security privileges to query an index).
+ ///
+ [JsonInclude, JsonPropertyName("error")] + public string? Error { get; init; } + + /// + /// Whether the index expression provided in the request matches any indices, aliases or data streams
on the cluster.
+ ///
+ [JsonInclude, JsonPropertyName("matching_indices")] + public bool? MatchingIndices { get; init; } + + /// + /// The skip_unavailable setting for a remote cluster. + /// + [JsonInclude, JsonPropertyName("skip_unavailable")] + public bool SkipUnavailable { get; init; } + + /// + /// Provides version information about the cluster. + /// + [JsonInclude, JsonPropertyName("version")] + public Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs new file mode 100644 index 00000000000..fee1e4ee883 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ResolveIndexAliasItem +{ + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs new file mode 100644 index 00000000000..bde3f17ffea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ResolveIndexDataStreamsItem +{ + [JsonInclude, JsonPropertyName("backing_indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection BackingIndices { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("timestamp_field")] + public string TimestampField { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs new file mode 100644 index 00000000000..588cb493527 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ResolveIndexItem +{ + [JsonInclude, JsonPropertyName("aliases")] + public IReadOnlyCollection? Aliases { get; init; } + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyCollection Attributes { get; init; } + [JsonInclude, JsonPropertyName("data_stream")] + public string? DataStream { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs index f74050c9045..bd063e40ea7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -184,10 +184,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MaxAgeValue, options); } - if (MaxAgeMillisValue is not null) + if (MaxAgeMillisValue.HasValue) { writer.WritePropertyName("max_age_millis"); - JsonSerializer.Serialize(writer, MaxAgeMillisValue, options); + writer.WriteNumberValue(MaxAgeMillisValue.Value); } if (MaxDocsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs new file mode 100644 index 00000000000..e67acb2be9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class Segment +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("committed")] + public bool Committed { get; init; } + [JsonInclude, JsonPropertyName("compound")] + public bool Compound { get; init; } + [JsonInclude, JsonPropertyName("deleted_docs")] + public long DeletedDocs { get; init; } + [JsonInclude, JsonPropertyName("generation")] + public int Generation { get; init; } + [JsonInclude, JsonPropertyName("num_docs")] + public long NumDocs { get; init; } + [JsonInclude, JsonPropertyName("search")] + public bool Search { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public double SizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs index 8cd9ad4c02a..c848a55f254 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs @@ -30,7 +30,6 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class SettingsAnalyze { [JsonInclude, JsonPropertyName("max_token_count")] - [JsonConverter(typeof(StringifiedIntegerConverter))] public int? MaxTokenCount { get; set; } } @@ -53,10 +52,10 @@ public SettingsAnalyzeDescriptor MaxTokenCount(int? maxTokenCount) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - if (MaxTokenCountValue is not null) + if (MaxTokenCountValue.HasValue) { writer.WritePropertyName("max_token_count"); - JsonSerializer.Serialize(writer, MaxTokenCountValue, options); + writer.WriteNumberValue(MaxTokenCountValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs index 000226f0493..af44bd56911 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs @@ -30,7 +30,6 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class SettingsQueryString { [JsonInclude, JsonPropertyName("lenient")] - [JsonConverter(typeof(StringifiedBoolConverter))] public bool Lenient { get; set; } } @@ -54,7 +53,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WriteStartObject(); writer.WritePropertyName("lenient"); - JsonSerializer.Serialize(writer, LenientValue, options); + writer.WriteBooleanValue(LenientValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs index a9c5ec19506..d50a4f9fbc3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs @@ -44,11 +44,11 @@ public SettingsSearchDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle? IdleValue { get; set; } - private SearchIdleDescriptor IdleDescriptor { get; set; } - private Action IdleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SearchIdleDescriptor IdleDescriptor { get; set; } + private Action IdleDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings? SlowlogValue { get; set; } - private SlowlogSettingsDescriptor SlowlogDescriptor { get; set; } - private Action SlowlogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettingsDescriptor SlowlogDescriptor { get; set; } + private Action SlowlogDescriptorAction { get; set; } public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle? idle) { @@ -58,7 +58,7 @@ public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.IndexManageme return Self; } - public SettingsSearchDescriptor Idle(SearchIdleDescriptor descriptor) + public SettingsSearchDescriptor Idle(Elastic.Clients.Elasticsearch.IndexManagement.SearchIdleDescriptor descriptor) { IdleValue = null; IdleDescriptorAction = null; @@ -66,7 +66,7 @@ public SettingsSearchDescriptor Idle(SearchIdleDescriptor descriptor) return Self; } - public SettingsSearchDescriptor Idle(Action configure) + public SettingsSearchDescriptor Idle(Action configure) { IdleValue = null; IdleDescriptor = null; @@ -82,7 +82,7 @@ public SettingsSearchDescriptor Slowlog(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public SettingsSearchDescriptor Slowlog(SlowlogSettingsDescriptor descriptor) + public SettingsSearchDescriptor Slowlog(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettingsDescriptor descriptor) { SlowlogValue = null; SlowlogDescriptorAction = null; @@ -90,7 +90,7 @@ public SettingsSearchDescriptor Slowlog(SlowlogSettingsDescriptor descriptor) return Self; } - public SettingsSearchDescriptor Slowlog(Action configure) + public SettingsSearchDescriptor Slowlog(Action configure) { SlowlogValue = null; SlowlogDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IdleDescriptorAction is not null) { writer.WritePropertyName("idle"); - JsonSerializer.Serialize(writer, new SearchIdleDescriptor(IdleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SearchIdleDescriptor(IdleDescriptorAction), options); } else if (IdleValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SlowlogDescriptorAction is not null) { writer.WritePropertyName("slowlog"); - JsonSerializer.Serialize(writer, new SlowlogSettingsDescriptor(SlowlogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettingsDescriptor(SlowlogDescriptorAction), options); } else if (SlowlogValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs new file mode 100644 index 00000000000..49db5a56af3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.IndexManagement; + +public partial class SettingsSimilarities : IsADictionary +{ + public SettingsSimilarities() + { + } + + public SettingsSimilarities(IDictionary container) : base(container) + { + } + + public void Add(string name, ISettingsSimilarity settingsSimilarity) => BackingDictionary.Add(Sanitize(name), settingsSimilarity); + public bool TryGetSettingsSimilarity(string name, [NotNullWhen(returnValue: true)] out ISettingsSimilarity settingsSimilarity) => BackingDictionary.TryGetValue(Sanitize(name), out settingsSimilarity); + + public bool TryGetSettingsSimilarity(string name, [NotNullWhen(returnValue: true)] out T? settingsSimilarity) where T : class, ISettingsSimilarity + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + settingsSimilarity = finalValue; + return true; + } + + settingsSimilarity = null; + return false; + } +} + +public sealed partial class SettingsSimilaritiesDescriptor : IsADictionaryDescriptor +{ + public SettingsSimilaritiesDescriptor() : base(new SettingsSimilarities()) + { + } + + public SettingsSimilaritiesDescriptor(SettingsSimilarities settingsSimilarities) : base(settingsSimilarities ?? new SettingsSimilarities()) + { + } + + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Bm25(string settingsSimilarityName, SettingsSimilarityBm25 settingsSimilarityBm25) => AssignVariant(settingsSimilarityName, settingsSimilarityBm25); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Boolean(string settingsSimilarityName, SettingsSimilarityBoolean settingsSimilarityBoolean) => AssignVariant(settingsSimilarityName, settingsSimilarityBoolean); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Dfi(string settingsSimilarityName, SettingsSimilarityDfi settingsSimilarityDfi) => AssignVariant(settingsSimilarityName, settingsSimilarityDfi); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Dfr(string settingsSimilarityName, SettingsSimilarityDfr settingsSimilarityDfr) => AssignVariant(settingsSimilarityName, settingsSimilarityDfr); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Ib(string settingsSimilarityName, SettingsSimilarityIb settingsSimilarityIb) => AssignVariant(settingsSimilarityName, settingsSimilarityIb); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Lmd(string settingsSimilarityName, SettingsSimilarityLmd settingsSimilarityLmd) => AssignVariant(settingsSimilarityName, settingsSimilarityLmd); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Lmj(string settingsSimilarityName, SettingsSimilarityLmj settingsSimilarityLmj) => AssignVariant(settingsSimilarityName, settingsSimilarityLmj); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName) => AssignVariant(settingsSimilarityName, null); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName, Action configure) => AssignVariant(settingsSimilarityName, configure); + public SettingsSimilaritiesDescriptor Scripted(string settingsSimilarityName, SettingsSimilarityScripted settingsSimilarityScripted) => AssignVariant(settingsSimilarityName, settingsSimilarityScripted); +} + +internal sealed partial class SettingsSimilarityInterfaceConverter : JsonConverter +{ + public override ISettingsSimilarity 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 "BM25": + return JsonSerializer.Deserialize(ref reader, options); + case "boolean": + return JsonSerializer.Deserialize(ref reader, options); + case "DFI": + return JsonSerializer.Deserialize(ref reader, options); + case "DFR": + return JsonSerializer.Deserialize(ref reader, options); + case "IB": + return JsonSerializer.Deserialize(ref reader, options); + case "LMDirichlet": + return JsonSerializer.Deserialize(ref reader, options); + case "LMJelinekMercer": + return JsonSerializer.Deserialize(ref reader, options); + case "scripted": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(ISettingsSimilarity)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, ISettingsSimilarity value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "BM25": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25), options); + return; + case "boolean": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean), options); + return; + case "DFI": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi), options); + return; + case "DFR": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr), options); + return; + case "IB": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb), options); + return; + case "LMDirichlet": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd), options); + return; + case "LMJelinekMercer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj), options); + return; + case "scripted": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(SettingsSimilarityInterfaceConverter))] +public partial interface ISettingsSimilarity +{ + public string? Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs deleted file mode 100644 index 00766e3a55c..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs +++ /dev/null @@ -1,363 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -public sealed partial class SettingsSimilarity -{ - [JsonInclude, JsonPropertyName("bm25")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25? Bm25 { get; set; } - [JsonInclude, JsonPropertyName("dfi")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi? Dfi { get; set; } - [JsonInclude, JsonPropertyName("dfr")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr? Dfr { get; set; } - [JsonInclude, JsonPropertyName("ib")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb? Ib { get; set; } - [JsonInclude, JsonPropertyName("lmd")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd? Lmd { get; set; } - [JsonInclude, JsonPropertyName("lmj")] - public Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj? Lmj { get; set; } - [JsonInclude, JsonPropertyName("scripted_tfidf")] - public Elastic.Clients.Elasticsearch.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.IndexManagement.SettingsSimilarityBm25? Bm25Value { get; set; } - private SettingsSimilarityBm25Descriptor Bm25Descriptor { get; set; } - private Action Bm25DescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi? DfiValue { get; set; } - private SettingsSimilarityDfiDescriptor DfiDescriptor { get; set; } - private Action DfiDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr? DfrValue { get; set; } - private SettingsSimilarityDfrDescriptor DfrDescriptor { get; set; } - private Action DfrDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb? IbValue { get; set; } - private SettingsSimilarityIbDescriptor IbDescriptor { get; set; } - private Action IbDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd? LmdValue { get; set; } - private SettingsSimilarityLmdDescriptor LmdDescriptor { get; set; } - private Action LmdDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj? LmjValue { get; set; } - private SettingsSimilarityLmjDescriptor LmjDescriptor { get; set; } - private Action LmjDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScriptedTfidf? ScriptedTfidfValue { get; set; } - private SettingsSimilarityScriptedTfidfDescriptor ScriptedTfidfDescriptor { get; set; } - private Action ScriptedTfidfDescriptorAction { get; set; } - - public SettingsSimilarityDescriptor Bm25(Elastic.Clients.Elasticsearch.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.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.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.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.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.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.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/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs index 1f64cabed29..4c05bb1d2d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs @@ -27,20 +27,20 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityBm25 +public sealed partial class SettingsSimilarityBm25 : ISettingsSimilarity { [JsonInclude, JsonPropertyName("b")] - public double b { get; set; } + public double? b { get; set; } [JsonInclude, JsonPropertyName("discount_overlaps")] - public bool DiscountOverlaps { get; set; } + public bool? DiscountOverlaps { get; set; } [JsonInclude, JsonPropertyName("k1")] - public double K1 { get; set; } + public double? K1 { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "BM25"; } -public sealed partial class SettingsSimilarityBm25Descriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityBm25Descriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityBm25Descriptor(Action configure) => configure.Invoke(this); @@ -48,23 +48,23 @@ public SettingsSimilarityBm25Descriptor() : base() { } - private double bValue { get; set; } - private bool DiscountOverlapsValue { get; set; } - private double K1Value { get; set; } + private double? bValue { get; set; } + private bool? DiscountOverlapsValue { get; set; } + private double? K1Value { get; set; } - public SettingsSimilarityBm25Descriptor b(double b) + public SettingsSimilarityBm25Descriptor b(double? b) { bValue = b; return Self; } - public SettingsSimilarityBm25Descriptor DiscountOverlaps(bool discountOverlaps = true) + public SettingsSimilarityBm25Descriptor DiscountOverlaps(bool? discountOverlaps = true) { DiscountOverlapsValue = discountOverlaps; return Self; } - public SettingsSimilarityBm25Descriptor K1(double k1) + public SettingsSimilarityBm25Descriptor K1(double? k1) { K1Value = k1; return Self; @@ -73,14 +73,33 @@ public SettingsSimilarityBm25Descriptor K1(double k1) 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); + if (bValue.HasValue) + { + writer.WritePropertyName("b"); + writer.WriteNumberValue(bValue.Value); + } + + if (DiscountOverlapsValue.HasValue) + { + writer.WritePropertyName("discount_overlaps"); + writer.WriteBooleanValue(DiscountOverlapsValue.Value); + } + + if (K1Value.HasValue) + { + writer.WritePropertyName("k1"); + writer.WriteNumberValue(K1Value.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("BM25"); writer.WriteEndObject(); } + + SettingsSimilarityBm25 IBuildableDescriptor.Build() => new() + { + b = bValue, + DiscountOverlaps = DiscountOverlapsValue, + K1 = K1Value + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs similarity index 66% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs index ca7b01dad08..152ce54095e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScriptedTfidf.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs @@ -27,38 +27,29 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityScriptedTfidf +public sealed partial class SettingsSimilarityBoolean : ISettingsSimilarity { - [JsonInclude, JsonPropertyName("script")] - public Elastic.Clients.Elasticsearch.Script Script { get; set; } - [JsonInclude, JsonPropertyName("type")] - public string Type => "scripted"; + public string Type => "boolean"; } -public sealed partial class SettingsSimilarityScriptedTfidfDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityBooleanDescriptor : SerializableDescriptor, IBuildableDescriptor { - internal SettingsSimilarityScriptedTfidfDescriptor(Action configure) => configure.Invoke(this); + internal SettingsSimilarityBooleanDescriptor(Action configure) => configure.Invoke(this); - public SettingsSimilarityScriptedTfidfDescriptor() : base() + public SettingsSimilarityBooleanDescriptor() : base() { } - private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } - - public SettingsSimilarityScriptedTfidfDescriptor Script(Elastic.Clients.Elasticsearch.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.WriteStringValue("boolean"); writer.WriteEndObject(); } + + SettingsSimilarityBoolean IBuildableDescriptor.Build() => new() + { + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs index bf46e170f92..7afd7c74faf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityDfi +public sealed partial class SettingsSimilarityDfi : ISettingsSimilarity { [JsonInclude, JsonPropertyName("independence_measure")] public Elastic.Clients.Elasticsearch.DFIIndependenceMeasure IndependenceMeasure { get; set; } @@ -36,7 +36,7 @@ public sealed partial class SettingsSimilarityDfi public string Type => "DFI"; } -public sealed partial class SettingsSimilarityDfiDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityDfiDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityDfiDescriptor(Action configure) => configure.Invoke(this); @@ -61,4 +61,9 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("DFI"); writer.WriteEndObject(); } + + SettingsSimilarityDfi IBuildableDescriptor.Build() => new() + { + IndependenceMeasure = IndependenceMeasureValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs index e60d0306cb0..6ec1d24507c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityDfr +public sealed partial class SettingsSimilarityDfr : ISettingsSimilarity { [JsonInclude, JsonPropertyName("after_effect")] public Elastic.Clients.Elasticsearch.DFRAfterEffect AfterEffect { get; set; } @@ -40,7 +40,7 @@ public sealed partial class SettingsSimilarityDfr public string Type => "DFR"; } -public sealed partial class SettingsSimilarityDfrDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityDfrDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityDfrDescriptor(Action configure) => configure.Invoke(this); @@ -83,4 +83,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("DFR"); writer.WriteEndObject(); } + + SettingsSimilarityDfr IBuildableDescriptor.Build() => new() + { + AfterEffect = AfterEffectValue, + BasicModel = BasicModelValue, + Normalization = NormalizationValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs index f66cf9b9dd9..25a268377ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityIb +public sealed partial class SettingsSimilarityIb : ISettingsSimilarity { [JsonInclude, JsonPropertyName("distribution")] public Elastic.Clients.Elasticsearch.IBDistribution Distribution { get; set; } @@ -40,7 +40,7 @@ public sealed partial class SettingsSimilarityIb public string Type => "IB"; } -public sealed partial class SettingsSimilarityIbDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityIbDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityIbDescriptor(Action configure) => configure.Invoke(this); @@ -83,4 +83,11 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue("IB"); writer.WriteEndObject(); } + + SettingsSimilarityIb IBuildableDescriptor.Build() => new() + { + Distribution = DistributionValue, + Lambda = LambdaValue, + Normalization = NormalizationValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs index 0e6c3c3faee..758aea7ad7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs @@ -27,16 +27,16 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityLmd +public sealed partial class SettingsSimilarityLmd : ISettingsSimilarity { [JsonInclude, JsonPropertyName("mu")] - public int Mu { get; set; } + public double? Mu { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "LMDirichlet"; } -public sealed partial class SettingsSimilarityLmdDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityLmdDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityLmdDescriptor(Action configure) => configure.Invoke(this); @@ -44,9 +44,9 @@ public SettingsSimilarityLmdDescriptor() : base() { } - private int MuValue { get; set; } + private double? MuValue { get; set; } - public SettingsSimilarityLmdDescriptor Mu(int mu) + public SettingsSimilarityLmdDescriptor Mu(double? mu) { MuValue = mu; return Self; @@ -55,10 +55,19 @@ public SettingsSimilarityLmdDescriptor Mu(int mu) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("mu"); - writer.WriteNumberValue(MuValue); + if (MuValue.HasValue) + { + writer.WritePropertyName("mu"); + writer.WriteNumberValue(MuValue.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("LMDirichlet"); writer.WriteEndObject(); } + + SettingsSimilarityLmd IBuildableDescriptor.Build() => new() + { + Mu = MuValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs index f96c1f51658..e152f81886e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs @@ -27,16 +27,16 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -public sealed partial class SettingsSimilarityLmj +public sealed partial class SettingsSimilarityLmj : ISettingsSimilarity { [JsonInclude, JsonPropertyName("lambda")] - public double Lambda { get; set; } + public double? Lambda { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "LMJelinekMercer"; } -public sealed partial class SettingsSimilarityLmjDescriptor : SerializableDescriptor +public sealed partial class SettingsSimilarityLmjDescriptor : SerializableDescriptor, IBuildableDescriptor { internal SettingsSimilarityLmjDescriptor(Action configure) => configure.Invoke(this); @@ -44,9 +44,9 @@ public SettingsSimilarityLmjDescriptor() : base() { } - private double LambdaValue { get; set; } + private double? LambdaValue { get; set; } - public SettingsSimilarityLmjDescriptor Lambda(double lambda) + public SettingsSimilarityLmjDescriptor Lambda(double? lambda) { LambdaValue = lambda; return Self; @@ -55,10 +55,19 @@ public SettingsSimilarityLmjDescriptor Lambda(double lambda) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("lambda"); - writer.WriteNumberValue(LambdaValue); + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("LMJelinekMercer"); writer.WriteEndObject(); } + + SettingsSimilarityLmj IBuildableDescriptor.Build() => new() + { + Lambda = LambdaValue + }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs new file mode 100644 index 00000000000..ae6a1c5b527 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class SettingsSimilarityScripted : ISettingsSimilarity +{ + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script Script { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "scripted"; + + [JsonInclude, JsonPropertyName("weight_script")] + public Elastic.Clients.Elasticsearch.Script? WeightScript { get; set; } +} + +public sealed partial class SettingsSimilarityScriptedDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SettingsSimilarityScriptedDescriptor(Action configure) => configure.Invoke(this); + + public SettingsSimilarityScriptedDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? WeightScriptValue { get; set; } + + public SettingsSimilarityScriptedDescriptor Script(Elastic.Clients.Elasticsearch.Script script) + { + ScriptValue = script; + return Self; + } + + public SettingsSimilarityScriptedDescriptor WeightScript(Elastic.Clients.Elasticsearch.Script? weightScript) + { + WeightScriptValue = weightScript; + 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"); + if (WeightScriptValue is not null) + { + writer.WritePropertyName("weight_script"); + JsonSerializer.Serialize(writer, WeightScriptValue, options); + } + + writer.WriteEndObject(); + } + + SettingsSimilarityScripted IBuildableDescriptor.Build() => new() + { + Script = ScriptValue, + WeightScript = WeightScriptValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs new file mode 100644 index 00000000000..6909feabb62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardRecovery +{ + [JsonInclude, JsonPropertyName("id")] + public long Id { get; init; } + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus Index { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin Source { get; init; } + [JsonInclude, JsonPropertyName("stage")] + public string Stage { get; init; } + [JsonInclude, JsonPropertyName("start")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus? Start { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("stop_time")] + public DateTimeOffset? StopTime { get; init; } + [JsonInclude, JsonPropertyName("stop_time_in_millis")] + public long? StopTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("target")] + public Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin Target { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.Duration? TotalTime { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_millis")] + public long TotalTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("translog")] + public Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus Translog { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } + [JsonInclude, JsonPropertyName("verify_index")] + public Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex VerifyIndex { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs new file mode 100644 index 00000000000..3a1d4589608 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardSegmentRouting +{ + [JsonInclude, JsonPropertyName("node")] + public string Node { get; init; } + [JsonInclude, JsonPropertyName("primary")] + public bool Primary { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs index 7edc1e0946d..76c31252cf3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs @@ -74,6 +74,8 @@ public sealed partial class ShardStats [JsonInclude, JsonPropertyName("shards")] [ReadOnlyIndexNameDictionaryConverter(typeof(object))] public IReadOnlyDictionary? Shards { get; init; } + [JsonInclude, JsonPropertyName("shard_stats")] + public Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats? ShardStats2 { get; init; } [JsonInclude, JsonPropertyName("store")] public Elastic.Clients.Elasticsearch.StoreStats? Store { get; init; } [JsonInclude, JsonPropertyName("translog")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs new file mode 100644 index 00000000000..45555b85e60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +internal sealed partial class ShardStoreConverter : JsonConverter +{ + public override ShardStore Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation allocation = default; + string? allocationId = default; + Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException? storeException = default; + string nodeId = default; + Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode node = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "allocation") + { + allocation = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "allocation_id") + { + allocationId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "store_exception") + { + storeException = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + nodeId = property; + reader.Read(); + node = JsonSerializer.Deserialize(ref reader, options); + } + } + + return new ShardStore { Allocation = allocation, AllocationId = allocationId, Node = node, NodeId = nodeId, StoreException = storeException }; + } + + public override void Write(Utf8JsonWriter writer, ShardStore value, JsonSerializerOptions options) + { + throw new NotImplementedException("'ShardStore' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(ShardStoreConverter))] +public sealed partial class ShardStore +{ + public Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation Allocation { get; init; } + public string? AllocationId { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode Node { get; init; } + public string NodeId { get; init; } + public Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException? StoreException { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs new file mode 100644 index 00000000000..9c8d5237ae0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardStoreException +{ + [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs new file mode 100644 index 00000000000..e7f3a201ea9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardStoreNode +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("ephemeral_id")] + public string? EphemeralId { get; init; } + [JsonInclude, JsonPropertyName("external_id")] + public string? ExternalId { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection Roles { get; init; } + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs new file mode 100644 index 00000000000..5e03fbbad98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardStoreWrapper +{ + [JsonInclude, JsonPropertyName("stores")] + public IReadOnlyCollection Stores { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs new file mode 100644 index 00000000000..6cf6304fed2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class ShardsSegment +{ + [JsonInclude, JsonPropertyName("num_committed_segments")] + public int NumCommittedSegments { get; init; } + [JsonInclude, JsonPropertyName("num_search_segments")] + public int NumSearchSegments { get; init; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting Routing { get; init; } + [JsonInclude, JsonPropertyName("segments")] + public IReadOnlyDictionary Segments { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs index e049c5ed73f..8b90454f753 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs @@ -51,8 +51,8 @@ public SlowlogSettingsDescriptor() : base() private bool? ReformatValue { get; set; } private int? SourceValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds? ThresholdValue { get; set; } - private SlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } - private Action ThresholdDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdsDescriptor ThresholdDescriptor { get; set; } + private Action ThresholdDescriptorAction { get; set; } public SlowlogSettingsDescriptor Level(string? level) { @@ -80,7 +80,7 @@ public SlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.IndexMa return Self; } - public SlowlogSettingsDescriptor Threshold(SlowlogTresholdsDescriptor descriptor) + public SlowlogSettingsDescriptor Threshold(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdsDescriptor descriptor) { ThresholdValue = null; ThresholdDescriptorAction = null; @@ -88,7 +88,7 @@ public SlowlogSettingsDescriptor Threshold(SlowlogTresholdsDescriptor descriptor return Self; } - public SlowlogSettingsDescriptor Threshold(Action configure) + public SlowlogSettingsDescriptor Threshold(Action configure) { ThresholdValue = null; ThresholdDescriptor = null; @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ThresholdDescriptorAction is not null) { writer.WritePropertyName("threshold"); - JsonSerializer.Serialize(writer, new SlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdsDescriptor(ThresholdDescriptorAction), options); } else if (ThresholdValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs index 31b3027d5fb..a470ccab3e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs @@ -44,11 +44,11 @@ public SlowlogTresholdsDescriptor() : base() } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? FetchValue { get; set; } - private SlowlogTresholdLevelsDescriptor FetchDescriptor { get; set; } - private Action FetchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor FetchDescriptor { get; set; } + private Action FetchDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? QueryValue { get; set; } - private SlowlogTresholdLevelsDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels? fetch) { @@ -58,7 +58,7 @@ public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public SlowlogTresholdsDescriptor Fetch(SlowlogTresholdLevelsDescriptor descriptor) + public SlowlogTresholdsDescriptor Fetch(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { FetchValue = null; FetchDescriptorAction = null; @@ -66,7 +66,7 @@ public SlowlogTresholdsDescriptor Fetch(SlowlogTresholdLevelsDescriptor descript return Self; } - public SlowlogTresholdsDescriptor Fetch(Action configure) + public SlowlogTresholdsDescriptor Fetch(Action configure) { FetchValue = null; FetchDescriptor = null; @@ -82,7 +82,7 @@ public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public SlowlogTresholdsDescriptor Query(SlowlogTresholdLevelsDescriptor descriptor) + public SlowlogTresholdsDescriptor Query(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -90,7 +90,7 @@ public SlowlogTresholdsDescriptor Query(SlowlogTresholdLevelsDescriptor descript return Self; } - public SlowlogTresholdsDescriptor Query(Action configure) + public SlowlogTresholdsDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -109,7 +109,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FetchDescriptorAction is not null) { writer.WritePropertyName("fetch"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(FetchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor(FetchDescriptorAction), options); } else if (FetchValue is not null) { @@ -125,7 +125,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SlowlogTresholdLevelsDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs index ab17074cacd..4ce2a5f168c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs @@ -52,8 +52,8 @@ public SoftDeletesDescriptor() : base() private bool? EnabledValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease? RetentionLeaseValue { get; set; } - private RetentionLeaseDescriptor RetentionLeaseDescriptor { get; set; } - private Action RetentionLeaseDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.RetentionLeaseDescriptor RetentionLeaseDescriptor { get; set; } + private Action RetentionLeaseDescriptorAction { get; set; } /// /// Indicates whether soft deletes are enabled on the index. @@ -75,7 +75,7 @@ public SoftDeletesDescriptor RetentionLease(Elastic.Clients.Elasticsearch.IndexM return Self; } - public SoftDeletesDescriptor RetentionLease(RetentionLeaseDescriptor descriptor) + public SoftDeletesDescriptor RetentionLease(Elastic.Clients.Elasticsearch.IndexManagement.RetentionLeaseDescriptor descriptor) { RetentionLeaseValue = null; RetentionLeaseDescriptorAction = null; @@ -83,7 +83,7 @@ public SoftDeletesDescriptor RetentionLease(RetentionLeaseDescriptor descriptor) return Self; } - public SoftDeletesDescriptor RetentionLease(Action configure) + public SoftDeletesDescriptor RetentionLease(Action configure) { RetentionLeaseValue = null; RetentionLeaseDescriptor = null; @@ -108,7 +108,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RetentionLeaseDescriptorAction is not null) { writer.WritePropertyName("retention_lease"); - JsonSerializer.Serialize(writer, new RetentionLeaseDescriptor(RetentionLeaseDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.RetentionLeaseDescriptor(RetentionLeaseDescriptorAction), options); } else if (RetentionLeaseValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs index 3d527c7f3f3..a64d9721337 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs @@ -33,7 +33,7 @@ public sealed partial class TemplateMapping [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Alias))] public IReadOnlyDictionary Aliases { get; init; } [JsonInclude, JsonPropertyName("index_patterns")] - public IReadOnlyCollection IndexPatterns { get; init; } + public IReadOnlyCollection IndexPatterns { get; init; } [JsonInclude, JsonPropertyName("mappings")] public Elastic.Clients.Elasticsearch.Mapping.TypeMapping Mappings { get; init; } [JsonInclude, JsonPropertyName("order")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs new file mode 100644 index 00000000000..4fa9f229093 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class TokenDetail +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("tokens")] + public IReadOnlyCollection Tokens { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs index 114c8e6d065..779e0d87702 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs @@ -61,8 +61,8 @@ public TranslogDescriptor() : base() private Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability? DurabilityValue { get; set; } private Elastic.Clients.Elasticsearch.ByteSize? FlushThresholdSizeValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention? RetentionValue { get; set; } - private TranslogRetentionDescriptor RetentionDescriptor { get; set; } - private Action RetentionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetentionDescriptor RetentionDescriptor { get; set; } + private Action RetentionDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Duration? SyncIntervalValue { get; set; } /// @@ -91,7 +91,7 @@ public TranslogDescriptor Retention(Elastic.Clients.Elasticsearch.IndexManagemen return Self; } - public TranslogDescriptor Retention(TranslogRetentionDescriptor descriptor) + public TranslogDescriptor Retention(Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetentionDescriptor descriptor) { RetentionValue = null; RetentionDescriptorAction = null; @@ -99,7 +99,7 @@ public TranslogDescriptor Retention(TranslogRetentionDescriptor descriptor) return Self; } - public TranslogDescriptor Retention(Action configure) + public TranslogDescriptor Retention(Action configure) { RetentionValue = null; RetentionDescriptor = null; @@ -139,7 +139,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RetentionDescriptorAction is not null) { writer.WritePropertyName("retention"); - JsonSerializer.Serialize(writer, new TranslogRetentionDescriptor(RetentionDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetentionDescriptor(RetentionDescriptorAction), options); } else if (RetentionValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs new file mode 100644 index 00000000000..d0a4adce47e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class TranslogStatus +{ + [JsonInclude, JsonPropertyName("percent")] + public double Percent { get; init; } + [JsonInclude, JsonPropertyName("recovered")] + public long Recovered { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } + [JsonInclude, JsonPropertyName("total_on_start")] + public long TotalOnStart { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.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/_Generated/Types/IndexManagement/VerifyIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs new file mode 100644 index 00000000000..bccd66ad7b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class VerifyIndex +{ + [JsonInclude, JsonPropertyName("check_index_time")] + public Elastic.Clients.Elasticsearch.Duration? CheckIndexTime { get; init; } + [JsonInclude, JsonPropertyName("check_index_time_in_millis")] + public long CheckIndexTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total_time")] + public Elastic.Clients.Elasticsearch.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/_Generated/Types/IndicesOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs new file mode 100644 index 00000000000..1fe3bf56a27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +/// +/// Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded
to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.
+///
+public sealed partial class IndicesOptions +{ + /// + /// 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`.
+ ///
+ [JsonInclude, JsonPropertyName("allow_no_indices")] + public bool? AllowNoIndices { get; set; } + + /// + /// 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`.
+ ///
+ [JsonInclude, JsonPropertyName("expand_wildcards")] + [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.ExpandWildcard))] + public ICollection? ExpandWildcards { get; set; } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + [JsonInclude, JsonPropertyName("ignore_throttled")] + public bool? IgnoreThrottled { get; set; } + + /// + /// If true, missing or closed indices are not included in the response. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } +} + +/// +/// Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded
to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.
+///
+public sealed partial class IndicesOptionsDescriptor : SerializableDescriptor +{ + internal IndicesOptionsDescriptor(Action configure) => configure.Invoke(this); + + public IndicesOptionsDescriptor() : base() + { + } + + private bool? AllowNoIndicesValue { get; set; } + private ICollection? ExpandWildcardsValue { get; set; } + private bool? IgnoreThrottledValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + + /// + /// 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 IndicesOptionsDescriptor AllowNoIndices(bool? allowNoIndices = true) + { + AllowNoIndicesValue = allowNoIndices; + return Self; + } + + /// + /// 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 IndicesOptionsDescriptor ExpandWildcards(ICollection? expandWildcards) + { + ExpandWildcardsValue = expandWildcards; + return Self; + } + + /// + /// If true, concrete, expanded or aliased indices are ignored when frozen. + /// + public IndicesOptionsDescriptor IgnoreThrottled(bool? ignoreThrottled = true) + { + IgnoreThrottledValue = ignoreThrottled; + return Self; + } + + /// + /// If true, missing or closed indices are not included in the response. + /// + public IndicesOptionsDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + 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 (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); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfig.g.cs new file mode 100644 index 00000000000..705bea0b654 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +/// +/// Configuration options when storing the model config +/// +public sealed partial class ModelConfig +{ + /// + /// The service type + /// + [JsonInclude, JsonPropertyName("service")] + public string Service { get; set; } + + /// + /// Settings specific to the service + /// + [JsonInclude, JsonPropertyName("service_settings")] + public object ServiceSettings { get; set; } + + /// + /// Task settings specific to the service and model + /// + [JsonInclude, JsonPropertyName("task_settings")] + public object TaskSettings { get; set; } +} + +/// +/// Configuration options when storing the model config +/// +public sealed partial class ModelConfigDescriptor : SerializableDescriptor +{ + internal ModelConfigDescriptor(Action configure) => configure.Invoke(this); + + public ModelConfigDescriptor() : base() + { + } + + private string ServiceValue { get; set; } + private object ServiceSettingsValue { get; set; } + private object TaskSettingsValue { get; set; } + + /// + /// The service type + /// + public ModelConfigDescriptor Service(string service) + { + ServiceValue = service; + return Self; + } + + /// + /// Settings specific to the service + /// + public ModelConfigDescriptor ServiceSettings(object serviceSettings) + { + ServiceSettingsValue = serviceSettings; + return Self; + } + + /// + /// Task settings specific to the service and model + /// + public ModelConfigDescriptor TaskSettings(object taskSettings) + { + TaskSettingsValue = taskSettings; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("service"); + writer.WriteStringValue(ServiceValue); + writer.WritePropertyName("service_settings"); + JsonSerializer.Serialize(writer, ServiceSettingsValue, options); + writer.WritePropertyName("task_settings"); + JsonSerializer.Serialize(writer, TaskSettingsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfigContainer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfigContainer.g.cs new file mode 100644 index 00000000000..5059120cb46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ModelConfigContainer.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +/// +/// Represents a model as returned by the GET API +/// +public sealed partial class ModelConfigContainer +{ + /// + /// The model Id + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The service type + /// + [JsonInclude, JsonPropertyName("service")] + public string Service { get; init; } + + /// + /// Settings specific to the service + /// + [JsonInclude, JsonPropertyName("service_settings")] + public object ServiceSettings { get; init; } + + /// + /// Task settings specific to the service and model + /// + [JsonInclude, JsonPropertyName("task_settings")] + public object TaskSettings { get; init; } + + /// + /// The model's task type + /// + [JsonInclude, JsonPropertyName("task_type")] + public Elastic.Clients.Elasticsearch.Inference.TaskType TaskType { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs index 7e2f967e813..82b25d44e1b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class AppendProcessor ///
[JsonInclude, JsonPropertyName("allow_duplicates")] public bool? AllowDuplicates { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,12 +46,28 @@ public sealed partial class AppendProcessor ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -57,7 +77,7 @@ public sealed partial class AppendProcessor [JsonInclude, JsonPropertyName("value")] public ICollection Value { get; set; } - public static implicit operator Processor(AppendProcessor appendProcessor) => Ingest.Processor.Append(appendProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(AppendProcessor appendProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Append(appendProcessor); } public sealed partial class AppendProcessorDescriptor : SerializableDescriptor> @@ -74,9 +94,9 @@ public AppendProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private ICollection ValueValue { get; set; } @@ -89,6 +109,9 @@ public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicate return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AppendProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -113,18 +136,36 @@ public AppendProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be appended to.
Supports template snippets.
+ ///
+ public AppendProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public AppendProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public AppendProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -134,7 +175,7 @@ public AppendProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public AppendProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -143,7 +184,7 @@ public AppendProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public AppendProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -152,7 +193,7 @@ public AppendProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public AppendProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -161,6 +202,9 @@ public AppendProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public AppendProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -216,7 +260,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -225,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -262,9 +306,9 @@ public AppendProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private ICollection ValueValue { get; set; } @@ -277,6 +321,9 @@ public AppendProcessorDescriptor AllowDuplicates(bool? allowDuplicates = true) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AppendProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -310,18 +357,27 @@ public AppendProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public AppendProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AppendProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public AppendProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -331,7 +387,7 @@ public AppendProcessorDescriptor OnFailure(ICollection configure) + public AppendProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -349,7 +405,7 @@ public AppendProcessorDescriptor OnFailure(Action configure return Self; } - public AppendProcessorDescriptor OnFailure(params Action[] configure) + public AppendProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -358,6 +414,9 @@ public AppendProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AppendProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -413,7 +472,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -422,7 +481,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs index f6f0d705e87..62d5488fcc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class AttachmentProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class AttachmentProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -59,6 +70,10 @@ public sealed partial class AttachmentProcessor /// [JsonInclude, JsonPropertyName("indexed_chars_field")] public Elastic.Clients.Elasticsearch.Field? IndexedCharsField { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -68,11 +83,21 @@ public sealed partial class AttachmentProcessor [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + /// + /// If true, the binary field will be removed from the document + /// + [JsonInclude, JsonPropertyName("remove_binary")] + public bool? RemoveBinary { 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; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +107,7 @@ public sealed partial class AttachmentProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(AttachmentProcessor attachmentProcessor) => Ingest.Processor.Attachment(attachmentProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(AttachmentProcessor attachmentProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Attachment(attachmentProcessor); } public sealed partial class AttachmentProcessorDescriptor : SerializableDescriptor> @@ -101,14 +126,18 @@ public AttachmentProcessorDescriptor() : base() private long? IndexedCharsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? IndexedCharsFieldValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } + private bool? RemoveBinaryValue { get; set; } private string? ResourceNameValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AttachmentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -133,12 +162,27 @@ public AttachmentProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to get the base64 encoded field from. + /// + public AttachmentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public AttachmentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -181,6 +225,18 @@ public AttachmentProcessorDescriptor IndexedCharsField(Expres 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; + } + + /// + /// Handle failures for the processor. + /// public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -190,7 +246,7 @@ public AttachmentProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public AttachmentProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -199,7 +255,7 @@ public AttachmentProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public AttachmentProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -208,7 +264,7 @@ public AttachmentProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public AttachmentProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -226,6 +282,15 @@ public AttachmentProcessorDescriptor Properties(ICollection? return Self; } + /// + /// If true, the binary field will be removed from the document + /// + public AttachmentProcessorDescriptor RemoveBinary(bool? removeBinary = true) + { + RemoveBinaryValue = removeBinary; + 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.
///
@@ -235,6 +300,9 @@ public AttachmentProcessorDescriptor ResourceName(string? resourceNam return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AttachmentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -259,6 +327,15 @@ public AttachmentProcessorDescriptor TargetField(Expression + /// 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(); @@ -311,7 +388,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -320,7 +397,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -337,6 +414,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (RemoveBinaryValue.HasValue) + { + writer.WritePropertyName("remove_binary"); + writer.WriteBooleanValue(RemoveBinaryValue.Value); + } + if (!string.IsNullOrEmpty(ResourceNameValue)) { writer.WritePropertyName("resource_name"); @@ -375,14 +458,18 @@ public AttachmentProcessorDescriptor() : base() private long? IndexedCharsValue { get; set; } private Elastic.Clients.Elasticsearch.Field? IndexedCharsFieldValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } + private bool? RemoveBinaryValue { get; set; } private string? ResourceNameValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public AttachmentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -416,12 +503,18 @@ public AttachmentProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public AttachmentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public AttachmentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -473,6 +566,9 @@ public AttachmentProcessorDescriptor IndexedCharsField(Expression + /// Handle failures for the processor. + /// public AttachmentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -482,7 +578,7 @@ public AttachmentProcessorDescriptor OnFailure(ICollection configure) + public AttachmentProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -500,7 +596,7 @@ public AttachmentProcessorDescriptor OnFailure(Action confi return Self; } - public AttachmentProcessorDescriptor OnFailure(params Action[] configure) + public AttachmentProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -518,6 +614,15 @@ public AttachmentProcessorDescriptor Properties(ICollection? properties) return Self; } + /// + /// If true, the binary field will be removed from the document + /// + public AttachmentProcessorDescriptor RemoveBinary(bool? removeBinary = true) + { + RemoveBinaryValue = removeBinary; + 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.
///
@@ -527,6 +632,9 @@ public AttachmentProcessorDescriptor ResourceName(string? resourceName) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public AttachmentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -612,7 +720,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -621,7 +729,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -638,6 +746,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (RemoveBinaryValue.HasValue) + { + writer.WritePropertyName("remove_binary"); + writer.WriteBooleanValue(RemoveBinaryValue.Value); + } + if (!string.IsNullOrEmpty(ResourceNameValue)) { writer.WritePropertyName("resource_name"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs index c7a70c1d761..74929c7fab8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class BytesProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class BytesProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class BytesProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class BytesProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(BytesProcessor bytesProcessor) => Ingest.Processor.Bytes(bytesProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(BytesProcessor bytesProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Bytes(bytesProcessor); } public sealed partial class BytesProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public BytesProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public BytesProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public BytesProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to convert. + /// + public BytesProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public BytesProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public BytesProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public BytesProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public BytesProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public BytesProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public BytesProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public BytesProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public BytesProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public BytesProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public BytesProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public BytesProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public BytesProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public BytesProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public BytesProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public BytesProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public BytesProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public BytesProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public BytesProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public BytesProcessorDescriptor OnFailure(ICollection configure) + public BytesProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public BytesProcessorDescriptor OnFailure(Action configure) return Self; } - public BytesProcessorDescriptor OnFailure(params Action[] configure) + public BytesProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public BytesProcessorDescriptor OnFailure(params Action[] c return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public BytesProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs index d1233805dba..303356ba6cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class CircleProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class CircleProcessor /// [JsonInclude, JsonPropertyName("shape_type")] public Elastic.Clients.Elasticsearch.Ingest.ShapeType ShapeType { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class CircleProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(CircleProcessor circleProcessor) => Ingest.Processor.Circle(circleProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(CircleProcessor circleProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Circle(circleProcessor); } public sealed partial class CircleProcessorDescriptor : SerializableDescriptor> @@ -88,13 +107,16 @@ public CircleProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.ShapeType ShapeTypeValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CircleProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -128,12 +150,27 @@ public CircleProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public CircleProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -149,6 +186,9 @@ public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public CircleProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -158,7 +198,7 @@ public CircleProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public CircleProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -167,7 +207,7 @@ public CircleProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public CircleProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -176,7 +216,7 @@ public CircleProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public CircleProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsea return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CircleProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public CircleProcessorDescriptor TargetField(Expression + /// 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(); @@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -269,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -313,13 +365,16 @@ public CircleProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.ShapeType ShapeTypeValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CircleProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -362,12 +417,18 @@ public CircleProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public CircleProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CircleProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -383,6 +444,9 @@ public CircleProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public CircleProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -392,7 +456,7 @@ public CircleProcessorDescriptor OnFailure(ICollection configure) + public CircleProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -410,7 +474,7 @@ public CircleProcessorDescriptor OnFailure(Action configure return Self; } - public CircleProcessorDescriptor OnFailure(params Action[] configure) + public CircleProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -428,6 +492,9 @@ public CircleProcessorDescriptor ShapeType(Elastic.Clients.Elasticsearch.Ingest. return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CircleProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -503,7 +570,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -512,7 +579,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs index 9e50c5b8e03..34b4102e8ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class ConvertProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class ConvertProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class ConvertProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -64,7 +83,7 @@ public sealed partial class ConvertProcessor [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.Ingest.ConvertType Type { get; set; } - public static implicit operator Processor(ConvertProcessor convertProcessor) => Ingest.Processor.Convert(convertProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(ConvertProcessor convertProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Convert(convertProcessor); } public sealed partial class ConvertProcessorDescriptor : SerializableDescriptor> @@ -81,13 +100,16 @@ public ConvertProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.ConvertType TypeValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ConvertProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -112,12 +134,27 @@ public ConvertProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field whose value is to be converted. + /// + public ConvertProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ConvertProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -133,6 +170,9 @@ public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -142,7 +182,7 @@ public ConvertProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public ConvertProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -151,7 +191,7 @@ public ConvertProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public ConvertProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -160,7 +200,7 @@ public ConvertProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public ConvertProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -169,6 +209,9 @@ public ConvertProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public ConvertProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -193,6 +236,15 @@ public ConvertProcessorDescriptor TargetField(Expression + /// 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. /// @@ -242,7 +294,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -251,7 +303,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -294,13 +346,16 @@ public ConvertProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.ConvertType TypeValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ConvertProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -334,12 +389,18 @@ public ConvertProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public ConvertProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ConvertProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -355,6 +416,9 @@ public ConvertProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public ConvertProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -364,7 +428,7 @@ public ConvertProcessorDescriptor OnFailure(ICollection configure) + public ConvertProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -382,7 +446,7 @@ public ConvertProcessorDescriptor OnFailure(Action configur return Self; } - public ConvertProcessorDescriptor OnFailure(params Action[] configure) + public ConvertProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -391,6 +455,9 @@ public ConvertProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public ConvertProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -473,7 +540,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -482,7 +549,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs index 8760d328fb2..1b321131133 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class CsvProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -67,6 +82,10 @@ public sealed partial class CsvProcessor /// [JsonInclude, JsonPropertyName("separator")] public string? Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +101,7 @@ public sealed partial class CsvProcessor [JsonInclude, JsonPropertyName("trim")] public bool? Trim { get; set; } - public static implicit operator Processor(CsvProcessor csvProcessor) => Ingest.Processor.Csv(csvProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(CsvProcessor csvProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Csv(csvProcessor); } public sealed partial class CsvProcessorDescriptor : SerializableDescriptor> @@ -100,15 +119,18 @@ public CsvProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? QuoteValue { get; set; } private string? SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Fields TargetFieldsValue { get; set; } private bool? TrimValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CsvProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -142,12 +164,27 @@ public CsvProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to extract data from. + /// + public CsvProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public CsvProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -163,6 +200,9 @@ public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tru return Self; } + /// + /// Handle failures for the processor. + /// public CsvProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -172,7 +212,7 @@ public CsvProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public CsvProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -181,7 +221,7 @@ public CsvProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public CsvProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -190,7 +230,7 @@ public CsvProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public CsvProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -217,6 +257,9 @@ public CsvProcessorDescriptor Separator(string? separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CsvProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -287,7 +330,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -296,7 +339,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -352,15 +395,18 @@ public CsvProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? QuoteValue { get; set; } private string? SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Fields TargetFieldsValue { get; set; } private bool? TrimValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public CsvProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -403,12 +449,18 @@ public CsvProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public CsvProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public CsvProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -424,6 +476,9 @@ public CsvProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public CsvProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -433,7 +488,7 @@ public CsvProcessorDescriptor OnFailure(ICollection configure) + public CsvProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -451,7 +506,7 @@ public CsvProcessorDescriptor OnFailure(Action configure) return Self; } - public CsvProcessorDescriptor OnFailure(params Action[] configure) + public CsvProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -478,6 +533,9 @@ public CsvProcessorDescriptor Separator(string? separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public CsvProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -548,7 +606,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -557,7 +615,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs index d1304d6f130..3e2143aa790 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs @@ -40,6 +40,10 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("date_rounding")] public string DateRounding { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -48,8 +52,16 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -70,8 +82,16 @@ public sealed partial class DateIndexNameProcessor /// [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -81,7 +101,7 @@ public sealed partial class DateIndexNameProcessor [JsonInclude, JsonPropertyName("timezone")] public string? Timezone { get; set; } - public static implicit operator Processor(DateIndexNameProcessor dateIndexNameProcessor) => Ingest.Processor.DateIndexName(dateIndexNameProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(DateIndexNameProcessor dateIndexNameProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.DateIndexName(dateIndexNameProcessor); } public sealed partial class DateIndexNameProcessorDescriptor : SerializableDescriptor> @@ -102,9 +122,9 @@ public DateIndexNameProcessorDescriptor() : base() private string? IndexNamePrefixValue { get; set; } private string? LocaleValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private string? TimezoneValue { get; set; } @@ -126,6 +146,9 @@ public DateIndexNameProcessorDescriptor DateRounding(string dateRound return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateIndexNameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -150,12 +173,27 @@ public DateIndexNameProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to get the date or timestamp from. + /// + public DateIndexNameProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public DateIndexNameProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -189,6 +227,9 @@ public DateIndexNameProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -198,7 +239,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DateIndexNameProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -207,7 +248,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ProcessorDescriptor return Self; } - public DateIndexNameProcessorDescriptor OnFailure(Action> configure) + public DateIndexNameProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -216,7 +257,7 @@ public DateIndexNameProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DateIndexNameProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -225,6 +266,9 @@ public DateIndexNameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateIndexNameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -296,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -305,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -350,9 +394,9 @@ public DateIndexNameProcessorDescriptor() : base() private string? IndexNamePrefixValue { get; set; } private string? LocaleValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private string? TimezoneValue { get; set; } @@ -374,6 +418,9 @@ public DateIndexNameProcessorDescriptor DateRounding(string dateRounding) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateIndexNameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -407,12 +454,18 @@ public DateIndexNameProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DateIndexNameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateIndexNameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -446,6 +499,9 @@ public DateIndexNameProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateIndexNameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -455,7 +511,7 @@ public DateIndexNameProcessorDescriptor OnFailure(ICollection configure) + public DateIndexNameProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -473,7 +529,7 @@ public DateIndexNameProcessorDescriptor OnFailure(Action co return Self; } - public DateIndexNameProcessorDescriptor OnFailure(params Action[] configure) + public DateIndexNameProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -482,6 +538,9 @@ public DateIndexNameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateIndexNameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -553,7 +612,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -562,7 +621,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs index 02f2d12565e..be58b9531fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class DateProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -43,8 +46,16 @@ public sealed partial class DateProcessor /// [JsonInclude, JsonPropertyName("formats")] public ICollection Formats { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,8 +64,16 @@ public sealed partial class DateProcessor /// [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class DateProcessor [JsonInclude, JsonPropertyName("timezone")] public string? Timezone { get; set; } - public static implicit operator Processor(DateProcessor dateProcessor) => Ingest.Processor.Date(dateProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(DateProcessor dateProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Date(dateProcessor); } public sealed partial class DateProcessorDescriptor : SerializableDescriptor> @@ -88,13 +107,16 @@ public DateProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? LocaleValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,6 +141,15 @@ public DateProcessorDescriptor Field(Expression + /// 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.
///
@@ -128,12 +159,18 @@ public DateProcessorDescriptor Formats(ICollection formats) return Self; } - public DateProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DateProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -149,6 +186,9 @@ public DateProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -158,7 +198,7 @@ public DateProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DateProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -167,7 +207,7 @@ public DateProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DateProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -176,7 +216,7 @@ public DateProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DateProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -185,6 +225,9 @@ public DateProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DateProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -209,6 +252,15 @@ public DateProcessorDescriptor TargetField(Expression + /// 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.
///
@@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -269,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -317,13 +369,16 @@ public DateProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? LocaleValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } private string? TimezoneValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DateProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -366,12 +421,18 @@ public DateProcessorDescriptor Formats(ICollection formats) return Self; } - public DateProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DateProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DateProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -387,6 +448,9 @@ public DateProcessorDescriptor Locale(string? locale) return Self; } + /// + /// Handle failures for the processor. + /// public DateProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -396,7 +460,7 @@ public DateProcessorDescriptor OnFailure(ICollection configure) + public DateProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -414,7 +478,7 @@ public DateProcessorDescriptor OnFailure(Action configure) return Self; } - public DateProcessorDescriptor OnFailure(params Action[] configure) + public DateProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -423,6 +487,9 @@ public DateProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DateProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -507,7 +574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -516,7 +583,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs index a7b083ffe65..c2358a320d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("append_separator")] public string? AppendSeparator { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,8 +46,16 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -52,6 +64,10 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -60,10 +76,14 @@ public sealed partial class DissectProcessor /// [JsonInclude, JsonPropertyName("pattern")] public string Pattern { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DissectProcessor dissectProcessor) => Ingest.Processor.Dissect(dissectProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(DissectProcessor dissectProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Dissect(dissectProcessor); } public sealed partial class DissectProcessorDescriptor : SerializableDescriptor> @@ -81,9 +101,9 @@ public DissectProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string? TagValue { get; set; } @@ -96,6 +116,9 @@ public DissectProcessorDescriptor AppendSeparator(string? appendSepar return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DissectProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -120,12 +143,27 @@ public DissectProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to dissect. + /// + public DissectProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public DissectProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -141,6 +179,9 @@ public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public DissectProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -150,7 +191,7 @@ public DissectProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DissectProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -159,7 +200,7 @@ public DissectProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DissectProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -168,7 +209,7 @@ public DissectProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DissectProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -186,6 +227,9 @@ public DissectProcessorDescriptor Pattern(string pattern) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DissectProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -238,7 +282,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -247,7 +291,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -285,9 +329,9 @@ public DissectProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string? TagValue { get; set; } @@ -300,6 +344,9 @@ public DissectProcessorDescriptor AppendSeparator(string? appendSeparator) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DissectProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -333,12 +380,18 @@ public DissectProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DissectProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DissectProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -354,6 +407,9 @@ public DissectProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public DissectProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -363,7 +419,7 @@ public DissectProcessorDescriptor OnFailure(ICollection configure) + public DissectProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -381,7 +437,7 @@ public DissectProcessorDescriptor OnFailure(Action configur return Self; } - public DissectProcessorDescriptor OnFailure(params Action[] configure) + public DissectProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -399,6 +455,9 @@ public DissectProcessorDescriptor Pattern(string pattern) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DissectProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -451,7 +510,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -460,7 +519,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs index a920632745d..9ef769a952c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs @@ -89,12 +89,12 @@ public override DocumentSimulation Read(ref Utf8JsonReader reader, Type typeToCo } additionalProperties ??= new Dictionary(); - var value = JsonSerializer.Deserialize(ref reader, options); - additionalProperties.Add(property, value); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); } } - return new DocumentSimulation { Id = id, Index = index, Ingest = ingest, Routing = routing, Source = source, Version = version, VersionType = versionType, Metadata = additionalProperties }; + return new DocumentSimulation { Id = id, Index = index, Ingest = ingest, Metadata = additionalProperties, Routing = routing, Source = source, Version = version, VersionType = versionType }; } public override void Write(Utf8JsonWriter writer, DocumentSimulation value, JsonSerializerOptions options) @@ -103,10 +103,10 @@ public override void Write(Utf8JsonWriter writer, DocumentSimulation value, Json } } -[JsonConverter(typeof(DocumentSimulationConverter))] /// /// The simulated document, with optional metadata. /// +[JsonConverter(typeof(DocumentSimulationConverter))] public sealed partial class DocumentSimulation { /// @@ -120,6 +120,11 @@ public sealed partial class DocumentSimulation public string Index { get; init; } public Elastic.Clients.Elasticsearch.Ingest.IngestInfo Ingest { get; init; } + /// + /// Additional metadata + /// + public IReadOnlyDictionary Metadata { get; init; } + /// /// Value used to send the document to a specific primary shard. /// @@ -129,8 +134,6 @@ public sealed partial class DocumentSimulation /// JSON body for the document. /// public IReadOnlyDictionary Source { get; init; } - [JsonConverter(typeof(StringifiedLongConverter))] public long? Version { get; init; } public Elastic.Clients.Elasticsearch.VersionType? VersionType { get; init; } - public IReadOnlyDictionary Metadata { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs index 36a5b18c094..768c22ca0a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class DotExpanderProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class DotExpanderProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,10 +64,14 @@ public sealed partial class DotExpanderProcessor /// [JsonInclude, JsonPropertyName("path")] public string? Path { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DotExpanderProcessor dotExpanderProcessor) => Ingest.Processor.DotExpander(dotExpanderProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(DotExpanderProcessor dotExpanderProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.DotExpander(dotExpanderProcessor); } public sealed partial class DotExpanderProcessorDescriptor : SerializableDescriptor> @@ -68,12 +87,15 @@ public DotExpanderProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? PathValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DotExpanderProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -98,18 +120,36 @@ public DotExpanderProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public DotExpanderProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +159,7 @@ public DotExpanderProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DotExpanderProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +168,7 @@ public DotExpanderProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DotExpanderProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public DotExpanderProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DotExpanderProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,6 +195,9 @@ public DotExpanderProcessorDescriptor Path(string? path) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DotExpanderProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -195,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -204,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -244,12 +287,15 @@ public DotExpanderProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? PathValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DotExpanderProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -283,18 +329,27 @@ public DotExpanderProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public DotExpanderProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DotExpanderProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DotExpanderProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -304,7 +359,7 @@ public DotExpanderProcessorDescriptor OnFailure(ICollection configure) + public DotExpanderProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -322,7 +377,7 @@ public DotExpanderProcessorDescriptor OnFailure(Action conf return Self; } - public DotExpanderProcessorDescriptor OnFailure(params Action[] configure) + public DotExpanderProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,6 +395,9 @@ public DotExpanderProcessorDescriptor Path(string? path) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DotExpanderProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -380,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -389,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs index a1bd4ec8319..7d226a61a92 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs @@ -29,18 +29,37 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class DropProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(DropProcessor dropProcessor) => Ingest.Processor.Drop(dropProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(DropProcessor dropProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Drop(dropProcessor); } public sealed partial class DropProcessorDescriptor : SerializableDescriptor> @@ -55,29 +74,41 @@ public DropProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DropProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public DropProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DropProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DropProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -87,7 +118,7 @@ public DropProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public DropProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -96,7 +127,7 @@ public DropProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public DropProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -105,7 +136,7 @@ public DropProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public DropProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -114,6 +145,9 @@ public DropProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public DropProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -152,7 +186,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -161,7 +195,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -194,29 +228,41 @@ public DropProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public DropProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public DropProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public DropProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public DropProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public DropProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -226,7 +272,7 @@ public DropProcessorDescriptor OnFailure(ICollection configure) + public DropProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -244,7 +290,7 @@ public DropProcessorDescriptor OnFailure(Action configure) return Self; } - public DropProcessorDescriptor OnFailure(params Action[] configure) + public DropProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -253,6 +299,9 @@ public DropProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public DropProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -291,7 +340,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -300,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs index e0ade8a97eb..0f99bc18368 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class EnrichProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,6 +64,10 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("max_matches")] public int? MaxMatches { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -73,6 +88,10 @@ public sealed partial class EnrichProcessor /// [JsonInclude, JsonPropertyName("shape_relation")] public Elastic.Clients.Elasticsearch.GeoShapeRelation? ShapeRelation { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -82,7 +101,7 @@ public sealed partial class EnrichProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field TargetField { get; set; } - public static implicit operator Processor(EnrichProcessor enrichProcessor) => Ingest.Processor.Enrich(enrichProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(EnrichProcessor enrichProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Enrich(enrichProcessor); } public sealed partial class EnrichProcessorDescriptor : SerializableDescriptor> @@ -100,15 +119,18 @@ public EnrichProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private int? MaxMatchesValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string PolicyNameValue { get; set; } private Elastic.Clients.Elasticsearch.GeoShapeRelation? ShapeRelationValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public EnrichProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -133,12 +155,27 @@ public EnrichProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// 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; + } + + /// + /// Conditionally execute the processor. + /// + public EnrichProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -163,6 +200,9 @@ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) return Self; } + /// + /// Handle failures for the processor. + /// public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -172,7 +212,7 @@ public EnrichProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public EnrichProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -181,7 +221,7 @@ public EnrichProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public EnrichProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -190,7 +230,7 @@ public EnrichProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public EnrichProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -202,9 +242,9 @@ public EnrichProcessorDescriptor OnFailure(params Action /// 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) + public EnrichProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } @@ -226,6 +266,9 @@ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasti return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public EnrichProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -250,6 +293,15 @@ public EnrichProcessorDescriptor TargetField(Expression + /// 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(); @@ -296,7 +348,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -305,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -357,15 +409,18 @@ public EnrichProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private int? MaxMatchesValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string PolicyNameValue { get; set; } private Elastic.Clients.Elasticsearch.GeoShapeRelation? ShapeRelationValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public EnrichProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -399,12 +454,18 @@ public EnrichProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public EnrichProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public EnrichProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -429,6 +490,9 @@ public EnrichProcessorDescriptor MaxMatches(int? maxMatches) return Self; } + /// + /// Handle failures for the processor. + /// public EnrichProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -438,7 +502,7 @@ public EnrichProcessorDescriptor OnFailure(ICollection configure) + public EnrichProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -456,7 +520,7 @@ public EnrichProcessorDescriptor OnFailure(Action configure return Self; } - public EnrichProcessorDescriptor OnFailure(params Action[] configure) + public EnrichProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -468,9 +532,9 @@ public EnrichProcessorDescriptor OnFailure(params Action[] /// /// 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) + public EnrichProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } @@ -492,6 +556,9 @@ public EnrichProcessorDescriptor ShapeRelation(Elastic.Clients.Elasticsearch.Geo return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public EnrichProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -571,7 +638,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -580,7 +647,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs index 6f848a6e948..ccc81d986e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs @@ -29,10 +29,21 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class FailProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -41,12 +52,20 @@ public sealed partial class FailProcessor /// [JsonInclude, JsonPropertyName("message")] public string Message { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(FailProcessor failProcessor) => Ingest.Processor.Fail(failProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(FailProcessor failProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Fail(failProcessor); } public sealed partial class FailProcessorDescriptor : SerializableDescriptor> @@ -62,23 +81,32 @@ public FailProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string MessageValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public FailProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public FailProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public FailProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -94,6 +122,9 @@ public FailProcessorDescriptor Message(string message) return Self; } + /// + /// Handle failures for the processor. + /// public FailProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -103,7 +134,7 @@ public FailProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public FailProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -112,7 +143,7 @@ public FailProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public FailProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -121,7 +152,7 @@ public FailProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public FailProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -130,6 +161,9 @@ public FailProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public FailProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -170,7 +204,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -179,7 +213,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -213,23 +247,32 @@ public FailProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string MessageValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public FailProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public FailProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public FailProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public FailProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -245,6 +288,9 @@ public FailProcessorDescriptor Message(string message) return Self; } + /// + /// Handle failures for the processor. + /// public FailProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -254,7 +300,7 @@ public FailProcessorDescriptor OnFailure(ICollection configure) + public FailProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -272,7 +318,7 @@ public FailProcessorDescriptor OnFailure(Action configure) return Self; } - public FailProcessorDescriptor OnFailure(params Action[] configure) + public FailProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -281,6 +327,9 @@ public FailProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public FailProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -321,7 +370,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -330,7 +379,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs index 4dbbded05cb..0693cacbf48 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class ForeachProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -55,10 +70,14 @@ public sealed partial class ForeachProcessor /// [JsonInclude, JsonPropertyName("processor")] public Elastic.Clients.Elasticsearch.Ingest.Processor Processor { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(ForeachProcessor foreachProcessor) => Ingest.Processor.Foreach(foreachProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(ForeachProcessor foreachProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Foreach(foreachProcessor); } public sealed partial class ForeachProcessorDescriptor : SerializableDescriptor> @@ -75,14 +94,17 @@ public ForeachProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.Processor ProcessorValue { get; set; } - private ProcessorDescriptor ProcessorDescriptor { get; set; } - private Action> ProcessorDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action> ProcessorDescriptorAction { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ForeachProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -107,12 +129,27 @@ public ForeachProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// Field containing array or object values. + /// + public ForeachProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ForeachProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -128,6 +165,9 @@ public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public ForeachProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -146,7 +186,7 @@ public ForeachProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public ForeachProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,7 +195,7 @@ public ForeachProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public ForeachProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -175,7 +215,7 @@ public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticse return Self; } - public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { ProcessorValue = null; ProcessorDescriptorAction = null; @@ -183,7 +223,7 @@ public ForeachProcessorDescriptor Processor(ProcessorDescriptor Processor(Action> configure) + public ForeachProcessorDescriptor Processor(Action> configure) { ProcessorValue = null; ProcessorDescriptor = null; @@ -191,6 +231,9 @@ public ForeachProcessorDescriptor Processor(Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public ForeachProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -237,7 +280,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -246,7 +289,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -265,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ProcessorDescriptorAction is not null) { writer.WritePropertyName("processor"); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorDescriptorAction), options); } else { @@ -297,14 +340,17 @@ public ForeachProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Ingest.Processor ProcessorValue { get; set; } - private ProcessorDescriptor ProcessorDescriptor { get; set; } - private Action ProcessorDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorDescriptor { get; set; } + private Action ProcessorDescriptorAction { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public ForeachProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -338,12 +384,18 @@ public ForeachProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public ForeachProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public ForeachProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -359,6 +411,9 @@ public ForeachProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public ForeachProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -368,7 +423,7 @@ public ForeachProcessorDescriptor OnFailure(ICollection configure) + public ForeachProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -386,7 +441,7 @@ public ForeachProcessorDescriptor OnFailure(Action configur return Self; } - public ForeachProcessorDescriptor OnFailure(params Action[] configure) + public ForeachProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -406,7 +461,7 @@ public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Ingest return Self; } - public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) + public ForeachProcessorDescriptor Processor(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { ProcessorValue = null; ProcessorDescriptorAction = null; @@ -414,7 +469,7 @@ public ForeachProcessorDescriptor Processor(ProcessorDescriptor descriptor) return Self; } - public ForeachProcessorDescriptor Processor(Action configure) + public ForeachProcessorDescriptor Processor(Action configure) { ProcessorValue = null; ProcessorDescriptor = null; @@ -422,6 +477,9 @@ public ForeachProcessorDescriptor Processor(Action configur return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public ForeachProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -468,7 +526,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -477,7 +535,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -496,7 +554,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ProcessorDescriptorAction is not null) { writer.WritePropertyName("processor"); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs index 1043128485b..80f17e1b727 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("database_file")] public string? DatabaseFile { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -48,8 +52,16 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("first_only")] public bool? FirstOnly { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,6 +70,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -66,6 +82,10 @@ public sealed partial class GeoIpProcessor /// [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -75,7 +95,7 @@ public sealed partial class GeoIpProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(GeoIpProcessor geoIpProcessor) => Ingest.Processor.Geoip(geoIpProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(GeoIpProcessor geoIpProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Geoip(geoIpProcessor); } public sealed partial class GeoIpProcessorDescriptor : SerializableDescriptor> @@ -94,9 +114,9 @@ public GeoIpProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } @@ -110,6 +130,9 @@ public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GeoIpProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -134,6 +157,15 @@ public GeoIpProcessorDescriptor Field(Expression + /// 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. /// @@ -143,12 +175,18 @@ public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) return Self; } - public GeoIpProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public GeoIpProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -164,6 +202,9 @@ public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -173,7 +214,7 @@ public GeoIpProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GeoIpProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -182,7 +223,7 @@ public GeoIpProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GeoIpProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -191,7 +232,7 @@ public GeoIpProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GeoIpProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -209,6 +250,9 @@ public GeoIpProcessorDescriptor Properties(ICollection? prope return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GeoIpProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -233,6 +277,15 @@ public GeoIpProcessorDescriptor TargetField(Expression + /// 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(); @@ -285,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -294,7 +347,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -343,9 +396,9 @@ public GeoIpProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } @@ -359,6 +412,9 @@ public GeoIpProcessorDescriptor DatabaseFile(string? databaseFile) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GeoIpProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -401,12 +457,18 @@ public GeoIpProcessorDescriptor FirstOnly(bool? firstOnly = true) return Self; } - public GeoIpProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public GeoIpProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GeoIpProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -422,6 +484,9 @@ public GeoIpProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GeoIpProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -431,7 +496,7 @@ public GeoIpProcessorDescriptor OnFailure(ICollection configure) + public GeoIpProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -449,7 +514,7 @@ public GeoIpProcessorDescriptor OnFailure(Action configure) return Self; } - public GeoIpProcessorDescriptor OnFailure(params Action[] configure) + public GeoIpProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -467,6 +532,9 @@ public GeoIpProcessorDescriptor Properties(ICollection? properties) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GeoIpProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -552,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -561,7 +629,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs index 6983ad3e229..4418f7c5b65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class GrokProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class GrokProcessor /// [JsonInclude, JsonPropertyName("patterns")] public ICollection Patterns { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class GrokProcessor [JsonInclude, JsonPropertyName("trace_match")] public bool? TraceMatch { get; set; } - public static implicit operator Processor(GrokProcessor grokProcessor) => Ingest.Processor.Grok(grokProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(GrokProcessor grokProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Grok(grokProcessor); } public sealed partial class GrokProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public GrokProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private IDictionary? PatternDefinitionsValue { get; set; } private ICollection PatternsValue { get; set; } private string? TagValue { get; set; } private bool? TraceMatchValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GrokProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public GrokProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to use for grok expression parsing. + /// + public GrokProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public GrokProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public GrokProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public GrokProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GrokProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public GrokProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GrokProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public GrokProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GrokProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public GrokProcessorDescriptor Patterns(ICollection patterns) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GrokProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -249,7 +292,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -258,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -307,14 +350,17 @@ public GrokProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private IDictionary? PatternDefinitionsValue { get; set; } private ICollection PatternsValue { get; set; } private string? TagValue { get; set; } private bool? TraceMatchValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GrokProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -348,12 +394,18 @@ public GrokProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public GrokProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GrokProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -369,6 +421,9 @@ public GrokProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GrokProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -378,7 +433,7 @@ public GrokProcessorDescriptor OnFailure(ICollection configure) + public GrokProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -396,7 +451,7 @@ public GrokProcessorDescriptor OnFailure(Action configure) return Self; } - public GrokProcessorDescriptor OnFailure(params Action[] configure) + public GrokProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -423,6 +478,9 @@ public GrokProcessorDescriptor Patterns(ICollection patterns) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GrokProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -478,7 +536,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -487,7 +545,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs index 4c5ad7c0c72..30bf4eb067c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class GsubProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class GsubProcessor /// [JsonInclude, JsonPropertyName("replacement")] public string Replacement { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class GsubProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(GsubProcessor gsubProcessor) => Ingest.Processor.Gsub(gsubProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(GsubProcessor gsubProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Gsub(gsubProcessor); } public sealed partial class GsubProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public GsubProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string ReplacementValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GsubProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public GsubProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to apply the replacement to. + /// + public GsubProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public GsubProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public GsubProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public GsubProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public GsubProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public GsubProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public GsubProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public GsubProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public GsubProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public GsubProcessorDescriptor Replacement(string replacement) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GsubProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public GsubProcessorDescriptor TargetField(Expression + /// 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(); @@ -258,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -267,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -312,14 +364,17 @@ public GsubProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string PatternValue { get; set; } private string ReplacementValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public GsubProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -353,12 +408,18 @@ public GsubProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public GsubProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public GsubProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -374,6 +435,9 @@ public GsubProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public GsubProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -383,7 +447,7 @@ public GsubProcessorDescriptor OnFailure(ICollection configure) + public GsubProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -401,7 +465,7 @@ public GsubProcessorDescriptor OnFailure(Action configure) return Self; } - public GsubProcessorDescriptor OnFailure(params Action[] configure) + public GsubProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -428,6 +492,9 @@ public GsubProcessorDescriptor Replacement(string replacement) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public GsubProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -501,7 +568,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -510,7 +577,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs index 97dfb407593..8f583aa4b12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -47,6 +48,18 @@ internal InferenceConfig(string variantName, object variant) public static InferenceConfig Classification(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification inferenceConfigClassification) => new InferenceConfig("classification", inferenceConfigClassification); public static InferenceConfig Regression(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression inferenceConfigRegression) => new InferenceConfig("regression", inferenceConfigRegression); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class InferenceConfigConverter : JsonConverter @@ -58,35 +71,48 @@ public override InferenceConfig Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "classification") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new InferenceConfig(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "regression") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new InferenceConfig(propertyName, variant); + if (propertyName == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfig' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new InferenceConfig(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, InferenceConfig value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -135,29 +161,27 @@ private InferenceConfigDescriptor Set(object variant, string variantN 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action> configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -193,31 +217,27 @@ private InferenceConfigDescriptor Set(object variant, string variantName) 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"); + public InferenceConfigDescriptor Classification(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification inferenceConfigClassification) => Set(inferenceConfigClassification, "classification"); + public InferenceConfigDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigDescriptor Regression(Elastic.Clients.Elasticsearch.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs index ab8943e591c..fd88216ad2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs @@ -59,7 +59,7 @@ public sealed partial class InferenceConfigClassification [JsonInclude, JsonPropertyName("top_classes_results_field")] public Elastic.Clients.Elasticsearch.Field? TopClassesResultsField { get; set; } - public static implicit operator InferenceConfig(InferenceConfigClassification inferenceConfigClassification) => Ingest.InferenceConfig.Classification(inferenceConfigClassification); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.InferenceConfig(InferenceConfigClassification inferenceConfigClassification) => Elastic.Clients.Elasticsearch.Ingest.InferenceConfig.Classification(inferenceConfigClassification); } public sealed partial class InferenceConfigClassificationDescriptor : SerializableDescriptor> @@ -121,6 +121,15 @@ public InferenceConfigClassificationDescriptor ResultsField(E 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. /// @@ -139,6 +148,15 @@ public InferenceConfigClassificationDescriptor 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs index e3d9e4fd50c..1120139ecbb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs @@ -41,7 +41,7 @@ public sealed partial class InferenceConfigRegression [JsonInclude, JsonPropertyName("results_field")] public Elastic.Clients.Elasticsearch.Field? ResultsField { get; set; } - public static implicit operator InferenceConfig(InferenceConfigRegression inferenceConfigRegression) => Ingest.InferenceConfig.Regression(inferenceConfigRegression); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.InferenceConfig(InferenceConfigRegression inferenceConfigRegression) => Elastic.Clients.Elasticsearch.Ingest.InferenceConfig.Regression(inferenceConfigRegression); } public sealed partial class InferenceConfigRegressionDescriptor : SerializableDescriptor> @@ -82,6 +82,15 @@ public InferenceConfigRegressionDescriptor ResultsField(Expre 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs index 033ee176b2f..527b4c3120a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class InferenceProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class InferenceProcessor /// [JsonInclude, JsonPropertyName("field_map")] public IDictionary? FieldMap { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -53,8 +64,16 @@ public sealed partial class InferenceProcessor /// [JsonInclude, JsonPropertyName("model_id")] public Elastic.Clients.Elasticsearch.Id ModelId { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -64,7 +83,7 @@ public sealed partial class InferenceProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(InferenceProcessor inferenceProcessor) => Ingest.Processor.Inference(inferenceProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(InferenceProcessor inferenceProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Inference(inferenceProcessor); } public sealed partial class InferenceProcessorDescriptor : SerializableDescriptor> @@ -80,16 +99,19 @@ public InferenceProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action> InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action> InferenceConfigDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id ModelIdValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public InferenceProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,18 @@ public InferenceProcessorDescriptor FieldMap(Func If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public InferenceProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -128,7 +156,7 @@ public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.E return Self; } - public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -136,7 +164,7 @@ public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDe return Self; } - public InferenceProcessorDescriptor InferenceConfig(Action> configure) + public InferenceProcessorDescriptor InferenceConfig(Action> configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -153,6 +181,9 @@ public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticse return Self; } + /// + /// Handle failures for the processor. + /// public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -162,7 +193,7 @@ public InferenceProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public InferenceProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -171,7 +202,7 @@ public InferenceProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public InferenceProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -180,7 +211,7 @@ public InferenceProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public InferenceProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -189,6 +220,9 @@ public InferenceProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public InferenceProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -213,6 +247,15 @@ public InferenceProcessorDescriptor TargetField(Expression + /// 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(); @@ -248,7 +291,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -269,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -278,7 +321,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -318,16 +361,19 @@ public InferenceProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private Elastic.Clients.Elasticsearch.Ingest.InferenceConfig? InferenceConfigValue { get; set; } - private InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } - private Action InferenceConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor InferenceConfigDescriptor { get; set; } + private Action InferenceConfigDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Id ModelIdValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public InferenceProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -343,12 +389,18 @@ public InferenceProcessorDescriptor FieldMap(Func + /// Conditionally execute the processor. + /// + public InferenceProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public InferenceProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -366,7 +418,7 @@ public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearc return Self; } - public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor descriptor) + public InferenceProcessorDescriptor InferenceConfig(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor descriptor) { InferenceConfigValue = null; InferenceConfigDescriptorAction = null; @@ -374,7 +426,7 @@ public InferenceProcessorDescriptor InferenceConfig(InferenceConfigDescriptor de return Self; } - public InferenceProcessorDescriptor InferenceConfig(Action configure) + public InferenceProcessorDescriptor InferenceConfig(Action configure) { InferenceConfigValue = null; InferenceConfigDescriptor = null; @@ -391,6 +443,9 @@ public InferenceProcessorDescriptor ModelId(Elastic.Clients.Elasticsearch.Id mod return Self; } + /// + /// Handle failures for the processor. + /// public InferenceProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -400,7 +455,7 @@ public InferenceProcessorDescriptor OnFailure(ICollection configure) + public InferenceProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -418,7 +473,7 @@ public InferenceProcessorDescriptor OnFailure(Action config return Self; } - public InferenceProcessorDescriptor OnFailure(params Action[] configure) + public InferenceProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -427,6 +482,9 @@ public InferenceProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public InferenceProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -495,7 +553,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InferenceConfigDescriptorAction is not null) { writer.WritePropertyName("inference_config"); - JsonSerializer.Serialize(writer, new InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigDescriptor(InferenceConfigDescriptorAction), options); } else if (InferenceConfigValue is not null) { @@ -516,7 +574,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -525,7 +583,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs index 02e1a387f8e..f69fce9de6b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class JoinProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class JoinProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,6 +64,10 @@ public sealed partial class JoinProcessor /// [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class JoinProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(JoinProcessor joinProcessor) => Ingest.Processor.Join(joinProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(JoinProcessor joinProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Join(joinProcessor); } public sealed partial class JoinProcessorDescriptor : SerializableDescriptor> @@ -74,13 +93,16 @@ public JoinProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JoinProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,18 +127,36 @@ public JoinProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// Field containing array values to join. + /// + public JoinProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public JoinProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JoinProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -126,7 +166,7 @@ public JoinProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public JoinProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -135,7 +175,7 @@ public JoinProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public JoinProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -144,7 +184,7 @@ public JoinProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public JoinProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public JoinProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JoinProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public JoinProcessorDescriptor TargetField(Expression + /// 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(); @@ -220,7 +272,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -229,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -271,13 +323,16 @@ public JoinProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JoinProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -311,18 +366,27 @@ public JoinProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public JoinProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JoinProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JoinProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -332,7 +396,7 @@ public JoinProcessorDescriptor OnFailure(ICollection configure) + public JoinProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -350,7 +414,7 @@ public JoinProcessorDescriptor OnFailure(Action configure) return Self; } - public JoinProcessorDescriptor OnFailure(params Action[] configure) + public JoinProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -368,6 +432,9 @@ public JoinProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JoinProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -435,7 +502,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -444,7 +511,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs index e4870c2de9c..b965598dc84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs @@ -46,6 +46,10 @@ public sealed partial class JsonProcessor /// [JsonInclude, JsonPropertyName("allow_duplicate_keys")] public bool? AllowDuplicateKeys { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -54,12 +58,28 @@ public sealed partial class JsonProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -69,7 +89,7 @@ public sealed partial class JsonProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(JsonProcessor jsonProcessor) => Ingest.Processor.Json(jsonProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(JsonProcessor jsonProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Json(jsonProcessor); } public sealed partial class JsonProcessorDescriptor : SerializableDescriptor> @@ -88,9 +108,9 @@ public JsonProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } @@ -121,6 +141,9 @@ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicat return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JsonProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -145,18 +168,36 @@ public JsonProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be parsed. + /// + public JsonProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; return Self; } + /// + /// Conditionally execute the processor. + /// + public JsonProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JsonProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -166,7 +207,7 @@ public JsonProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public JsonProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -175,7 +216,7 @@ public JsonProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public JsonProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -184,7 +225,7 @@ public JsonProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public JsonProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -193,6 +234,9 @@ public JsonProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public JsonProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -217,6 +261,15 @@ public JsonProcessorDescriptor TargetField(Expression + /// 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(); @@ -269,7 +322,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -278,7 +331,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -321,9 +374,9 @@ public JsonProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } @@ -354,6 +407,9 @@ public JsonProcessorDescriptor AllowDuplicateKeys(bool? allowDuplicateKeys = tru return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public JsonProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -387,18 +443,27 @@ public JsonProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public JsonProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public JsonProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public JsonProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -408,7 +473,7 @@ public JsonProcessorDescriptor OnFailure(ICollection configure) + public JsonProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -426,7 +491,7 @@ public JsonProcessorDescriptor OnFailure(Action configure) return Self; } - public JsonProcessorDescriptor OnFailure(params Action[] configure) + public JsonProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -435,6 +500,9 @@ public JsonProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public JsonProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -520,7 +588,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -529,7 +597,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs index 938e5117df2..44e9fa5eede 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class KeyValueProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -49,8 +52,16 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("field_split")] public string FieldSplit { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -65,6 +76,10 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("include_keys")] public ICollection? IncludeKeys { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -79,6 +94,10 @@ public sealed partial class KeyValueProcessor /// [JsonInclude, JsonPropertyName("strip_brackets")] public bool? StripBrackets { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -106,7 +125,7 @@ public sealed partial class KeyValueProcessor [JsonInclude, JsonPropertyName("value_split")] public string ValueSplit { get; set; } - public static implicit operator Processor(KeyValueProcessor keyValueProcessor) => Ingest.Processor.Kv(keyValueProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(KeyValueProcessor keyValueProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Kv(keyValueProcessor); } public sealed partial class KeyValueProcessorDescriptor : SerializableDescriptor> @@ -126,9 +145,9 @@ public KeyValueProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private ICollection? IncludeKeysValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? PrefixValue { get; set; } private bool? StripBracketsValue { get; set; } private string? TagValue { get; set; } @@ -137,6 +156,9 @@ public KeyValueProcessorDescriptor() : base() private string? TrimValueValue { get; set; } private string ValueSplitValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public KeyValueProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -170,6 +192,15 @@ public KeyValueProcessorDescriptor Field(Expression + /// 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. /// @@ -179,12 +210,18 @@ public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) return Self; } - public KeyValueProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public KeyValueProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -209,6 +246,9 @@ public KeyValueProcessorDescriptor IncludeKeys(ICollection? i return Self; } + /// + /// Handle failures for the processor. + /// public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -218,7 +258,7 @@ public KeyValueProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public KeyValueProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -227,7 +267,7 @@ public KeyValueProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public KeyValueProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -236,7 +276,7 @@ public KeyValueProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public KeyValueProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -263,6 +303,9 @@ public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public KeyValueProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -287,6 +330,15 @@ public KeyValueProcessorDescriptor TargetField(Expression + /// 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. /// @@ -368,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -377,7 +429,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -447,9 +499,9 @@ public KeyValueProcessorDescriptor() : base() private bool? IgnoreMissingValue { get; set; } private ICollection? IncludeKeysValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? PrefixValue { get; set; } private bool? StripBracketsValue { get; set; } private string? TagValue { get; set; } @@ -458,6 +510,9 @@ public KeyValueProcessorDescriptor() : base() private string? TrimValueValue { get; set; } private string ValueSplitValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public KeyValueProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -509,12 +564,18 @@ public KeyValueProcessorDescriptor FieldSplit(string fieldSplit) return Self; } - public KeyValueProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public KeyValueProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public KeyValueProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -539,6 +600,9 @@ public KeyValueProcessorDescriptor IncludeKeys(ICollection? includeKeys) return Self; } + /// + /// Handle failures for the processor. + /// public KeyValueProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -548,7 +612,7 @@ public KeyValueProcessorDescriptor OnFailure(ICollection configure) + public KeyValueProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -566,7 +630,7 @@ public KeyValueProcessorDescriptor OnFailure(Action configu return Self; } - public KeyValueProcessorDescriptor OnFailure(params Action[] configure) + public KeyValueProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -593,6 +657,9 @@ public KeyValueProcessorDescriptor StripBrackets(bool? stripBrackets = true) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public KeyValueProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -707,7 +774,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -716,7 +783,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs index 723210729de..7217dce202c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class LowercaseProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class LowercaseProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class LowercaseProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class LowercaseProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(LowercaseProcessor lowercaseProcessor) => Ingest.Processor.Lowercase(lowercaseProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(LowercaseProcessor lowercaseProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Lowercase(lowercaseProcessor); } public sealed partial class LowercaseProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public LowercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public LowercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public LowercaseProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to make lowercase. + /// + public LowercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public LowercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public LowercaseProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public LowercaseProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public LowercaseProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public LowercaseProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public LowercaseProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public LowercaseProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public LowercaseProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public LowercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public LowercaseProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public LowercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public LowercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public LowercaseProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public LowercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public LowercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public LowercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public LowercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public LowercaseProcessorDescriptor OnFailure(ICollection configure) + public LowercaseProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public LowercaseProcessorDescriptor OnFailure(Action config return Self; } - public LowercaseProcessorDescriptor OnFailure(params Action[] configure) + public LowercaseProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public LowercaseProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public LowercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs index 7952eb5da63..cda3da98740 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs @@ -29,18 +29,18 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class Pipeline { - /// - /// Arbitrary metadata about the ingest pipeline. 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; } + /// + /// Arbitrary metadata about the ingest pipeline. This map is not automatically generated by Elasticsearch. + /// + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + /// /// Processors to run immediately after a processor failure. /// @@ -71,13 +71,13 @@ public PipelineDescriptor() : base() private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action> ProcessorsDescriptorAction { get; set; } + private Action>[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -110,7 +110,7 @@ public PipelineDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PipelineDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -119,7 +119,7 @@ public PipelineDescriptor OnFailure(ProcessorDescriptor de return Self; } - public PipelineDescriptor OnFailure(Action> configure) + public PipelineDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -128,7 +128,7 @@ public PipelineDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PipelineDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -149,7 +149,7 @@ public PipelineDescriptor Processors(ICollection Processors(ProcessorDescriptor descriptor) + public PipelineDescriptor Processors(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { ProcessorsValue = null; ProcessorsDescriptorAction = null; @@ -158,7 +158,7 @@ public PipelineDescriptor Processors(ProcessorDescriptor d return Self; } - public PipelineDescriptor Processors(Action> configure) + public PipelineDescriptor Processors(Action> configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -167,7 +167,7 @@ public PipelineDescriptor Processors(Action Processors(params Action>[] configure) + public PipelineDescriptor Processors(params Action>[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -211,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -220,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -242,7 +242,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -251,7 +251,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -262,10 +262,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -283,13 +283,13 @@ public PipelineDescriptor() : base() private string? DescriptionValue { get; set; } private IDictionary? MetaValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor ProcessorsDescriptor { get; set; } + private Action ProcessorsDescriptorAction { get; set; } + private Action[] ProcessorsDescriptorActions { get; set; } private long? VersionValue { get; set; } /// @@ -322,7 +322,7 @@ public PipelineDescriptor OnFailure(ICollection configure) + public PipelineDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,7 +340,7 @@ public PipelineDescriptor OnFailure(Action configure) return Self; } - public PipelineDescriptor OnFailure(params Action[] configure) + public PipelineDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -361,7 +361,7 @@ public PipelineDescriptor Processors(ICollection configure) + public PipelineDescriptor Processors(Action configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -379,7 +379,7 @@ public PipelineDescriptor Processors(Action configure) return Self; } - public PipelineDescriptor Processors(params Action[] configure) + public PipelineDescriptor Processors(params Action[] configure) { ProcessorsValue = null; ProcessorsDescriptor = null; @@ -423,7 +423,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -432,7 +432,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -454,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("processors"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(ProcessorsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(ProcessorsDescriptorAction), options); writer.WriteEndArray(); } else if (ProcessorsDescriptorActions is not null) @@ -463,7 +463,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ProcessorsDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -474,10 +474,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, ProcessorsValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs index 67d4e79c148..2230f3cd42d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs @@ -29,10 +29,21 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class PipelineProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,12 +58,20 @@ public sealed partial class PipelineProcessor ///
[JsonInclude, JsonPropertyName("name")] public Elastic.Clients.Elasticsearch.Name Name { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(PipelineProcessor pipelineProcessor) => Ingest.Processor.Pipeline(pipelineProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(PipelineProcessor pipelineProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Pipeline(pipelineProcessor); } public sealed partial class PipelineProcessorDescriptor : SerializableDescriptor> @@ -69,23 +88,32 @@ public PipelineProcessorDescriptor() : base() private bool? IgnoreMissingPipelineValue { get; set; } private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public PipelineProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public PipelineProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public PipelineProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -110,6 +138,9 @@ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch return Self; } + /// + /// Handle failures for the processor. + /// public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +150,7 @@ public PipelineProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public PipelineProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +159,7 @@ public PipelineProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public PipelineProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +168,7 @@ public PipelineProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public PipelineProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -146,6 +177,9 @@ public PipelineProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public PipelineProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -192,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -201,7 +235,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -236,23 +270,32 @@ public PipelineProcessorDescriptor() : base() private bool? IgnoreMissingPipelineValue { get; set; } private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public PipelineProcessorDescriptor Description(string? description) { DescriptionValue = description; return Self; } - public PipelineProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public PipelineProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public PipelineProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -277,6 +320,9 @@ public PipelineProcessorDescriptor Name(Elastic.Clients.Elasticsearch.Name name) return Self; } + /// + /// Handle failures for the processor. + /// public PipelineProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -286,7 +332,7 @@ public PipelineProcessorDescriptor OnFailure(ICollection configure) + public PipelineProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -304,7 +350,7 @@ public PipelineProcessorDescriptor OnFailure(Action configu return Self; } - public PipelineProcessorDescriptor OnFailure(params Action[] configure) + public PipelineProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -313,6 +359,9 @@ public PipelineProcessorDescriptor OnFailure(params Action[ return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public PipelineProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -359,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -368,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs index ebd6e35a895..fa104f2357e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -71,6 +72,7 @@ internal Processor(string variantName, object variant) public static Processor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => new Processor("remove", removeProcessor); public static Processor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => new Processor("rename", renameProcessor); public static Processor Reroute(Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor rerouteProcessor) => new Processor("reroute", rerouteProcessor); + public static Processor Script(Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor scriptProcessor) => new Processor("script", scriptProcessor); public static Processor Set(Elastic.Clients.Elasticsearch.Ingest.SetProcessor setProcessor) => new Processor("set", setProcessor); public static Processor SetSecurityUser(Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => new Processor("set_security_user", setSecurityUserProcessor); public static Processor Sort(Elastic.Clients.Elasticsearch.Ingest.SortProcessor sortProcessor) => new Processor("sort", sortProcessor); @@ -79,6 +81,18 @@ internal Processor(string variantName, object variant) public static Processor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => new Processor("uppercase", uppercaseProcessor); public static Processor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => new Processor("urldecode", urlDecodeProcessor); public static Processor UserAgent(Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor userAgentProcessor) => new Processor("user_agent", userAgentProcessor); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class ProcessorConverter : JsonConverter @@ -90,259 +104,279 @@ public override Processor Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "append") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "attachment") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "append") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "bytes") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "attachment") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "circle") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "bytes") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "convert") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "circle") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "csv") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "convert") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "date") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "csv") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "date_index_name") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "date") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dissect") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "date_index_name") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dot_expander") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "dissect") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "drop") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "dot_expander") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "enrich") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "drop") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fail") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "enrich") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "foreach") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "fail") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geoip") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "foreach") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "grok") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "geoip") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "gsub") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "grok") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "inference") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "gsub") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "join") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "inference") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "json") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "join") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "kv") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "json") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "lowercase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "kv") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "pipeline") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "lowercase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "remove") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "pipeline") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rename") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "remove") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "reroute") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "rename") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "set") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "reroute") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "set_security_user") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "sort") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "set") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "split") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "set_security_user") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "trim") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "sort") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "uppercase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "split") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "urldecode") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); - } + if (propertyName == "trim") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "user_agent") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Processor(propertyName, variant); + if (propertyName == "uppercase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "urldecode") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "user_agent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Processor' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Processor(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Processor value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -425,6 +459,9 @@ public override void Write(Utf8JsonWriter writer, Processor value, JsonSerialize case "reroute": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor)value.Variant, options); break; + case "script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor)value.Variant, options); + break; case "set": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ingest.SetProcessor)value.Variant, options); break; @@ -487,93 +524,93 @@ private ProcessorDescriptor Set(object variant, string variantName) 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 Reroute(RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); - public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); - 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"); + public ProcessorDescriptor Append(Elastic.Clients.Elasticsearch.Ingest.AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action> configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action> configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(Elastic.Clients.Elasticsearch.Ingest.BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action> configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action> configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action> configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action> configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(Elastic.Clients.Elasticsearch.Ingest.DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action> configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action> configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(Elastic.Clients.Elasticsearch.Ingest.DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action> configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action> configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(Elastic.Clients.Elasticsearch.Ingest.DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action> configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action> configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action> configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action> configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action> configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(Elastic.Clients.Elasticsearch.Ingest.GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action> configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action> configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action> configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action> configure) => Set(configure, "join"); + public ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action> configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action> configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action> configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action> configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action> configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action> configure) => Set(configure, "rename"); + public ProcessorDescriptor Reroute(Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); + public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); + public ProcessorDescriptor Script(Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor scriptProcessor) => Set(scriptProcessor, "script"); + public ProcessorDescriptor Script(Action> configure) => Set(configure, "script"); + public ProcessorDescriptor Set(Elastic.Clients.Elasticsearch.Ingest.SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action> configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action> configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(Elastic.Clients.Elasticsearch.Ingest.SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action> configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action> configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action> configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action> configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action> configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -609,127 +646,93 @@ private ProcessorDescriptor Set(object variant, string variantName) 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 Reroute(RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); - public ProcessorDescriptor Reroute(Action configure) => Set(configure, "reroute"); - public ProcessorDescriptor Reroute(Action> configure) => Set(configure, "reroute"); - 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"); + public ProcessorDescriptor Append(Elastic.Clients.Elasticsearch.Ingest.AppendProcessor appendProcessor) => Set(appendProcessor, "append"); + public ProcessorDescriptor Append(Action configure) => Set(configure, "append"); + public ProcessorDescriptor Attachment(Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor attachmentProcessor) => Set(attachmentProcessor, "attachment"); + public ProcessorDescriptor Attachment(Action configure) => Set(configure, "attachment"); + public ProcessorDescriptor Bytes(Elastic.Clients.Elasticsearch.Ingest.BytesProcessor bytesProcessor) => Set(bytesProcessor, "bytes"); + public ProcessorDescriptor Bytes(Action configure) => Set(configure, "bytes"); + public ProcessorDescriptor Circle(Elastic.Clients.Elasticsearch.Ingest.CircleProcessor circleProcessor) => Set(circleProcessor, "circle"); + public ProcessorDescriptor Circle(Action configure) => Set(configure, "circle"); + public ProcessorDescriptor Convert(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor convertProcessor) => Set(convertProcessor, "convert"); + public ProcessorDescriptor Convert(Action configure) => Set(configure, "convert"); + public ProcessorDescriptor Csv(Elastic.Clients.Elasticsearch.Ingest.CsvProcessor csvProcessor) => Set(csvProcessor, "csv"); + public ProcessorDescriptor Csv(Action configure) => Set(configure, "csv"); + public ProcessorDescriptor Date(Elastic.Clients.Elasticsearch.Ingest.DateProcessor dateProcessor) => Set(dateProcessor, "date"); + public ProcessorDescriptor Date(Action configure) => Set(configure, "date"); + public ProcessorDescriptor DateIndexName(Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor dateIndexNameProcessor) => Set(dateIndexNameProcessor, "date_index_name"); + public ProcessorDescriptor DateIndexName(Action configure) => Set(configure, "date_index_name"); + public ProcessorDescriptor Dissect(Elastic.Clients.Elasticsearch.Ingest.DissectProcessor dissectProcessor) => Set(dissectProcessor, "dissect"); + public ProcessorDescriptor Dissect(Action configure) => Set(configure, "dissect"); + public ProcessorDescriptor DotExpander(Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor dotExpanderProcessor) => Set(dotExpanderProcessor, "dot_expander"); + public ProcessorDescriptor DotExpander(Action configure) => Set(configure, "dot_expander"); + public ProcessorDescriptor Drop(Elastic.Clients.Elasticsearch.Ingest.DropProcessor dropProcessor) => Set(dropProcessor, "drop"); + public ProcessorDescriptor Drop(Action configure) => Set(configure, "drop"); + public ProcessorDescriptor Enrich(Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor enrichProcessor) => Set(enrichProcessor, "enrich"); + public ProcessorDescriptor Enrich(Action configure) => Set(configure, "enrich"); + public ProcessorDescriptor Fail(Elastic.Clients.Elasticsearch.Ingest.FailProcessor failProcessor) => Set(failProcessor, "fail"); + public ProcessorDescriptor Fail(Action configure) => Set(configure, "fail"); + public ProcessorDescriptor Foreach(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor foreachProcessor) => Set(foreachProcessor, "foreach"); + public ProcessorDescriptor Foreach(Action configure) => Set(configure, "foreach"); + public ProcessorDescriptor Geoip(Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor geoIpProcessor) => Set(geoIpProcessor, "geoip"); + public ProcessorDescriptor Geoip(Action configure) => Set(configure, "geoip"); + public ProcessorDescriptor Grok(Elastic.Clients.Elasticsearch.Ingest.GrokProcessor grokProcessor) => Set(grokProcessor, "grok"); + public ProcessorDescriptor Grok(Action configure) => Set(configure, "grok"); + public ProcessorDescriptor Gsub(Elastic.Clients.Elasticsearch.Ingest.GsubProcessor gsubProcessor) => Set(gsubProcessor, "gsub"); + public ProcessorDescriptor Gsub(Action configure) => Set(configure, "gsub"); + public ProcessorDescriptor Inference(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor inferenceProcessor) => Set(inferenceProcessor, "inference"); + public ProcessorDescriptor Inference(Action configure) => Set(configure, "inference"); + public ProcessorDescriptor Join(Elastic.Clients.Elasticsearch.Ingest.JoinProcessor joinProcessor) => Set(joinProcessor, "join"); + public ProcessorDescriptor Join(Action configure) => Set(configure, "join"); + public ProcessorDescriptor Json(Elastic.Clients.Elasticsearch.Ingest.JsonProcessor jsonProcessor) => Set(jsonProcessor, "json"); + public ProcessorDescriptor Json(Action configure) => Set(configure, "json"); + public ProcessorDescriptor Kv(Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor keyValueProcessor) => Set(keyValueProcessor, "kv"); + public ProcessorDescriptor Kv(Action configure) => Set(configure, "kv"); + public ProcessorDescriptor Lowercase(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor lowercaseProcessor) => Set(lowercaseProcessor, "lowercase"); + public ProcessorDescriptor Lowercase(Action configure) => Set(configure, "lowercase"); + public ProcessorDescriptor Pipeline(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor pipelineProcessor) => Set(pipelineProcessor, "pipeline"); + public ProcessorDescriptor Pipeline(Action configure) => Set(configure, "pipeline"); + public ProcessorDescriptor Remove(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor removeProcessor) => Set(removeProcessor, "remove"); + public ProcessorDescriptor Remove(Action configure) => Set(configure, "remove"); + public ProcessorDescriptor Rename(Elastic.Clients.Elasticsearch.Ingest.RenameProcessor renameProcessor) => Set(renameProcessor, "rename"); + public ProcessorDescriptor Rename(Action configure) => Set(configure, "rename"); + public ProcessorDescriptor Reroute(Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor rerouteProcessor) => Set(rerouteProcessor, "reroute"); + public ProcessorDescriptor Reroute(Action configure) => Set(configure, "reroute"); + public ProcessorDescriptor Script(Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor scriptProcessor) => Set(scriptProcessor, "script"); + public ProcessorDescriptor Script(Action configure) => Set(configure, "script"); + public ProcessorDescriptor Set(Elastic.Clients.Elasticsearch.Ingest.SetProcessor setProcessor) => Set(setProcessor, "set"); + public ProcessorDescriptor Set(Action configure) => Set(configure, "set"); + public ProcessorDescriptor SetSecurityUser(Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor setSecurityUserProcessor) => Set(setSecurityUserProcessor, "set_security_user"); + public ProcessorDescriptor SetSecurityUser(Action configure) => Set(configure, "set_security_user"); + public ProcessorDescriptor Sort(Elastic.Clients.Elasticsearch.Ingest.SortProcessor sortProcessor) => Set(sortProcessor, "sort"); + public ProcessorDescriptor Sort(Action configure) => Set(configure, "sort"); + public ProcessorDescriptor Split(Elastic.Clients.Elasticsearch.Ingest.SplitProcessor splitProcessor) => Set(splitProcessor, "split"); + public ProcessorDescriptor Split(Action configure) => Set(configure, "split"); + public ProcessorDescriptor Trim(Elastic.Clients.Elasticsearch.Ingest.TrimProcessor trimProcessor) => Set(trimProcessor, "trim"); + public ProcessorDescriptor Trim(Action configure) => Set(configure, "trim"); + public ProcessorDescriptor Uppercase(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor uppercaseProcessor) => Set(uppercaseProcessor, "uppercase"); + public ProcessorDescriptor Uppercase(Action configure) => Set(configure, "uppercase"); + public ProcessorDescriptor UrlDecode(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor urlDecodeProcessor) => Set(urlDecodeProcessor, "urldecode"); + public ProcessorDescriptor UrlDecode(Action configure) => Set(configure, "urldecode"); + public ProcessorDescriptor UserAgent(Elastic.Clients.Elasticsearch.Ingest.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs index e8c8619e0c0..a3e15e76be9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class RemoveProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class RemoveProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Fields Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,12 +58,20 @@ public sealed partial class RemoveProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(RemoveProcessor removeProcessor) => Ingest.Processor.Remove(removeProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(RemoveProcessor removeProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Remove(removeProcessor); } public sealed partial class RemoveProcessorDescriptor : SerializableDescriptor> @@ -69,11 +88,14 @@ public RemoveProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RemoveProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -89,12 +111,18 @@ public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch. return Self; } - public RemoveProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RemoveProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -110,6 +138,9 @@ public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +150,7 @@ public RemoveProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RemoveProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +159,7 @@ public RemoveProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RemoveProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +168,7 @@ public RemoveProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RemoveProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -146,6 +177,9 @@ public RemoveProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public RemoveProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -192,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -201,7 +235,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -236,11 +270,14 @@ public RemoveProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RemoveProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -256,12 +293,18 @@ public RemoveProcessorDescriptor Field(Elastic.Clients.Elasticsearch.Fields fiel return Self; } - public RemoveProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RemoveProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RemoveProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -277,6 +320,9 @@ public RemoveProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public RemoveProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -286,7 +332,7 @@ public RemoveProcessorDescriptor OnFailure(ICollection configure) + public RemoveProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -304,7 +350,7 @@ public RemoveProcessorDescriptor OnFailure(Action configure return Self; } - public RemoveProcessorDescriptor OnFailure(params Action[] configure) + public RemoveProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -313,6 +359,9 @@ public RemoveProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RemoveProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -359,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -368,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs index 521662e3ac3..926ebfefe60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class RenameProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class RenameProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class RenameProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class RenameProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field TargetField { get; set; } - public static implicit operator Processor(RenameProcessor renameProcessor) => Ingest.Processor.Rename(renameProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(RenameProcessor renameProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Rename(renameProcessor); } public sealed partial class RenameProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public RenameProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RenameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public RenameProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be renamed.
Supports template snippets.
+ ///
+ public RenameProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public RenameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = return Self; } + /// + /// Handle failures for the processor. + /// public RenameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public RenameProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RenameProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public RenameProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RenameProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public RenameProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RenameProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public RenameProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public RenameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public RenameProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -272,12 +324,15 @@ public RenameProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RenameProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -311,12 +366,18 @@ public RenameProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public RenameProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RenameProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -332,6 +393,9 @@ public RenameProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public RenameProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -341,7 +405,7 @@ public RenameProcessorDescriptor OnFailure(ICollection configure) + public RenameProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -359,7 +423,7 @@ public RenameProcessorDescriptor OnFailure(Action configure return Self; } - public RenameProcessorDescriptor OnFailure(params Action[] configure) + public RenameProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -368,6 +432,9 @@ public RenameProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RenameProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -441,7 +508,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -450,7 +517,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs index 67aef6d5de0..8e564e4de81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs @@ -37,6 +37,10 @@ public sealed partial class RerouteProcessor [JsonInclude, JsonPropertyName("dataset")] [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Dataset { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -45,8 +49,16 @@ public sealed partial class RerouteProcessor /// [JsonInclude, JsonPropertyName("destination")] public string? Destination { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,12 +70,20 @@ public sealed partial class RerouteProcessor [JsonInclude, JsonPropertyName("namespace")] [SingleOrManyCollectionConverter(typeof(string))] public ICollection? Namespace { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(RerouteProcessor rerouteProcessor) => Ingest.Processor.Reroute(rerouteProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(RerouteProcessor rerouteProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Reroute(rerouteProcessor); } public sealed partial class RerouteProcessorDescriptor : SerializableDescriptor> @@ -81,9 +101,9 @@ public RerouteProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private ICollection? NamespaceValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } /// @@ -97,6 +117,9 @@ public RerouteProcessorDescriptor Dataset(ICollection? datase return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RerouteProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -112,12 +135,18 @@ public RerouteProcessorDescriptor Destination(string? destination) return Self; } - public RerouteProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RerouteProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RerouteProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -135,6 +164,9 @@ public RerouteProcessorDescriptor Namespace(ICollection? valu return Self; } + /// + /// Handle failures for the processor. + /// public RerouteProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -144,7 +176,7 @@ public RerouteProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public RerouteProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -153,7 +185,7 @@ public RerouteProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public RerouteProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,7 +194,7 @@ public RerouteProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public RerouteProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -171,6 +203,9 @@ public RerouteProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RerouteProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -227,7 +262,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -236,7 +271,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -272,9 +307,9 @@ public RerouteProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private ICollection? NamespaceValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } /// @@ -288,6 +323,9 @@ public RerouteProcessorDescriptor Dataset(ICollection? dataset) return Self; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public RerouteProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -303,12 +341,18 @@ public RerouteProcessorDescriptor Destination(string? destination) return Self; } - public RerouteProcessorDescriptor If(string? ifValue) + /// + /// Conditionally execute the processor. + /// + public RerouteProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public RerouteProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -326,6 +370,9 @@ public RerouteProcessorDescriptor Namespace(ICollection? value) return Self; } + /// + /// Handle failures for the processor. + /// public RerouteProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -335,7 +382,7 @@ public RerouteProcessorDescriptor OnFailure(ICollection configure) + public RerouteProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -353,7 +400,7 @@ public RerouteProcessorDescriptor OnFailure(Action configur return Self; } - public RerouteProcessorDescriptor OnFailure(params Action[] configure) + public RerouteProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -362,6 +409,9 @@ public RerouteProcessorDescriptor OnFailure(params Action[] return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public RerouteProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -418,7 +468,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -427,7 +477,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -446,4 +496,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs new file mode 100644 index 00000000000..e90bab7a002 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +public sealed partial class ScriptProcessor +{ + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ [JsonInclude, JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Id? Id { get; set; } + + /// + /// Conditionally execute the processor. + /// + [JsonInclude, JsonPropertyName("if")] + public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// + [JsonInclude, JsonPropertyName("ignore_failure")] + public bool? IgnoreFailure { get; set; } + + /// + /// Script language. + /// + [JsonInclude, JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// Handle failures for the processor. + /// + [JsonInclude, JsonPropertyName("on_failure")] + public ICollection? OnFailure { get; set; } + + /// + /// Object containing parameters for the script. + /// + [JsonInclude, JsonPropertyName("params")] + public IDictionary? Params { get; set; } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ [JsonInclude, JsonPropertyName("source")] + public string? Source { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ [JsonInclude, JsonPropertyName("tag")] + public string? Tag { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(ScriptProcessor scriptProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Script(scriptProcessor); +} + +public sealed partial class ScriptProcessorDescriptor : SerializableDescriptor> +{ + internal ScriptProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public ScriptProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Id? IdValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LangValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + private string? TagValue { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ public ScriptProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ScriptProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// + public ScriptProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Script language. + /// + public ScriptProcessorDescriptor Lang(string? lang) + { + LangValue = lang; + return Self; + } + + /// + /// Handle failures for the processor. + /// + public ScriptProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Action> configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(params Action>[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Object containing parameters for the script. + /// + public ScriptProcessorDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ public ScriptProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, 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(LangValue)) + { + writer.WritePropertyName("lang"); + writer.WriteStringValue(LangValue); + } + + 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 Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + if (!string.IsNullOrEmpty(TagValue)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(TagValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptProcessorDescriptor : SerializableDescriptor +{ + internal ScriptProcessorDescriptor(Action configure) => configure.Invoke(this); + + public ScriptProcessorDescriptor() : base() + { + } + + private string? DescriptionValue { get; set; } + private Elastic.Clients.Elasticsearch.Id? IdValue { get; set; } + private string? IfValue { get; set; } + private bool? IgnoreFailureValue { get; set; } + private string? LangValue { get; set; } + private ICollection? OnFailureValue { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } + private IDictionary? ParamsValue { get; set; } + private string? SourceValue { get; set; } + private string? TagValue { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
+ public ScriptProcessorDescriptor Description(string? description) + { + DescriptionValue = description; + return Self; + } + + /// + /// ID of a stored script.
If no `source` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public ScriptProcessorDescriptor If(string? value) + { + IfValue = value; + return Self; + } + + /// + /// Ignore failures for the processor. + /// + public ScriptProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) + { + IgnoreFailureValue = ignoreFailure; + return Self; + } + + /// + /// Script language. + /// + public ScriptProcessorDescriptor Lang(string? lang) + { + LangValue = lang; + return Self; + } + + /// + /// Handle failures for the processor. + /// + public ScriptProcessorDescriptor OnFailure(ICollection? onFailure) + { + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureValue = onFailure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) + { + OnFailureValue = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = null; + OnFailureDescriptor = descriptor; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(Action configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorActions = null; + OnFailureDescriptorAction = configure; + return Self; + } + + public ScriptProcessorDescriptor OnFailure(params Action[] configure) + { + OnFailureValue = null; + OnFailureDescriptor = null; + OnFailureDescriptorAction = null; + OnFailureDescriptorActions = configure; + return Self; + } + + /// + /// Object containing parameters for the script. + /// + public ScriptProcessorDescriptor Params(Func, FluentDictionary> selector) + { + ParamsValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Inline script.
If no `id` is specified, this parameter is required.
+ ///
+ public ScriptProcessorDescriptor Source(string? source) + { + SourceValue = source; + return Self; + } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
+ public ScriptProcessorDescriptor Tag(string? tag) + { + TagValue = tag; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DescriptionValue)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + } + + if (IdValue is not null) + { + writer.WritePropertyName("id"); + JsonSerializer.Serialize(writer, IdValue, 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(LangValue)) + { + writer.WritePropertyName("lang"); + writer.WriteStringValue(LangValue); + } + + 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 Elastic.Clients.Elasticsearch.Ingest.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 Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (OnFailureValue is not null) + { + writer.WritePropertyName("on_failure"); + JsonSerializer.Serialize(writer, OnFailureValue, options); + } + + if (ParamsValue is not null) + { + writer.WritePropertyName("params"); + JsonSerializer.Serialize(writer, ParamsValue, options); + } + + if (!string.IsNullOrEmpty(SourceValue)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(SourceValue); + } + + 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/_Generated/Types/Ingest/SetProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs index d272f8dae9d..47860e13b4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs @@ -34,6 +34,10 @@ public sealed partial class SetProcessor ///
[JsonInclude, JsonPropertyName("copy_from")] public Elastic.Clients.Elasticsearch.Field? CopyFrom { get; set; } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -42,6 +46,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } @@ -50,6 +58,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("ignore_empty_value")] public bool? IgnoreEmptyValue { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -58,6 +70,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("media_type")] public string? MediaType { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -66,6 +82,10 @@ public sealed partial class SetProcessor /// [JsonInclude, JsonPropertyName("override")] public bool? Override { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -75,7 +95,7 @@ public sealed partial class SetProcessor [JsonInclude, JsonPropertyName("value")] public object? Value { get; set; } - public static implicit operator Processor(SetProcessor setProcessor) => Ingest.Processor.Set(setProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(SetProcessor setProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Set(setProcessor); } public sealed partial class SetProcessorDescriptor : SerializableDescriptor> @@ -94,9 +114,9 @@ public SetProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? MediaTypeValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string? TagValue { get; set; } private object? ValueValue { get; set; } @@ -119,6 +139,18 @@ public SetProcessorDescriptor CopyFrom(Expression + /// 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; + } + + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -143,9 +175,21 @@ public SetProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to insert, upsert, or update.
Supports template snippets.
+ ///
+ public SetProcessorDescriptor Field(Expression> field) { - IfValue = ifValue; + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SetProcessorDescriptor If(string? value) + { + IfValue = value; return Self; } @@ -158,6 +202,9 @@ public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue return Self; } + /// + /// Ignore failures for the processor. + /// public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -173,6 +220,9 @@ public SetProcessorDescriptor MediaType(string? mediaType) return Self; } + /// + /// Handle failures for the processor. + /// public SetProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -182,7 +232,7 @@ public SetProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SetProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -191,7 +241,7 @@ public SetProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SetProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -200,7 +250,7 @@ public SetProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SetProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -212,12 +262,15 @@ public SetProcessorDescriptor OnFailure(params Action /// 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) + public SetProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -285,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -294,7 +347,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -343,9 +396,9 @@ public SetProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private string? MediaTypeValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private bool? OverrideValue { get; set; } private string? TagValue { get; set; } private object? ValueValue { get; set; } @@ -377,6 +430,9 @@ public SetProcessorDescriptor CopyFrom(Expression + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ /// public SetProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -410,9 +466,12 @@ public SetProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SetProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } @@ -425,6 +484,9 @@ public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue = true) return Self; } + /// + /// Ignore failures for the processor. + /// public SetProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -440,6 +502,9 @@ public SetProcessorDescriptor MediaType(string? mediaType) return Self; } + /// + /// Handle failures for the processor. + /// public SetProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -449,7 +514,7 @@ public SetProcessorDescriptor OnFailure(ICollection configure) + public SetProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -467,7 +532,7 @@ public SetProcessorDescriptor OnFailure(Action configure) return Self; } - public SetProcessorDescriptor OnFailure(params Action[] configure) + public SetProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -479,12 +544,15 @@ public SetProcessorDescriptor OnFailure(params Action[] con /// /// 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) + public SetProcessorDescriptor Override(bool? value = true) { - OverrideValue = overrideValue; + OverrideValue = value; return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -552,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -561,7 +629,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs index 05d6ab11dce..b22df385471 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class SetSecurityUserProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class SetSecurityUserProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,10 +64,14 @@ public sealed partial class SetSecurityUserProcessor /// [JsonInclude, JsonPropertyName("properties")] public ICollection? Properties { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } - public static implicit operator Processor(SetSecurityUserProcessor setSecurityUserProcessor) => Ingest.Processor.SetSecurityUser(setSecurityUserProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(SetSecurityUserProcessor setSecurityUserProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.SetSecurityUser(setSecurityUserProcessor); } public sealed partial class SetSecurityUserProcessorDescriptor : SerializableDescriptor> @@ -68,12 +87,15 @@ public SetSecurityUserProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetSecurityUserProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -98,18 +120,36 @@ public SetSecurityUserProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to store the user information into. + /// + public SetSecurityUserProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SetSecurityUserProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -119,7 +159,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SetSecurityUserProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -128,7 +168,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ProcessorDescript return Self; } - public SetSecurityUserProcessorDescriptor OnFailure(Action> configure) + public SetSecurityUserProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -137,7 +177,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SetSecurityUserProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -155,6 +195,9 @@ public SetSecurityUserProcessorDescriptor Properties(ICollection + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public SetSecurityUserProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -195,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -204,7 +247,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -244,12 +287,15 @@ public SetSecurityUserProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? PropertiesValue { get; set; } private string? TagValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SetSecurityUserProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -283,18 +329,27 @@ public SetSecurityUserProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SetSecurityUserProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SetSecurityUserProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SetSecurityUserProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -304,7 +359,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(ICollection configure) + public SetSecurityUserProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -322,7 +377,7 @@ public SetSecurityUserProcessorDescriptor OnFailure(Action return Self; } - public SetSecurityUserProcessorDescriptor OnFailure(params Action[] configure) + public SetSecurityUserProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -340,6 +395,9 @@ public SetSecurityUserProcessorDescriptor Properties(ICollection? proper return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SetSecurityUserProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -380,7 +438,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -389,7 +447,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs index 0e983359ff6..5154e11a21d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class SortProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,10 +40,22 @@ public sealed partial class SortProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -49,6 +64,10 @@ public sealed partial class SortProcessor /// [JsonInclude, JsonPropertyName("order")] public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class SortProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(SortProcessor sortProcessor) => Ingest.Processor.Sort(sortProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(SortProcessor sortProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Sort(sortProcessor); } public sealed partial class SortProcessorDescriptor : SerializableDescriptor> @@ -74,13 +93,16 @@ public SortProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SortProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,18 +127,36 @@ public SortProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to be sorted. + /// + public SortProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SortProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SortProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -126,7 +166,7 @@ public SortProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SortProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -135,7 +175,7 @@ public SortProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SortProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -144,7 +184,7 @@ public SortProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SortProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.So return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SortProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public SortProcessorDescriptor TargetField(Expression + /// 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(); @@ -220,7 +272,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -229,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -275,13 +327,16 @@ public SortProcessorDescriptor() : base() private string? IfValue { get; set; } private bool? IgnoreFailureValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SortProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,18 +370,27 @@ public SortProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SortProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SortProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; return Self; } + /// + /// Handle failures for the processor. + /// public SortProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -336,7 +400,7 @@ public SortProcessorDescriptor OnFailure(ICollection configure) + public SortProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -354,7 +418,7 @@ public SortProcessorDescriptor OnFailure(Action configure) return Self; } - public SortProcessorDescriptor OnFailure(params Action[] configure) + public SortProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public SortProcessorDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? or return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SortProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -439,7 +506,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -448,7 +515,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs index 9087be3a66a..cfe7325c8d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class SplitProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } @@ -61,6 +76,10 @@ public sealed partial class SplitProcessor /// [JsonInclude, JsonPropertyName("separator")] public string Separator { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -70,7 +89,7 @@ public sealed partial class SplitProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(SplitProcessor splitProcessor) => Ingest.Processor.Split(splitProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(SplitProcessor splitProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Split(splitProcessor); } public sealed partial class SplitProcessorDescriptor : SerializableDescriptor> @@ -87,14 +106,17 @@ public SplitProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private bool? PreserveTrailingValue { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SplitProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -119,12 +141,27 @@ public SplitProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to split. + /// + public SplitProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public SplitProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -140,6 +177,9 @@ public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = t return Self; } + /// + /// Handle failures for the processor. + /// public SplitProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -149,7 +189,7 @@ public SplitProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public SplitProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -158,7 +198,7 @@ public SplitProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public SplitProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -167,7 +207,7 @@ public SplitProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public SplitProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -194,6 +234,9 @@ public SplitProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SplitProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -218,6 +261,15 @@ public SplitProcessorDescriptor TargetField(Expression + /// 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(); @@ -258,7 +310,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -267,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -316,14 +368,17 @@ public SplitProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private bool? PreserveTrailingValue { get; set; } private string SeparatorValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public SplitProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -357,12 +412,18 @@ public SplitProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public SplitProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public SplitProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -378,6 +439,9 @@ public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public SplitProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -387,7 +451,7 @@ public SplitProcessorDescriptor OnFailure(ICollection configure) + public SplitProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -405,7 +469,7 @@ public SplitProcessorDescriptor OnFailure(Action configure) return Self; } - public SplitProcessorDescriptor OnFailure(params Action[] configure) + public SplitProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -432,6 +496,9 @@ public SplitProcessorDescriptor Separator(string separator) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public SplitProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -505,7 +572,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -514,7 +581,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs index 2cd3082bdf3..a0b542d2823 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class TrimProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class TrimProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class TrimProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class TrimProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(TrimProcessor trimProcessor) => Ingest.Processor.Trim(trimProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(TrimProcessor trimProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Trim(trimProcessor); } public sealed partial class TrimProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public TrimProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public TrimProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public TrimProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The string-valued field to trim whitespace from. + /// + public TrimProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public TrimProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = tr return Self; } + /// + /// Handle failures for the processor. + /// public TrimProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public TrimProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public TrimProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public TrimProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public TrimProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public TrimProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public TrimProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public TrimProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public TrimProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public TrimProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public TrimProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public TrimProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public TrimProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public TrimProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public TrimProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public TrimProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public TrimProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public TrimProcessorDescriptor OnFailure(ICollection configure) + public TrimProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public TrimProcessorDescriptor OnFailure(Action configure) return Self; } - public TrimProcessorDescriptor OnFailure(params Action[] configure) + public TrimProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public TrimProcessorDescriptor OnFailure(params Action[] co return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public TrimProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs index 635371ab11b..34d6b6123d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class UppercaseProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UppercaseProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class UppercaseProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class UppercaseProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(UppercaseProcessor uppercaseProcessor) => Ingest.Processor.Uppercase(uppercaseProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(UppercaseProcessor uppercaseProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.Uppercase(uppercaseProcessor); } public sealed partial class UppercaseProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public UppercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UppercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public UppercaseProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to make uppercase. + /// + public UppercaseProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UppercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public UppercaseProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UppercaseProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public UppercaseProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UppercaseProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public UppercaseProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UppercaseProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public UppercaseProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public UppercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public UppercaseProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public UppercaseProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UppercaseProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public UppercaseProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UppercaseProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UppercaseProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public UppercaseProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UppercaseProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public UppercaseProcessorDescriptor OnFailure(ICollection configure) + public UppercaseProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public UppercaseProcessorDescriptor OnFailure(Action config return Self; } - public UppercaseProcessorDescriptor OnFailure(params Action[] configure) + public UppercaseProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public UppercaseProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UppercaseProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs index 53fa83de569..cf145fbd071 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class UrlDecodeProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UrlDecodeProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,8 +58,16 @@ public sealed partial class UrlDecodeProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -58,7 +77,7 @@ public sealed partial class UrlDecodeProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(UrlDecodeProcessor urlDecodeProcessor) => Ingest.Processor.UrlDecode(urlDecodeProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(UrlDecodeProcessor urlDecodeProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.UrlDecode(urlDecodeProcessor); } public sealed partial class UrlDecodeProcessorDescriptor : SerializableDescriptor> @@ -75,12 +94,15 @@ public UrlDecodeProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UrlDecodeProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -105,12 +127,27 @@ public UrlDecodeProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field to decode. + /// + public UrlDecodeProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UrlDecodeProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -126,6 +163,9 @@ public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -135,7 +175,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UrlDecodeProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -144,7 +184,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UrlDecodeProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -153,7 +193,7 @@ public UrlDecodeProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UrlDecodeProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -162,6 +202,9 @@ public UrlDecodeProcessorDescriptor OnFailure(params Action + /// Identifier for the processor.
Useful for debugging and metrics.
+ /// public UrlDecodeProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -186,6 +229,15 @@ public UrlDecodeProcessorDescriptor TargetField(Expression + /// 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(); @@ -226,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -235,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -276,12 +328,15 @@ public UrlDecodeProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UrlDecodeProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -315,12 +370,18 @@ public UrlDecodeProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UrlDecodeProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UrlDecodeProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -336,6 +397,9 @@ public UrlDecodeProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UrlDecodeProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -345,7 +409,7 @@ public UrlDecodeProcessorDescriptor OnFailure(ICollection configure) + public UrlDecodeProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -363,7 +427,7 @@ public UrlDecodeProcessorDescriptor OnFailure(Action config return Self; } - public UrlDecodeProcessorDescriptor OnFailure(params Action[] configure) + public UrlDecodeProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -372,6 +436,9 @@ public UrlDecodeProcessorDescriptor OnFailure(params Action return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UrlDecodeProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -445,7 +512,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -454,7 +521,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs index 9e7443d76cf..d8c4fbf32a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs @@ -29,6 +29,9 @@ namespace Elastic.Clients.Elasticsearch.Ingest; public sealed partial class UserAgentProcessor { + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
[JsonInclude, JsonPropertyName("description")] public string? Description { get; set; } @@ -37,8 +40,16 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Conditionally execute the processor. + /// [JsonInclude, JsonPropertyName("if")] public string? If { get; set; } + + /// + /// Ignore failures for the processor. + /// [JsonInclude, JsonPropertyName("ignore_failure")] public bool? IgnoreFailure { get; set; } @@ -47,6 +58,10 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("ignore_missing")] public bool? IgnoreMissing { get; set; } + + /// + /// Handle failures for the processor. + /// [JsonInclude, JsonPropertyName("on_failure")] public ICollection? OnFailure { get; set; } [JsonInclude, JsonPropertyName("options")] @@ -57,6 +72,10 @@ public sealed partial class UserAgentProcessor /// [JsonInclude, JsonPropertyName("regex_file")] public string? RegexFile { get; set; } + + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
[JsonInclude, JsonPropertyName("tag")] public string? Tag { get; set; } @@ -66,7 +85,7 @@ public sealed partial class UserAgentProcessor [JsonInclude, JsonPropertyName("target_field")] public Elastic.Clients.Elasticsearch.Field? TargetField { get; set; } - public static implicit operator Processor(UserAgentProcessor userAgentProcessor) => Ingest.Processor.UserAgent(userAgentProcessor); + public static implicit operator Elastic.Clients.Elasticsearch.Ingest.Processor(UserAgentProcessor userAgentProcessor) => Elastic.Clients.Elasticsearch.Ingest.Processor.UserAgent(userAgentProcessor); } public sealed partial class UserAgentProcessorDescriptor : SerializableDescriptor> @@ -83,14 +102,17 @@ public UserAgentProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action> OnFailureDescriptorAction { get; set; } - private Action>[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action> OnFailureDescriptorAction { get; set; } + private Action>[] OnFailureDescriptorActions { get; set; } private ICollection? OptionsValue { get; set; } private string? RegexFileValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UserAgentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -115,12 +137,27 @@ public UserAgentProcessorDescriptor Field(Expression If(string? ifValue) + /// + /// The field containing the user agent string. + /// + public UserAgentProcessorDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Conditionally execute the processor. + /// + public UserAgentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -136,6 +173,9 @@ public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing return Self; } + /// + /// Handle failures for the processor. + /// public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -145,7 +185,7 @@ public UserAgentProcessorDescriptor OnFailure(ICollection OnFailure(ProcessorDescriptor descriptor) + public UserAgentProcessorDescriptor OnFailure(Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor descriptor) { OnFailureValue = null; OnFailureDescriptorAction = null; @@ -154,7 +194,7 @@ public UserAgentProcessorDescriptor OnFailure(ProcessorDescriptor OnFailure(Action> configure) + public UserAgentProcessorDescriptor OnFailure(Action> configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -163,7 +203,7 @@ public UserAgentProcessorDescriptor OnFailure(Action OnFailure(params Action>[] configure) + public UserAgentProcessorDescriptor OnFailure(params Action>[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -187,6 +227,9 @@ public UserAgentProcessorDescriptor RegexFile(string? regexFile) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UserAgentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -211,6 +254,15 @@ public UserAgentProcessorDescriptor TargetField(Expression + /// 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(); @@ -251,7 +303,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -260,7 +312,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); @@ -313,14 +365,17 @@ public UserAgentProcessorDescriptor() : base() private bool? IgnoreFailureValue { get; set; } private bool? IgnoreMissingValue { get; set; } private ICollection? OnFailureValue { get; set; } - private ProcessorDescriptor OnFailureDescriptor { get; set; } - private Action OnFailureDescriptorAction { get; set; } - private Action[] OnFailureDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor OnFailureDescriptor { get; set; } + private Action OnFailureDescriptorAction { get; set; } + private Action[] OnFailureDescriptorActions { get; set; } private ICollection? OptionsValue { get; set; } private string? RegexFileValue { get; set; } private string? TagValue { get; set; } private Elastic.Clients.Elasticsearch.Field? TargetFieldValue { get; set; } + /// + /// Description of the processor.
Useful for describing the purpose of the processor or its configuration.
+ ///
public UserAgentProcessorDescriptor Description(string? description) { DescriptionValue = description; @@ -354,12 +409,18 @@ public UserAgentProcessorDescriptor Field(Expression + /// Conditionally execute the processor. + /// + public UserAgentProcessorDescriptor If(string? value) { - IfValue = ifValue; + IfValue = value; return Self; } + /// + /// Ignore failures for the processor. + /// public UserAgentProcessorDescriptor IgnoreFailure(bool? ignoreFailure = true) { IgnoreFailureValue = ignoreFailure; @@ -375,6 +436,9 @@ public UserAgentProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) return Self; } + /// + /// Handle failures for the processor. + /// public UserAgentProcessorDescriptor OnFailure(ICollection? onFailure) { OnFailureDescriptor = null; @@ -384,7 +448,7 @@ public UserAgentProcessorDescriptor OnFailure(ICollection configure) + public UserAgentProcessorDescriptor OnFailure(Action configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -402,7 +466,7 @@ public UserAgentProcessorDescriptor OnFailure(Action config return Self; } - public UserAgentProcessorDescriptor OnFailure(params Action[] configure) + public UserAgentProcessorDescriptor OnFailure(params Action[] configure) { OnFailureValue = null; OnFailureDescriptor = null; @@ -426,6 +490,9 @@ public UserAgentProcessorDescriptor RegexFile(string? regexFile) return Self; } + /// + /// Identifier for the processor.
Useful for debugging and metrics.
+ ///
public UserAgentProcessorDescriptor Tag(string? tag) { TagValue = tag; @@ -499,7 +566,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("on_failure"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new ProcessorDescriptor(OnFailureDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(OnFailureDescriptorAction), options); writer.WriteEndArray(); } else if (OnFailureDescriptorActions is not null) @@ -508,7 +575,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in OnFailureDescriptorActions) { - JsonSerializer.Serialize(writer, new ProcessorDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Ingest.ProcessorDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs index 6db7448afb9..9be338fb787 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs @@ -27,21 +27,87 @@ namespace Elastic.Clients.Elasticsearch; +internal sealed partial class InlineGetConverter : JsonConverter> +{ + public override InlineGet Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyDictionary? fields = default; + bool found = default; + long? primaryTerm = default; + string? routing = default; + long? seqNo = default; + TDocument? source = default; + Dictionary additionalProperties = null; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "fields") + { + fields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "found") + { + found = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_primary_term") + { + primaryTerm = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_routing") + { + routing = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_seq_no") + { + seqNo = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_source") + { + source = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new InlineGet { Fields = fields, Found = found, Metadata = additionalProperties, PrimaryTerm = primaryTerm, Routing = routing, SeqNo = seqNo, Source = source }; + } + + public override void Write(Utf8JsonWriter writer, InlineGet value, JsonSerializerOptions options) + { + throw new NotImplementedException("'InlineGet' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[GenericConverter(typeof(InlineGetConverter<>), unwrap: true)] 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")] + + /// + /// Document metadata + /// public IReadOnlyDictionary Metadata { get; init; } + public long? PrimaryTerm { get; init; } + public string? Routing { get; init; } + public long? SeqNo { get; init; } + public TDocument? Source { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineScript.g.cs index 107e40bcd21..6b1aca59783 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineScript.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineScript.g.cs @@ -36,6 +36,10 @@ public sealed partial class InlineScript public Elastic.Clients.Elasticsearch.ScriptLanguage? Language { get; set; } [JsonInclude, JsonPropertyName("options")] public IDictionary? Options { get; set; } + + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
[JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } @@ -74,6 +78,9 @@ public InlineScriptDescriptor Options(Func, Flu return Self; } + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
public InlineScriptDescriptor Params(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs index 5b5933ad0ff..caa139329c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs @@ -24,11 +24,10 @@ using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; -using Elastic.Clients.Elasticsearch.QueryDsl; namespace Elastic.Clients.Elasticsearch; -public sealed partial class KnnQuery : SearchQuery +public sealed partial class KnnQuery { /// /// Boost value to apply to kNN scores @@ -49,6 +48,12 @@ public sealed partial class KnnQuery : SearchQuery [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Query))] public ICollection? Filter { get; set; } + /// + /// If defined, each search hit will contain inner hits. + /// + [JsonInclude, JsonPropertyName("inner_hits")] + public Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHits { get; set; } + /// /// The final number of nearest neighbors to return as top hits /// @@ -79,9 +84,7 @@ public sealed partial class KnnQuery : SearchQuery [JsonInclude, JsonPropertyName("similarity")] public float? Similarity { get; set; } - public static implicit operator Query(KnnQuery knnQuery) => QueryDsl.Query.Knn(knnQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("knn", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(KnnQuery knnQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Knn(knnQuery); } public sealed partial class KnnQueryDescriptor : SerializableDescriptor> @@ -95,15 +98,18 @@ public KnnQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private long kValue { get; set; } private long NumCandidatesValue { get; set; } private ICollection? QueryVectorValue { get; set; } private Elastic.Clients.Elasticsearch.QueryVectorBuilder? QueryVectorBuilderValue { get; set; } - private QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } - private Action QueryVectorBuilderDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } private float? SimilarityValue { get; set; } /// @@ -133,6 +139,15 @@ public KnnQueryDescriptor Field(Expression + /// The name of the vector field to search against + /// + public KnnQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Filters for the kNN search query /// @@ -145,7 +160,7 @@ public KnnQueryDescriptor Filter(ICollection Filter(QueryDsl.QueryDescriptor descriptor) + public KnnQueryDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -154,7 +169,7 @@ public KnnQueryDescriptor Filter(QueryDsl.QueryDescriptor return Self; } - public KnnQueryDescriptor Filter(Action> configure) + public KnnQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -163,7 +178,7 @@ public KnnQueryDescriptor Filter(Action Filter(params Action>[] configure) + public KnnQueryDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -172,6 +187,33 @@ public KnnQueryDescriptor Filter(params Action + /// If defined, each search hit will contain inner hits. + /// + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor InnerHits(Action> configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + /// /// The final number of nearest neighbors to return as top hits /// @@ -210,7 +252,7 @@ public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elastics return Self; } - public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor descriptor) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptorAction = null; @@ -218,7 +260,7 @@ public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescri return Self; } - public KnnQueryDescriptor QueryVectorBuilder(Action configure) + public KnnQueryDescriptor QueryVectorBuilder(Action configure) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptor = null; @@ -254,7 +296,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -263,7 +305,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -275,6 +317,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(FilterValue, writer, 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 Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + writer.WritePropertyName("k"); writer.WriteNumberValue(kValue); writer.WritePropertyName("num_candidates"); @@ -293,7 +351,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryVectorBuilderDescriptorAction is not null) { writer.WritePropertyName("query_vector_builder"); - JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); } else if (QueryVectorBuilderValue is not null) { @@ -322,15 +380,18 @@ public KnnQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private long kValue { get; set; } private long NumCandidatesValue { get; set; } private ICollection? QueryVectorValue { get; set; } private Elastic.Clients.Elasticsearch.QueryVectorBuilder? QueryVectorBuilderValue { get; set; } - private QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } - private Action QueryVectorBuilderDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor QueryVectorBuilderDescriptor { get; set; } + private Action QueryVectorBuilderDescriptorAction { get; set; } private float? SimilarityValue { get; set; } /// @@ -381,7 +442,7 @@ public KnnQueryDescriptor Filter(ICollection configure) + public KnnQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -399,7 +460,7 @@ public KnnQueryDescriptor Filter(Action configure) return Self; } - public KnnQueryDescriptor Filter(params Action[] configure) + public KnnQueryDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -408,6 +469,33 @@ public KnnQueryDescriptor Filter(params Action[] confi return Self; } + /// + /// If defined, each search hit will contain inner hits. + /// + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHits? innerHits) + { + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = null; + InnerHitsValue = innerHits; + return Self; + } + + public KnnQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) + { + InnerHitsValue = null; + InnerHitsDescriptorAction = null; + InnerHitsDescriptor = descriptor; + return Self; + } + + public KnnQueryDescriptor InnerHits(Action configure) + { + InnerHitsValue = null; + InnerHitsDescriptor = null; + InnerHitsDescriptorAction = configure; + return Self; + } + /// /// The final number of nearest neighbors to return as top hits /// @@ -446,7 +534,7 @@ public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.Query return Self; } - public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descriptor) + public KnnQueryDescriptor QueryVectorBuilder(Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor descriptor) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptorAction = null; @@ -454,7 +542,7 @@ public KnnQueryDescriptor QueryVectorBuilder(QueryVectorBuilderDescriptor descri return Self; } - public KnnQueryDescriptor QueryVectorBuilder(Action configure) + public KnnQueryDescriptor QueryVectorBuilder(Action configure) { QueryVectorBuilderValue = null; QueryVectorBuilderDescriptor = null; @@ -490,7 +578,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -499,7 +587,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -511,6 +599,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(FilterValue, writer, 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 Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + } + else if (InnerHitsValue is not null) + { + writer.WritePropertyName("inner_hits"); + JsonSerializer.Serialize(writer, InnerHitsValue, options); + } + writer.WritePropertyName("k"); writer.WriteNumberValue(kValue); writer.WritePropertyName("num_candidates"); @@ -529,7 +633,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryVectorBuilderDescriptorAction is not null) { writer.WritePropertyName("query_vector_builder"); - JsonSerializer.Serialize(writer, new QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(QueryVectorBuilderDescriptorAction), options); } else if (QueryVectorBuilderValue is not null) { @@ -545,4 +649,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs new file mode 100644 index 00000000000..528902e7649 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class Acknowledgement +{ + [JsonInclude, JsonPropertyName("license")] + public IReadOnlyCollection License { get; init; } + [JsonInclude, JsonPropertyName("message")] + public string Message { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs new file mode 100644 index 00000000000..b6671feb117 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class License +{ + [JsonInclude, JsonPropertyName("expiry_date_in_millis")] + public long ExpiryDateInMillis { get; set; } + [JsonInclude, JsonPropertyName("issue_date_in_millis")] + public long IssueDateInMillis { get; set; } + [JsonInclude, JsonPropertyName("issued_to")] + public string IssuedTo { get; set; } + [JsonInclude, JsonPropertyName("issuer")] + public string Issuer { get; set; } + [JsonInclude, JsonPropertyName("max_nodes")] + public long? MaxNodes { get; set; } + [JsonInclude, JsonPropertyName("max_resource_units")] + public long? MaxResourceUnits { get; set; } + [JsonInclude, JsonPropertyName("signature")] + public string Signature { get; set; } + [JsonInclude, JsonPropertyName("start_date_in_millis")] + public long? StartDateInMillis { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType Type { get; set; } + [JsonInclude, JsonPropertyName("uid")] + public string Uid { get; set; } +} + +public sealed partial class LicenseDescriptor : SerializableDescriptor +{ + internal LicenseDescriptor(Action configure) => configure.Invoke(this); + + public LicenseDescriptor() : base() + { + } + + private long ExpiryDateInMillisValue { get; set; } + private long IssueDateInMillisValue { get; set; } + private string IssuedToValue { get; set; } + private string IssuerValue { get; set; } + private long? MaxNodesValue { get; set; } + private long? MaxResourceUnitsValue { get; set; } + private string SignatureValue { get; set; } + private long? StartDateInMillisValue { get; set; } + private Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType TypeValue { get; set; } + private string UidValue { get; set; } + + public LicenseDescriptor ExpiryDateInMillis(long expiryDateInMillis) + { + ExpiryDateInMillisValue = expiryDateInMillis; + return Self; + } + + public LicenseDescriptor IssueDateInMillis(long issueDateInMillis) + { + IssueDateInMillisValue = issueDateInMillis; + return Self; + } + + public LicenseDescriptor IssuedTo(string issuedTo) + { + IssuedToValue = issuedTo; + return Self; + } + + public LicenseDescriptor Issuer(string issuer) + { + IssuerValue = issuer; + return Self; + } + + public LicenseDescriptor MaxNodes(long? maxNodes) + { + MaxNodesValue = maxNodes; + return Self; + } + + public LicenseDescriptor MaxResourceUnits(long? maxResourceUnits) + { + MaxResourceUnitsValue = maxResourceUnits; + return Self; + } + + public LicenseDescriptor Signature(string signature) + { + SignatureValue = signature; + return Self; + } + + public LicenseDescriptor StartDateInMillis(long? startDateInMillis) + { + StartDateInMillisValue = startDateInMillis; + return Self; + } + + public LicenseDescriptor Type(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType type) + { + TypeValue = type; + return Self; + } + + public LicenseDescriptor Uid(string uid) + { + UidValue = uid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("expiry_date_in_millis"); + writer.WriteNumberValue(ExpiryDateInMillisValue); + writer.WritePropertyName("issue_date_in_millis"); + writer.WriteNumberValue(IssueDateInMillisValue); + writer.WritePropertyName("issued_to"); + writer.WriteStringValue(IssuedToValue); + writer.WritePropertyName("issuer"); + writer.WriteStringValue(IssuerValue); + if (MaxNodesValue.HasValue) + { + writer.WritePropertyName("max_nodes"); + writer.WriteNumberValue(MaxNodesValue.Value); + } + + if (MaxResourceUnitsValue.HasValue) + { + writer.WritePropertyName("max_resource_units"); + writer.WriteNumberValue(MaxResourceUnitsValue.Value); + } + + writer.WritePropertyName("signature"); + writer.WriteStringValue(SignatureValue); + if (StartDateInMillisValue.HasValue) + { + writer.WritePropertyName("start_date_in_millis"); + writer.WriteNumberValue(StartDateInMillisValue.Value); + } + + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WritePropertyName("uid"); + writer.WriteStringValue(UidValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs new file mode 100644 index 00000000000..1ac2d70dc1a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +public sealed partial class LicenseInformation +{ + [JsonInclude, JsonPropertyName("expiry_date")] + public DateTimeOffset? ExpiryDate { get; init; } + [JsonInclude, JsonPropertyName("expiry_date_in_millis")] + public long? ExpiryDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("issue_date")] + public DateTimeOffset IssueDate { get; init; } + [JsonInclude, JsonPropertyName("issue_date_in_millis")] + public long IssueDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("issued_to")] + public string IssuedTo { get; init; } + [JsonInclude, JsonPropertyName("issuer")] + public string Issuer { get; init; } + [JsonInclude, JsonPropertyName("max_nodes")] + public long? MaxNodes { get; init; } + [JsonInclude, JsonPropertyName("max_resource_units")] + public int? MaxResourceUnits { get; init; } + [JsonInclude, JsonPropertyName("start_date_in_millis")] + public long StartDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType Type { get; init; } + [JsonInclude, JsonPropertyName("uid")] + public string Uid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs new file mode 100644 index 00000000000..7f46c8a855a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AggregateOutput +{ + [JsonInclude, JsonPropertyName("exponent")] + public Elastic.Clients.Elasticsearch.MachineLearning.Weights? Exponent { get; set; } + [JsonInclude, JsonPropertyName("logistic_regression")] + public Elastic.Clients.Elasticsearch.MachineLearning.Weights? LogisticRegression { get; set; } + [JsonInclude, JsonPropertyName("weighted_mode")] + public Elastic.Clients.Elasticsearch.MachineLearning.Weights? WeightedMode { get; set; } + [JsonInclude, JsonPropertyName("weighted_sum")] + public Elastic.Clients.Elasticsearch.MachineLearning.Weights? WeightedSum { get; set; } +} + +public sealed partial class AggregateOutputDescriptor : SerializableDescriptor +{ + internal AggregateOutputDescriptor(Action configure) => configure.Invoke(this); + + public AggregateOutputDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Weights? ExponentValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor ExponentDescriptor { get; set; } + private Action ExponentDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Weights? LogisticRegressionValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor LogisticRegressionDescriptor { get; set; } + private Action LogisticRegressionDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Weights? WeightedModeValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor WeightedModeDescriptor { get; set; } + private Action WeightedModeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Weights? WeightedSumValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor WeightedSumDescriptor { get; set; } + private Action WeightedSumDescriptorAction { get; set; } + + public AggregateOutputDescriptor Exponent(Elastic.Clients.Elasticsearch.MachineLearning.Weights? exponent) + { + ExponentDescriptor = null; + ExponentDescriptorAction = null; + ExponentValue = exponent; + return Self; + } + + public AggregateOutputDescriptor Exponent(Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor descriptor) + { + ExponentValue = null; + ExponentDescriptorAction = null; + ExponentDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor Exponent(Action configure) + { + ExponentValue = null; + ExponentDescriptor = null; + ExponentDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Elastic.Clients.Elasticsearch.MachineLearning.Weights? logisticRegression) + { + LogisticRegressionDescriptor = null; + LogisticRegressionDescriptorAction = null; + LogisticRegressionValue = logisticRegression; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor descriptor) + { + LogisticRegressionValue = null; + LogisticRegressionDescriptorAction = null; + LogisticRegressionDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor LogisticRegression(Action configure) + { + LogisticRegressionValue = null; + LogisticRegressionDescriptor = null; + LogisticRegressionDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Elastic.Clients.Elasticsearch.MachineLearning.Weights? weightedMode) + { + WeightedModeDescriptor = null; + WeightedModeDescriptorAction = null; + WeightedModeValue = weightedMode; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor descriptor) + { + WeightedModeValue = null; + WeightedModeDescriptorAction = null; + WeightedModeDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor WeightedMode(Action configure) + { + WeightedModeValue = null; + WeightedModeDescriptor = null; + WeightedModeDescriptorAction = configure; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Elastic.Clients.Elasticsearch.MachineLearning.Weights? weightedSum) + { + WeightedSumDescriptor = null; + WeightedSumDescriptorAction = null; + WeightedSumValue = weightedSum; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor descriptor) + { + WeightedSumValue = null; + WeightedSumDescriptorAction = null; + WeightedSumDescriptor = descriptor; + return Self; + } + + public AggregateOutputDescriptor WeightedSum(Action configure) + { + WeightedSumValue = null; + WeightedSumDescriptor = null; + WeightedSumDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ExponentDescriptor is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, ExponentDescriptor, options); + } + else if (ExponentDescriptorAction is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor(ExponentDescriptorAction), options); + } + else if (ExponentValue is not null) + { + writer.WritePropertyName("exponent"); + JsonSerializer.Serialize(writer, ExponentValue, options); + } + + if (LogisticRegressionDescriptor is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, LogisticRegressionDescriptor, options); + } + else if (LogisticRegressionDescriptorAction is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor(LogisticRegressionDescriptorAction), options); + } + else if (LogisticRegressionValue is not null) + { + writer.WritePropertyName("logistic_regression"); + JsonSerializer.Serialize(writer, LogisticRegressionValue, options); + } + + if (WeightedModeDescriptor is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, WeightedModeDescriptor, options); + } + else if (WeightedModeDescriptorAction is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor(WeightedModeDescriptorAction), options); + } + else if (WeightedModeValue is not null) + { + writer.WritePropertyName("weighted_mode"); + JsonSerializer.Serialize(writer, WeightedModeValue, options); + } + + if (WeightedSumDescriptor is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, WeightedSumDescriptor, options); + } + else if (WeightedSumDescriptorAction is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.WeightsDescriptor(WeightedSumDescriptorAction), options); + } + else if (WeightedSumValue is not null) + { + writer.WritePropertyName("weighted_sum"); + JsonSerializer.Serialize(writer, WeightedSumValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs new file mode 100644 index 00000000000..b752d525b17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs @@ -0,0 +1,729 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnalysisConfig +{ + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Duration? BucketSpan { get; set; } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzer { get; set; } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + [JsonInclude, JsonPropertyName("categorization_field_name")] + public Elastic.Clients.Elasticsearch.Field? CategorizationFieldName { get; set; } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + [JsonInclude, JsonPropertyName("categorization_filters")] + public ICollection? CategorizationFilters { get; set; } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + [JsonInclude, JsonPropertyName("detectors")] + public ICollection Detectors { get; set; } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + [JsonInclude, JsonPropertyName("influencers")] + public ICollection? Influencers { get; set; } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + [JsonInclude, JsonPropertyName("latency")] + public Elastic.Clients.Elasticsearch.Duration? Latency { get; set; } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Duration? ModelPruneWindow { get; set; } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + [JsonInclude, JsonPropertyName("multivariate_by_fields")] + public bool? MultivariateByFields { get; set; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; set; } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + [JsonInclude, JsonPropertyName("summary_count_field_name")] + public Elastic.Clients.Elasticsearch.Field? SummaryCountFieldName { get; set; } +} + +public sealed partial class AnalysisConfigDescriptor : SerializableDescriptor> +{ + internal AnalysisConfigDescriptor(Action> configure) => configure.Invoke(this); + + public AnalysisConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? BucketSpanValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? CategorizationFieldNameValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private ICollection DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action> DetectorsDescriptorAction { get; set; } + private Action>[] DetectorsDescriptorActions { get; set; } + private ICollection? InfluencersValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? LatencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ModelPruneWindowValue { get; set; } + private bool? MultivariateByFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SummaryCountFieldNameValue { get; set; } + + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ public AnalysisConfigDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + public AnalysisConfigDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Elastic.Clients.Elasticsearch.Field? categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + public AnalysisConfigDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + public AnalysisConfigDescriptor Detectors(ICollection detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Action> configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public AnalysisConfigDescriptor Detectors(params Action>[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + public AnalysisConfigDescriptor Influencers(ICollection? influencers) + { + InfluencersValue = influencers; + return Self; + } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + public AnalysisConfigDescriptor Latency(Elastic.Clients.Elasticsearch.Duration? latency) + { + LatencyValue = latency; + return Self; + } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + public AnalysisConfigDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + public AnalysisConfigDescriptor MultivariateByFields(bool? multivariateByFields = true) + { + MultivariateByFieldsValue = multivariateByFields; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Elastic.Clients.Elasticsearch.Field? summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFieldNameValue is not null) + { + writer.WritePropertyName("categorization_field_name"); + JsonSerializer.Serialize(writer, CategorizationFieldNameValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (InfluencersValue is not null) + { + writer.WritePropertyName("influencers"); + JsonSerializer.Serialize(writer, InfluencersValue, options); + } + + if (LatencyValue is not null) + { + writer.WritePropertyName("latency"); + JsonSerializer.Serialize(writer, LatencyValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (MultivariateByFieldsValue.HasValue) + { + writer.WritePropertyName("multivariate_by_fields"); + writer.WriteBooleanValue(MultivariateByFieldsValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (SummaryCountFieldNameValue is not null) + { + writer.WritePropertyName("summary_count_field_name"); + JsonSerializer.Serialize(writer, SummaryCountFieldNameValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class AnalysisConfigDescriptor : SerializableDescriptor +{ + internal AnalysisConfigDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? BucketSpanValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzerValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? CategorizationFieldNameValue { get; set; } + private ICollection? CategorizationFiltersValue { get; set; } + private ICollection DetectorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor DetectorsDescriptor { get; set; } + private Action DetectorsDescriptorAction { get; set; } + private Action[] DetectorsDescriptorActions { get; set; } + private ICollection? InfluencersValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? LatencyValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? ModelPruneWindowValue { get; set; } + private bool? MultivariateByFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor PerPartitionCategorizationDescriptor { get; set; } + private Action PerPartitionCategorizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? SummaryCountFieldNameValue { get; set; } + + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. This value should be either a whole number of days or equate to a
whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation.
+ ///
+ public AnalysisConfigDescriptor BucketSpan(Elastic.Clients.Elasticsearch.Duration? bucketSpan) + { + BucketSpanValue = bucketSpan; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. + /// + public AnalysisConfigDescriptor CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? categorizationAnalyzer) + { + CategorizationAnalyzerValue = categorizationAnalyzer; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Elastic.Clients.Elasticsearch.Field? categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. + /// + public AnalysisConfigDescriptor CategorizationFieldName(Expression> categorizationFieldName) + { + CategorizationFieldNameValue = categorizationFieldName; + return Self; + } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same. + /// + public AnalysisConfigDescriptor CategorizationFilters(ICollection? categorizationFilters) + { + CategorizationFiltersValue = categorizationFilters; + return Self; + } + + /// + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. + /// + public AnalysisConfigDescriptor Detectors(ICollection detectors) + { + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsValue = detectors; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor descriptor) + { + DetectorsValue = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = null; + DetectorsDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor Detectors(Action configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorActions = null; + DetectorsDescriptorAction = configure; + return Self; + } + + public AnalysisConfigDescriptor Detectors(params Action[] configure) + { + DetectorsValue = null; + DetectorsDescriptor = null; + DetectorsDescriptorAction = null; + DetectorsDescriptorActions = configure; + return Self; + } + + /// + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// + public AnalysisConfigDescriptor Influencers(ICollection? influencers) + { + InfluencersValue = influencers; + return Self; + } + + /// + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. + /// + public AnalysisConfigDescriptor Latency(Elastic.Clients.Elasticsearch.Duration? latency) + { + LatencyValue = latency; + return Self; + } + + /// + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the `bucket_span`. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`. + /// + public AnalysisConfigDescriptor ModelPruneWindow(Elastic.Clients.Elasticsearch.Duration? modelPruneWindow) + { + ModelPruneWindowValue = modelPruneWindow; + return Self; + } + + /// + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector. + /// + public AnalysisConfigDescriptor MultivariateByFields(bool? multivariateByFields = true) + { + MultivariateByFieldsValue = multivariateByFields; + return Self; + } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? perPartitionCategorization) + { + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationValue = perPartitionCategorization; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor descriptor) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptorAction = null; + PerPartitionCategorizationDescriptor = descriptor; + return Self; + } + + public AnalysisConfigDescriptor PerPartitionCategorization(Action configure) + { + PerPartitionCategorizationValue = null; + PerPartitionCategorizationDescriptor = null; + PerPartitionCategorizationDescriptorAction = configure; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Elastic.Clients.Elasticsearch.Field? summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same `summary_count_field_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function. + /// + public AnalysisConfigDescriptor SummaryCountFieldName(Expression> summaryCountFieldName) + { + SummaryCountFieldNameValue = summaryCountFieldName; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (BucketSpanValue is not null) + { + writer.WritePropertyName("bucket_span"); + JsonSerializer.Serialize(writer, BucketSpanValue, options); + } + + if (CategorizationAnalyzerValue is not null) + { + writer.WritePropertyName("categorization_analyzer"); + JsonSerializer.Serialize(writer, CategorizationAnalyzerValue, options); + } + + if (CategorizationFieldNameValue is not null) + { + writer.WritePropertyName("categorization_field_name"); + JsonSerializer.Serialize(writer, CategorizationFieldNameValue, options); + } + + if (CategorizationFiltersValue is not null) + { + writer.WritePropertyName("categorization_filters"); + JsonSerializer.Serialize(writer, CategorizationFiltersValue, options); + } + + if (DetectorsDescriptor is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, DetectorsDescriptor, options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorAction is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(DetectorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DetectorsDescriptorActions is not null) + { + writer.WritePropertyName("detectors"); + writer.WriteStartArray(); + foreach (var action in DetectorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("detectors"); + JsonSerializer.Serialize(writer, DetectorsValue, options); + } + + if (InfluencersValue is not null) + { + writer.WritePropertyName("influencers"); + JsonSerializer.Serialize(writer, InfluencersValue, options); + } + + if (LatencyValue is not null) + { + writer.WritePropertyName("latency"); + JsonSerializer.Serialize(writer, LatencyValue, options); + } + + if (ModelPruneWindowValue is not null) + { + writer.WritePropertyName("model_prune_window"); + JsonSerializer.Serialize(writer, ModelPruneWindowValue, options); + } + + if (MultivariateByFieldsValue.HasValue) + { + writer.WritePropertyName("multivariate_by_fields"); + writer.WriteBooleanValue(MultivariateByFieldsValue.Value); + } + + if (PerPartitionCategorizationDescriptor is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationDescriptor, options); + } + else if (PerPartitionCategorizationDescriptorAction is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationDescriptor(PerPartitionCategorizationDescriptorAction), options); + } + else if (PerPartitionCategorizationValue is not null) + { + writer.WritePropertyName("per_partition_categorization"); + JsonSerializer.Serialize(writer, PerPartitionCategorizationValue, options); + } + + if (SummaryCountFieldNameValue is not null) + { + writer.WritePropertyName("summary_count_field_name"); + JsonSerializer.Serialize(writer, SummaryCountFieldNameValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs new file mode 100644 index 00000000000..16ae4256233 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnalysisConfigRead +{ + /// + /// The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public Elastic.Clients.Elasticsearch.Duration BucketSpan { get; init; } + + /// + /// If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field.
This property cannot be used at the same time as `categorization_filters`.
The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzer { get; init; } + + /// + /// If this property is specified, the values of the specified field will be categorized.
The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_field_name")] + public string? CategorizationFieldName { get; init; } + + /// + /// If `categorization_field_name` is specified, you can also define optional filters.
This property expects an array of regular expressions.
The expressions are used to filter out matching sequences from the categorization field values.
+ ///
+ [JsonInclude, JsonPropertyName("categorization_filters")] + public IReadOnlyCollection? CategorizationFilters { get; init; } + + /// + /// An array of detector configuration objects.
Detector configuration objects specify which data fields a job analyzes.
They also specify which analytical functions are used.
You can specify multiple detectors for a job.
+ ///
+ [JsonInclude, JsonPropertyName("detectors")] + public IReadOnlyCollection Detectors { get; init; } + + /// + /// A comma separated list of influencer field names.
Typically these can be the by, over, or partition fields that are used in the detector configuration.
You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data.
When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity.
+ ///
+ [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } + + /// + /// The size of the window in which to expect data that is out of time order.
Defaults to no latency.
If you specify a non-zero value, it must be greater than or equal to one second.
+ ///
+ [JsonInclude, JsonPropertyName("latency")] + public Elastic.Clients.Elasticsearch.Duration? Latency { get; init; } + + /// + /// Advanced configuration option.
Affects the pruning of models that have not been updated for the given time duration.
The value must be set to a multiple of the `bucket_span`.
If set too low, important information may be removed from the model.
Typically, set to `30d` or longer.
If not set, model pruning only occurs if the model memory status reaches the soft limit or the hard limit.
For jobs created in 8.1 and later, the default value is the greater of `30d` or 20 times `bucket_span`.
+ ///
+ [JsonInclude, JsonPropertyName("model_prune_window")] + public Elastic.Clients.Elasticsearch.Duration? ModelPruneWindow { get; init; } + + /// + /// This functionality is reserved for internal use.
It is not supported for use in customer environments and is not subject to the support SLA of official GA features.
If set to `true`, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold.
+ ///
+ [JsonInclude, JsonPropertyName("multivariate_by_fields")] + public bool? MultivariateByFields { get; init; } + + /// + /// Settings related to how categorization interacts with partition fields. + /// + [JsonInclude, JsonPropertyName("per_partition_categorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization? PerPartitionCategorization { get; init; } + + /// + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized.
This property value is the name of the field that contains the count of raw data points that have been summarized.
The same `summary_count_field_name` applies to all detectors in the job.
+ ///
+ [JsonInclude, JsonPropertyName("summary_count_field_name")] + public string? SummaryCountFieldName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs new file mode 100644 index 00000000000..f4a40589710 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnalysisLimits +{ + /// + /// The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization. + /// + [JsonInclude, JsonPropertyName("categorization_examples_limit")] + public long? CategorizationExamplesLimit { get; set; } + + /// + /// The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit of `b` or `kb` and the number does not equate to a discrete number of megabytes, it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you specify a value less than 1 MiB, an error occurs. If you specify a value for the `xpack.ml.max_model_memory_limit` setting, an error occurs when you try to create jobs that have `model_memory_limit` values greater than that setting value. + /// + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } +} + +public sealed partial class AnalysisLimitsDescriptor : SerializableDescriptor +{ + internal AnalysisLimitsDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisLimitsDescriptor() : base() + { + } + + private long? CategorizationExamplesLimitValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + + /// + /// The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The `categorization_examples_limit` applies only to analysis that uses categorization. + /// + public AnalysisLimitsDescriptor CategorizationExamplesLimit(long? categorizationExamplesLimit) + { + CategorizationExamplesLimitValue = categorizationExamplesLimit; + return Self; + } + + /// + /// The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit of `b` or `kb` and the number does not equate to a discrete number of megabytes, it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you specify a value less than 1 MiB, an error occurs. If you specify a value for the `xpack.ml.max_model_memory_limit` setting, an error occurs when you try to create jobs that have `model_memory_limit` values greater than that setting value. + /// + public AnalysisLimitsDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CategorizationExamplesLimitValue.HasValue) + { + writer.WritePropertyName("categorization_examples_limit"); + writer.WriteNumberValue(CategorizationExamplesLimitValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs new file mode 100644 index 00000000000..4cd5136d0a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnalysisMemoryLimit +{ + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; set; } +} + +public sealed partial class AnalysisMemoryLimitDescriptor : SerializableDescriptor +{ + internal AnalysisMemoryLimitDescriptor(Action configure) => configure.Invoke(this); + + public AnalysisMemoryLimitDescriptor() : base() + { + } + + private string ModelMemoryLimitValue { get; set; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes. + /// + public AnalysisMemoryLimitDescriptor ModelMemoryLimit(string modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs new file mode 100644 index 00000000000..f4f01e5b5b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs @@ -0,0 +1,175 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Anomaly +{ + /// + /// The actual value for the bucket. + /// + [JsonInclude, JsonPropertyName("actual")] + public IReadOnlyCollection? Actual { get; init; } + + /// + /// Information about the factors impacting the initial anomaly score. + /// + [JsonInclude, JsonPropertyName("anomaly_score_explanation")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation? AnomalyScoreExplanation { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + [JsonInclude, JsonPropertyName("by_field_name")] + public string? ByFieldName { get; init; } + + /// + /// The value of `by_field_name`. + /// + [JsonInclude, JsonPropertyName("by_field_value")] + public string? ByFieldValue { get; init; } + + /// + /// For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes. + /// + [JsonInclude, JsonPropertyName("causes")] + public IReadOnlyCollection? Causes { get; init; } + + /// + /// A unique identifier for the detector. + /// + [JsonInclude, JsonPropertyName("detector_index")] + public int DetectorIndex { get; init; } + + /// + /// Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed. + /// + [JsonInclude, JsonPropertyName("field_name")] + public string? FieldName { get; init; } + + /// + /// The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`. + /// + [JsonInclude, JsonPropertyName("function")] + public string? Function { get; init; } + + /// + /// The description of the function in which the anomaly occurs, as specified in the detector configuration. + /// + [JsonInclude, JsonPropertyName("function_description")] + public string? FunctionDescription { get; init; } + + /// + /// If the detector function is `lat_long`, this object contains comma delimited strings for the latitude and longitude of the actual and typical values. + /// + [JsonInclude, JsonPropertyName("geo_results")] + public Elastic.Clients.Elasticsearch.MachineLearning.GeoResults? GeoResults { get; init; } + + /// + /// If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly. + /// + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection? Influencers { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed. + /// + [JsonInclude, JsonPropertyName("initial_record_score")] + public double InitialRecordScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + [JsonInclude, JsonPropertyName("over_field_name")] + public string? OverFieldName { get; init; } + + /// + /// The value of `over_field_name`. + /// + [JsonInclude, JsonPropertyName("over_field_value")] + public string? OverFieldValue { get; init; } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// The value of `partition_field_name`. + /// + [JsonInclude, JsonPropertyName("partition_field_value")] + public string? PartitionFieldValue { get; init; } + + /// + /// The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this. + /// + [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed. + /// + [JsonInclude, JsonPropertyName("record_score")] + public double RecordScore { get; init; } + + /// + /// Internal. This is always set to `record`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The typical value for the bucket, according to analytical modeling. + /// + [JsonInclude, JsonPropertyName("typical")] + public IReadOnlyCollection? Typical { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs new file mode 100644 index 00000000000..9d46f90aac6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnomalyCause +{ + [JsonInclude, JsonPropertyName("actual")] + public IReadOnlyCollection Actual { get; init; } + [JsonInclude, JsonPropertyName("by_field_name")] + public string ByFieldName { get; init; } + [JsonInclude, JsonPropertyName("by_field_value")] + public string ByFieldValue { get; init; } + [JsonInclude, JsonPropertyName("correlated_by_field_value")] + public string CorrelatedByFieldValue { get; init; } + [JsonInclude, JsonPropertyName("field_name")] + public string FieldName { get; init; } + [JsonInclude, JsonPropertyName("function")] + public string Function { get; init; } + [JsonInclude, JsonPropertyName("function_description")] + public string FunctionDescription { get; init; } + [JsonInclude, JsonPropertyName("influencers")] + public IReadOnlyCollection Influencers { get; init; } + [JsonInclude, JsonPropertyName("over_field_name")] + public string OverFieldName { get; init; } + [JsonInclude, JsonPropertyName("over_field_value")] + public string OverFieldValue { get; init; } + [JsonInclude, JsonPropertyName("partition_field_name")] + public string PartitionFieldName { get; init; } + [JsonInclude, JsonPropertyName("partition_field_value")] + public string PartitionFieldValue { get; init; } + [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + [JsonInclude, JsonPropertyName("typical")] + public IReadOnlyCollection Typical { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs new file mode 100644 index 00000000000..252879eab56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnomalyDetectors +{ + [JsonInclude, JsonPropertyName("categorization_analyzer")] + public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer CategorizationAnalyzer { get; init; } + [JsonInclude, JsonPropertyName("categorization_examples_limit")] + public int CategorizationExamplesLimit { get; init; } + [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public int DailyModelSnapshotRetentionAfterDays { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public int ModelSnapshotRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs new file mode 100644 index 00000000000..186bee8154a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class AnomalyExplanation +{ + /// + /// Impact from the duration and magnitude of the detected anomaly relative to the historical average. + /// + [JsonInclude, JsonPropertyName("anomaly_characteristics_impact")] + public int? AnomalyCharacteristicsImpact { get; init; } + + /// + /// Length of the detected anomaly in the number of buckets. + /// + [JsonInclude, JsonPropertyName("anomaly_length")] + public int? AnomalyLength { get; init; } + + /// + /// Type of the detected anomaly: `spike` or `dip`. + /// + [JsonInclude, JsonPropertyName("anomaly_type")] + public string? AnomalyType { get; init; } + + /// + /// Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced. + /// + [JsonInclude, JsonPropertyName("high_variance_penalty")] + public bool? HighVariancePenalty { get; init; } + + /// + /// If the bucket contains fewer samples than expected, the score is reduced. + /// + [JsonInclude, JsonPropertyName("incomplete_bucket_penalty")] + public bool? IncompleteBucketPenalty { get; init; } + + /// + /// Lower bound of the 95% confidence interval. + /// + [JsonInclude, JsonPropertyName("lower_confidence_bound")] + public double? LowerConfidenceBound { get; init; } + + /// + /// Impact of the deviation between actual and typical values in the past 12 buckets. + /// + [JsonInclude, JsonPropertyName("multi_bucket_impact")] + public int? MultiBucketImpact { get; init; } + + /// + /// Impact of the deviation between actual and typical values in the current bucket. + /// + [JsonInclude, JsonPropertyName("single_bucket_impact")] + public int? SingleBucketImpact { get; init; } + + /// + /// Typical (expected) value for this bucket. + /// + [JsonInclude, JsonPropertyName("typical_value")] + public double? TypicalValue { get; init; } + + /// + /// Upper bound of the 95% confidence interval. + /// + [JsonInclude, JsonPropertyName("upper_confidence_bound")] + public double? UpperConfidenceBound { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs new file mode 100644 index 00000000000..aaadda81645 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ApiKeyAuthorization +{ + /// + /// The identifier for the API key. + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// The name of the API key. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs new file mode 100644 index 00000000000..1ec42f1e6d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class BucketInfluencer +{ + /// + /// A normalized score between 0-100, which is calculated for each bucket influencer. This score might be updated as
newer data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("anomaly_score")] + public double AnomalyScore { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The field name of the influencer. + /// + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + + /// + /// The score between 0-100 for each bucket influencer. This score is the initial value that was calculated at the
time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_anomaly_score")] + public double InitialAnomalyScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The probability that the bucket has this behavior, in the range 0 to 1. This value can be held to a high precision
of over 300 decimal places, so the `anomaly_score` is provided as a human-readable and friendly interpretation of
this.
+ ///
+ [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// Internal. + /// + [JsonInclude, JsonPropertyName("raw_anomaly_score")] + public double RawAnomalyScore { get; init; } + + /// + /// Internal. This value is always set to `bucket_influencer`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset? TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs new file mode 100644 index 00000000000..50fbd94a493 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class BucketSummary +{ + /// + /// The maximum anomaly score, between 0-100, for any of the bucket influencers. This is an overall, rate-limited
score for the job. All the anomaly records in the bucket contribute to this score. This value might be updated as
new data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("anomaly_score")] + public double AnomalyScore { get; init; } + [JsonInclude, JsonPropertyName("bucket_influencers")] + public IReadOnlyCollection BucketInfluencers { get; init; } + + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// The number of input data records processed in this bucket. + /// + [JsonInclude, JsonPropertyName("event_count")] + public long EventCount { get; init; } + + /// + /// The maximum anomaly score for any of the bucket influencers. This is the initial value that was calculated at the
time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_anomaly_score")] + public double InitialAnomalyScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The amount of time, in milliseconds, that it took to analyze the bucket contents and calculate results. + /// + [JsonInclude, JsonPropertyName("processing_time_ms")] + public long ProcessingTimeMs { get; init; } + + /// + /// Internal. This value is always set to bucket. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the
timestamp of the bucket are included in the results for the bucket.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket. This timestamp uniquely identifies the bucket. Events that occur exactly at the
timestamp of the bucket are included in the results for the bucket.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset? TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs new file mode 100644 index 00000000000..82546040a95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Calendar +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public string CalendarId { get; init; } + + /// + /// A description of the calendar. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// An array of anomaly detection job identifiers. + /// + [JsonInclude, JsonPropertyName("job_ids")] + public IReadOnlyCollection JobIds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs new file mode 100644 index 00000000000..36db5c535c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class CalendarEvent +{ + /// + /// A string that uniquely identifies a calendar. + /// + [JsonInclude, JsonPropertyName("calendar_id")] + public Elastic.Clients.Elasticsearch.Id? CalendarId { get; set; } + + /// + /// A description of the scheduled event. + /// + [JsonInclude, JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("end_time")] + public DateTimeOffset EndTime { get; set; } + [JsonInclude, JsonPropertyName("event_id")] + public Elastic.Clients.Elasticsearch.Id? EventId { get; set; } + + /// + /// The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset StartTime { get; set; } +} + +public sealed partial class CalendarEventDescriptor : SerializableDescriptor +{ + internal CalendarEventDescriptor(Action configure) => configure.Invoke(this); + + public CalendarEventDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Id? CalendarIdValue { get; set; } + private string DescriptionValue { get; set; } + private DateTimeOffset EndTimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Id? EventIdValue { get; set; } + private DateTimeOffset StartTimeValue { get; set; } + + /// + /// A string that uniquely identifies a calendar. + /// + public CalendarEventDescriptor CalendarId(Elastic.Clients.Elasticsearch.Id? calendarId) + { + CalendarIdValue = calendarId; + return Self; + } + + /// + /// A description of the scheduled event. + /// + public CalendarEventDescriptor Description(string description) + { + DescriptionValue = description; + return Self; + } + + /// + /// The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + public CalendarEventDescriptor EndTime(DateTimeOffset endTime) + { + EndTimeValue = endTime; + return Self; + } + + public CalendarEventDescriptor EventId(Elastic.Clients.Elasticsearch.Id? eventId) + { + EventIdValue = eventId; + return Self; + } + + /// + /// The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format. + /// + public CalendarEventDescriptor StartTime(DateTimeOffset startTime) + { + StartTimeValue = startTime; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CalendarIdValue is not null) + { + writer.WritePropertyName("calendar_id"); + JsonSerializer.Serialize(writer, CalendarIdValue, options); + } + + writer.WritePropertyName("description"); + writer.WriteStringValue(DescriptionValue); + writer.WritePropertyName("end_time"); + JsonSerializer.Serialize(writer, EndTimeValue, options); + if (EventIdValue is not null) + { + writer.WritePropertyName("event_id"); + JsonSerializer.Serialize(writer, EventIdValue, options); + } + + writer.WritePropertyName("start_time"); + JsonSerializer.Serialize(writer, StartTimeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs new file mode 100644 index 00000000000..24508aef8fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.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.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.MachineLearning; + +public sealed partial class CategorizationAnalyzer : Union +{ + public CategorizationAnalyzer(string Name) : base(Name) + { + } + + public CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition Definition) : base(Definition) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs new file mode 100644 index 00000000000..515940cab43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class CategorizationAnalyzerDefinition +{ + /// + /// One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters. + /// + [JsonInclude, JsonPropertyName("char_filter")] + public ICollection? CharFilter { get; set; } + + /// + /// One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization. + /// + [JsonInclude, JsonPropertyName("filter")] + public ICollection? Filter { get; set; } + + /// + /// The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`. + /// + [JsonInclude, JsonPropertyName("tokenizer")] + public Elastic.Clients.Elasticsearch.Analysis.ITokenizer? Tokenizer { get; set; } +} + +public sealed partial class CategorizationAnalyzerDefinitionDescriptor : SerializableDescriptor +{ + internal CategorizationAnalyzerDefinitionDescriptor(Action configure) => configure.Invoke(this); + + public CategorizationAnalyzerDefinitionDescriptor() : base() + { + } + + private ICollection? CharFilterValue { get; set; } + private ICollection? FilterValue { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.ITokenizer? TokenizerValue { get; set; } + + /// + /// One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters. + /// + public CategorizationAnalyzerDefinitionDescriptor CharFilter(ICollection? charFilter) + { + CharFilterValue = charFilter; + return Self; + } + + /// + /// One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization. + /// + public CategorizationAnalyzerDefinitionDescriptor Filter(ICollection? filter) + { + FilterValue = filter; + return Self; + } + + /// + /// The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`. + /// + public CategorizationAnalyzerDefinitionDescriptor Tokenizer(Elastic.Clients.Elasticsearch.Analysis.ITokenizer? 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 (TokenizerValue is not null) + { + writer.WritePropertyName("tokenizer"); + JsonSerializer.Serialize(writer, TokenizerValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs new file mode 100644 index 00000000000..82af9a810d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Category +{ + /// + /// A unique identifier for the category. category_id is unique at the job level, even when per-partition categorization is enabled. + /// + [JsonInclude, JsonPropertyName("category_id")] + public long CategoryId { get; init; } + + /// + /// A list of examples of actual values that matched the category. + /// + [JsonInclude, JsonPropertyName("examples")] + public IReadOnlyCollection Examples { get; init; } + + /// + /// [experimental] A Grok pattern that could be used in Logstash or an ingest pipeline to extract fields from messages that match the category. This field is experimental and may be changed or removed in a future release. The Grok patterns that are found are not optimal, but are often a good starting point for manual tweaking. + /// + [JsonInclude, JsonPropertyName("grok_pattern")] + public string? GrokPattern { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The maximum length of the fields that matched the category. The value is increased by 10% to enable matching for similar fields that have not been analyzed. + /// + [JsonInclude, JsonPropertyName("max_matching_length")] + public long MaxMatchingLength { get; init; } + [JsonInclude, JsonPropertyName("mlcategory")] + public string Mlcategory { get; init; } + + /// + /// The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close + /// + [JsonInclude, JsonPropertyName("num_matches")] + public long? NumMatches { get; init; } + [JsonInclude, JsonPropertyName("p")] + public string? p { get; init; } + + /// + /// If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled. + /// + [JsonInclude, JsonPropertyName("partition_field_value")] + public string? PartitionFieldValue { get; init; } + + /// + /// A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close + /// + [JsonInclude, JsonPropertyName("preferred_to_categories")] + public IReadOnlyCollection? PreferredToCategories { get; init; } + + /// + /// A regular expression that is used to search for values that match the category. + /// + [JsonInclude, JsonPropertyName("regex")] + public string Regex { get; init; } + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// A space separated list of the common tokens that are matched in values of the category. + /// + [JsonInclude, JsonPropertyName("terms")] + public string Terms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs new file mode 100644 index 00000000000..7c1bd56c6ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ChunkingConfig +{ + /// + /// If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
+ ///
+ [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode Mode { get; set; } + + /// + /// The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`. + /// + [JsonInclude, JsonPropertyName("time_span")] + public Elastic.Clients.Elasticsearch.Duration? TimeSpan { get; set; } +} + +public sealed partial class ChunkingConfigDescriptor : SerializableDescriptor +{ + internal ChunkingConfigDescriptor(Action configure) => configure.Invoke(this); + + public ChunkingConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode ModeValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? TimeSpanValue { get; set; } + + /// + /// If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
+ ///
+ public ChunkingConfigDescriptor Mode(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode mode) + { + ModeValue = mode; + return Self; + } + + /// + /// The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`. + /// + public ChunkingConfigDescriptor TimeSpan(Elastic.Clients.Elasticsearch.Duration? timeSpan) + { + TimeSpanValue = timeSpan; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + if (TimeSpanValue is not null) + { + writer.WritePropertyName("time_span"); + JsonSerializer.Serialize(writer, TimeSpanValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs index e750cfee4fd..60aacf79e09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class ClassificationInferenceOptions { @@ -58,6 +58,10 @@ public sealed partial class ClassificationInferenceOptions ///
[JsonInclude, JsonPropertyName("top_classes_results_field")] public string? TopClassesResultsField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig.Classification(classificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.Classification(classificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(ClassificationInferenceOptions classificationInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.Classification(classificationInferenceOptions); } public sealed partial class ClassificationInferenceOptionsDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs new file mode 100644 index 00000000000..0431e3c30f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ConfusionMatrixItem +{ + [JsonInclude, JsonPropertyName("actual_class")] + public string ActualClass { get; init; } + [JsonInclude, JsonPropertyName("actual_class_doc_count")] + public int ActualClassDocCount { get; init; } + [JsonInclude, JsonPropertyName("other_predicted_class_doc_count")] + public int OtherPredictedClassDocCount { get; init; } + [JsonInclude, JsonPropertyName("predicted_classes")] + public IReadOnlyCollection PredictedClasses { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs new file mode 100644 index 00000000000..4097b8e29b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ConfusionMatrixPrediction +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("predicted_class")] + public string PredictedClass { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs new file mode 100644 index 00000000000..1a6e08fd696 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ConfusionMatrixThreshold +{ + /// + /// False Negative + /// + [JsonInclude, JsonPropertyName("fn")] + public int FalseNegative { get; init; } + + /// + /// False Positive + /// + [JsonInclude, JsonPropertyName("fp")] + public int FalsePositive { get; init; } + + /// + /// True Negative + /// + [JsonInclude, JsonPropertyName("tn")] + public int TrueNegative { get; init; } + + /// + /// True Positive + /// + [JsonInclude, JsonPropertyName("tp")] + public int TruePositive { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs new file mode 100644 index 00000000000..45d2043fb05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataCounts +{ + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + [JsonInclude, JsonPropertyName("earliest_record_timestamp")] + public long? EarliestRecordTimestamp { get; init; } + [JsonInclude, JsonPropertyName("empty_bucket_count")] + public long EmptyBucketCount { get; init; } + [JsonInclude, JsonPropertyName("input_bytes")] + public long InputBytes { get; init; } + [JsonInclude, JsonPropertyName("input_field_count")] + public long InputFieldCount { get; init; } + [JsonInclude, JsonPropertyName("input_record_count")] + public long InputRecordCount { get; init; } + [JsonInclude, JsonPropertyName("invalid_date_count")] + public long InvalidDateCount { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("last_data_time")] + public long? LastDataTime { get; init; } + [JsonInclude, JsonPropertyName("latest_bucket_timestamp")] + public long? LatestBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_empty_bucket_timestamp")] + public long? LatestEmptyBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_record_timestamp")] + public long? LatestRecordTimestamp { get; init; } + [JsonInclude, JsonPropertyName("latest_sparse_bucket_timestamp")] + public long? LatestSparseBucketTimestamp { get; init; } + [JsonInclude, JsonPropertyName("log_time")] + public long? LogTime { get; init; } + [JsonInclude, JsonPropertyName("missing_field_count")] + public long MissingFieldCount { get; init; } + [JsonInclude, JsonPropertyName("out_of_order_timestamp_count")] + public long OutOfOrderTimestampCount { get; init; } + [JsonInclude, JsonPropertyName("processed_field_count")] + public long ProcessedFieldCount { get; init; } + [JsonInclude, JsonPropertyName("processed_record_count")] + public long ProcessedRecordCount { get; init; } + [JsonInclude, JsonPropertyName("sparse_bucket_count")] + public long SparseBucketCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs new file mode 100644 index 00000000000..7df6db241f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs @@ -0,0 +1,242 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataDescription +{ + [JsonInclude, JsonPropertyName("field_delimiter")] + public string? FieldDelimiter { get; set; } + + /// + /// Only JSON format is supported at this time. + /// + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + + /// + /// The name of the field that contains the timestamp. + /// + [JsonInclude, JsonPropertyName("time_field")] + public Elastic.Clients.Elasticsearch.Field? TimeField { get; set; } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + [JsonInclude, JsonPropertyName("time_format")] + public string? TimeFormat { get; set; } +} + +public sealed partial class DataDescriptionDescriptor : SerializableDescriptor> +{ + internal DataDescriptionDescriptor(Action> configure) => configure.Invoke(this); + + public DataDescriptionDescriptor() : base() + { + } + + private string? FieldDelimiterValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TimeFieldValue { get; set; } + private string? TimeFormatValue { get; set; } + + public DataDescriptionDescriptor FieldDelimiter(string? fieldDelimiter) + { + FieldDelimiterValue = fieldDelimiter; + return Self; + } + + /// + /// Only JSON format is supported at this time. + /// + public DataDescriptionDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Elastic.Clients.Elasticsearch.Field? timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + public DataDescriptionDescriptor TimeFormat(string? timeFormat) + { + TimeFormatValue = timeFormat; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FieldDelimiterValue)) + { + writer.WritePropertyName("field_delimiter"); + writer.WriteStringValue(FieldDelimiterValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (TimeFieldValue is not null) + { + writer.WritePropertyName("time_field"); + JsonSerializer.Serialize(writer, TimeFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimeFormatValue)) + { + writer.WritePropertyName("time_format"); + writer.WriteStringValue(TimeFormatValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataDescriptionDescriptor : SerializableDescriptor +{ + internal DataDescriptionDescriptor(Action configure) => configure.Invoke(this); + + public DataDescriptionDescriptor() : base() + { + } + + private string? FieldDelimiterValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TimeFieldValue { get; set; } + private string? TimeFormatValue { get; set; } + + public DataDescriptionDescriptor FieldDelimiter(string? fieldDelimiter) + { + FieldDelimiterValue = fieldDelimiter; + return Self; + } + + /// + /// Only JSON format is supported at this time. + /// + public DataDescriptionDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Elastic.Clients.Elasticsearch.Field? timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The name of the field that contains the timestamp. + /// + public DataDescriptionDescriptor TimeField(Expression> timeField) + { + TimeFieldValue = timeField; + return Self; + } + + /// + /// The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The value `epoch_ms` indicates that time is measured in milliseconds since the epoch. The `epoch` and `epoch_ms` time formats accept either integer or real values. Custom patterns must conform to the Java DateTimeFormatter class. When you use date-time formatting patterns, it is recommended that you provide the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`. If the pattern that you specify is not sufficient to produce a complete timestamp, job creation fails. + /// + public DataDescriptionDescriptor TimeFormat(string? timeFormat) + { + TimeFormatValue = timeFormat; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(FieldDelimiterValue)) + { + writer.WritePropertyName("field_delimiter"); + writer.WriteStringValue(FieldDelimiterValue); + } + + if (!string.IsNullOrEmpty(FormatValue)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(FormatValue); + } + + if (TimeFieldValue is not null) + { + writer.WritePropertyName("time_field"); + JsonSerializer.Serialize(writer, TimeFieldValue, options); + } + + if (!string.IsNullOrEmpty(TimeFormatValue)) + { + writer.WritePropertyName("time_format"); + writer.WriteStringValue(TimeFormatValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs new file mode 100644 index 00000000000..6253b74ce2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +internal sealed partial class DatafeedConverter : JsonConverter +{ + public override Datafeed Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyDictionary? aggregations = default; + Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? authorization = default; + Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig = default; + string datafeedId = default; + Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig delayedDataCheckConfig = default; + Elastic.Clients.Elasticsearch.Duration? frequency = default; + IReadOnlyCollection? indexes = default; + IReadOnlyCollection indices = default; + Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions = default; + string jobId = default; + int? maxEmptySearches = default; + Elastic.Clients.Elasticsearch.QueryDsl.Query query = default; + Elastic.Clients.Elasticsearch.Duration? queryDelay = default; + IReadOnlyDictionary? runtimeMappings = default; + IReadOnlyDictionary? scriptFields = default; + int? scrollSize = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "aggregations" || property == "aggs") + { + aggregations = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "authorization") + { + authorization = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "chunking_config") + { + chunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "datafeed_id") + { + datafeedId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + delayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indexes") + { + indexes = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices") + { + indices = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + indicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + jobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + maxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + queryDelay = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "runtime_mappings") + { + runtimeMappings = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "script_fields") + { + scriptFields = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "scroll_size") + { + scrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new Datafeed { Aggregations = aggregations, Authorization = authorization, ChunkingConfig = chunkingConfig, DatafeedId = datafeedId, DelayedDataCheckConfig = delayedDataCheckConfig, Frequency = frequency, Indexes = indexes, Indices = indices, IndicesOptions = indicesOptions, JobId = jobId, MaxEmptySearches = maxEmptySearches, Query = query, QueryDelay = queryDelay, RuntimeMappings = runtimeMappings, ScriptFields = scriptFields, ScrollSize = scrollSize }; + } + + public override void Write(Utf8JsonWriter writer, Datafeed value, JsonSerializerOptions options) + { + throw new NotImplementedException("'Datafeed' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(DatafeedConverter))] +public sealed partial class Datafeed +{ + public IReadOnlyDictionary? Aggregations { get; init; } + + /// + /// The security privileges that the datafeed uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the datafeed, this property is omitted. + /// + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? Authorization { get; init; } + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfig { get; init; } + public string DatafeedId { get; init; } + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig DelayedDataCheckConfig { get; init; } + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; init; } + public IReadOnlyCollection? Indexes { get; init; } + public IReadOnlyCollection Indices { get; init; } + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; init; } + public string JobId { get; init; } + public int? MaxEmptySearches { get; init; } + public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; init; } + public Elastic.Clients.Elasticsearch.Duration? QueryDelay { get; init; } + public IReadOnlyDictionary? RuntimeMappings { get; init; } + public IReadOnlyDictionary? ScriptFields { get; init; } + public int? ScrollSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs new file mode 100644 index 00000000000..7117939781d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DatafeedAuthorization +{ + /// + /// If an API key was used for the most recent update to the datafeed, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the datafeed, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs new file mode 100644 index 00000000000..89fe8ae19a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs @@ -0,0 +1,1004 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +internal sealed partial class DatafeedConfigConverter : JsonConverter +{ + public override DatafeedConfig Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DatafeedConfig(); + 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 == "chunking_config") + { + variant.ChunkingConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "datafeed_id") + { + variant.DatafeedId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delayed_data_check_config") + { + variant.DelayedDataCheckConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "frequency") + { + variant.Frequency = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "indices" || property == "indexes") + { + variant.Indices = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "indices_options") + { + variant.IndicesOptions = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "job_id") + { + variant.JobId = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_empty_searches") + { + variant.MaxEmptySearches = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query") + { + variant.Query = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "query_delay") + { + variant.QueryDelay = 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 == "scroll_size") + { + variant.ScrollSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DatafeedConfig value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.ChunkingConfig is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, value.ChunkingConfig, options); + } + + if (value.DatafeedId is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, value.DatafeedId, options); + } + + if (value.DelayedDataCheckConfig is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, value.DelayedDataCheckConfig, options); + } + + if (value.Frequency is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, value.Frequency, options); + } + + if (value.Indices is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, value.Indices, options); + } + + if (value.IndicesOptions is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, value.IndicesOptions, options); + } + + if (value.JobId is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, value.JobId, options); + } + + if (value.MaxEmptySearches.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(value.MaxEmptySearches.Value); + } + + if (value.Query is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + } + + if (value.QueryDelay is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, value.QueryDelay, 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.ScrollSize.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(value.ScrollSize.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DatafeedConfigConverter))] +public sealed partial class DatafeedConfig +{ + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public IDictionary? Aggregations { get; set; } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfig { get; set; } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public Elastic.Clients.Elasticsearch.Id? DatafeedId { get; set; } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public ICollection? Indices { get; set; } + + /// + /// Specifies index expansion options that are used during search. + /// + public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; set; } + public Elastic.Clients.Elasticsearch.Id? JobId { get; set; } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public int? MaxEmptySearches { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public Elastic.Clients.Elasticsearch.Duration? QueryDelay { get; set; } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public IDictionary? ScriptFields { get; set; } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public int? ScrollSize { get; set; } +} + +public sealed partial class DatafeedConfigDescriptor : SerializableDescriptor> +{ + internal DatafeedConfigDescriptor(Action> configure) => configure.Invoke(this); + + public DatafeedConfigDescriptor() : base() + { + } + + private IDictionary> AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? DatafeedIdValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public DatafeedConfigDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public DatafeedConfigDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id? datafeedId) + { + DatafeedIdValue = datafeedId; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public DatafeedConfigDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public DatafeedConfigDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public DatafeedConfigDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public DatafeedConfigDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public DatafeedConfigDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public DatafeedConfigDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public DatafeedConfigDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public DatafeedConfigDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DatafeedIdValue is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, DatafeedIdValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DatafeedConfigDescriptor : SerializableDescriptor +{ + internal DatafeedConfigDescriptor(Action configure) => configure.Invoke(this); + + public DatafeedConfigDescriptor() : base() + { + } + + private IDictionary AggregationsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? ChunkingConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor ChunkingConfigDescriptor { get; set; } + private Action ChunkingConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? DatafeedIdValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor DelayedDataCheckConfigDescriptor { get; set; } + private Action DelayedDataCheckConfigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FrequencyValue { get; set; } + private ICollection? IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptionsValue { get; set; } + private Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor IndicesOptionsDescriptor { get; set; } + private Action IndicesOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Id? JobIdValue { get; set; } + private int? MaxEmptySearchesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Duration? QueryDelayValue { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private IDictionary ScriptFieldsValue { get; set; } + private int? ScrollSizeValue { get; set; } + + /// + /// If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data. + /// + public DatafeedConfigDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option. + /// + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig? chunkingConfig) + { + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigValue = chunkingConfig; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor descriptor) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptorAction = null; + ChunkingConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor ChunkingConfig(Action configure) + { + ChunkingConfigValue = null; + ChunkingConfigDescriptor = null; + ChunkingConfigDescriptorAction = configure; + return Self; + } + + /// + /// A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier. + /// + public DatafeedConfigDescriptor DatafeedId(Elastic.Clients.Elasticsearch.Id? datafeedId) + { + DatafeedIdValue = datafeedId; + return Self; + } + + /// + /// Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds. + /// + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? delayedDataCheckConfig) + { + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigValue = delayedDataCheckConfig; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor descriptor) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptorAction = null; + DelayedDataCheckConfigDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor DelayedDataCheckConfig(Action configure) + { + DelayedDataCheckConfigValue = null; + DelayedDataCheckConfigDescriptor = null; + DelayedDataCheckConfigDescriptorAction = configure; + return Self; + } + + /// + /// The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation. + /// + public DatafeedConfigDescriptor Frequency(Elastic.Clients.Elasticsearch.Duration? frequency) + { + FrequencyValue = frequency; + return Self; + } + + /// + /// An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role. + /// + public DatafeedConfigDescriptor Indices(ICollection? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Specifies index expansion options that are used during search. + /// + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptions? indicesOptions) + { + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsValue = indicesOptions; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor descriptor) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptorAction = null; + IndicesOptionsDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor IndicesOptions(Action configure) + { + IndicesOptionsValue = null; + IndicesOptionsDescriptor = null; + IndicesOptionsDescriptorAction = configure; + return Self; + } + + public DatafeedConfigDescriptor JobId(Elastic.Clients.Elasticsearch.Id? jobId) + { + JobIdValue = jobId; + return Self; + } + + /// + /// If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped. + /// + public DatafeedConfigDescriptor MaxEmptySearches(int? maxEmptySearches) + { + MaxEmptySearchesValue = maxEmptySearches; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. + /// + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DatafeedConfigDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DatafeedConfigDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node. + /// + public DatafeedConfigDescriptor QueryDelay(Elastic.Clients.Elasticsearch.Duration? queryDelay) + { + QueryDelayValue = queryDelay; + return Self; + } + + /// + /// Specifies runtime fields for the datafeed search. + /// + public DatafeedConfigDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields. + /// + public DatafeedConfigDescriptor ScriptFields(Func, FluentDescriptorDictionary> selector) + { + ScriptFieldsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default. + /// + public DatafeedConfigDescriptor ScrollSize(int? scrollSize) + { + ScrollSizeValue = scrollSize; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (ChunkingConfigDescriptor is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigDescriptor, options); + } + else if (ChunkingConfigDescriptorAction is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigDescriptor(ChunkingConfigDescriptorAction), options); + } + else if (ChunkingConfigValue is not null) + { + writer.WritePropertyName("chunking_config"); + JsonSerializer.Serialize(writer, ChunkingConfigValue, options); + } + + if (DatafeedIdValue is not null) + { + writer.WritePropertyName("datafeed_id"); + JsonSerializer.Serialize(writer, DatafeedIdValue, options); + } + + if (DelayedDataCheckConfigDescriptor is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigDescriptor, options); + } + else if (DelayedDataCheckConfigDescriptorAction is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigDescriptor(DelayedDataCheckConfigDescriptorAction), options); + } + else if (DelayedDataCheckConfigValue is not null) + { + writer.WritePropertyName("delayed_data_check_config"); + JsonSerializer.Serialize(writer, DelayedDataCheckConfigValue, options); + } + + if (FrequencyValue is not null) + { + writer.WritePropertyName("frequency"); + JsonSerializer.Serialize(writer, FrequencyValue, options); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (IndicesOptionsDescriptor is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsDescriptor, options); + } + else if (IndicesOptionsDescriptorAction is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndicesOptionsDescriptor(IndicesOptionsDescriptorAction), options); + } + else if (IndicesOptionsValue is not null) + { + writer.WritePropertyName("indices_options"); + JsonSerializer.Serialize(writer, IndicesOptionsValue, options); + } + + if (JobIdValue is not null) + { + writer.WritePropertyName("job_id"); + JsonSerializer.Serialize(writer, JobIdValue, options); + } + + if (MaxEmptySearchesValue.HasValue) + { + writer.WritePropertyName("max_empty_searches"); + writer.WriteNumberValue(MaxEmptySearchesValue.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (QueryDelayValue is not null) + { + writer.WritePropertyName("query_delay"); + JsonSerializer.Serialize(writer, QueryDelayValue, 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 (ScrollSizeValue.HasValue) + { + writer.WritePropertyName("scroll_size"); + writer.WriteNumberValue(ScrollSizeValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs new file mode 100644 index 00000000000..d1ec9342e35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DatafeedRunningState +{ + /// + /// Indicates if the datafeed is "real-time"; meaning that the datafeed has no configured `end` time. + /// + [JsonInclude, JsonPropertyName("real_time_configured")] + public bool RealTimeConfigured { get; init; } + + /// + /// Indicates whether the datafeed has finished running on the available past data.
For datafeeds without a configured `end` time, this means that the datafeed is now running on "real-time" data.
+ ///
+ [JsonInclude, JsonPropertyName("real_time_running")] + public bool RealTimeRunning { get; init; } + + /// + /// Provides the latest time interval the datafeed has searched. + /// + [JsonInclude, JsonPropertyName("search_interval")] + public Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval? SearchInterval { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs new file mode 100644 index 00000000000..b24bacfa320 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DatafeedStats +{ + /// + /// For started datafeeds only, contains messages relating to the selection of a node. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// A numerical character string that uniquely identifies the datafeed.
This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
It must start and end with alphanumeric characters.
+ ///
+ [JsonInclude, JsonPropertyName("datafeed_id")] + public string DatafeedId { get; init; } + + /// + /// For started datafeeds only, this information pertains to the node upon which the datafeed is started. + /// + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNode? Node { get; init; } + + /// + /// An object containing the running state for this datafeed.
It is only provided if the datafeed is started.
+ ///
+ [JsonInclude, JsonPropertyName("running_state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState? RunningState { get; init; } + + /// + /// The status of the datafeed, which can be one of the following values: `starting`, `started`, `stopping`, `stopped`. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState State { get; init; } + + /// + /// An object that provides statistical information about timing aspect of this datafeed. + /// + [JsonInclude, JsonPropertyName("timing_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats TimingStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs new file mode 100644 index 00000000000..2ba4a239983 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DatafeedTimingStats +{ + /// + /// The average search time per bucket, in milliseconds. + /// + [JsonInclude, JsonPropertyName("average_search_time_per_bucket_ms")] + public double? AverageSearchTimePerBucketMs { get; init; } + + /// + /// The number of buckets processed. + /// + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + + /// + /// The exponential average search time per hour, in milliseconds. + /// + [JsonInclude, JsonPropertyName("exponential_average_search_time_per_hour_ms")] + public double ExponentialAverageSearchTimePerHourMs { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The number of searches run by the datafeed. + /// + [JsonInclude, JsonPropertyName("search_count")] + public long SearchCount { get; init; } + + /// + /// The total time the datafeed spent searching, in milliseconds. + /// + [JsonInclude, JsonPropertyName("total_search_time_ms")] + public double TotalSearchTimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StopWordsConverter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs similarity index 86% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/StopWordsConverter.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs index 3c495f96168..c2a86f33d4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StopWordsConverter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs @@ -17,19 +17,18 @@ #nullable restore -using Elastic.Clients.Elasticsearch.Core; using Elastic.Clients.Elasticsearch.Fluent; using Elastic.Clients.Elasticsearch.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; +namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed class StopWordsConverter : SingleOrManyCollectionConverter +public sealed partial class Datafeeds { + [JsonInclude, JsonPropertyName("scroll_size")] + public int ScrollSize { get; init; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs new file mode 100644 index 00000000000..ebee058d2e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +[JsonConverter(typeof(DataframeAnalysisConverter))] +public sealed partial class DataframeAnalysis +{ + internal DataframeAnalysis(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 DataframeAnalysis Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => new DataframeAnalysis("classification", dataframeAnalysisClassification); + public static DataframeAnalysis OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => new DataframeAnalysis("outlier_detection", dataframeAnalysisOutlierDetection); + public static DataframeAnalysis Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => new DataframeAnalysis("regression", dataframeAnalysisRegression); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeAnalysisConverter : JsonConverter +{ + public override DataframeAnalysis 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; + 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "outlier_detection") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeAnalysis' from the response."); + } + + reader.Read(); + var result = new DataframeAnalysis(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysis 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.MachineLearning.DataframeAnalysisClassification)value.Variant, options); + break; + case "outlier_detection": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisDescriptor 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 DataframeAnalysisDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisDescriptor Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => Set(dataframeAnalysisClassification, "classification"); + public DataframeAnalysisDescriptor Classification(Action> configure) => Set(configure, "classification"); + public DataframeAnalysisDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Set(dataframeAnalysisOutlierDetection, "outlier_detection"); + public DataframeAnalysisDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeAnalysisDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => Set(dataframeAnalysisRegression, "regression"); + public DataframeAnalysisDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeAnalysisDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisDescriptor 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 DataframeAnalysisDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisDescriptor Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification dataframeAnalysisClassification) => Set(dataframeAnalysisClassification, "classification"); + public DataframeAnalysisDescriptor Classification(Action configure) => Set(configure, "classification"); + public DataframeAnalysisDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Set(dataframeAnalysisOutlierDetection, "outlier_detection"); + public DataframeAnalysisDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeAnalysisDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression dataframeAnalysisRegression) => Set(dataframeAnalysisRegression, "regression"); + public DataframeAnalysisDescriptor Regression(Action configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs new file mode 100644 index 00000000000..ce7f87efc88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisAnalyzedFields +{ + /// + /// An array of strings that defines the fields that will be included in the analysis. + /// + [JsonInclude, JsonPropertyName("excludes")] + public ICollection Excludes { get; set; } + + /// + /// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. + /// + [JsonInclude, JsonPropertyName("includes")] + public ICollection Includes { get; set; } +} + +public sealed partial class DataframeAnalysisAnalyzedFieldsDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisAnalyzedFieldsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisAnalyzedFieldsDescriptor() : base() + { + } + + private ICollection ExcludesValue { get; set; } + private ICollection IncludesValue { get; set; } + + /// + /// An array of strings that defines the fields that will be included in the analysis. + /// + public DataframeAnalysisAnalyzedFieldsDescriptor Excludes(ICollection excludes) + { + ExcludesValue = excludes; + return Self; + } + + /// + /// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. + /// + public DataframeAnalysisAnalyzedFieldsDescriptor Includes(ICollection includes) + { + IncludesValue = includes; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("excludes"); + JsonSerializer.Serialize(writer, ExcludesValue, options); + writer.WritePropertyName("includes"); + JsonSerializer.Serialize(writer, IncludesValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs new file mode 100644 index 00000000000..262f70e6ca1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs @@ -0,0 +1,1200 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +internal sealed partial class DataframeAnalysisClassificationConverter : JsonConverter +{ + public override DataframeAnalysisClassification Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DataframeAnalysisClassification(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "alpha") + { + variant.Alpha = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "class_assignment_objective") + { + variant.ClassAssignmentObjective = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "dependent_variable") + { + variant.DependentVariable = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "downsample_factor") + { + variant.DownsampleFactor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "early_stopping_enabled") + { + variant.EarlyStoppingEnabled = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta") + { + variant.Eta = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta_growth_rate_per_tree") + { + variant.EtaGrowthRatePerTree = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_bag_fraction") + { + variant.FeatureBagFraction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_processors") + { + variant.FeatureProcessors = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "gamma") + { + variant.Gamma = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lambda") + { + variant.Lambda = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_optimization_rounds_per_hyperparameter") + { + variant.MaxOptimizationRoundsPerHyperparameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_trees" || property == "maximum_number_trees") + { + variant.MaxTrees = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_classes") + { + variant.NumTopClasses = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_feature_importance_values") + { + variant.NumTopFeatureImportanceValues = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prediction_field_name") + { + variant.PredictionFieldName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "randomize_seed") + { + variant.RandomizeSeed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_limit") + { + variant.SoftTreeDepthLimit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_tolerance") + { + variant.SoftTreeDepthTolerance = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "training_percent") + { + variant.TrainingPercent = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisClassification value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Alpha.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(value.Alpha.Value); + } + + if (!string.IsNullOrEmpty(value.ClassAssignmentObjective)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(value.ClassAssignmentObjective); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(value.DependentVariable); + if (value.DownsampleFactor.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(value.DownsampleFactor.Value); + } + + if (value.EarlyStoppingEnabled.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(value.EarlyStoppingEnabled.Value); + } + + if (value.Eta.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(value.Eta.Value); + } + + if (value.EtaGrowthRatePerTree.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(value.EtaGrowthRatePerTree.Value); + } + + if (value.FeatureBagFraction.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(value.FeatureBagFraction.Value); + } + + if (value.FeatureProcessors is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, value.FeatureProcessors, options); + } + + if (value.Gamma.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(value.Gamma.Value); + } + + if (value.Lambda.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(value.Lambda.Value); + } + + if (value.MaxOptimizationRoundsPerHyperparameter.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(value.MaxOptimizationRoundsPerHyperparameter.Value); + } + + if (value.MaxTrees.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(value.MaxTrees.Value); + } + + if (value.NumTopClasses.HasValue) + { + writer.WritePropertyName("num_top_classes"); + writer.WriteNumberValue(value.NumTopClasses.Value); + } + + if (value.NumTopFeatureImportanceValues.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(value.NumTopFeatureImportanceValues.Value); + } + + if (value.PredictionFieldName is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, value.PredictionFieldName, options); + } + + if (value.RandomizeSeed.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(value.RandomizeSeed.Value); + } + + if (value.SoftTreeDepthLimit.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(value.SoftTreeDepthLimit.Value); + } + + if (value.SoftTreeDepthTolerance.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(value.SoftTreeDepthTolerance.Value); + } + + if (value.TrainingPercent.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(value.TrainingPercent.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DataframeAnalysisClassificationConverter))] +public sealed partial class DataframeAnalysisClassification +{ + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public double? Alpha { get; set; } + public string? ClassAssignmentObjective { get; set; } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public string DependentVariable { get; set; } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public double? DownsampleFactor { get; set; } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public bool? EarlyStoppingEnabled { get; set; } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public double? Eta { get; set; } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public double? EtaGrowthRatePerTree { get; set; } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public double? FeatureBagFraction { get; set; } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public ICollection? FeatureProcessors { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Gamma { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Lambda { get; set; } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxOptimizationRoundsPerHyperparameter { get; set; } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxTrees { get; set; } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public int? NumTopClasses { get; set; } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public Elastic.Clients.Elasticsearch.Field? PredictionFieldName { get; set; } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public double? RandomizeSeed { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public int? SoftTreeDepthLimit { get; set; } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public double? SoftTreeDepthTolerance { get; set; } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public double? TrainingPercent { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis(DataframeAnalysisClassification dataframeAnalysisClassification) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis.Classification(dataframeAnalysisClassification); +} + +public sealed partial class DataframeAnalysisClassificationDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisClassificationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisClassificationDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string? ClassAssignmentObjectiveValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action> FeatureProcessorsDescriptorAction { get; set; } + private Action>[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisClassificationDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + public DataframeAnalysisClassificationDescriptor ClassAssignmentObjective(string? classAssignmentObjective) + { + ClassAssignmentObjectiveValue = classAssignmentObjective; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisClassificationDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisClassificationDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisClassificationDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisClassificationDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisClassificationDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisClassificationDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Action> configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(params Action>[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public DataframeAnalysisClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisClassificationDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisClassificationDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + if (!string.IsNullOrEmpty(ClassAssignmentObjectiveValue)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(ClassAssignmentObjectiveValue); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + 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 (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisClassificationDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisClassificationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisClassificationDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string? ClassAssignmentObjectiveValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action FeatureProcessorsDescriptorAction { get; set; } + private Action[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopClassesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisClassificationDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + public DataframeAnalysisClassificationDescriptor ClassAssignmentObjective(string? classAssignmentObjective) + { + ClassAssignmentObjectiveValue = classAssignmentObjective; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisClassificationDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisClassificationDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisClassificationDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisClassificationDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisClassificationDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisClassificationDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(Action configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisClassificationDescriptor FeatureProcessors(params Action[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisClassificationDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisClassificationDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Defines the number of categories for which the predicted probabilities are reported. It must be non-negative or -1. If it is -1 or greater than the total number of categories, probabilities are reported for all categories; if you have a large number of categories, there could be a significant effect on the size of your destination index. NOTE: To use the AUC ROC evaluation method, `num_top_classes` must be set to -1 or a value greater than or equal to the total number of categories. + /// + public DataframeAnalysisClassificationDescriptor NumTopClasses(int? numTopClasses) + { + NumTopClassesValue = numTopClasses; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisClassificationDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisClassificationDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisClassificationDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisClassificationDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisClassificationDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + if (!string.IsNullOrEmpty(ClassAssignmentObjectiveValue)) + { + writer.WritePropertyName("class_assignment_objective"); + writer.WriteStringValue(ClassAssignmentObjectiveValue); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + 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 (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs new file mode 100644 index 00000000000..1dcdd57f678 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs @@ -0,0 +1,288 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +[JsonConverter(typeof(DataframeAnalysisFeatureProcessorConverter))] +public sealed partial class DataframeAnalysisFeatureProcessor +{ + internal DataframeAnalysisFeatureProcessor(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 DataframeAnalysisFeatureProcessor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => new DataframeAnalysisFeatureProcessor("frequency_encoding", dataframeAnalysisFeatureProcessorFrequencyEncoding); + public static DataframeAnalysisFeatureProcessor MultiEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => new DataframeAnalysisFeatureProcessor("multi_encoding", dataframeAnalysisFeatureProcessorMultiEncoding); + public static DataframeAnalysisFeatureProcessor NGramEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => new DataframeAnalysisFeatureProcessor("n_gram_encoding", dataframeAnalysisFeatureProcessorNGramEncoding); + public static DataframeAnalysisFeatureProcessor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => new DataframeAnalysisFeatureProcessor("one_hot_encoding", dataframeAnalysisFeatureProcessorOneHotEncoding); + public static DataframeAnalysisFeatureProcessor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => new DataframeAnalysisFeatureProcessor("target_mean_encoding", dataframeAnalysisFeatureProcessorTargetMeanEncoding); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeAnalysisFeatureProcessorConverter : JsonConverter +{ + public override DataframeAnalysisFeatureProcessor 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; + 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 == "frequency_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "multi_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "n_gram_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "one_hot_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "target_mean_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeAnalysisFeatureProcessor' from the response."); + } + + reader.Read(); + var result = new DataframeAnalysisFeatureProcessor(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisFeatureProcessor value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "frequency_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding)value.Variant, options); + break; + case "multi_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding)value.Variant, options); + break; + case "n_gram_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding)value.Variant, options); + break; + case "one_hot_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding)value.Variant, options); + break; + case "target_mean_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisFeatureProcessorDescriptor 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 DataframeAnalysisFeatureProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Set(dataframeAnalysisFeatureProcessorFrequencyEncoding, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Action> configure) => Set(configure, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Set(dataframeAnalysisFeatureProcessorMultiEncoding, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Action configure) => Set(configure, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Set(dataframeAnalysisFeatureProcessorNGramEncoding, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Action> configure) => Set(configure, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Set(dataframeAnalysisFeatureProcessorOneHotEncoding, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Action> configure) => Set(configure, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Set(dataframeAnalysisFeatureProcessorTargetMeanEncoding, "target_mean_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Action> configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeAnalysisFeatureProcessorDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeAnalysisFeatureProcessorDescriptor 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 DataframeAnalysisFeatureProcessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Set(dataframeAnalysisFeatureProcessorFrequencyEncoding, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Set(dataframeAnalysisFeatureProcessorMultiEncoding, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor MultiEncoding(Action configure) => Set(configure, "multi_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Set(dataframeAnalysisFeatureProcessorNGramEncoding, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor NGramEncoding(Action configure) => Set(configure, "n_gram_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Set(dataframeAnalysisFeatureProcessorOneHotEncoding, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Set(dataframeAnalysisFeatureProcessorTargetMeanEncoding, "target_mean_encoding"); + public DataframeAnalysisFeatureProcessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs new file mode 100644 index 00000000000..f3c9ccd8645 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncoding +{ + /// + /// The resulting feature name. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public Elastic.Clients.Elasticsearch.Name FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + [JsonInclude, JsonPropertyName("frequency_map")] + public IDictionary FrequencyMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorFrequencyEncoding dataframeAnalysisFeatureProcessorFrequencyEncoding) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor.FrequencyEncoding(dataframeAnalysisFeatureProcessorFrequencyEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The resulting frequency map for the field value. If the field value is missing from the frequency_map, the resulting value is 0. + /// + public DataframeAnalysisFeatureProcessorFrequencyEncodingDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs new file mode 100644 index 00000000000..739bc8b0b60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorMultiEncoding +{ + /// + /// The ordered array of custom processors to execute. Must be more than 1. + /// + [JsonInclude, JsonPropertyName("processors")] + public ICollection Processors { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorMultiEncoding dataframeAnalysisFeatureProcessorMultiEncoding) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor.MultiEncoding(dataframeAnalysisFeatureProcessorMultiEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorMultiEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorMultiEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorMultiEncodingDescriptor() : base() + { + } + + private ICollection ProcessorsValue { get; set; } + + /// + /// The ordered array of custom processors to execute. Must be more than 1. + /// + public DataframeAnalysisFeatureProcessorMultiEncodingDescriptor Processors(ICollection processors) + { + ProcessorsValue = processors; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("processors"); + JsonSerializer.Serialize(writer, ProcessorsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs new file mode 100644 index 00000000000..93b00d0838f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs @@ -0,0 +1,304 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncoding +{ + [JsonInclude, JsonPropertyName("custom")] + public bool? Custom { get; set; } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + [JsonInclude, JsonPropertyName("feature_prefix")] + public string? FeaturePrefix { get; set; } + + /// + /// The name of the text field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + [JsonInclude, JsonPropertyName("length")] + public int? Length { get; set; } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + [JsonInclude, JsonPropertyName("n_grams")] + public ICollection NGrams { get; set; } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + [JsonInclude, JsonPropertyName("start")] + public int? Start { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorNGramEncoding dataframeAnalysisFeatureProcessorNGramEncoding) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor.NGramEncoding(dataframeAnalysisFeatureProcessorNGramEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorNGramEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor() : base() + { + } + + private bool? CustomValue { get; set; } + private string? FeaturePrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private int? LengthValue { get; set; } + private ICollection NGramsValue { get; set; } + private int? StartValue { get; set; } + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Custom(bool? custom = true) + { + CustomValue = custom; + return Self; + } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor FeaturePrefix(string? featurePrefix) + { + FeaturePrefixValue = featurePrefix; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Length(int? length) + { + LengthValue = length; + return Self; + } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor NGrams(ICollection nGrams) + { + NGramsValue = nGrams; + return Self; + } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Start(int? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CustomValue.HasValue) + { + writer.WritePropertyName("custom"); + writer.WriteBooleanValue(CustomValue.Value); + } + + if (!string.IsNullOrEmpty(FeaturePrefixValue)) + { + writer.WritePropertyName("feature_prefix"); + writer.WriteStringValue(FeaturePrefixValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LengthValue.HasValue) + { + writer.WritePropertyName("length"); + writer.WriteNumberValue(LengthValue.Value); + } + + writer.WritePropertyName("n_grams"); + JsonSerializer.Serialize(writer, NGramsValue, options); + if (StartValue.HasValue) + { + writer.WritePropertyName("start"); + writer.WriteNumberValue(StartValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorNGramEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor() : base() + { + } + + private bool? CustomValue { get; set; } + private string? FeaturePrefixValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private int? LengthValue { get; set; } + private ICollection NGramsValue { get; set; } + private int? StartValue { get; set; } + + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Custom(bool? custom = true) + { + CustomValue = custom; + return Self; + } + + /// + /// The feature name prefix. Defaults to ngram__. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor FeaturePrefix(string? featurePrefix) + { + FeaturePrefixValue = featurePrefix; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the text field to encode. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the length of the n-gram substring. Defaults to 50. Must be greater than 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Length(int? length) + { + LengthValue = length; + return Self; + } + + /// + /// Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor NGrams(ICollection nGrams) + { + NGramsValue = nGrams; + return Self; + } + + /// + /// Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to 0. + /// + public DataframeAnalysisFeatureProcessorNGramEncodingDescriptor Start(int? start) + { + StartValue = start; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CustomValue.HasValue) + { + writer.WritePropertyName("custom"); + writer.WriteBooleanValue(CustomValue.Value); + } + + if (!string.IsNullOrEmpty(FeaturePrefixValue)) + { + writer.WritePropertyName("feature_prefix"); + writer.WriteStringValue(FeaturePrefixValue); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + if (LengthValue.HasValue) + { + writer.WritePropertyName("length"); + writer.WriteNumberValue(LengthValue.Value); + } + + writer.WritePropertyName("n_grams"); + JsonSerializer.Serialize(writer, NGramsValue, options); + if (StartValue.HasValue) + { + writer.WritePropertyName("start"); + writer.WriteNumberValue(StartValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs new file mode 100644 index 00000000000..1dbfa56068d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncoding +{ + /// + /// The name of the field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// The one hot map mapping the field value with the column name. + /// + [JsonInclude, JsonPropertyName("hot_map")] + public string HotMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorOneHotEncoding dataframeAnalysisFeatureProcessorOneHotEncoding) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor.OneHotEncoding(dataframeAnalysisFeatureProcessorOneHotEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string HotMapValue { get; set; } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The one hot map mapping the field value with the column name. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor HotMap(string hotMap) + { + HotMapValue = hotMap; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("hot_map"); + writer.WriteStringValue(HotMapValue); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string HotMapValue { get; set; } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The one hot map mapping the field value with the column name. + /// + public DataframeAnalysisFeatureProcessorOneHotEncodingDescriptor HotMap(string hotMap) + { + HotMapValue = hotMap; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("hot_map"); + writer.WriteStringValue(HotMapValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs new file mode 100644 index 00000000000..472fc51f75c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs @@ -0,0 +1,221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncoding +{ + /// + /// The default value if field value is not found in the target_map. + /// + [JsonInclude, JsonPropertyName("default_value")] + public int DefaultValue { get; set; } + + /// + /// The resulting feature name. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public Elastic.Clients.Elasticsearch.Name FeatureName { get; set; } + + /// + /// The name of the field to encode. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// The field value to target mean transition map. + /// + [JsonInclude, JsonPropertyName("target_map")] + public IDictionary TargetMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(DataframeAnalysisFeatureProcessorTargetMeanEncoding dataframeAnalysisFeatureProcessorTargetMeanEncoding) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor.TargetMeanEncoding(dataframeAnalysisFeatureProcessorTargetMeanEncoding); +} + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor() : base() + { + } + + private int DefaultValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + /// + /// The default value if field value is not found in the target_map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor DefaultValue(int defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field value to target mean transition map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor() : base() + { + } + + private int DefaultValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Name FeatureNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + /// + /// The default value if field value is not found in the target_map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor DefaultValue(int defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + /// + /// The resulting feature name. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor FeatureName(Elastic.Clients.Elasticsearch.Name featureName) + { + FeatureNameValue = featureName; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The name of the field to encode. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field value to target mean transition map. + /// + public DataframeAnalysisFeatureProcessorTargetMeanEncodingDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + JsonSerializer.Serialize(writer, FeatureNameValue, options); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs new file mode 100644 index 00000000000..9230ae6366d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalysisOutlierDetection +{ + /// + /// Specifies whether the feature influence calculation is enabled. + /// + [JsonInclude, JsonPropertyName("compute_feature_influence")] + public bool? ComputeFeatureInfluence { get; set; } + + /// + /// The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1. + /// + [JsonInclude, JsonPropertyName("feature_influence_threshold")] + public double? FeatureInfluenceThreshold { get; set; } + + /// + /// The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score. + /// + [JsonInclude, JsonPropertyName("method")] + public string? Method { get; set; } + + /// + /// Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set. + /// + [JsonInclude, JsonPropertyName("n_neighbors")] + public int? NNeighbors { get; set; } + + /// + /// The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers. + /// + [JsonInclude, JsonPropertyName("outlier_fraction")] + public double? OutlierFraction { get; set; } + + /// + /// If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`. + /// + [JsonInclude, JsonPropertyName("standardization_enabled")] + public bool? StandardizationEnabled { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis(DataframeAnalysisOutlierDetection dataframeAnalysisOutlierDetection) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis.OutlierDetection(dataframeAnalysisOutlierDetection); +} + +public sealed partial class DataframeAnalysisOutlierDetectionDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisOutlierDetectionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisOutlierDetectionDescriptor() : base() + { + } + + private bool? ComputeFeatureInfluenceValue { get; set; } + private double? FeatureInfluenceThresholdValue { get; set; } + private string? MethodValue { get; set; } + private int? NNeighborsValue { get; set; } + private double? OutlierFractionValue { get; set; } + private bool? StandardizationEnabledValue { get; set; } + + /// + /// Specifies whether the feature influence calculation is enabled. + /// + public DataframeAnalysisOutlierDetectionDescriptor ComputeFeatureInfluence(bool? computeFeatureInfluence = true) + { + ComputeFeatureInfluenceValue = computeFeatureInfluence; + return Self; + } + + /// + /// The minimum outlier score that a document needs to have in order to calculate its feature influence score. Value range: 0-1. + /// + public DataframeAnalysisOutlierDetectionDescriptor FeatureInfluenceThreshold(double? featureInfluenceThreshold) + { + FeatureInfluenceThresholdValue = featureInfluenceThreshold; + return Self; + } + + /// + /// The method that outlier detection uses. Available methods are `lof`, `ldof`, `distance_kth_nn`, `distance_knn`, and `ensemble`. The default value is ensemble, which means that outlier detection uses an ensemble of different methods and normalises and combines their individual outlier scores to obtain the overall outlier score. + /// + public DataframeAnalysisOutlierDetectionDescriptor Method(string? method) + { + MethodValue = method; + return Self; + } + + /// + /// Defines the value for how many nearest neighbors each method of outlier detection uses to calculate its outlier score. When the value is not set, different values are used for different ensemble members. This default behavior helps improve the diversity in the ensemble; only override it if you are confident that the value you choose is appropriate for the data set. + /// + public DataframeAnalysisOutlierDetectionDescriptor NNeighbors(int? nNeighbors) + { + NNeighborsValue = nNeighbors; + return Self; + } + + /// + /// The proportion of the data set that is assumed to be outlying prior to outlier detection. For example, 0.05 means it is assumed that 5% of values are real outliers and 95% are inliers. + /// + public DataframeAnalysisOutlierDetectionDescriptor OutlierFraction(double? outlierFraction) + { + OutlierFractionValue = outlierFraction; + return Self; + } + + /// + /// If true, the following operation is performed on the columns before computing outlier scores: `(x_i - mean(x_i)) / sd(x_i)`. + /// + public DataframeAnalysisOutlierDetectionDescriptor StandardizationEnabled(bool? standardizationEnabled = true) + { + StandardizationEnabledValue = standardizationEnabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ComputeFeatureInfluenceValue.HasValue) + { + writer.WritePropertyName("compute_feature_influence"); + writer.WriteBooleanValue(ComputeFeatureInfluenceValue.Value); + } + + if (FeatureInfluenceThresholdValue.HasValue) + { + writer.WritePropertyName("feature_influence_threshold"); + writer.WriteNumberValue(FeatureInfluenceThresholdValue.Value); + } + + if (!string.IsNullOrEmpty(MethodValue)) + { + writer.WritePropertyName("method"); + writer.WriteStringValue(MethodValue); + } + + if (NNeighborsValue.HasValue) + { + writer.WritePropertyName("n_neighbors"); + writer.WriteNumberValue(NNeighborsValue.Value); + } + + if (OutlierFractionValue.HasValue) + { + writer.WritePropertyName("outlier_fraction"); + writer.WriteNumberValue(OutlierFractionValue.Value); + } + + if (StandardizationEnabledValue.HasValue) + { + writer.WritePropertyName("standardization_enabled"); + writer.WriteBooleanValue(StandardizationEnabledValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs new file mode 100644 index 00000000000..4bf2fc5e751 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs @@ -0,0 +1,1210 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +internal sealed partial class DataframeAnalysisRegressionConverter : JsonConverter +{ + public override DataframeAnalysisRegression Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new DataframeAnalysisRegression(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "alpha") + { + variant.Alpha = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "dependent_variable") + { + variant.DependentVariable = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "downsample_factor") + { + variant.DownsampleFactor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "early_stopping_enabled") + { + variant.EarlyStoppingEnabled = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta") + { + variant.Eta = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "eta_growth_rate_per_tree") + { + variant.EtaGrowthRatePerTree = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_bag_fraction") + { + variant.FeatureBagFraction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "feature_processors") + { + variant.FeatureProcessors = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "gamma") + { + variant.Gamma = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "lambda") + { + variant.Lambda = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "loss_function") + { + variant.LossFunction = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "loss_function_parameter") + { + variant.LossFunctionParameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_optimization_rounds_per_hyperparameter") + { + variant.MaxOptimizationRoundsPerHyperparameter = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_trees" || property == "maximum_number_trees") + { + variant.MaxTrees = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "num_top_feature_importance_values") + { + variant.NumTopFeatureImportanceValues = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "prediction_field_name") + { + variant.PredictionFieldName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "randomize_seed") + { + variant.RandomizeSeed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_limit") + { + variant.SoftTreeDepthLimit = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "soft_tree_depth_tolerance") + { + variant.SoftTreeDepthTolerance = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "training_percent") + { + variant.TrainingPercent = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, DataframeAnalysisRegression value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Alpha.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(value.Alpha.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(value.DependentVariable); + if (value.DownsampleFactor.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(value.DownsampleFactor.Value); + } + + if (value.EarlyStoppingEnabled.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(value.EarlyStoppingEnabled.Value); + } + + if (value.Eta.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(value.Eta.Value); + } + + if (value.EtaGrowthRatePerTree.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(value.EtaGrowthRatePerTree.Value); + } + + if (value.FeatureBagFraction.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(value.FeatureBagFraction.Value); + } + + if (value.FeatureProcessors is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, value.FeatureProcessors, options); + } + + if (value.Gamma.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(value.Gamma.Value); + } + + if (value.Lambda.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(value.Lambda.Value); + } + + if (!string.IsNullOrEmpty(value.LossFunction)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(value.LossFunction); + } + + if (value.LossFunctionParameter.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(value.LossFunctionParameter.Value); + } + + if (value.MaxOptimizationRoundsPerHyperparameter.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(value.MaxOptimizationRoundsPerHyperparameter.Value); + } + + if (value.MaxTrees.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(value.MaxTrees.Value); + } + + if (value.NumTopFeatureImportanceValues.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(value.NumTopFeatureImportanceValues.Value); + } + + if (value.PredictionFieldName is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, value.PredictionFieldName, options); + } + + if (value.RandomizeSeed.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(value.RandomizeSeed.Value); + } + + if (value.SoftTreeDepthLimit.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(value.SoftTreeDepthLimit.Value); + } + + if (value.SoftTreeDepthTolerance.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(value.SoftTreeDepthTolerance.Value); + } + + if (value.TrainingPercent.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(value.TrainingPercent.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(DataframeAnalysisRegressionConverter))] +public sealed partial class DataframeAnalysisRegression +{ + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public double? Alpha { get; set; } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public string DependentVariable { get; set; } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public double? DownsampleFactor { get; set; } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public bool? EarlyStoppingEnabled { get; set; } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public double? Eta { get; set; } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public double? EtaGrowthRatePerTree { get; set; } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public double? FeatureBagFraction { get; set; } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public ICollection? FeatureProcessors { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Gamma { get; set; } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public double? Lambda { get; set; } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public string? LossFunction { get; set; } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public double? LossFunctionParameter { get; set; } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxOptimizationRoundsPerHyperparameter { get; set; } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public int? MaxTrees { get; set; } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public int? NumTopFeatureImportanceValues { get; set; } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public Elastic.Clients.Elasticsearch.Field? PredictionFieldName { get; set; } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public double? RandomizeSeed { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public int? SoftTreeDepthLimit { get; set; } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public double? SoftTreeDepthTolerance { get; set; } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public double? TrainingPercent { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis(DataframeAnalysisRegression dataframeAnalysisRegression) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis.Regression(dataframeAnalysisRegression); +} + +public sealed partial class DataframeAnalysisRegressionDescriptor : SerializableDescriptor> +{ + internal DataframeAnalysisRegressionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalysisRegressionDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action> FeatureProcessorsDescriptorAction { get; set; } + private Action>[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private string? LossFunctionValue { get; set; } + private double? LossFunctionParameterValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisRegressionDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisRegressionDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisRegressionDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisRegressionDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisRegressionDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisRegressionDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisRegressionDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Action> configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(params Action>[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public DataframeAnalysisRegressionDescriptor LossFunction(string? lossFunction) + { + LossFunctionValue = lossFunction; + return Self; + } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public DataframeAnalysisRegressionDescriptor LossFunctionParameter(double? lossFunctionParameter) + { + LossFunctionParameterValue = lossFunctionParameter; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisRegressionDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisRegressionDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (!string.IsNullOrEmpty(LossFunctionValue)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(LossFunctionValue); + } + + if (LossFunctionParameterValue.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(LossFunctionParameterValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalysisRegressionDescriptor : SerializableDescriptor +{ + internal DataframeAnalysisRegressionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalysisRegressionDescriptor() : base() + { + } + + private double? AlphaValue { get; set; } + private string DependentVariableValue { get; set; } + private double? DownsampleFactorValue { get; set; } + private bool? EarlyStoppingEnabledValue { get; set; } + private double? EtaValue { get; set; } + private double? EtaGrowthRatePerTreeValue { get; set; } + private double? FeatureBagFractionValue { get; set; } + private ICollection? FeatureProcessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor FeatureProcessorsDescriptor { get; set; } + private Action FeatureProcessorsDescriptorAction { get; set; } + private Action[] FeatureProcessorsDescriptorActions { get; set; } + private double? GammaValue { get; set; } + private double? LambdaValue { get; set; } + private string? LossFunctionValue { get; set; } + private double? LossFunctionParameterValue { get; set; } + private int? MaxOptimizationRoundsPerHyperparameterValue { get; set; } + private int? MaxTreesValue { get; set; } + private int? NumTopFeatureImportanceValuesValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictionFieldNameValue { get; set; } + private double? RandomizeSeedValue { get; set; } + private int? SoftTreeDepthLimitValue { get; set; } + private double? SoftTreeDepthToleranceValue { get; set; } + private double? TrainingPercentValue { get; set; } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero. + /// + public DataframeAnalysisRegressionDescriptor Alpha(double? alpha) + { + AlphaValue = alpha; + return Self; + } + + /// + /// Defines which field of the document is to be predicted. It must match one of the fields in the index being used to train. If this field is missing from a document, then that document will not be used for training, but a prediction with the trained model will be generated for it. It is also known as continuous target variable.
For classification analysis, the data type of the field must be numeric (`integer`, `short`, `long`, `byte`), categorical (`ip` or `keyword`), or `boolean`. There must be no more than 30 different values in this field.
For regression analysis, the data type of the field must be numeric.
+ ///
+ public DataframeAnalysisRegressionDescriptor DependentVariable(string dependentVariable) + { + DependentVariableValue = dependentVariable; + return Self; + } + + /// + /// Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. + /// + public DataframeAnalysisRegressionDescriptor DownsampleFactor(double? downsampleFactor) + { + DownsampleFactorValue = downsampleFactor; + return Self; + } + + /// + /// Advanced configuration option. Specifies whether the training process should finish if it is not finding any better performing models. If disabled, the training process can take significantly longer and the chance of finding a better performing model is unremarkable. + /// + public DataframeAnalysisRegressionDescriptor EarlyStoppingEnabled(bool? earlyStoppingEnabled = true) + { + EarlyStoppingEnabledValue = earlyStoppingEnabled; + return Self; + } + + /// + /// Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1. + /// + public DataframeAnalysisRegressionDescriptor Eta(double? eta) + { + EtaValue = eta; + return Self; + } + + /// + /// Advanced configuration option. Specifies the rate at which `eta` increases for each new tree that is added to the forest. For example, a rate of 1.05 increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. + /// + public DataframeAnalysisRegressionDescriptor EtaGrowthRatePerTree(double? etaGrowthRatePerTree) + { + EtaGrowthRatePerTreeValue = etaGrowthRatePerTree; + return Self; + } + + /// + /// Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor FeatureBagFraction(double? featureBagFraction) + { + FeatureBagFractionValue = featureBagFraction; + return Self; + } + + /// + /// Advanced configuration option. A collection of feature preprocessors that modify one or more included fields. The analysis uses the resulting one or more features instead of the original document field. However, these features are ephemeral; they are not stored in the destination index. Multiple `feature_processors` entries can refer to the same document fields. Automatic categorical feature encoding still occurs for the fields that are unprocessed by a custom processor or that have categorical values. Use this property only if you want to override the automatic feature encoding of the specified fields. + /// + public DataframeAnalysisRegressionDescriptor FeatureProcessors(ICollection? featureProcessors) + { + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsValue = featureProcessors; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor descriptor) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptor = descriptor; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(Action configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorActions = null; + FeatureProcessorsDescriptorAction = configure; + return Self; + } + + public DataframeAnalysisRegressionDescriptor FeatureProcessors(params Action[] configure) + { + FeatureProcessorsValue = null; + FeatureProcessorsDescriptor = null; + FeatureProcessorsDescriptorAction = null; + FeatureProcessorsDescriptorActions = configure; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Gamma(double? gamma) + { + GammaValue = gamma; + return Self; + } + + /// + /// Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. + /// + public DataframeAnalysisRegressionDescriptor Lambda(double? lambda) + { + LambdaValue = lambda; + return Self; + } + + /// + /// The loss function used during regression. Available options are `mse` (mean squared error), `msle` (mean squared logarithmic error), `huber` (Pseudo-Huber loss). + /// + public DataframeAnalysisRegressionDescriptor LossFunction(string? lossFunction) + { + LossFunctionValue = lossFunction; + return Self; + } + + /// + /// A positive number that is used as a parameter to the `loss_function`. + /// + public DataframeAnalysisRegressionDescriptor LossFunctionParameter(double? lossFunctionParameter) + { + LossFunctionParameterValue = lossFunctionParameter; + return Self; + } + + /// + /// Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxOptimizationRoundsPerHyperparameter(int? maxOptimizationRoundsPerHyperparameter) + { + MaxOptimizationRoundsPerHyperparameterValue = maxOptimizationRoundsPerHyperparameter; + return Self; + } + + /// + /// Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. + /// + public DataframeAnalysisRegressionDescriptor MaxTrees(int? maxTrees) + { + MaxTreesValue = maxTrees; + return Self; + } + + /// + /// Advanced configuration option. Specifies the maximum number of feature importance values per document to return. By default, no feature importance calculation occurs. + /// + public DataframeAnalysisRegressionDescriptor NumTopFeatureImportanceValues(int? numTopFeatureImportanceValues) + { + NumTopFeatureImportanceValuesValue = numTopFeatureImportanceValues; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Elastic.Clients.Elasticsearch.Field? predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the name of the prediction field in the results. Defaults to `_prediction`. + /// + public DataframeAnalysisRegressionDescriptor PredictionFieldName(Expression> predictionFieldName) + { + PredictionFieldNameValue = predictionFieldName; + return Self; + } + + /// + /// Defines the seed for the random generator that is used to pick training data. By default, it is randomly generated. Set it to a specific value to use the same training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). + /// + public DataframeAnalysisRegressionDescriptor RandomizeSeed(double? randomizeSeed) + { + RandomizeSeedValue = randomizeSeed; + return Self; + } + + /// + /// Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the `soft_tree_depth_tolerance` to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthLimit(int? softTreeDepthLimit) + { + SoftTreeDepthLimitValue = softTreeDepthLimit; + return Self; + } + + /// + /// Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01. + /// + public DataframeAnalysisRegressionDescriptor SoftTreeDepthTolerance(double? softTreeDepthTolerance) + { + SoftTreeDepthToleranceValue = softTreeDepthTolerance; + return Self; + } + + /// + /// Defines what percentage of the eligible documents that will be used for training. Documents that are ignored by the analysis (for example those that contain arrays with more than one value) won’t be included in the calculation for used percentage. + /// + public DataframeAnalysisRegressionDescriptor TrainingPercent(double? trainingPercent) + { + TrainingPercentValue = trainingPercent; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlphaValue.HasValue) + { + writer.WritePropertyName("alpha"); + writer.WriteNumberValue(AlphaValue.Value); + } + + writer.WritePropertyName("dependent_variable"); + writer.WriteStringValue(DependentVariableValue); + if (DownsampleFactorValue.HasValue) + { + writer.WritePropertyName("downsample_factor"); + writer.WriteNumberValue(DownsampleFactorValue.Value); + } + + if (EarlyStoppingEnabledValue.HasValue) + { + writer.WritePropertyName("early_stopping_enabled"); + writer.WriteBooleanValue(EarlyStoppingEnabledValue.Value); + } + + if (EtaValue.HasValue) + { + writer.WritePropertyName("eta"); + writer.WriteNumberValue(EtaValue.Value); + } + + if (EtaGrowthRatePerTreeValue.HasValue) + { + writer.WritePropertyName("eta_growth_rate_per_tree"); + writer.WriteNumberValue(EtaGrowthRatePerTreeValue.Value); + } + + if (FeatureBagFractionValue.HasValue) + { + writer.WritePropertyName("feature_bag_fraction"); + writer.WriteNumberValue(FeatureBagFractionValue.Value); + } + + if (FeatureProcessorsDescriptor is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, FeatureProcessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorAction is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(FeatureProcessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (FeatureProcessorsDescriptorActions is not null) + { + writer.WritePropertyName("feature_processors"); + writer.WriteStartArray(); + foreach (var action in FeatureProcessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (FeatureProcessorsValue is not null) + { + writer.WritePropertyName("feature_processors"); + JsonSerializer.Serialize(writer, FeatureProcessorsValue, options); + } + + if (GammaValue.HasValue) + { + writer.WritePropertyName("gamma"); + writer.WriteNumberValue(GammaValue.Value); + } + + if (LambdaValue.HasValue) + { + writer.WritePropertyName("lambda"); + writer.WriteNumberValue(LambdaValue.Value); + } + + if (!string.IsNullOrEmpty(LossFunctionValue)) + { + writer.WritePropertyName("loss_function"); + writer.WriteStringValue(LossFunctionValue); + } + + if (LossFunctionParameterValue.HasValue) + { + writer.WritePropertyName("loss_function_parameter"); + writer.WriteNumberValue(LossFunctionParameterValue.Value); + } + + if (MaxOptimizationRoundsPerHyperparameterValue.HasValue) + { + writer.WritePropertyName("max_optimization_rounds_per_hyperparameter"); + writer.WriteNumberValue(MaxOptimizationRoundsPerHyperparameterValue.Value); + } + + if (MaxTreesValue.HasValue) + { + writer.WritePropertyName("max_trees"); + writer.WriteNumberValue(MaxTreesValue.Value); + } + + if (NumTopFeatureImportanceValuesValue.HasValue) + { + writer.WritePropertyName("num_top_feature_importance_values"); + writer.WriteNumberValue(NumTopFeatureImportanceValuesValue.Value); + } + + if (PredictionFieldNameValue is not null) + { + writer.WritePropertyName("prediction_field_name"); + JsonSerializer.Serialize(writer, PredictionFieldNameValue, options); + } + + if (RandomizeSeedValue.HasValue) + { + writer.WritePropertyName("randomize_seed"); + writer.WriteNumberValue(RandomizeSeedValue.Value); + } + + if (SoftTreeDepthLimitValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_limit"); + writer.WriteNumberValue(SoftTreeDepthLimitValue.Value); + } + + if (SoftTreeDepthToleranceValue.HasValue) + { + writer.WritePropertyName("soft_tree_depth_tolerance"); + writer.WriteNumberValue(SoftTreeDepthToleranceValue.Value); + } + + if (TrainingPercentValue.HasValue) + { + writer.WritePropertyName("training_percent"); + writer.WriteNumberValue(TrainingPercentValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs new file mode 100644 index 00000000000..4ecc568d97e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalytics +{ + /// + /// For running jobs only, contains messages relating to the selection of a node to run the job. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// An object that provides counts for the quantity of documents skipped, used in training, or available for testing. + /// + [JsonInclude, JsonPropertyName("data_counts")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts DataCounts { get; init; } + + /// + /// The unique identifier of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// An object describing memory usage of the analytics. It is present only after the job is started and memory usage is reported. + /// + [JsonInclude, JsonPropertyName("memory_usage")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage MemoryUsage { get; init; } + + /// + /// Contains properties for the node that runs the job. This information is available only for running jobs. + /// + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.NodeAttributes? Node { get; init; } + + /// + /// The progress report of the data frame analytics job by phase. + /// + [JsonInclude, JsonPropertyName("progress")] + public IReadOnlyCollection Progress { get; init; } + + /// + /// The status of the data frame analytics job, which can be one of the following values: failed, started, starting, stopping, stopped. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeState State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs new file mode 100644 index 00000000000..46a414603a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsAuthorization +{ + /// + /// If an API key was used for the most recent update to the job, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the job, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs new file mode 100644 index 00000000000..b4421538614 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsDestination +{ + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName Index { get; set; } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + [JsonInclude, JsonPropertyName("results_field")] + public Elastic.Clients.Elasticsearch.Field? ResultsField { get; set; } +} + +public sealed partial class DataframeAnalyticsDestinationDescriptor : SerializableDescriptor> +{ + internal DataframeAnalyticsDestinationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalyticsDestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? ResultsFieldValue { get; set; } + + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + public DataframeAnalyticsDestinationDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + if (ResultsFieldValue is not null) + { + writer.WritePropertyName("results_field"); + JsonSerializer.Serialize(writer, ResultsFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalyticsDestinationDescriptor : SerializableDescriptor +{ + internal DataframeAnalyticsDestinationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalyticsDestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? ResultsFieldValue { get; set; } + + /// + /// Defines the destination index to store the results of the data frame analytics job. + /// + public DataframeAnalyticsDestinationDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index) + { + IndexValue = index; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Elastic.Clients.Elasticsearch.Field? resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + /// + /// Defines the name of the field in which to store the results of the analysis. Defaults to `ml`. + /// + public DataframeAnalyticsDestinationDescriptor ResultsField(Expression> resultsField) + { + ResultsFieldValue = resultsField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndexValue, options); + 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/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs new file mode 100644 index 00000000000..9ace2f1a2e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsFieldSelection +{ + /// + /// The feature type of this field for the analysis. May be categorical or numerical. + /// + [JsonInclude, JsonPropertyName("feature_type")] + public string? FeatureType { get; init; } + + /// + /// Whether the field is selected to be included in the analysis. + /// + [JsonInclude, JsonPropertyName("is_included")] + public bool IsIncluded { get; init; } + + /// + /// Whether the field is required. + /// + [JsonInclude, JsonPropertyName("is_required")] + public bool IsRequired { get; init; } + + /// + /// The mapping types of the field. + /// + [JsonInclude, JsonPropertyName("mapping_types")] + public IReadOnlyCollection MappingTypes { get; init; } + + /// + /// The field name. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// The reason a field is not selected to be included in the analysis. + /// + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs new file mode 100644 index 00000000000..982f9c11c84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsMemoryEstimation +{ + /// + /// Estimated memory usage under the assumption that overflowing to disk is allowed during data frame analytics. expected_memory_with_disk is usually smaller than expected_memory_without_disk as using disk allows to limit the main memory needed to perform data frame analytics. + /// + [JsonInclude, JsonPropertyName("expected_memory_with_disk")] + public string ExpectedMemoryWithDisk { get; init; } + + /// + /// Estimated memory usage under the assumption that the whole data frame analytics should happen in memory (i.e. without overflowing to disk). + /// + [JsonInclude, JsonPropertyName("expected_memory_without_disk")] + public string ExpectedMemoryWithoutDisk { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs new file mode 100644 index 00000000000..20bbb7ebd75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs @@ -0,0 +1,327 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsSource +{ + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Indices Indices { get; set; } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? Source { get; set; } +} + +public sealed partial class DataframeAnalyticsSourceDescriptor : SerializableDescriptor> +{ + internal DataframeAnalyticsSourceDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeAnalyticsSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + public DataframeAnalyticsSourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + public DataframeAnalyticsSourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeAnalyticsSourceDescriptor : SerializableDescriptor +{ + internal DataframeAnalyticsSourceDescriptor(Action configure) => configure.Invoke(this); + + public DataframeAnalyticsSourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + /// + /// Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index. + /// + public DataframeAnalyticsSourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value: {"match_all": {}}. + /// + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of runtime fields that will become part of the mapping of the destination index. + /// + public DataframeAnalyticsSourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Specify `includes` and/or `excludes patterns to select which fields will be present in the destination. Fields that are excluded cannot be included in the analysis. + /// + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframeAnalyticsSourceDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(SourceDescriptorAction), options); + } + else if (SourceValue is not null) + { + writer.WritePropertyName("_source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs new file mode 100644 index 00000000000..35d62c44544 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsDataCounts +{ + /// + /// The number of documents that are skipped during the analysis because they contained values that are not supported by the analysis. For example, outlier detection does not support missing fields so it skips documents with missing fields. Likewise, all types of analysis skip documents that contain arrays with more than one element. + /// + [JsonInclude, JsonPropertyName("skipped_docs_count")] + public int SkippedDocsCount { get; init; } + + /// + /// The number of documents that are not used for training the model and can be used for testing. + /// + [JsonInclude, JsonPropertyName("test_docs_count")] + public int TestDocsCount { get; init; } + + /// + /// The number of documents that are used for training the model. + /// + [JsonInclude, JsonPropertyName("training_docs_count")] + public int TrainingDocsCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs new file mode 100644 index 00000000000..236caf76c5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsMemoryUsage +{ + /// + /// This value is present when the status is hard_limit and it is a new estimate of how much memory the job needs. + /// + [JsonInclude, JsonPropertyName("memory_reestimate_bytes")] + public long? MemoryReestimateBytes { get; init; } + + /// + /// The number of bytes used at the highest peak of memory usage. + /// + [JsonInclude, JsonPropertyName("peak_usage_bytes")] + public long PeakUsageBytes { get; init; } + + /// + /// The memory usage status. + /// + [JsonInclude, JsonPropertyName("status")] + public string Status { get; init; } + + /// + /// The timestamp when memory usage was calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs new file mode 100644 index 00000000000..1ce9c8604aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsStatsProgress +{ + /// + /// Defines the phase of the data frame analytics job. + /// + [JsonInclude, JsonPropertyName("phase")] + public string Phase { get; init; } + + /// + /// The progress that the data frame analytics job has made expressed in percentage. + /// + [JsonInclude, JsonPropertyName("progress_percent")] + public int ProgressPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs new file mode 100644 index 00000000000..46d369bb8da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeAnalyticsSummary +{ + [JsonInclude, JsonPropertyName("allow_lazy_start")] + public bool? AllowLazyStart { get; init; } + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; init; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; init; } + + /// + /// The security privileges that the job uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the job, this property is omitted. + /// + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public long? CreateTime { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; init; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs new file mode 100644 index 00000000000..814f0b4ca7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeClassificationSummary +{ + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("accuracy")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy? Accuracy { get; init; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve.
It is calculated for a specific class (provided as "class_name") treated as positive.
+ ///
+ [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc? AucRoc { get; init; } + + /// + /// Multiclass confusion matrix. + /// + [JsonInclude, JsonPropertyName("multiclass_confusion_matrix")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix? MulticlassConfusionMatrix { get; init; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision? Precision { get; init; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall? Recall { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs new file mode 100644 index 00000000000..592c12fbcad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeClassificationSummaryAccuracy +{ + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } + [JsonInclude, JsonPropertyName("overall_accuracy")] + public double OverallAccuracy { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs new file mode 100644 index 00000000000..74261a863b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeClassificationSummaryMulticlassConfusionMatrix +{ + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IReadOnlyCollection ConfusionMatrix { get; init; } + [JsonInclude, JsonPropertyName("other_actual_class_count")] + public int OtherActualClassCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs new file mode 100644 index 00000000000..b3c5d6671aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeClassificationSummaryPrecision +{ + [JsonInclude, JsonPropertyName("avg_precision")] + public double AvgPrecision { get; init; } + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs new file mode 100644 index 00000000000..ca1f1943c28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeClassificationSummaryRecall +{ + [JsonInclude, JsonPropertyName("avg_recall")] + public double AvgRecall { get; init; } + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs new file mode 100644 index 00000000000..d1da52c363f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +[JsonConverter(typeof(DataframeEvaluationConverter))] +public sealed partial class DataframeEvaluation +{ + internal DataframeEvaluation(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 DataframeEvaluation Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => new DataframeEvaluation("classification", dataframeEvaluationClassification); + public static DataframeEvaluation OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => new DataframeEvaluation("outlier_detection", dataframeEvaluationOutlierDetection); + public static DataframeEvaluation Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => new DataframeEvaluation("regression", dataframeEvaluationRegression); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class DataframeEvaluationConverter : JsonConverter +{ + public override DataframeEvaluation 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; + 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "outlier_detection") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'DataframeEvaluation' from the response."); + } + + reader.Read(); + var result = new DataframeEvaluation(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, DataframeEvaluation 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.MachineLearning.DataframeEvaluationClassification)value.Variant, options); + break; + case "outlier_detection": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeEvaluationDescriptor 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 DataframeEvaluationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeEvaluationDescriptor Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => Set(dataframeEvaluationClassification, "classification"); + public DataframeEvaluationDescriptor Classification(Action> configure) => Set(configure, "classification"); + public DataframeEvaluationDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Set(dataframeEvaluationOutlierDetection, "outlier_detection"); + public DataframeEvaluationDescriptor OutlierDetection(Action> configure) => Set(configure, "outlier_detection"); + public DataframeEvaluationDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => Set(dataframeEvaluationRegression, "regression"); + public DataframeEvaluationDescriptor Regression(Action> configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 DataframeEvaluationDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private DataframeEvaluationDescriptor 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 DataframeEvaluationDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public DataframeEvaluationDescriptor Classification(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification dataframeEvaluationClassification) => Set(dataframeEvaluationClassification, "classification"); + public DataframeEvaluationDescriptor Classification(Action configure) => Set(configure, "classification"); + public DataframeEvaluationDescriptor OutlierDetection(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Set(dataframeEvaluationOutlierDetection, "outlier_detection"); + public DataframeEvaluationDescriptor OutlierDetection(Action configure) => Set(configure, "outlier_detection"); + public DataframeEvaluationDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression dataframeEvaluationRegression) => Set(dataframeEvaluationRegression, "regression"); + public DataframeEvaluationDescriptor Regression(Action configure) => Set(configure, "regression"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs new file mode 100644 index 00000000000..2baed4fcc75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationClass +{ + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs new file mode 100644 index 00000000000..6c399078751 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationClassification +{ + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics? Metrics { get; set; } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + [JsonInclude, JsonPropertyName("predicted_field")] + public Elastic.Clients.Elasticsearch.Field? PredictedField { get; set; } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + [JsonInclude, JsonPropertyName("top_classes_field")] + public Elastic.Clients.Elasticsearch.Field? TopClassesField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation(DataframeEvaluationClassification dataframeEvaluationClassification) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation.Classification(dataframeEvaluationClassification); +} + +public sealed partial class DataframeEvaluationClassificationDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationClassificationDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictedFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TopClassesFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Elastic.Clients.Elasticsearch.Field? predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Elastic.Clients.Elasticsearch.Field? topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + if (PredictedFieldValue is not null) + { + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + } + + if (TopClassesFieldValue is not null) + { + writer.WritePropertyName("top_classes_field"); + JsonSerializer.Serialize(writer, TopClassesFieldValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationClassificationDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field? PredictedFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TopClassesFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationClassificationDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Elastic.Clients.Elasticsearch.Field? predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index which contains the predicted value, in other words the results of the classification analysis. + /// + public DataframeEvaluationClassificationDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Elastic.Clients.Elasticsearch.Field? topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + /// + /// The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings. + /// + public DataframeEvaluationClassificationDescriptor TopClassesField(Expression> topClassesField) + { + TopClassesFieldValue = topClassesField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + if (PredictedFieldValue is not null) + { + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + } + + if (TopClassesFieldValue is not null) + { + writer.WritePropertyName("top_classes_field"); + JsonSerializer.Serialize(writer, TopClassesFieldValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs new file mode 100644 index 00000000000..561d5cb44dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationClassificationMetrics +{ + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("accuracy")] + public IDictionary? Accuracy { get; set; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRoc { get; set; } + + /// + /// Multiclass confusion matrix. + /// + [JsonInclude, JsonPropertyName("multiclass_confusion_matrix")] + public IDictionary? MulticlassConfusionMatrix { get; set; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public IDictionary? Precision { get; set; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public IDictionary? Recall { get; set; } +} + +public sealed partial class DataframeEvaluationClassificationMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationMetricsDescriptor() : base() + { + } + + private IDictionary? AccuracyValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRocValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor AucRocDescriptor { get; set; } + private Action AucRocDescriptorAction { get; set; } + private IDictionary? MulticlassConfusionMatrixValue { get; set; } + private IDictionary? PrecisionValue { get; set; } + private IDictionary? RecallValue { get; set; } + + /// + /// Accuracy of predictions (per-class and overall). + /// + public DataframeEvaluationClassificationMetricsDescriptor Accuracy(Func, FluentDictionary> selector) + { + AccuracyValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? aucRoc) + { + AucRocDescriptor = null; + AucRocDescriptorAction = null; + AucRocValue = aucRoc; + return Self; + } + + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor descriptor) + { + AucRocValue = null; + AucRocDescriptorAction = null; + AucRocDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationClassificationMetricsDescriptor AucRoc(Action configure) + { + AucRocValue = null; + AucRocDescriptor = null; + AucRocDescriptorAction = configure; + return Self; + } + + /// + /// Multiclass confusion matrix. + /// + public DataframeEvaluationClassificationMetricsDescriptor MulticlassConfusionMatrix(Func, FluentDictionary> selector) + { + MulticlassConfusionMatrixValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Precision of predictions (per-class and average). + /// + public DataframeEvaluationClassificationMetricsDescriptor Precision(Func, FluentDictionary> selector) + { + PrecisionValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Recall of predictions (per-class and average). + /// + public DataframeEvaluationClassificationMetricsDescriptor Recall(Func, FluentDictionary> selector) + { + RecallValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AccuracyValue is not null) + { + writer.WritePropertyName("accuracy"); + JsonSerializer.Serialize(writer, AccuracyValue, options); + } + + if (AucRocDescriptor is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocDescriptor, options); + } + else if (AucRocDescriptorAction is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor(AucRocDescriptorAction), options); + } + else if (AucRocValue is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocValue, options); + } + + if (MulticlassConfusionMatrixValue is not null) + { + writer.WritePropertyName("multiclass_confusion_matrix"); + JsonSerializer.Serialize(writer, MulticlassConfusionMatrixValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + 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/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs new file mode 100644 index 00000000000..f4cefa988b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationClassificationMetricsAucRoc +{ + /// + /// Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes. + /// + [JsonInclude, JsonPropertyName("class_name")] + public Elastic.Clients.Elasticsearch.Name? ClassName { get; set; } + + /// + /// Whether or not the curve should be returned in addition to the score. Default value is false. + /// + [JsonInclude, JsonPropertyName("include_curve")] + public bool? IncludeCurve { get; set; } +} + +public sealed partial class DataframeEvaluationClassificationMetricsAucRocDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationClassificationMetricsAucRocDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationClassificationMetricsAucRocDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Name? ClassNameValue { get; set; } + private bool? IncludeCurveValue { get; set; } + + /// + /// Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes. + /// + public DataframeEvaluationClassificationMetricsAucRocDescriptor ClassName(Elastic.Clients.Elasticsearch.Name? className) + { + ClassNameValue = className; + return Self; + } + + /// + /// Whether or not the curve should be returned in addition to the score. Default value is false. + /// + public DataframeEvaluationClassificationMetricsAucRocDescriptor IncludeCurve(bool? includeCurve = true) + { + IncludeCurveValue = includeCurve; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ClassNameValue is not null) + { + writer.WritePropertyName("class_name"); + JsonSerializer.Serialize(writer, ClassNameValue, options); + } + + if (IncludeCurveValue.HasValue) + { + writer.WritePropertyName("include_curve"); + writer.WriteBooleanValue(IncludeCurveValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs new file mode 100644 index 00000000000..c159a929756 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationOutlierDetection +{ + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? Metrics { get; set; } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + [JsonInclude, JsonPropertyName("predicted_probability_field")] + public Elastic.Clients.Elasticsearch.Field PredictedProbabilityField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation(DataframeEvaluationOutlierDetection dataframeEvaluationOutlierDetection) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation.OutlierDetection(dataframeEvaluationOutlierDetection); +} + +public sealed partial class DataframeEvaluationOutlierDetectionDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationOutlierDetectionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field PredictedProbabilityFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Elastic.Clients.Elasticsearch.Field predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_probability_field"); + JsonSerializer.Serialize(writer, PredictedProbabilityFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationOutlierDetectionDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationOutlierDetectionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field PredictedProbabilityFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true). + /// + public DataframeEvaluationOutlierDetectionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. + /// + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Elastic.Clients.Elasticsearch.Field predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + /// + /// The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis. + /// + public DataframeEvaluationOutlierDetectionDescriptor PredictedProbabilityField(Expression> predictedProbabilityField) + { + PredictedProbabilityFieldValue = predictedProbabilityField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_probability_field"); + JsonSerializer.Serialize(writer, PredictedProbabilityFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs new file mode 100644 index 00000000000..2b23a7319df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationOutlierDetectionMetrics +{ + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRoc { get; set; } + + /// + /// Accuracy of predictions (per-class and overall). + /// + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IDictionary? ConfusionMatrix { get; set; } + + /// + /// Precision of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("precision")] + public IDictionary? Precision { get; set; } + + /// + /// Recall of predictions (per-class and average). + /// + [JsonInclude, JsonPropertyName("recall")] + public IDictionary? Recall { get; set; } +} + +public sealed partial class DataframeEvaluationOutlierDetectionMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationOutlierDetectionMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationOutlierDetectionMetricsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? AucRocValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor AucRocDescriptor { get; set; } + private Action AucRocDescriptorAction { get; set; } + private IDictionary? ConfusionMatrixValue { get; set; } + private IDictionary? PrecisionValue { get; set; } + private IDictionary? RecallValue { get; set; } + + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive. + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc? aucRoc) + { + AucRocDescriptor = null; + AucRocDescriptorAction = null; + AucRocValue = aucRoc; + return Self; + } + + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor descriptor) + { + AucRocValue = null; + AucRocDescriptorAction = null; + AucRocDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationOutlierDetectionMetricsDescriptor AucRoc(Action configure) + { + AucRocValue = null; + AucRocDescriptor = null; + AucRocDescriptorAction = configure; + return Self; + } + + /// + /// Accuracy of predictions (per-class and overall). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor ConfusionMatrix(Func, FluentDictionary> selector) + { + ConfusionMatrixValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Precision of predictions (per-class and average). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor Precision(Func, FluentDictionary> selector) + { + PrecisionValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Recall of predictions (per-class and average). + /// + public DataframeEvaluationOutlierDetectionMetricsDescriptor Recall(Func, FluentDictionary> selector) + { + RecallValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AucRocDescriptor is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocDescriptor, options); + } + else if (AucRocDescriptorAction is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocDescriptor(AucRocDescriptorAction), options); + } + else if (AucRocValue is not null) + { + writer.WritePropertyName("auc_roc"); + JsonSerializer.Serialize(writer, AucRocValue, options); + } + + if (ConfusionMatrixValue is not null) + { + writer.WritePropertyName("confusion_matrix"); + JsonSerializer.Serialize(writer, ConfusionMatrixValue, options); + } + + if (PrecisionValue is not null) + { + writer.WritePropertyName("precision"); + JsonSerializer.Serialize(writer, PrecisionValue, options); + } + + 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/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs new file mode 100644 index 00000000000..872dd808c8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs @@ -0,0 +1,295 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationRegression +{ + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + [JsonInclude, JsonPropertyName("actual_field")] + public Elastic.Clients.Elasticsearch.Field ActualField { get; set; } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + [JsonInclude, JsonPropertyName("metrics")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics? Metrics { get; set; } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + [JsonInclude, JsonPropertyName("predicted_field")] + public Elastic.Clients.Elasticsearch.Field PredictedField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation(DataframeEvaluationRegression dataframeEvaluationRegression) => Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation.Regression(dataframeEvaluationRegression); +} + +public sealed partial class DataframeEvaluationRegressionDescriptor : SerializableDescriptor> +{ + internal DataframeEvaluationRegressionDescriptor(Action> configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field PredictedFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Elastic.Clients.Elasticsearch.Field predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class DataframeEvaluationRegressionDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field ActualFieldValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics? MetricsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor MetricsDescriptor { get; set; } + private Action MetricsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Field PredictedFieldValue { get; set; } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Elastic.Clients.Elasticsearch.Field actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// The field of the index which contains the ground truth. The data type of this field must be numerical. + /// + public DataframeEvaluationRegressionDescriptor ActualField(Expression> actualField) + { + ActualFieldValue = actualField; + return Self; + } + + /// + /// Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions. + /// + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics? metrics) + { + MetricsDescriptor = null; + MetricsDescriptorAction = null; + MetricsValue = metrics; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor descriptor) + { + MetricsValue = null; + MetricsDescriptorAction = null; + MetricsDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionDescriptor Metrics(Action configure) + { + MetricsValue = null; + MetricsDescriptor = null; + MetricsDescriptorAction = configure; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Elastic.Clients.Elasticsearch.Field predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + /// + /// The field in the index that contains the predicted value, in other words the results of the regression analysis. + /// + public DataframeEvaluationRegressionDescriptor PredictedField(Expression> predictedField) + { + PredictedFieldValue = predictedField; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("actual_field"); + JsonSerializer.Serialize(writer, ActualFieldValue, options); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsDescriptor(MetricsDescriptorAction), options); + } + else if (MetricsValue is not null) + { + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + } + + writer.WritePropertyName("predicted_field"); + JsonSerializer.Serialize(writer, PredictedFieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs new file mode 100644 index 00000000000..9bd3e2f6931 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetrics +{ + /// + /// Pseudo Huber loss function. + /// + [JsonInclude, JsonPropertyName("huber")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber? Huber { get; set; } + + /// + /// Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article. + /// + [JsonInclude, JsonPropertyName("mse")] + public IDictionary? Mse { get; set; } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value. + /// + [JsonInclude, JsonPropertyName("msle")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle? Msle { get; set; } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + [JsonInclude, JsonPropertyName("r_squared")] + public IDictionary? RSquared { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber? HuberValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor HuberDescriptor { get; set; } + private Action HuberDescriptorAction { get; set; } + private IDictionary? MseValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle? MsleValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor MsleDescriptor { get; set; } + private Action MsleDescriptorAction { get; set; } + private IDictionary? RSquaredValue { get; set; } + + /// + /// Pseudo Huber loss function. + /// + public DataframeEvaluationRegressionMetricsDescriptor Huber(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber? huber) + { + HuberDescriptor = null; + HuberDescriptorAction = null; + HuberValue = huber; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Huber(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor descriptor) + { + HuberValue = null; + HuberDescriptorAction = null; + HuberDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Huber(Action configure) + { + HuberValue = null; + HuberDescriptor = null; + HuberDescriptorAction = configure; + return Self; + } + + /// + /// Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article. + /// + public DataframeEvaluationRegressionMetricsDescriptor Mse(Func, FluentDictionary> selector) + { + MseValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value. + /// + public DataframeEvaluationRegressionMetricsDescriptor Msle(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle? msle) + { + MsleDescriptor = null; + MsleDescriptorAction = null; + MsleValue = msle; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Msle(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor descriptor) + { + MsleValue = null; + MsleDescriptorAction = null; + MsleDescriptor = descriptor; + return Self; + } + + public DataframeEvaluationRegressionMetricsDescriptor Msle(Action configure) + { + MsleValue = null; + MsleDescriptor = null; + MsleDescriptorAction = configure; + return Self; + } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + public DataframeEvaluationRegressionMetricsDescriptor RSquared(Func, FluentDictionary> selector) + { + RSquaredValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (HuberDescriptor is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, HuberDescriptor, options); + } + else if (HuberDescriptorAction is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuberDescriptor(HuberDescriptorAction), options); + } + else if (HuberValue is not null) + { + writer.WritePropertyName("huber"); + JsonSerializer.Serialize(writer, HuberValue, options); + } + + if (MseValue is not null) + { + writer.WritePropertyName("mse"); + JsonSerializer.Serialize(writer, MseValue, options); + } + + if (MsleDescriptor is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, MsleDescriptor, options); + } + else if (MsleDescriptorAction is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsleDescriptor(MsleDescriptorAction), options); + } + else if (MsleValue is not null) + { + writer.WritePropertyName("msle"); + JsonSerializer.Serialize(writer, MsleValue, options); + } + + if (RSquaredValue is not null) + { + writer.WritePropertyName("r_squared"); + JsonSerializer.Serialize(writer, RSquaredValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs new file mode 100644 index 00000000000..ae3eb286196 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetricsHuber +{ + /// + /// Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0. + /// + [JsonInclude, JsonPropertyName("delta")] + public double? Delta { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsHuberDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsHuberDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsHuberDescriptor() : base() + { + } + + private double? DeltaValue { get; set; } + + /// + /// Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0. + /// + public DataframeEvaluationRegressionMetricsHuberDescriptor Delta(double? delta) + { + DeltaValue = delta; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DeltaValue.HasValue) + { + writer.WritePropertyName("delta"); + writer.WriteNumberValue(DeltaValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs new file mode 100644 index 00000000000..2ec5941a541 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationRegressionMetricsMsle +{ + /// + /// Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1. + /// + [JsonInclude, JsonPropertyName("offset")] + public double? Offset { get; set; } +} + +public sealed partial class DataframeEvaluationRegressionMetricsMsleDescriptor : SerializableDescriptor +{ + internal DataframeEvaluationRegressionMetricsMsleDescriptor(Action configure) => configure.Invoke(this); + + public DataframeEvaluationRegressionMetricsMsleDescriptor() : base() + { + } + + private double? OffsetValue { get; set; } + + /// + /// Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1. + /// + public DataframeEvaluationRegressionMetricsMsleDescriptor Offset(double? offset) + { + OffsetValue = offset; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OffsetValue.HasValue) + { + writer.WritePropertyName("offset"); + writer.WriteNumberValue(OffsetValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs new file mode 100644 index 00000000000..b2448c23170 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationSummaryAucRoc +{ + [JsonInclude, JsonPropertyName("curve")] + public IReadOnlyCollection? Curve { get; init; } + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs new file mode 100644 index 00000000000..2d08bddff11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationSummaryAucRocCurveItem +{ + [JsonInclude, JsonPropertyName("fpr")] + public double Fpr { get; init; } + [JsonInclude, JsonPropertyName("threshold")] + public double Threshold { get; init; } + [JsonInclude, JsonPropertyName("tpr")] + public double Tpr { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs new file mode 100644 index 00000000000..2850ff64e44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeEvaluationValue +{ + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs new file mode 100644 index 00000000000..d4fab44a979 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeOutlierDetectionSummary +{ + /// + /// The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. + /// + [JsonInclude, JsonPropertyName("auc_roc")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc? AucRoc { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metrics (`tp` - true positive, `fp` - false positive, `tn` - true negative, `fn` - false negative) are calculated. + /// + [JsonInclude, JsonPropertyName("confusion_matrix")] + public IReadOnlyDictionary? ConfusionMatrix { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metric is calculated. + /// + [JsonInclude, JsonPropertyName("precision")] + public IReadOnlyDictionary? Precision { get; init; } + + /// + /// Set the different thresholds of the outlier score at where the metric is calculated. + /// + [JsonInclude, JsonPropertyName("recall")] + public IReadOnlyDictionary? Recall { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs new file mode 100644 index 00000000000..69818982617 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframePreviewConfig +{ + [JsonInclude, JsonPropertyName("analysis")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } + [JsonInclude, JsonPropertyName("analyzed_fields")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } + [JsonInclude, JsonPropertyName("max_num_threads")] + public int? MaxNumThreads { get; set; } + [JsonInclude, JsonPropertyName("model_memory_limit")] + public string? ModelMemoryLimit { get; set; } + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } +} + +public sealed partial class DataframePreviewConfigDescriptor : SerializableDescriptor> +{ + internal DataframePreviewConfigDescriptor(Action> configure) => configure.Invoke(this); + + public DataframePreviewConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action> AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action> SourceDescriptorAction { get; set; } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Action> configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + public DataframePreviewConfigDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Action> configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DataframePreviewConfigDescriptor : SerializableDescriptor +{ + internal DataframePreviewConfigDescriptor(Action configure) => configure.Invoke(this); + + public DataframePreviewConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis AnalysisValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor AnalysisDescriptor { get; set; } + private Action AnalysisDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor AnalyzedFieldsDescriptor { get; set; } + private Action AnalyzedFieldsDescriptorAction { get; set; } + private int? MaxNumThreadsValue { get; set; } + private string? ModelMemoryLimitValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource SourceValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis analysis) + { + AnalysisDescriptor = null; + AnalysisDescriptorAction = null; + AnalysisValue = analysis; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor descriptor) + { + AnalysisValue = null; + AnalysisDescriptorAction = null; + AnalysisDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Analysis(Action configure) + { + AnalysisValue = null; + AnalysisDescriptor = null; + AnalysisDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? analyzedFields) + { + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsValue = analyzedFields; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor descriptor) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptorAction = null; + AnalyzedFieldsDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor AnalyzedFields(Action configure) + { + AnalyzedFieldsValue = null; + AnalyzedFieldsDescriptor = null; + AnalyzedFieldsDescriptorAction = configure; + return Self; + } + + public DataframePreviewConfigDescriptor MaxNumThreads(int? maxNumThreads) + { + MaxNumThreadsValue = maxNumThreads; + return Self; + } + + public DataframePreviewConfigDescriptor ModelMemoryLimit(string? modelMemoryLimit) + { + ModelMemoryLimitValue = modelMemoryLimit; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource source) + { + SourceDescriptor = null; + SourceDescriptorAction = null; + SourceValue = source; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor descriptor) + { + SourceValue = null; + SourceDescriptorAction = null; + SourceDescriptor = descriptor; + return Self; + } + + public DataframePreviewConfigDescriptor Source(Action configure) + { + SourceValue = null; + SourceDescriptor = null; + SourceDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisDescriptor(AnalysisDescriptorAction), options); + } + else + { + writer.WritePropertyName("analysis"); + JsonSerializer.Serialize(writer, AnalysisValue, options); + } + + if (AnalyzedFieldsDescriptor is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsDescriptor, options); + } + else if (AnalyzedFieldsDescriptorAction is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsDescriptor(AnalyzedFieldsDescriptorAction), options); + } + else if (AnalyzedFieldsValue is not null) + { + writer.WritePropertyName("analyzed_fields"); + JsonSerializer.Serialize(writer, AnalyzedFieldsValue, options); + } + + if (MaxNumThreadsValue.HasValue) + { + writer.WritePropertyName("max_num_threads"); + writer.WriteNumberValue(MaxNumThreadsValue.Value); + } + + if (!string.IsNullOrEmpty(ModelMemoryLimitValue)) + { + writer.WritePropertyName("model_memory_limit"); + writer.WriteStringValue(ModelMemoryLimitValue); + } + + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceDescriptor(SourceDescriptorAction), options); + } + else + { + writer.WritePropertyName("source"); + JsonSerializer.Serialize(writer, SourceValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs new file mode 100644 index 00000000000..fc4c98815ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DataframeRegressionSummary +{ + /// + /// Pseudo Huber loss function. + /// + [JsonInclude, JsonPropertyName("huber")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue? Huber { get; init; } + + /// + /// Average squared difference between the predicted values and the actual (`ground truth`) value. + /// + [JsonInclude, JsonPropertyName("mse")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue? Mse { get; init; } + + /// + /// Average squared difference between the logarithm of the predicted values and the logarithm of the actual (`ground truth`) value. + /// + [JsonInclude, JsonPropertyName("msle")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue? Msle { get; init; } + + /// + /// Proportion of the variance in the dependent variable that is predictable from the independent variables. + /// + [JsonInclude, JsonPropertyName("r_squared")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue? RSquared { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs new file mode 100644 index 00000000000..a62f088ab68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Defaults +{ + [JsonInclude, JsonPropertyName("anomaly_detectors")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors AnomalyDetectors { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds Datafeeds { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs new file mode 100644 index 00000000000..330d4d21bef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Definition +{ + /// + /// Collection of preprocessors + /// + [JsonInclude, JsonPropertyName("preprocessors")] + public ICollection? Preprocessors { get; set; } + + /// + /// The definition of the trained model. + /// + [JsonInclude, JsonPropertyName("trained_model")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel TrainedModel { get; set; } +} + +public sealed partial class DefinitionDescriptor : SerializableDescriptor +{ + internal DefinitionDescriptor(Action configure) => configure.Invoke(this); + + public DefinitionDescriptor() : base() + { + } + + private ICollection? PreprocessorsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.PreprocessorDescriptor PreprocessorsDescriptor { get; set; } + private Action PreprocessorsDescriptorAction { get; set; } + private Action[] PreprocessorsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel TrainedModelValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor TrainedModelDescriptor { get; set; } + private Action TrainedModelDescriptorAction { get; set; } + + /// + /// Collection of preprocessors + /// + public DefinitionDescriptor Preprocessors(ICollection? preprocessors) + { + PreprocessorsDescriptor = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = null; + PreprocessorsValue = preprocessors; + return Self; + } + + public DefinitionDescriptor Preprocessors(Elastic.Clients.Elasticsearch.MachineLearning.PreprocessorDescriptor descriptor) + { + PreprocessorsValue = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = null; + PreprocessorsDescriptor = descriptor; + return Self; + } + + public DefinitionDescriptor Preprocessors(Action configure) + { + PreprocessorsValue = null; + PreprocessorsDescriptor = null; + PreprocessorsDescriptorActions = null; + PreprocessorsDescriptorAction = configure; + return Self; + } + + public DefinitionDescriptor Preprocessors(params Action[] configure) + { + PreprocessorsValue = null; + PreprocessorsDescriptor = null; + PreprocessorsDescriptorAction = null; + PreprocessorsDescriptorActions = configure; + return Self; + } + + /// + /// The definition of the trained model. + /// + public DefinitionDescriptor TrainedModel(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel trainedModel) + { + TrainedModelDescriptor = null; + TrainedModelDescriptorAction = null; + TrainedModelValue = trainedModel; + return Self; + } + + public DefinitionDescriptor TrainedModel(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor descriptor) + { + TrainedModelValue = null; + TrainedModelDescriptorAction = null; + TrainedModelDescriptor = descriptor; + return Self; + } + + public DefinitionDescriptor TrainedModel(Action configure) + { + TrainedModelValue = null; + TrainedModelDescriptor = null; + TrainedModelDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (PreprocessorsDescriptor is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, PreprocessorsDescriptor, options); + writer.WriteEndArray(); + } + else if (PreprocessorsDescriptorAction is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PreprocessorDescriptor(PreprocessorsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (PreprocessorsDescriptorActions is not null) + { + writer.WritePropertyName("preprocessors"); + writer.WriteStartArray(); + foreach (var action in PreprocessorsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.PreprocessorDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (PreprocessorsValue is not null) + { + writer.WritePropertyName("preprocessors"); + JsonSerializer.Serialize(writer, PreprocessorsValue, options); + } + + if (TrainedModelDescriptor is not null) + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, TrainedModelDescriptor, options); + } + else if (TrainedModelDescriptorAction is not null) + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor(TrainedModelDescriptorAction), options); + } + else + { + writer.WritePropertyName("trained_model"); + JsonSerializer.Serialize(writer, TrainedModelValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs new file mode 100644 index 00000000000..73bd7ef0845 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DelayedDataCheckConfig +{ + /// + /// The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
+ ///
+ [JsonInclude, JsonPropertyName("check_window")] + public Elastic.Clients.Elasticsearch.Duration? CheckWindow { get; set; } + + /// + /// Specifies whether the datafeed periodically checks for delayed data. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; set; } +} + +public sealed partial class DelayedDataCheckConfigDescriptor : SerializableDescriptor +{ + internal DelayedDataCheckConfigDescriptor(Action configure) => configure.Invoke(this); + + public DelayedDataCheckConfigDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? CheckWindowValue { get; set; } + private bool EnabledValue { get; set; } + + /// + /// The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
+ ///
+ public DelayedDataCheckConfigDescriptor CheckWindow(Elastic.Clients.Elasticsearch.Duration? checkWindow) + { + CheckWindowValue = checkWindow; + return Self; + } + + /// + /// Specifies whether the datafeed periodically checks for delayed data. + /// + public DelayedDataCheckConfigDescriptor Enabled(bool enabled = true) + { + EnabledValue = enabled; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CheckWindowValue is not null) + { + writer.WritePropertyName("check_window"); + JsonSerializer.Serialize(writer, CheckWindowValue, options); + } + + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs new file mode 100644 index 00000000000..36edb40584d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs @@ -0,0 +1,293 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DetectionRule +{ + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + [JsonInclude, JsonPropertyName("actions")] + public ICollection? Actions { get; set; } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + [JsonInclude, JsonPropertyName("conditions")] + public ICollection? Conditions { get; set; } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + [JsonInclude, JsonPropertyName("scope")] + public IDictionary? Scope { get; set; } +} + +public sealed partial class DetectionRuleDescriptor : SerializableDescriptor> +{ + internal DetectionRuleDescriptor(Action> configure) => configure.Invoke(this); + + public DetectionRuleDescriptor() : base() + { + } + + private ICollection? ActionsValue { get; set; } + private ICollection? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Action[] ConditionsDescriptorActions { get; set; } + private IDictionary ScopeValue { get; set; } + + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + public DetectionRuleDescriptor Actions(ICollection? actions) + { + ActionsValue = actions; + return Self; + } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + public DetectionRuleDescriptor Conditions(ICollection? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsValue = conditions; + return Self; + } + + public DetectionRuleDescriptor Conditions(Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor descriptor) + { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsDescriptor = descriptor; + return Self; + } + + public DetectionRuleDescriptor Conditions(Action configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorActions = null; + ConditionsDescriptorAction = configure; + return Self; + } + + public DetectionRuleDescriptor Conditions(params Action[] configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = configure; + return Self; + } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + public DetectionRuleDescriptor Scope(Func, FluentDescriptorDictionary> selector) + { + ScopeValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (ConditionsDescriptor is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ConditionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorAction is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor(ConditionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorActions is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + foreach (var action in ConditionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ConditionsValue is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsValue, options); + } + + if (ScopeValue is not null) + { + writer.WritePropertyName("scope"); + JsonSerializer.Serialize(writer, ScopeValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DetectionRuleDescriptor : SerializableDescriptor +{ + internal DetectionRuleDescriptor(Action configure) => configure.Invoke(this); + + public DetectionRuleDescriptor() : base() + { + } + + private ICollection? ActionsValue { get; set; } + private ICollection? ConditionsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor ConditionsDescriptor { get; set; } + private Action ConditionsDescriptorAction { get; set; } + private Action[] ConditionsDescriptorActions { get; set; } + private IDictionary ScopeValue { get; set; } + + /// + /// The set of actions to be triggered when the rule applies. If more than one action is specified the effects of all actions are combined. + /// + public DetectionRuleDescriptor Actions(ICollection? actions) + { + ActionsValue = actions; + return Self; + } + + /// + /// An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND. + /// + public DetectionRuleDescriptor Conditions(ICollection? conditions) + { + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsValue = conditions; + return Self; + } + + public DetectionRuleDescriptor Conditions(Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor descriptor) + { + ConditionsValue = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = null; + ConditionsDescriptor = descriptor; + return Self; + } + + public DetectionRuleDescriptor Conditions(Action configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorActions = null; + ConditionsDescriptorAction = configure; + return Self; + } + + public DetectionRuleDescriptor Conditions(params Action[] configure) + { + ConditionsValue = null; + ConditionsDescriptor = null; + ConditionsDescriptorAction = null; + ConditionsDescriptorActions = configure; + return Self; + } + + /// + /// A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. By default, the scope includes all series. Scoping is allowed for any of the fields that are also specified in `by_field_name`, `over_field_name`, or `partition_field_name`. + /// + public DetectionRuleDescriptor Scope(Func, FluentDescriptorDictionary> selector) + { + ScopeValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsValue is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (ConditionsDescriptor is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, ConditionsDescriptor, options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorAction is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor(ConditionsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (ConditionsDescriptorActions is not null) + { + writer.WritePropertyName("conditions"); + writer.WriteStartArray(); + foreach (var action in ConditionsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (ConditionsValue is not null) + { + writer.WritePropertyName("conditions"); + JsonSerializer.Serialize(writer, ConditionsValue, options); + } + + if (ScopeValue is not null) + { + writer.WritePropertyName("scope"); + JsonSerializer.Serialize(writer, ScopeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs new file mode 100644 index 00000000000..ac2bcabca56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs @@ -0,0 +1,703 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Detector +{ + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + [JsonInclude, JsonPropertyName("by_field_name")] + public Elastic.Clients.Elasticsearch.Field? ByFieldName { get; set; } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + [JsonInclude, JsonPropertyName("custom_rules")] + public ICollection? CustomRules { get; set; } + + /// + /// A description of the detector. + /// + [JsonInclude, JsonPropertyName("detector_description")] + public string? DetectorDescription { get; set; } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + [JsonInclude, JsonPropertyName("detector_index")] + public int? DetectorIndex { get; set; } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + [JsonInclude, JsonPropertyName("exclude_frequent")] + public Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; set; } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + [JsonInclude, JsonPropertyName("field_name")] + public Elastic.Clients.Elasticsearch.Field? FieldName { get; set; } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + [JsonInclude, JsonPropertyName("function")] + public string? Function { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + [JsonInclude, JsonPropertyName("over_field_name")] + public Elastic.Clients.Elasticsearch.Field? OverFieldName { get; set; } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + [JsonInclude, JsonPropertyName("partition_field_name")] + public Elastic.Clients.Elasticsearch.Field? PartitionFieldName { get; set; } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + [JsonInclude, JsonPropertyName("use_null")] + public bool? UseNull { get; set; } +} + +public sealed partial class DetectorDescriptor : SerializableDescriptor> +{ + internal DetectorDescriptor(Action> configure) => configure.Invoke(this); + + public DetectorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? ByFieldNameValue { get; set; } + private ICollection? CustomRulesValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor CustomRulesDescriptor { get; set; } + private Action> CustomRulesDescriptorAction { get; set; } + private Action>[] CustomRulesDescriptorActions { get; set; } + private string? DetectorDescriptionValue { get; set; } + private int? DetectorIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? ExcludeFrequentValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldNameValue { get; set; } + private string? FunctionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? OverFieldNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PartitionFieldNameValue { get; set; } + private bool? UseNullValue { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Elastic.Clients.Elasticsearch.Field? byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + public DetectorDescriptor CustomRules(ICollection? customRules) + { + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesValue = customRules; + return Self; + } + + public DetectorDescriptor CustomRules(Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor descriptor) + { + CustomRulesValue = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptor = descriptor; + return Self; + } + + public DetectorDescriptor CustomRules(Action> configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptorAction = configure; + return Self; + } + + public DetectorDescriptor CustomRules(params Action>[] configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = configure; + return Self; + } + + /// + /// A description of the detector. + /// + public DetectorDescriptor DetectorDescription(string? detectorDescription) + { + DetectorDescriptionValue = detectorDescription; + return Self; + } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + public DetectorDescriptor DetectorIndex(int? detectorIndex) + { + DetectorIndexValue = detectorIndex; + return Self; + } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + public DetectorDescriptor ExcludeFrequent(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? excludeFrequent) + { + ExcludeFrequentValue = excludeFrequent; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Elastic.Clients.Elasticsearch.Field? fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + public DetectorDescriptor Function(string? function) + { + FunctionValue = function; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Elastic.Clients.Elasticsearch.Field? overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Elastic.Clients.Elasticsearch.Field? partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + public DetectorDescriptor UseNull(bool? useNull = true) + { + UseNullValue = useNull; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ByFieldNameValue is not null) + { + writer.WritePropertyName("by_field_name"); + JsonSerializer.Serialize(writer, ByFieldNameValue, options); + } + + if (CustomRulesDescriptor is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CustomRulesDescriptor, options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorAction is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor(CustomRulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorActions is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + foreach (var action in CustomRulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (CustomRulesValue is not null) + { + writer.WritePropertyName("custom_rules"); + JsonSerializer.Serialize(writer, CustomRulesValue, options); + } + + if (!string.IsNullOrEmpty(DetectorDescriptionValue)) + { + writer.WritePropertyName("detector_description"); + writer.WriteStringValue(DetectorDescriptionValue); + } + + if (DetectorIndexValue.HasValue) + { + writer.WritePropertyName("detector_index"); + writer.WriteNumberValue(DetectorIndexValue.Value); + } + + if (ExcludeFrequentValue is not null) + { + writer.WritePropertyName("exclude_frequent"); + JsonSerializer.Serialize(writer, ExcludeFrequentValue, options); + } + + if (FieldNameValue is not null) + { + writer.WritePropertyName("field_name"); + JsonSerializer.Serialize(writer, FieldNameValue, options); + } + + if (!string.IsNullOrEmpty(FunctionValue)) + { + writer.WritePropertyName("function"); + writer.WriteStringValue(FunctionValue); + } + + if (OverFieldNameValue is not null) + { + writer.WritePropertyName("over_field_name"); + JsonSerializer.Serialize(writer, OverFieldNameValue, options); + } + + if (PartitionFieldNameValue is not null) + { + writer.WritePropertyName("partition_field_name"); + JsonSerializer.Serialize(writer, PartitionFieldNameValue, options); + } + + if (UseNullValue.HasValue) + { + writer.WritePropertyName("use_null"); + writer.WriteBooleanValue(UseNullValue.Value); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DetectorDescriptor : SerializableDescriptor +{ + internal DetectorDescriptor(Action configure) => configure.Invoke(this); + + public DetectorDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field? ByFieldNameValue { get; set; } + private ICollection? CustomRulesValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor CustomRulesDescriptor { get; set; } + private Action CustomRulesDescriptorAction { get; set; } + private Action[] CustomRulesDescriptorActions { get; set; } + private string? DetectorDescriptionValue { get; set; } + private int? DetectorIndexValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? ExcludeFrequentValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? FieldNameValue { get; set; } + private string? FunctionValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? OverFieldNameValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? PartitionFieldNameValue { get; set; } + private bool? UseNullValue { get; set; } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Elastic.Clients.Elasticsearch.Field? byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + /// + public DetectorDescriptor ByFieldName(Expression> byFieldName) + { + ByFieldNameValue = byFieldName; + return Self; + } + + /// + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. + /// + public DetectorDescriptor CustomRules(ICollection? customRules) + { + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesValue = customRules; + return Self; + } + + public DetectorDescriptor CustomRules(Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor descriptor) + { + CustomRulesValue = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptor = descriptor; + return Self; + } + + public DetectorDescriptor CustomRules(Action configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorActions = null; + CustomRulesDescriptorAction = configure; + return Self; + } + + public DetectorDescriptor CustomRules(params Action[] configure) + { + CustomRulesValue = null; + CustomRulesDescriptor = null; + CustomRulesDescriptorAction = null; + CustomRulesDescriptorActions = configure; + return Self; + } + + /// + /// A description of the detector. + /// + public DetectorDescriptor DetectorDescription(string? detectorDescription) + { + DetectorDescriptionValue = detectorDescription; + return Self; + } + + /// + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the `analysis_config`, starting at zero. If you specify a value for this property, it is ignored. + /// + public DetectorDescriptor DetectorIndex(int? detectorIndex) + { + DetectorIndexValue = detectorIndex; + return Self; + } + + /// + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set `exclude_frequent` to `all` for both fields, or to `by` or `over` for those specific fields. + /// + public DetectorDescriptor ExcludeFrequent(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? excludeFrequent) + { + ExcludeFrequentValue = excludeFrequent; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Elastic.Clients.Elasticsearch.Field? fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The `field_name` cannot contain double quotes or backslashes. + /// + public DetectorDescriptor FieldName(Expression> fieldName) + { + FieldNameValue = fieldName; + return Self; + } + + /// + /// The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`. + /// + public DetectorDescriptor Function(string? function) + { + FunctionValue = function; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Elastic.Clients.Elasticsearch.Field? overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + /// + public DetectorDescriptor OverFieldName(Expression> overFieldName) + { + OverFieldNameValue = overFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Elastic.Clients.Elasticsearch.Field? partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + /// + public DetectorDescriptor PartitionFieldName(Expression> partitionFieldName) + { + PartitionFieldNameValue = partitionFieldName; + return Self; + } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + public DetectorDescriptor UseNull(bool? useNull = true) + { + UseNullValue = useNull; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ByFieldNameValue is not null) + { + writer.WritePropertyName("by_field_name"); + JsonSerializer.Serialize(writer, ByFieldNameValue, options); + } + + if (CustomRulesDescriptor is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CustomRulesDescriptor, options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorAction is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor(CustomRulesDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CustomRulesDescriptorActions is not null) + { + writer.WritePropertyName("custom_rules"); + writer.WriteStartArray(); + foreach (var action in CustomRulesDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else if (CustomRulesValue is not null) + { + writer.WritePropertyName("custom_rules"); + JsonSerializer.Serialize(writer, CustomRulesValue, options); + } + + if (!string.IsNullOrEmpty(DetectorDescriptionValue)) + { + writer.WritePropertyName("detector_description"); + writer.WriteStringValue(DetectorDescriptionValue); + } + + if (DetectorIndexValue.HasValue) + { + writer.WritePropertyName("detector_index"); + writer.WriteNumberValue(DetectorIndexValue.Value); + } + + if (ExcludeFrequentValue is not null) + { + writer.WritePropertyName("exclude_frequent"); + JsonSerializer.Serialize(writer, ExcludeFrequentValue, options); + } + + if (FieldNameValue is not null) + { + writer.WritePropertyName("field_name"); + JsonSerializer.Serialize(writer, FieldNameValue, options); + } + + if (!string.IsNullOrEmpty(FunctionValue)) + { + writer.WritePropertyName("function"); + writer.WriteStringValue(FunctionValue); + } + + if (OverFieldNameValue is not null) + { + writer.WritePropertyName("over_field_name"); + JsonSerializer.Serialize(writer, OverFieldNameValue, options); + } + + if (PartitionFieldNameValue is not null) + { + writer.WritePropertyName("partition_field_name"); + JsonSerializer.Serialize(writer, PartitionFieldNameValue, options); + } + + if (UseNullValue.HasValue) + { + writer.WritePropertyName("use_null"); + writer.WriteBooleanValue(UseNullValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs new file mode 100644 index 00000000000..df4105bd1a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DetectorRead +{ + /// + /// The field used to split the data.
In particular, this property is used for analyzing the splits with respect to their own history.
It is used for finding unusual values in the context of the split.
+ ///
+ [JsonInclude, JsonPropertyName("by_field_name")] + public string? ByFieldName { get; init; } + + /// + /// An array of custom rule objects, which enable you to customize the way detectors operate.
For example, a rule may dictate to the detector conditions under which results should be skipped.
Kibana refers to custom rules as job rules.
+ ///
+ [JsonInclude, JsonPropertyName("custom_rules")] + public IReadOnlyCollection? CustomRules { get; init; } + + /// + /// A description of the detector. + /// + [JsonInclude, JsonPropertyName("detector_description")] + public string? DetectorDescription { get; init; } + + /// + /// A unique identifier for the detector.
This identifier is based on the order of the detectors in the `analysis_config`, starting at zero.
+ ///
+ [JsonInclude, JsonPropertyName("detector_index")] + public int? DetectorIndex { get; init; } + + /// + /// Contains one of the following values: `all`, `none`, `by`, or `over`.
If set, frequent entities are excluded from influencing the anomaly results.
Entities can be considered frequent over time or frequent in a population.
If you are working with both over and by fields, then you can set `exclude_frequent` to all for both fields, or to `by` or `over` for those specific fields.
+ ///
+ [JsonInclude, JsonPropertyName("exclude_frequent")] + public Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; init; } + + /// + /// The field that the detector uses in the function.
If you use an event rate function such as `count` or `rare`, do not specify this field.
+ ///
+ [JsonInclude, JsonPropertyName("field_name")] + public string? FieldName { get; init; } + + /// + /// The analysis function that is used.
For example, `count`, `rare`, `mean`, `min`, `max`, and `sum`.
+ ///
+ [JsonInclude, JsonPropertyName("function")] + public string Function { get; init; } + + /// + /// The field used to split the data.
In particular, this property is used for analyzing the splits with respect to the history of all splits.
It is used for finding unusual values in the population of all splits.
+ ///
+ [JsonInclude, JsonPropertyName("over_field_name")] + public string? OverFieldName { get; init; } + + /// + /// The field used to segment the analysis.
When you use this property, you have completely independent baselines for each value of this field.
+ ///
+ [JsonInclude, JsonPropertyName("partition_field_name")] + public string? PartitionFieldName { get; init; } + + /// + /// Defines whether a new series is used as the null series when there is no value for the by or partition fields. + /// + [JsonInclude, JsonPropertyName("use_null")] + public bool? UseNull { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNode.g.cs new file mode 100644 index 00000000000..b45aec98b79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class DiscoveryNode +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("ephemeral_id")] + public string EphemeralId { 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; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs new file mode 100644 index 00000000000..d9c603a5abc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs @@ -0,0 +1,211 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Ensemble +{ + [JsonInclude, JsonPropertyName("aggregate_output")] + public Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput? AggregateOutput { get; set; } + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + [JsonInclude, JsonPropertyName("feature_names")] + public ICollection? FeatureNames { get; set; } + [JsonInclude, JsonPropertyName("target_type")] + public string? TargetType { get; set; } + [JsonInclude, JsonPropertyName("trained_models")] + public ICollection TrainedModels { get; set; } +} + +public sealed partial class EnsembleDescriptor : SerializableDescriptor +{ + internal EnsembleDescriptor(Action configure) => configure.Invoke(this); + + public EnsembleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput? AggregateOutputValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutputDescriptor AggregateOutputDescriptor { get; set; } + private Action AggregateOutputDescriptorAction { get; set; } + private ICollection? ClassificationLabelsValue { get; set; } + private ICollection? FeatureNamesValue { get; set; } + private string? TargetTypeValue { get; set; } + private ICollection TrainedModelsValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor TrainedModelsDescriptor { get; set; } + private Action TrainedModelsDescriptorAction { get; set; } + private Action[] TrainedModelsDescriptorActions { get; set; } + + public EnsembleDescriptor AggregateOutput(Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput? aggregateOutput) + { + AggregateOutputDescriptor = null; + AggregateOutputDescriptorAction = null; + AggregateOutputValue = aggregateOutput; + return Self; + } + + public EnsembleDescriptor AggregateOutput(Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutputDescriptor descriptor) + { + AggregateOutputValue = null; + AggregateOutputDescriptorAction = null; + AggregateOutputDescriptor = descriptor; + return Self; + } + + public EnsembleDescriptor AggregateOutput(Action configure) + { + AggregateOutputValue = null; + AggregateOutputDescriptor = null; + AggregateOutputDescriptorAction = configure; + return Self; + } + + public EnsembleDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + public EnsembleDescriptor FeatureNames(ICollection? featureNames) + { + FeatureNamesValue = featureNames; + return Self; + } + + public EnsembleDescriptor TargetType(string? targetType) + { + TargetTypeValue = targetType; + return Self; + } + + public EnsembleDescriptor TrainedModels(ICollection trainedModels) + { + TrainedModelsDescriptor = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = null; + TrainedModelsValue = trainedModels; + return Self; + } + + public EnsembleDescriptor TrainedModels(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor descriptor) + { + TrainedModelsValue = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = null; + TrainedModelsDescriptor = descriptor; + return Self; + } + + public EnsembleDescriptor TrainedModels(Action configure) + { + TrainedModelsValue = null; + TrainedModelsDescriptor = null; + TrainedModelsDescriptorActions = null; + TrainedModelsDescriptorAction = configure; + return Self; + } + + public EnsembleDescriptor TrainedModels(params Action[] configure) + { + TrainedModelsValue = null; + TrainedModelsDescriptor = null; + TrainedModelsDescriptorAction = null; + TrainedModelsDescriptorActions = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregateOutputDescriptor is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, AggregateOutputDescriptor, options); + } + else if (AggregateOutputDescriptorAction is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutputDescriptor(AggregateOutputDescriptorAction), options); + } + else if (AggregateOutputValue is not null) + { + writer.WritePropertyName("aggregate_output"); + JsonSerializer.Serialize(writer, AggregateOutputValue, options); + } + + if (ClassificationLabelsValue is not null) + { + writer.WritePropertyName("classification_labels"); + JsonSerializer.Serialize(writer, ClassificationLabelsValue, options); + } + + if (FeatureNamesValue is not null) + { + writer.WritePropertyName("feature_names"); + JsonSerializer.Serialize(writer, FeatureNamesValue, options); + } + + if (!string.IsNullOrEmpty(TargetTypeValue)) + { + writer.WritePropertyName("target_type"); + writer.WriteStringValue(TargetTypeValue); + } + + if (TrainedModelsDescriptor is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TrainedModelsDescriptor, options); + writer.WriteEndArray(); + } + else if (TrainedModelsDescriptorAction is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor(TrainedModelsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TrainedModelsDescriptorActions is not null) + { + writer.WritePropertyName("trained_models"); + writer.WriteStartArray(); + foreach (var action in TrainedModelsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("trained_models"); + JsonSerializer.Serialize(writer, TrainedModelsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs index b0d89248684..6cbace7f11a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Fill mask inference options @@ -54,9 +54,9 @@ public sealed partial class FillMaskInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(FillMaskInferenceOptions fillMaskInferenceOptions) => Ml.InferenceConfigCreate.FillMask(fillMaskInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(FillMaskInferenceOptions fillMaskInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.FillMask(fillMaskInferenceOptions); } /// @@ -73,9 +73,9 @@ public FillMaskInferenceOptionsDescriptor() : base() private string? MaskTokenValue { get; set; } private int? NumTopClassesValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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.
@@ -107,7 +107,7 @@ public FillMaskInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options to update when inferring /// - public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticse return Self; } - public FillMaskInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public FillMaskInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public FillMaskInferenceOptionsDescriptor Tokenization(TokenizationConfigDescrip return Self; } - public FillMaskInferenceOptionsDescriptor Tokenization(Action configure) + public FillMaskInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs similarity index 77% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs index 4a8d5bff084..380bfdf6d12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/FillMaskInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class FillMaskInferenceUpdateOptions { @@ -45,9 +45,9 @@ public sealed partial class FillMaskInferenceUpdateOptions /// The tokenization options to update when inferring ///
[JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Ml.InferenceConfigUpdate.FillMask(fillMaskInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.FillMask(fillMaskInferenceUpdateOptions); } public sealed partial class FillMaskInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -60,9 +60,9 @@ public FillMaskInferenceUpdateOptionsDescriptor() : base() private int? NumTopClassesValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// Specifies the number of top class predictions to return. Defaults to 0. @@ -85,7 +85,7 @@ public FillMaskInferenceUpdateOptionsDescriptor ResultsField(string? resultsFiel /// /// The tokenization options to update when inferring /// - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -93,7 +93,7 @@ public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Ela return Self; } - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -101,7 +101,7 @@ public FillMaskInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpda return Self; } - public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public FillMaskInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -132,7 +132,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs new file mode 100644 index 00000000000..b39c33320bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Filter +{ + /// + /// A description of the filter. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A string that uniquely identifies a filter. + /// + [JsonInclude, JsonPropertyName("filter_id")] + public string FilterId { get; init; } + + /// + /// An array of strings which is the filter item list. + /// + [JsonInclude, JsonPropertyName("items")] + public IReadOnlyCollection Items { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs new file mode 100644 index 00000000000..3e9f06271c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class FilterRef +{ + /// + /// The identifier for the filter. + /// + [JsonInclude, JsonPropertyName("filter_id")] + public Elastic.Clients.Elasticsearch.Id FilterId { get; set; } + + /// + /// If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter. + /// + [JsonInclude, JsonPropertyName("filter_type")] + public Elastic.Clients.Elasticsearch.MachineLearning.FilterType? FilterType { get; set; } +} + +public sealed partial class FilterRefDescriptor : SerializableDescriptor +{ + internal FilterRefDescriptor(Action configure) => configure.Invoke(this); + + public FilterRefDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Id FilterIdValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.FilterType? FilterTypeValue { get; set; } + + /// + /// The identifier for the filter. + /// + public FilterRefDescriptor FilterId(Elastic.Clients.Elasticsearch.Id filterId) + { + FilterIdValue = filterId; + return Self; + } + + /// + /// If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter. + /// + public FilterRefDescriptor FilterType(Elastic.Clients.Elasticsearch.MachineLearning.FilterType? filterType) + { + FilterTypeValue = filterType; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("filter_id"); + JsonSerializer.Serialize(writer, FilterIdValue, options); + if (FilterTypeValue is not null) + { + writer.WritePropertyName("filter_type"); + JsonSerializer.Serialize(writer, FilterTypeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..a5115879616 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class FrequencyEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("frequency_map")] + public IDictionary FrequencyMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor(FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor.FrequencyEncoding(frequencyEncodingPreprocessor); +} + +public sealed partial class FrequencyEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal FrequencyEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public FrequencyEncodingPreprocessorDescriptor() : base() + { + } + + private string FeatureNameValue { get; set; } + private string FieldValue { get; set; } + private IDictionary FrequencyMapValue { get; set; } + + public FrequencyEncodingPreprocessorDescriptor FeatureName(string featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public FrequencyEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public FrequencyEncodingPreprocessorDescriptor FrequencyMap(Func, FluentDictionary> selector) + { + FrequencyMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("feature_name"); + writer.WriteStringValue(FeatureNameValue); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("frequency_map"); + JsonSerializer.Serialize(writer, FrequencyMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs new file mode 100644 index 00000000000..ad19f50aff6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class GeoResults +{ + /// + /// The actual value for the bucket formatted as a `geo_point`. + /// + [JsonInclude, JsonPropertyName("actual_point")] + public string ActualPoint { get; init; } + + /// + /// The typical value for the bucket formatted as a `geo_point`. + /// + [JsonInclude, JsonPropertyName("typical_point")] + public string TypicalPoint { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs new file mode 100644 index 00000000000..16ed21a5221 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Hyperparameter +{ + /// + /// A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. + /// + [JsonInclude, JsonPropertyName("absolute_importance")] + public double? AbsoluteImportance { get; init; } + + /// + /// Name of the hyperparameter. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization. + /// + [JsonInclude, JsonPropertyName("relative_importance")] + public double? RelativeImportance { get; init; } + + /// + /// Indicates if the hyperparameter is specified by the user (true) or optimized (false). + /// + [JsonInclude, JsonPropertyName("supplied")] + public bool Supplied { get; init; } + + /// + /// The value of the hyperparameter, either optimized or specified by the user. + /// + [JsonInclude, JsonPropertyName("value")] + public double Value { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs new file mode 100644 index 00000000000..3a744656dd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +/// +/// Inference configuration provided when storing the model config +/// +[JsonConverter(typeof(InferenceConfigCreateConverter))] +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.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigCreate("classification", classificationInferenceOptions); + public static InferenceConfigCreate FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => new InferenceConfigCreate("fill_mask", fillMaskInferenceOptions); + public static InferenceConfigCreate Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions nerInferenceOptions) => new InferenceConfigCreate("ner", nerInferenceOptions); + public static InferenceConfigCreate PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => new InferenceConfigCreate("pass_through", passThroughInferenceOptions); + public static InferenceConfigCreate QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => new InferenceConfigCreate("question_answering", questionAnsweringInferenceOptions); + public static InferenceConfigCreate Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigCreate("regression", regressionInferenceOptions); + public static InferenceConfigCreate TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => new InferenceConfigCreate("text_classification", textClassificationInferenceOptions); + public static InferenceConfigCreate TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => new InferenceConfigCreate("text_embedding", textEmbeddingInferenceOptions); + public static InferenceConfigCreate TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => new InferenceConfigCreate("text_expansion", textExpansionInferenceOptions); + public static InferenceConfigCreate ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => new InferenceConfigCreate("zero_shot_classification", zeroShotClassificationInferenceOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "fill_mask") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ner") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "pass_through") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "question_answering") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "zero_shot_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfigCreate' from the response."); + } + + reader.Read(); + var result = new InferenceConfigCreate(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.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(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.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) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigCreateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigCreateDescriptor FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions fillMaskInferenceOptions) => Set(fillMaskInferenceOptions, "fill_mask"); + public InferenceConfigCreateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigCreateDescriptor Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions nerInferenceOptions) => Set(nerInferenceOptions, "ner"); + public InferenceConfigCreateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigCreateDescriptor PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions passThroughInferenceOptions) => Set(passThroughInferenceOptions, "pass_through"); + public InferenceConfigCreateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigCreateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Set(questionAnsweringInferenceOptions, "question_answering"); + public InferenceConfigCreateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigCreateDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigCreateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigCreateDescriptor TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions textClassificationInferenceOptions) => Set(textClassificationInferenceOptions, "text_classification"); + public InferenceConfigCreateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigCreateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Set(textEmbeddingInferenceOptions, "text_embedding"); + public InferenceConfigCreateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigCreateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions textExpansionInferenceOptions) => Set(textExpansionInferenceOptions, "text_expansion"); + public InferenceConfigCreateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigCreateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.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) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs new file mode 100644 index 00000000000..026e311ca20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +[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.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigUpdate("classification", classificationInferenceOptions); + public static InferenceConfigUpdate FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => new InferenceConfigUpdate("fill_mask", fillMaskInferenceUpdateOptions); + public static InferenceConfigUpdate Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => new InferenceConfigUpdate("ner", nerInferenceUpdateOptions); + public static InferenceConfigUpdate PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => new InferenceConfigUpdate("pass_through", passThroughInferenceUpdateOptions); + public static InferenceConfigUpdate QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => new InferenceConfigUpdate("question_answering", questionAnsweringInferenceUpdateOptions); + public static InferenceConfigUpdate Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigUpdate("regression", regressionInferenceOptions); + public static InferenceConfigUpdate TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("text_classification", textClassificationInferenceUpdateOptions); + public static InferenceConfigUpdate TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => new InferenceConfigUpdate("text_embedding", textEmbeddingInferenceUpdateOptions); + public static InferenceConfigUpdate TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => new InferenceConfigUpdate("text_expansion", textExpansionInferenceUpdateOptions); + public static InferenceConfigUpdate ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("zero_shot_classification", zeroShotClassificationInferenceUpdateOptions); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "fill_mask") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "ner") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "pass_through") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "question_answering") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "regression") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "zero_shot_classification") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'InferenceConfigUpdate' from the response."); + } + + reader.Read(); + var result = new InferenceConfigUpdate(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.ClassificationInferenceOptions)value.Variant, options); + break; + case "fill_mask": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions)value.Variant, options); + break; + case "ner": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions)value.Variant, options); + break; + case "pass_through": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions)value.Variant, options); + break; + case "question_answering": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions)value.Variant, options); + break; + case "regression": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, options); + break; + case "text_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions)value.Variant, options); + break; + case "text_embedding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions)value.Variant, options); + break; + case "text_expansion": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions)value.Variant, options); + break; + case "zero_shot_classification": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.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(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action> configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.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) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions classificationInferenceOptions) => Set(classificationInferenceOptions, "classification"); + public InferenceConfigUpdateDescriptor Classification(Action configure) => Set(configure, "classification"); + public InferenceConfigUpdateDescriptor FillMask(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => Set(fillMaskInferenceUpdateOptions, "fill_mask"); + public InferenceConfigUpdateDescriptor FillMask(Action configure) => Set(configure, "fill_mask"); + public InferenceConfigUpdateDescriptor Ner(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions nerInferenceUpdateOptions) => Set(nerInferenceUpdateOptions, "ner"); + public InferenceConfigUpdateDescriptor Ner(Action configure) => Set(configure, "ner"); + public InferenceConfigUpdateDescriptor PassThrough(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Set(passThroughInferenceUpdateOptions, "pass_through"); + public InferenceConfigUpdateDescriptor PassThrough(Action configure) => Set(configure, "pass_through"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Set(questionAnsweringInferenceUpdateOptions, "question_answering"); + public InferenceConfigUpdateDescriptor QuestionAnswering(Action configure) => Set(configure, "question_answering"); + public InferenceConfigUpdateDescriptor Regression(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions regressionInferenceOptions) => Set(regressionInferenceOptions, "regression"); + public InferenceConfigUpdateDescriptor Regression(Action configure) => Set(configure, "regression"); + public InferenceConfigUpdateDescriptor TextClassification(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Set(textClassificationInferenceUpdateOptions, "text_classification"); + public InferenceConfigUpdateDescriptor TextClassification(Action configure) => Set(configure, "text_classification"); + public InferenceConfigUpdateDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Set(textEmbeddingInferenceUpdateOptions, "text_embedding"); + public InferenceConfigUpdateDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public InferenceConfigUpdateDescriptor TextExpansion(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Set(textExpansionInferenceUpdateOptions, "text_expansion"); + public InferenceConfigUpdateDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public InferenceConfigUpdateDescriptor ZeroShotClassification(Elastic.Clients.Elasticsearch.MachineLearning.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) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs new file mode 100644 index 00000000000..b7f56e93114 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class InferenceResponseResult +{ + /// + /// If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities. + /// + [JsonInclude, JsonPropertyName("entities")] + public IReadOnlyCollection? Entities { get; init; } + + /// + /// The feature importance for the inference results. Relevant only for classification or regression models + /// + [JsonInclude, JsonPropertyName("feature_importance")] + public IReadOnlyCollection? FeatureImportance { get; init; } + + /// + /// Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property
is present only when it is true.
+ ///
+ [JsonInclude, JsonPropertyName("is_truncated")] + public bool? IsTruncated { get; init; } + + /// + /// If the model is trained for a text classification or zero shot classification task, the response is the
predicted class.
For named entity recognition (NER) tasks, it contains the annotated text output.
For fill mask tasks, it contains the top prediction for replacing the mask token.
For text embedding tasks, it contains the raw numerical text embedding values.
For regression models, its a numerical value
For classification models, it may be an integer, double, boolean or string depending on prediction type
+ ///
+ [JsonInclude, JsonPropertyName("predicted_value")] + public IReadOnlyCollection? PredictedValue { get; init; } + + /// + /// For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted
value.
Additionally
+ ///
+ [JsonInclude, JsonPropertyName("predicted_value_sequence")] + public string? PredictedValueSequence { get; init; } + + /// + /// Specifies a probability for the predicted value. + /// + [JsonInclude, JsonPropertyName("prediction_probability")] + public double? PredictionProbability { get; init; } + + /// + /// Specifies a confidence score for the predicted value. + /// + [JsonInclude, JsonPropertyName("prediction_score")] + public double? PredictionScore { get; init; } + + /// + /// For fill mask, text classification, and zero shot classification tasks, the response contains a list of top
class entries.
+ ///
+ [JsonInclude, JsonPropertyName("top_classes")] + public IReadOnlyCollection? TopClasses { get; init; } + + /// + /// If the request failed, the response contains the reason for the failure. + /// + [JsonInclude, JsonPropertyName("warning")] + public string? Warning { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs new file mode 100644 index 00000000000..b9a3b169a2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Influence +{ + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + [JsonInclude, JsonPropertyName("influencer_field_values")] + public IReadOnlyCollection InfluencerFieldValues { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs new file mode 100644 index 00000000000..913a137812c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Influencer +{ + /// + /// The length of the bucket in seconds. This value matches the bucket span that is specified in the job. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// Additional influencer properties are added, depending on the fields being analyzed. For example, if it’s
analyzing `user_name` as an influencer, a field `user_name` is added to the result document. This
information enables you to filter the anomaly results more easily.
+ ///
+ [JsonInclude, JsonPropertyName("foo")] + public string? Foo { get; init; } + + /// + /// The field name of the influencer. + /// + [JsonInclude, JsonPropertyName("influencer_field_name")] + public string InfluencerFieldName { get; init; } + + /// + /// The entity that influenced, contributed to, or was to blame for the anomaly. + /// + [JsonInclude, JsonPropertyName("influencer_field_value")] + public string InfluencerFieldValue { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the influencer in this bucket aggregated
across detectors. Unlike `initial_influencer_score`, this value is updated by a re-normalization process as new
data is analyzed.
+ ///
+ [JsonInclude, JsonPropertyName("influencer_score")] + public double InfluencerScore { get; init; } + + /// + /// A normalized score between 0-100, which is based on the probability of the influencer aggregated across detectors.
This is the initial value that was calculated at the time the bucket was processed.
+ ///
+ [JsonInclude, JsonPropertyName("initial_influencer_score")] + public double InitialInfluencerScore { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The probability that the influencer has this behavior, in the range 0 to 1. This value can be held to a high
precision of over 300 decimal places, so the `influencer_score` is provided as a human-readable and friendly
interpretation of this value.
+ ///
+ [JsonInclude, JsonPropertyName("probability")] + public double Probability { get; init; } + + /// + /// Internal. This value is always set to `influencer`. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs new file mode 100644 index 00000000000..db1ccc9437f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Input +{ + [JsonInclude, JsonPropertyName("field_names")] + public Elastic.Clients.Elasticsearch.Names FieldNames { get; set; } +} + +public sealed partial class InputDescriptor : SerializableDescriptor +{ + internal InputDescriptor(Action configure) => configure.Invoke(this); + + public InputDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Names FieldNamesValue { get; set; } + + public InputDescriptor FieldNames(Elastic.Clients.Elasticsearch.Names fieldNames) + { + FieldNamesValue = fieldNames; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field_names"); + JsonSerializer.Serialize(writer, FieldNamesValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs new file mode 100644 index 00000000000..95686e9bcac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Job +{ + /// + /// Advanced configuration option.
Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.
+ ///
+ [JsonInclude, JsonPropertyName("allow_lazy_open")] + public bool AllowLazyOpen { get; init; } + + /// + /// The analysis configuration, which specifies how to analyze the data.
After you create a job, you cannot change the analysis configuration; all the properties are informational.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig AnalysisConfig { get; init; } + + /// + /// Limits can be applied for the resources required to hold the mathematical models in memory.
These limits are approximate and can be set per job.
They do not control the memory used by other processes, for example the Elasticsearch Java processes.
+ ///
+ [JsonInclude, JsonPropertyName("analysis_limits")] + public Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits? AnalysisLimits { get; init; } + + /// + /// Advanced configuration option.
The time between each periodic persistence of the model.
The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time.
The smallest allowed value is 1 hour.
+ ///
+ [JsonInclude, JsonPropertyName("background_persist_interval")] + public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; init; } + [JsonInclude, JsonPropertyName("blocked")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked? Blocked { get; init; } + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Advanced configuration option.
Contains custom metadata about the job.
+ ///
+ [JsonInclude, JsonPropertyName("custom_settings")] + public object? CustomSettings { get; init; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job.
It specifies a period of time (in days) after which only the first snapshot per day is retained.
This period is relative to the timestamp of the most recent snapshot for this job.
Valid values range from 0 to `model_snapshot_retention_days`.
+ ///
+ [JsonInclude, JsonPropertyName("daily_model_snapshot_retention_after_days")] + public long? DailyModelSnapshotRetentionAfterDays { get; init; } + + /// + /// The data description defines the format of the input data when you send data to the job by using the post data API.
Note that when configuring a datafeed, these properties are automatically set.
When data is received via the post data API, it is not stored in Elasticsearch.
Only the results for anomaly detection are retained.
+ ///
+ [JsonInclude, JsonPropertyName("data_description")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; init; } + + /// + /// The datafeed, which retrieves data from Elasticsearch for analysis by the job.
You can associate only one datafeed with each anomaly detection job.
+ ///
+ [JsonInclude, JsonPropertyName("datafeed_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.Datafeed? DatafeedConfig { get; init; } + + /// + /// Indicates that the process of deleting the job is in progress but not yet completed.
It is only reported when `true`.
+ ///
+ [JsonInclude, JsonPropertyName("deleting")] + public bool? Deleting { get; init; } + + /// + /// A description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// If the job closed or failed, this is the time the job finished, otherwise it is `null`.
This property is informational; you cannot change its value.
+ ///
+ [JsonInclude, JsonPropertyName("finished_time")] + public DateTimeOffset? FinishedTime { get; init; } + + /// + /// A list of job groups.
A job can belong to no groups or many.
+ ///
+ [JsonInclude, JsonPropertyName("groups")] + public IReadOnlyCollection? Groups { get; init; } + + /// + /// Identifier for the anomaly detection job.
This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
It must start and end with alphanumeric characters.
+ ///
+ [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// Reserved for future use, currently set to `anomaly_detector`. + /// + [JsonInclude, JsonPropertyName("job_type")] + public string? JobType { get; init; } + + /// + /// The machine learning configuration version number at which the the job was created. + /// + [JsonInclude, JsonPropertyName("job_version")] + public string? JobVersion { get; init; } + + /// + /// This advanced configuration option stores model information along with the results.
It provides a more detailed view into anomaly detection.
Model plot provides a simplified and indicative view of the model and its bounds.
+ ///
+ [JsonInclude, JsonPropertyName("model_plot_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; init; } + [JsonInclude, JsonPropertyName("model_snapshot_id")] + public string? ModelSnapshotId { get; init; } + + /// + /// Advanced configuration option, which affects the automatic removal of old model snapshots for this job.
It specifies the maximum period of time (in days) that snapshots are retained.
This period is relative to the timestamp of the most recent snapshot for this job.
By default, snapshots ten days older than the newest snapshot are deleted.
+ ///
+ [JsonInclude, JsonPropertyName("model_snapshot_retention_days")] + public long ModelSnapshotRetentionDays { get; init; } + + /// + /// Advanced configuration option.
The period over which adjustments to the score are applied, as new data is seen.
The default value is the longer of 30 days or 100 `bucket_spans`.
+ ///
+ [JsonInclude, JsonPropertyName("renormalization_window_days")] + public long? RenormalizationWindowDays { get; init; } + + /// + /// A text string that affects the name of the machine learning results index.
The default value is `shared`, which generates an index named `.ml-anomalies-shared`.
+ ///
+ [JsonInclude, JsonPropertyName("results_index_name")] + public string ResultsIndexName { get; init; } + + /// + /// Advanced configuration option.
The period of time (in days) that results are retained.
Age is calculated relative to the timestamp of the latest bucket result.
If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch.
The default value is null, which means all results are retained.
Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results.
Annotations added by users are retained forever.
+ ///
+ [JsonInclude, JsonPropertyName("results_retention_days")] + public long? ResultsRetentionDays { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs new file mode 100644 index 00000000000..612647b2eca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JobBlocked +{ + [JsonInclude, JsonPropertyName("reason")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason Reason { get; init; } + [JsonInclude, JsonPropertyName("task_id")] + public Elastic.Clients.Elasticsearch.TaskId? TaskId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs new file mode 100644 index 00000000000..151d5765fae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JobForecastStatistics +{ + [JsonInclude, JsonPropertyName("forecasted_jobs")] + public int ForecastedJobs { get; init; } + [JsonInclude, JsonPropertyName("memory_bytes")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? MemoryBytes { get; init; } + [JsonInclude, JsonPropertyName("processing_time_ms")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? ProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("records")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? Records { get; init; } + [JsonInclude, JsonPropertyName("status")] + public IReadOnlyDictionary? Status { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs new file mode 100644 index 00000000000..f4f896549d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JobStatistics +{ + [JsonInclude, JsonPropertyName("avg")] + public double Avg { get; init; } + [JsonInclude, JsonPropertyName("max")] + public double Max { get; init; } + [JsonInclude, JsonPropertyName("min")] + public double Min { get; init; } + [JsonInclude, JsonPropertyName("total")] + public double Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs new file mode 100644 index 00000000000..3b5801b1dae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JobStats +{ + /// + /// For open anomaly detection jobs only, contains messages relating to the selection of a node to run the job. + /// + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string? AssignmentExplanation { get; init; } + + /// + /// An object that describes the quantity of input to the job and any related error counts.
The `data_count` values are cumulative for the lifetime of a job.
If a model snapshot is reverted or old results are deleted, the job counts are not reset.
+ ///
+ [JsonInclude, JsonPropertyName("data_counts")] + public Elastic.Clients.Elasticsearch.MachineLearning.DataCounts DataCounts { get; init; } + + /// + /// Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when `true`. + /// + [JsonInclude, JsonPropertyName("deleting")] + public bool? Deleting { get; init; } + + /// + /// An object that provides statistical information about forecasts belonging to this job.
Some statistics are omitted if no forecasts have been made.
+ ///
+ [JsonInclude, JsonPropertyName("forecasts_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics ForecastsStats { get; init; } + + /// + /// Identifier for the anomaly detection job. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// An object that provides information about the size and contents of the model. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats ModelSizeStats { get; init; } + + /// + /// Contains properties for the node that runs the job.
This information is available only for open jobs.
+ ///
+ [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNode? Node { get; init; } + + /// + /// For open jobs only, the elapsed time for which the job has been open. + /// + [JsonInclude, JsonPropertyName("open_time")] + public DateTimeOffset? OpenTime { get; init; } + + /// + /// The status of the anomaly detection job, which can be one of the following values: `closed`, `closing`, `failed`, `opened`, `opening`. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobState State { get; init; } + + /// + /// An object that provides statistical information about timing aspect of this job. + /// + [JsonInclude, JsonPropertyName("timing_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats TimingStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs new file mode 100644 index 00000000000..884bb992621 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JobTimingStats +{ + [JsonInclude, JsonPropertyName("average_bucket_processing_time_ms")] + public double? AverageBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("bucket_count")] + public long BucketCount { get; init; } + [JsonInclude, JsonPropertyName("exponential_average_bucket_processing_time_ms")] + public double? ExponentialAverageBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("exponential_average_bucket_processing_time_per_hour_ms")] + public double ExponentialAverageBucketProcessingTimePerHourMs { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("maximum_bucket_processing_time_ms")] + public double? MaximumBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("minimum_bucket_processing_time_ms")] + public double? MinimumBucketProcessingTimeMs { get; init; } + [JsonInclude, JsonPropertyName("total_bucket_processing_time_ms")] + public double TotalBucketProcessingTimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs new file mode 100644 index 00000000000..bfbe30b4921 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class JvmStats +{ + /// + /// Maximum amount of memory available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max")] + public Elastic.Clients.Elasticsearch.ByteSize? HeapMax { get; init; } + + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public int HeapMaxInBytes { get; init; } + + /// + /// Amount of Java heap currently being used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference")] + public Elastic.Clients.Elasticsearch.ByteSize? JavaInference { get; init; } + + /// + /// Amount of Java heap, in bytes, currently being used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_in_bytes")] + public int JavaInferenceInBytes { get; init; } + + /// + /// Maximum amount of Java heap to be used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_max")] + public Elastic.Clients.Elasticsearch.ByteSize? JavaInferenceMax { get; init; } + + /// + /// Maximum amount of Java heap, in bytes, to be used for caching inference models. + /// + [JsonInclude, JsonPropertyName("java_inference_max_in_bytes")] + public int JavaInferenceMaxInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs new file mode 100644 index 00000000000..b1845bd0aba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Limits +{ + [JsonInclude, JsonPropertyName("effective_max_model_memory_limit")] + public string EffectiveMaxModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("max_model_memory_limit")] + public string? MaxModelMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("total_ml_memory")] + public string TotalMlMemory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs new file mode 100644 index 00000000000..8951ce05d70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class MemMlStats +{ + /// + /// Amount of native memory set aside for anomaly detection jobs. + /// + [JsonInclude, JsonPropertyName("anomaly_detectors")] + public Elastic.Clients.Elasticsearch.ByteSize? AnomalyDetectors { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for anomaly detection jobs. + /// + [JsonInclude, JsonPropertyName("anomaly_detectors_in_bytes")] + public int AnomalyDetectorsInBytes { get; init; } + + /// + /// Amount of native memory set aside for data frame analytics jobs. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics")] + public Elastic.Clients.Elasticsearch.ByteSize? DataFrameAnalytics { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for data frame analytics jobs. + /// + [JsonInclude, JsonPropertyName("data_frame_analytics_in_bytes")] + public int DataFrameAnalyticsInBytes { get; init; } + + /// + /// Maximum amount of native memory (separate to the JVM heap) that may be used by machine learning native processes. + /// + [JsonInclude, JsonPropertyName("max")] + public Elastic.Clients.Elasticsearch.ByteSize? Max { get; init; } + + /// + /// Maximum amount of native memory (separate to the JVM heap), in bytes, that may be used by machine learning native processes. + /// + [JsonInclude, JsonPropertyName("max_in_bytes")] + public int MaxInBytes { get; init; } + + /// + /// Amount of native memory set aside for loading machine learning native code shared libraries. + /// + [JsonInclude, JsonPropertyName("native_code_overhead")] + public Elastic.Clients.Elasticsearch.ByteSize? NativeCodeOverhead { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for loading machine learning native code shared libraries. + /// + [JsonInclude, JsonPropertyName("native_code_overhead_in_bytes")] + public int NativeCodeOverheadInBytes { get; init; } + + /// + /// Amount of native memory set aside for trained models that have a PyTorch model_type. + /// + [JsonInclude, JsonPropertyName("native_inference")] + public Elastic.Clients.Elasticsearch.ByteSize? NativeInference { get; init; } + + /// + /// Amount of native memory, in bytes, set aside for trained models that have a PyTorch model_type. + /// + [JsonInclude, JsonPropertyName("native_inference_in_bytes")] + public int NativeInferenceInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs new file mode 100644 index 00000000000..78414335cfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class MemStats +{ + /// + /// If the amount of physical memory has been overridden using the es.total_memory_bytes system property
then this reports the overridden value. Otherwise it reports the same value as total.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total")] + public Elastic.Clients.Elasticsearch.ByteSize? AdjustedTotal { get; init; } + + /// + /// If the amount of physical memory has been overridden using the `es.total_memory_bytes` system property
then this reports the overridden value in bytes. Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public int AdjustedTotalInBytes { get; init; } + + /// + /// Contains statistics about machine learning use of native memory on the node. + /// + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats Ml { get; init; } + + /// + /// Total amount of physical memory. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.ByteSize? Total { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public int TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs new file mode 100644 index 00000000000..634924f57c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Memory +{ + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("ephemeral_id")] + public string EphemeralId { get; init; } + + /// + /// Contains Java Virtual Machine (JVM) statistics for the node. + /// + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.MachineLearning.JvmStats Jvm { get; init; } + + /// + /// Contains statistics about memory usage for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.MachineLearning.MemStats Mem { get; init; } + + /// + /// Human-readable identifier for the node. Based on the Node name setting setting. + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// Roles assigned to the node. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection Roles { get; init; } + + /// + /// The host and port where transport HTTP connections are accepted. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs new file mode 100644 index 00000000000..66efee0e942 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ModelPlotConfig +{ + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + [JsonInclude, JsonPropertyName("annotations_enabled")] + public bool? AnnotationsEnabled { get; set; } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + [JsonInclude, JsonPropertyName("terms")] + public Elastic.Clients.Elasticsearch.Field? Terms { get; set; } +} + +public sealed partial class ModelPlotConfigDescriptor : SerializableDescriptor> +{ + internal ModelPlotConfigDescriptor(Action> configure) => configure.Invoke(this); + + public ModelPlotConfigDescriptor() : base() + { + } + + private bool? AnnotationsEnabledValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TermsValue { get; set; } + + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor AnnotationsEnabled(bool? annotationsEnabled = true) + { + AnnotationsEnabledValue = annotationsEnabled; + return Self; + } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Elastic.Clients.Elasticsearch.Field? terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnnotationsEnabledValue.HasValue) + { + writer.WritePropertyName("annotations_enabled"); + writer.WriteBooleanValue(AnnotationsEnabledValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class ModelPlotConfigDescriptor : SerializableDescriptor +{ + internal ModelPlotConfigDescriptor(Action configure) => configure.Invoke(this); + + public ModelPlotConfigDescriptor() : base() + { + } + + private bool? AnnotationsEnabledValue { get; set; } + private bool? EnabledValue { get; set; } + private Elastic.Clients.Elasticsearch.Field? TermsValue { get; set; } + + /// + /// If true, enables calculation and storage of the model change annotations for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor AnnotationsEnabled(bool? annotationsEnabled = true) + { + AnnotationsEnabledValue = annotationsEnabled; + return Self; + } + + /// + /// If true, enables calculation and storage of the model bounds for each entity that is being analyzed. + /// + public ModelPlotConfigDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Elastic.Clients.Elasticsearch.Field? terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + /// + /// Limits data collection to this comma separated list of partition or by field values. If terms are not specified or it is an empty string, no filtering is applied. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer. + /// + public ModelPlotConfigDescriptor Terms(Expression> terms) + { + TermsValue = terms; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnnotationsEnabledValue.HasValue) + { + writer.WritePropertyName("annotations_enabled"); + writer.WriteBooleanValue(AnnotationsEnabledValue.Value); + } + + if (EnabledValue.HasValue) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(EnabledValue.Value); + } + + if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs new file mode 100644 index 00000000000..a390216ea6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ModelSizeStats +{ + [JsonInclude, JsonPropertyName("assignment_memory_basis")] + public string? AssignmentMemoryBasis { get; init; } + [JsonInclude, JsonPropertyName("bucket_allocation_failures_count")] + public long BucketAllocationFailuresCount { get; init; } + [JsonInclude, JsonPropertyName("categorization_status")] + public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus CategorizationStatus { get; init; } + [JsonInclude, JsonPropertyName("categorized_doc_count")] + public int CategorizedDocCount { get; init; } + [JsonInclude, JsonPropertyName("dead_category_count")] + public int DeadCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("failed_category_count")] + public int FailedCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("frequent_category_count")] + public int FrequentCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("log_time")] + public DateTimeOffset LogTime { get; init; } + [JsonInclude, JsonPropertyName("memory_status")] + public Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus MemoryStatus { get; init; } + [JsonInclude, JsonPropertyName("model_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize ModelBytes { get; init; } + [JsonInclude, JsonPropertyName("model_bytes_exceeded")] + public Elastic.Clients.Elasticsearch.ByteSize? ModelBytesExceeded { get; init; } + [JsonInclude, JsonPropertyName("model_bytes_memory_limit")] + public Elastic.Clients.Elasticsearch.ByteSize? ModelBytesMemoryLimit { get; init; } + [JsonInclude, JsonPropertyName("peak_model_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize? PeakModelBytes { get; init; } + [JsonInclude, JsonPropertyName("rare_category_count")] + public int RareCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + [JsonInclude, JsonPropertyName("total_by_field_count")] + public long TotalByFieldCount { get; init; } + [JsonInclude, JsonPropertyName("total_category_count")] + public int TotalCategoryCount { get; init; } + [JsonInclude, JsonPropertyName("total_over_field_count")] + public long TotalOverFieldCount { get; init; } + [JsonInclude, JsonPropertyName("total_partition_field_count")] + public long TotalPartitionFieldCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs new file mode 100644 index 00000000000..a8d6d371352 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ModelSnapshot +{ + /// + /// An optional description of the job. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// A numerical character string that uniquely identifies the job that the snapshot was created for. + /// + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + + /// + /// The timestamp of the latest processed record. + /// + [JsonInclude, JsonPropertyName("latest_record_time_stamp")] + public int? LatestRecordTimeStamp { get; init; } + + /// + /// The timestamp of the latest bucket result. + /// + [JsonInclude, JsonPropertyName("latest_result_time_stamp")] + public int? LatestResultTimeStamp { get; init; } + + /// + /// The minimum version required to be able to restore the model snapshot. + /// + [JsonInclude, JsonPropertyName("min_version")] + public string MinVersion { get; init; } + + /// + /// Summary information describing the model. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats? ModelSizeStats { get; init; } + + /// + /// If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false. + /// + [JsonInclude, JsonPropertyName("retain")] + public bool Retain { get; init; } + + /// + /// For internal use only. + /// + [JsonInclude, JsonPropertyName("snapshot_doc_count")] + public long SnapshotDocCount { get; init; } + + /// + /// A numerical character string that uniquely identifies the model snapshot. + /// + [JsonInclude, JsonPropertyName("snapshot_id")] + public string SnapshotId { get; init; } + + /// + /// The creation timestamp for the snapshot. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs new file mode 100644 index 00000000000..93702047375 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class ModelSnapshotUpgrade +{ + [JsonInclude, JsonPropertyName("assignment_explanation")] + public string AssignmentExplanation { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNode Node { get; init; } + [JsonInclude, JsonPropertyName("snapshot_id")] + public string SnapshotId { get; init; } + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState State { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs new file mode 100644 index 00000000000..8b41fbba4a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class NativeCode +{ + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs similarity index 72% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs index 99ab97c6976..33028e2527c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Named entity recognition options @@ -48,11 +48,11 @@ public sealed partial class NerInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } [JsonInclude, JsonPropertyName("vocabulary")] - public Elastic.Clients.Elasticsearch.Ml.Vocabulary? Vocabulary { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary? Vocabulary { get; set; } - public static implicit operator InferenceConfigCreate(NerInferenceOptions nerInferenceOptions) => Ml.InferenceConfigCreate.Ner(nerInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(NerInferenceOptions nerInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.Ner(nerInferenceOptions); } /// @@ -68,12 +68,12 @@ public NerInferenceOptionsDescriptor() : base() private ICollection? ClassificationLabelsValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Ml.Vocabulary? VocabularyValue { get; set; } - private VocabularyDescriptor VocabularyDescriptor { get; set; } - private Action VocabularyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary? VocabularyValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.VocabularyDescriptor VocabularyDescriptor { get; set; } + private Action VocabularyDescriptorAction { get; set; } /// /// The token classification labels. Must be IOB formatted tags @@ -96,7 +96,7 @@ public NerInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options /// - public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -104,7 +104,7 @@ public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch. return Self; } - public NerInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public NerInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -112,7 +112,7 @@ public NerInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor d return Self; } - public NerInferenceOptionsDescriptor Tokenization(Action configure) + public NerInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -120,7 +120,7 @@ public NerInferenceOptionsDescriptor Tokenization(Action configure) + public NerInferenceOptionsDescriptor Vocabulary(Action configure) { VocabularyValue = null; VocabularyDescriptor = null; @@ -167,7 +167,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { @@ -183,7 +183,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VocabularyDescriptorAction is not null) { writer.WritePropertyName("vocabulary"); - JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.VocabularyDescriptor(VocabularyDescriptorAction), options); } else if (VocabularyValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs index 6447fb5b533..45736382831 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NerInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class NerInferenceUpdateOptions { @@ -39,9 +39,9 @@ public sealed partial class NerInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Ml.InferenceConfigUpdate.Ner(nerInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(NerInferenceUpdateOptions nerInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.Ner(nerInferenceUpdateOptions); } public sealed partial class NerInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -53,9 +53,9 @@ public NerInferenceUpdateOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -69,7 +69,7 @@ public NerInferenceUpdateOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options to update when inferring /// - public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -77,7 +77,7 @@ public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elastics return Self; } - public NerInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public NerInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -85,7 +85,7 @@ public NerInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOpt return Self; } - public NerInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public NerInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -110,7 +110,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs similarity index 94% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs index fd1cb9ac301..1718927e417 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpBertTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// BERT and MPNet tokenization configuration options @@ -54,7 +54,7 @@ public sealed partial class NlpBertTokenizationConfig /// Should tokenization input be automatically truncated before sending to the model for inference /// [JsonInclude, JsonPropertyName("truncate")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? Truncate { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? Truncate { get; set; } /// /// Is tokenization completed with special tokens @@ -77,7 +77,7 @@ public NlpBertTokenizationConfigDescriptor() : base() private bool? DoLowerCaseValue { get; set; } private int? MaxSequenceLengthValue { get; set; } private int? SpanValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? TruncateValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } private bool? WithSpecialTokensValue { get; set; } /// @@ -110,7 +110,7 @@ public NlpBertTokenizationConfigDescriptor Span(int? span) /// /// Should tokenization input be automatically truncated before sending to the model for inference /// - public NlpBertTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? truncate) + public NlpBertTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs index 1419c17110c..7671fcbf8d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpRobertaTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// RoBERTa tokenization configuration options @@ -54,7 +54,7 @@ public sealed partial class NlpRobertaTokenizationConfig /// Should tokenization input be automatically truncated before sending to the model for inference /// [JsonInclude, JsonPropertyName("truncate")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? Truncate { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? Truncate { get; set; } /// /// Is tokenization completed with special tokens @@ -62,7 +62,7 @@ public sealed partial class NlpRobertaTokenizationConfig [JsonInclude, JsonPropertyName("with_special_tokens")] public bool? WithSpecialTokens { get; set; } - public static implicit operator TokenizationConfig(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Ml.TokenizationConfig.Roberta(nlpRobertaTokenizationConfig); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig(NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig.Roberta(nlpRobertaTokenizationConfig); } /// @@ -79,7 +79,7 @@ public NlpRobertaTokenizationConfigDescriptor() : base() private bool? AddPrefixSpaceValue { get; set; } private int? MaxSequenceLengthValue { get; set; } private int? SpanValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? TruncateValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } private bool? WithSpecialTokensValue { get; set; } /// @@ -112,7 +112,7 @@ public NlpRobertaTokenizationConfigDescriptor Span(int? span) /// /// Should tokenization input be automatically truncated before sending to the model for inference /// - public NlpRobertaTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? truncate) + public NlpRobertaTokenizationConfigDescriptor Truncate(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs similarity index 89% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs index 86a105180f2..932586037a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/NlpTokenizationUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class NlpTokenizationUpdateOptions { @@ -39,7 +39,7 @@ public sealed partial class NlpTokenizationUpdateOptions /// Truncate options to apply /// [JsonInclude, JsonPropertyName("truncate")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? Truncate { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? Truncate { get; set; } } public sealed partial class NlpTokenizationUpdateOptionsDescriptor : SerializableDescriptor @@ -51,7 +51,7 @@ public NlpTokenizationUpdateOptionsDescriptor() : base() } private int? SpanValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? TruncateValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? TruncateValue { get; set; } /// /// Span options to apply @@ -65,7 +65,7 @@ public NlpTokenizationUpdateOptionsDescriptor Span(int? span) /// /// Truncate options to apply /// - public NlpTokenizationUpdateOptionsDescriptor Truncate(Elastic.Clients.Elasticsearch.Ml.TokenizationTruncate? truncate) + public NlpTokenizationUpdateOptionsDescriptor Truncate(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? truncate) { TruncateValue = truncate; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..0b3439fe854 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class OneHotEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("hot_map")] + public IDictionary HotMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor(OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor.OneHotEncoding(oneHotEncodingPreprocessor); +} + +public sealed partial class OneHotEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal OneHotEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public OneHotEncodingPreprocessorDescriptor() : base() + { + } + + private string FieldValue { get; set; } + private IDictionary HotMapValue { get; set; } + + public OneHotEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public OneHotEncodingPreprocessorDescriptor HotMap(Func, FluentDictionary> selector) + { + HotMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("hot_map"); + JsonSerializer.Serialize(writer, HotMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs new file mode 100644 index 00000000000..6aab4655594 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class OverallBucket +{ + /// + /// The length of the bucket in seconds. Matches the job with the longest bucket_span value. + /// + [JsonInclude, JsonPropertyName("bucket_span")] + public long BucketSpan { get; init; } + + /// + /// If true, this is an interim result. In other words, the results are calculated based on partial input data. + /// + [JsonInclude, JsonPropertyName("is_interim")] + public bool IsInterim { get; init; } + + /// + /// An array of objects that contain the max_anomaly_score per job_id. + /// + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyCollection Jobs { get; init; } + + /// + /// The top_n average of the maximum bucket anomaly_score per job. + /// + [JsonInclude, JsonPropertyName("overall_score")] + public double OverallScore { get; init; } + + /// + /// Internal. This is always set to overall_bucket. + /// + [JsonInclude, JsonPropertyName("result_type")] + public string ResultType { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } + + /// + /// The start time of the bucket for which these results were calculated. + /// + [JsonInclude, JsonPropertyName("timestamp_string")] + public DateTimeOffset TimestampString { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs new file mode 100644 index 00000000000..b731902f3a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class OverallBucketJob +{ + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("max_anomaly_score")] + public double MaxAnomalyScore { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs similarity index 60% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs index 79aeeda6870..5f32488edfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs @@ -25,59 +25,67 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Aggregations; +namespace Elastic.Clients.Elasticsearch.MachineLearning; -public sealed partial class TermsPartition +public sealed partial class Page { /// - /// The number of partitions. + /// Skips the specified number of items. /// - [JsonInclude, JsonPropertyName("num_partitions")] - public long NumPartitions { get; set; } + [JsonInclude, JsonPropertyName("from")] + public int? From { get; set; } /// - /// The partition number for this request. + /// Specifies the maximum number of items to obtain. /// - [JsonInclude, JsonPropertyName("partition")] - public long Partition { get; set; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; set; } } -public sealed partial class TermsPartitionDescriptor : SerializableDescriptor +public sealed partial class PageDescriptor : SerializableDescriptor { - internal TermsPartitionDescriptor(Action configure) => configure.Invoke(this); + internal PageDescriptor(Action configure) => configure.Invoke(this); - public TermsPartitionDescriptor() : base() + public PageDescriptor() : base() { } - private long NumPartitionsValue { get; set; } - private long PartitionValue { get; set; } + private int? FromValue { get; set; } + private int? SizeValue { get; set; } /// - /// The number of partitions. + /// Skips the specified number of items. /// - public TermsPartitionDescriptor NumPartitions(long numPartitions) + public PageDescriptor From(int? from) { - NumPartitionsValue = numPartitions; + FromValue = from; return Self; } /// - /// The partition number for this request. + /// Specifies the maximum number of items to obtain. /// - public TermsPartitionDescriptor Partition(long partition) + public PageDescriptor Size(int? size) { - PartitionValue = partition; + SizeValue = size; 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); + if (FromValue.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(FromValue.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/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs similarity index 70% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs index 3be92c12bba..743a8a82dc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/PassThroughInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Pass through configuration options @@ -42,11 +42,11 @@ public sealed partial class PassThroughInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } [JsonInclude, JsonPropertyName("vocabulary")] - public Elastic.Clients.Elasticsearch.Ml.Vocabulary? Vocabulary { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary? Vocabulary { get; set; } - public static implicit operator InferenceConfigCreate(PassThroughInferenceOptions passThroughInferenceOptions) => Ml.InferenceConfigCreate.PassThrough(passThroughInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(PassThroughInferenceOptions passThroughInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.PassThrough(passThroughInferenceOptions); } /// @@ -61,12 +61,12 @@ public PassThroughInferenceOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } - private Elastic.Clients.Elasticsearch.Ml.Vocabulary? VocabularyValue { get; set; } - private VocabularyDescriptor VocabularyDescriptor { get; set; } - private Action VocabularyDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary? VocabularyValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -80,7 +80,7 @@ public PassThroughInferenceOptionsDescriptor ResultsField(string? resultsField) /// /// The tokenization options /// - public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -88,7 +88,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasti return Self; } - public PassThroughInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public PassThroughInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -96,7 +96,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(TokenizationConfigDesc return Self; } - public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -104,7 +104,7 @@ public PassThroughInferenceOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceOptionsDescriptor Vocabulary(Action configure) { VocabularyValue = null; VocabularyDescriptor = null; @@ -145,7 +145,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { @@ -161,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (VocabularyDescriptorAction is not null) { writer.WritePropertyName("vocabulary"); - JsonSerializer.Serialize(writer, new VocabularyDescriptor(VocabularyDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.VocabularyDescriptor(VocabularyDescriptorAction), options); } else if (VocabularyValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs similarity index 75% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs index dd998a46ef2..ea6d0a06c33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/PassThroughInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class PassThroughInferenceUpdateOptions { @@ -39,9 +39,9 @@ public sealed partial class PassThroughInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Ml.InferenceConfigUpdate.PassThrough(passThroughInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.PassThrough(passThroughInferenceUpdateOptions); } public sealed partial class PassThroughInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -53,9 +53,9 @@ public PassThroughInferenceUpdateOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -69,7 +69,7 @@ public PassThroughInferenceUpdateOptionsDescriptor ResultsField(string? resultsF /// /// The tokenization options to update when inferring /// - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -77,7 +77,7 @@ public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients. return Self; } - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -85,7 +85,7 @@ public PassThroughInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationU return Self; } - public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public PassThroughInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -110,7 +110,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs new file mode 100644 index 00000000000..e33f7ce6e92 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class PerPartitionCategorization +{ + /// + /// To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails. + /// + [JsonInclude, JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly. + /// + [JsonInclude, JsonPropertyName("stop_on_warn")] + public bool? StopOnWarn { get; set; } +} + +public sealed partial class PerPartitionCategorizationDescriptor : SerializableDescriptor +{ + internal PerPartitionCategorizationDescriptor(Action configure) => configure.Invoke(this); + + public PerPartitionCategorizationDescriptor() : base() + { + } + + private bool? EnabledValue { get; set; } + private bool? StopOnWarnValue { get; set; } + + /// + /// To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails. + /// + public PerPartitionCategorizationDescriptor Enabled(bool? enabled = true) + { + EnabledValue = enabled; + return Self; + } + + /// + /// This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly. + /// + public PerPartitionCategorizationDescriptor StopOnWarn(bool? stopOnWarn = true) + { + StopOnWarnValue = stopOnWarn; + 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 (StopOnWarnValue.HasValue) + { + writer.WritePropertyName("stop_on_warn"); + writer.WriteBooleanValue(StopOnWarnValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs new file mode 100644 index 00000000000..ed90019f270 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +[JsonConverter(typeof(PreprocessorConverter))] +public sealed partial class Preprocessor +{ + internal Preprocessor(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 Preprocessor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => new Preprocessor("frequency_encoding", frequencyEncodingPreprocessor); + public static Preprocessor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => new Preprocessor("one_hot_encoding", oneHotEncodingPreprocessor); + public static Preprocessor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => new Preprocessor("target_mean_encoding", targetMeanEncodingPreprocessor); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class PreprocessorConverter : JsonConverter +{ + public override Preprocessor 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; + 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 == "frequency_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "one_hot_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "target_mean_encoding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Preprocessor' from the response."); + } + + reader.Read(); + var result = new Preprocessor(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, Preprocessor value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "frequency_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor)value.Variant, options); + break; + case "one_hot_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor)value.Variant, options); + break; + case "target_mean_encoding": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PreprocessorDescriptor : SerializableDescriptor> +{ + internal PreprocessorDescriptor(Action> configure) => configure.Invoke(this); + + public PreprocessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PreprocessorDescriptor 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 PreprocessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PreprocessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Set(frequencyEncodingPreprocessor, "frequency_encoding"); + public PreprocessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public PreprocessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Set(oneHotEncodingPreprocessor, "one_hot_encoding"); + public PreprocessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Set(targetMeanEncodingPreprocessor, "target_mean_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 PreprocessorDescriptor : SerializableDescriptor +{ + internal PreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public PreprocessorDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private PreprocessorDescriptor 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 PreprocessorDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public PreprocessorDescriptor FrequencyEncoding(Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor frequencyEncodingPreprocessor) => Set(frequencyEncodingPreprocessor, "frequency_encoding"); + public PreprocessorDescriptor FrequencyEncoding(Action configure) => Set(configure, "frequency_encoding"); + public PreprocessorDescriptor OneHotEncoding(Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor oneHotEncodingPreprocessor) => Set(oneHotEncodingPreprocessor, "one_hot_encoding"); + public PreprocessorDescriptor OneHotEncoding(Action configure) => Set(configure, "one_hot_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Set(targetMeanEncodingPreprocessor, "target_mean_encoding"); + public PreprocessorDescriptor TargetMeanEncoding(Action configure) => Set(configure, "target_mean_encoding"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs index c77ee61165f..82f5453c514 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/QuestionAnsweringInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Question answering inference options @@ -54,9 +54,9 @@ public sealed partial class QuestionAnsweringInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Ml.InferenceConfigCreate.QuestionAnswering(questionAnsweringInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.QuestionAnswering(questionAnsweringInferenceOptions); } /// @@ -73,9 +73,9 @@ public QuestionAnsweringInferenceOptionsDescriptor() : base() private int? MaxAnswerLengthValue { get; set; } private int? NumTopClassesValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The maximum answer length to consider @@ -107,7 +107,7 @@ public QuestionAnsweringInferenceOptionsDescriptor ResultsField(string? resultsF /// /// The tokenization options to update when inferring /// - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients. return Self; } - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public QuestionAnsweringInferenceOptionsDescriptor Tokenization(TokenizationConf return Self; } - public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Action configure) + public QuestionAnsweringInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs similarity index 81% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs index 50f6bffa09a..a7263fa3f1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/QuestionAnsweringInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class QuestionAnsweringInferenceUpdateOptions { @@ -57,9 +57,9 @@ public sealed partial class QuestionAnsweringInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Ml.InferenceConfigUpdate.QuestionAnswering(questionAnsweringInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.QuestionAnswering(questionAnsweringInferenceUpdateOptions); } public sealed partial class QuestionAnsweringInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -74,9 +74,9 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor() : base() private int? NumTopClassesValue { get; set; } private string QuestionValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The maximum answer length to consider for extraction @@ -117,7 +117,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor ResultsField(string? re /// /// The tokenization options to update when inferring /// - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -125,7 +125,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Cl return Self; } - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -133,7 +133,7 @@ public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(NlpTokeniz return Self; } - public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public QuestionAnsweringInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -172,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/RegressionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/RegressionInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs index b70c3ff18d4..5158c6afba9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/RegressionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class RegressionInferenceOptions { @@ -40,6 +40,10 @@ public sealed partial class RegressionInferenceOptions /// [JsonInclude, JsonPropertyName("results_field")] public Elastic.Clients.Elasticsearch.Field? ResultsField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig.Regression(regressionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.Regression(regressionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(RegressionInferenceOptions regressionInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.Regression(regressionInferenceOptions); } public sealed partial class RegressionInferenceOptionsDescriptor : SerializableDescriptor> @@ -80,6 +84,15 @@ public RegressionInferenceOptionsDescriptor ResultsField(Expr 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs new file mode 100644 index 00000000000..713cd3316a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class RuleCondition +{ + /// + /// Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time. + /// + [JsonInclude, JsonPropertyName("applies_to")] + public Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo AppliesTo { get; set; } + + /// + /// Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals. + /// + [JsonInclude, JsonPropertyName("operator")] + public Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator Operator { get; set; } + + /// + /// The value that is compared against the `applies_to` field using the operator. + /// + [JsonInclude, JsonPropertyName("value")] + public double Value { get; set; } +} + +public sealed partial class RuleConditionDescriptor : SerializableDescriptor +{ + internal RuleConditionDescriptor(Action configure) => configure.Invoke(this); + + public RuleConditionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo AppliesToValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator OperatorValue { get; set; } + private double ValueValue { get; set; } + + /// + /// Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time. + /// + public RuleConditionDescriptor AppliesTo(Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo appliesTo) + { + AppliesToValue = appliesTo; + return Self; + } + + /// + /// Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals. + /// + public RuleConditionDescriptor Operator(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator value) + { + OperatorValue = value; + return Self; + } + + /// + /// The value that is compared against the `applies_to` field using the operator. + /// + public RuleConditionDescriptor Value(double value) + { + ValueValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("applies_to"); + JsonSerializer.Serialize(writer, AppliesToValue, options); + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, OperatorValue, options); + writer.WritePropertyName("value"); + writer.WriteNumberValue(ValueValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs new file mode 100644 index 00000000000..17960b7b598 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class RunningStateSearchInterval +{ + /// + /// The end time. + /// + [JsonInclude, JsonPropertyName("end")] + public Elastic.Clients.Elasticsearch.Duration? End { get; init; } + + /// + /// The end time as an epoch in milliseconds. + /// + [JsonInclude, JsonPropertyName("end_ms")] + public long EndMs { get; init; } + + /// + /// The start time. + /// + [JsonInclude, JsonPropertyName("start")] + public Elastic.Clients.Elasticsearch.Duration? Start { get; init; } + + /// + /// The start time as an epoch in milliseconds. + /// + [JsonInclude, JsonPropertyName("start_ms")] + public long StartMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs new file mode 100644 index 00000000000..6e46c48c41a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TargetMeanEncodingPreprocessor +{ + [JsonInclude, JsonPropertyName("default_value")] + public double DefaultValue { get; set; } + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; set; } + [JsonInclude, JsonPropertyName("field")] + public string Field { get; set; } + [JsonInclude, JsonPropertyName("target_map")] + public IDictionary TargetMap { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor(TargetMeanEncodingPreprocessor targetMeanEncodingPreprocessor) => Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor.TargetMeanEncoding(targetMeanEncodingPreprocessor); +} + +public sealed partial class TargetMeanEncodingPreprocessorDescriptor : SerializableDescriptor +{ + internal TargetMeanEncodingPreprocessorDescriptor(Action configure) => configure.Invoke(this); + + public TargetMeanEncodingPreprocessorDescriptor() : base() + { + } + + private double DefaultValueValue { get; set; } + private string FeatureNameValue { get; set; } + private string FieldValue { get; set; } + private IDictionary TargetMapValue { get; set; } + + public TargetMeanEncodingPreprocessorDescriptor DefaultValue(double defaultValue) + { + DefaultValueValue = defaultValue; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor FeatureName(string featureName) + { + FeatureNameValue = featureName; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor Field(string field) + { + FieldValue = field; + return Self; + } + + public TargetMeanEncodingPreprocessorDescriptor TargetMap(Func, FluentDictionary> selector) + { + TargetMapValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("default_value"); + writer.WriteNumberValue(DefaultValueValue); + writer.WritePropertyName("feature_name"); + writer.WriteStringValue(FeatureNameValue); + writer.WritePropertyName("field"); + writer.WriteStringValue(FieldValue); + writer.WritePropertyName("target_map"); + JsonSerializer.Serialize(writer, TargetMapValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs index 0038dc406c1..d70f2aa62b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Text classification configuration options @@ -54,9 +54,9 @@ public sealed partial class TextClassificationInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextClassificationInferenceOptions textClassificationInferenceOptions) => Ml.InferenceConfigCreate.TextClassification(textClassificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(TextClassificationInferenceOptions textClassificationInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.TextClassification(textClassificationInferenceOptions); } /// @@ -73,9 +73,9 @@ public TextClassificationInferenceOptionsDescriptor() : base() private ICollection? ClassificationLabelsValue { get; set; } private int? NumTopClassesValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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 @@ -107,7 +107,7 @@ public TextClassificationInferenceOptionsDescriptor ResultsField(string? results /// /// The tokenization options /// - public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -115,7 +115,7 @@ public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients return Self; } - public TextClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -123,7 +123,7 @@ public TextClassificationInferenceOptionsDescriptor Tokenization(TokenizationCon return Self; } - public TextClassificationInferenceOptionsDescriptor Tokenization(Action configure) + public TextClassificationInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -160,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs similarity index 80% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs index d422767afbf..d98446d119a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class TextClassificationInferenceUpdateOptions { @@ -51,9 +51,9 @@ public sealed partial class TextClassificationInferenceUpdateOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextClassification(textClassificationInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.TextClassification(textClassificationInferenceUpdateOptions); } public sealed partial class TextClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -67,9 +67,9 @@ public TextClassificationInferenceUpdateOptionsDescriptor() : base() private ICollection? ClassificationLabelsValue { get; set; } private int? NumTopClassesValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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 @@ -101,7 +101,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor ResultsField(string? r /// /// The tokenization options to update when inferring /// - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -109,7 +109,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.C return Self; } - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -117,7 +117,7 @@ public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokeni return Self; } - public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -154,7 +154,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs similarity index 78% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs index 054ecc117a0..41817db88ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Text embedding inference options @@ -48,9 +48,9 @@ public sealed partial class TextEmbeddingInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Ml.InferenceConfigCreate.TextEmbedding(textEmbeddingInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.TextEmbedding(textEmbeddingInferenceOptions); } /// @@ -66,9 +66,9 @@ public TextEmbeddingInferenceOptionsDescriptor() : base() private int? EmbeddingSizeValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The number of dimensions in the embedding output @@ -91,7 +91,7 @@ public TextEmbeddingInferenceOptionsDescriptor ResultsField(string? resultsField /// /// The tokenization options /// - public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -99,7 +99,7 @@ public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elas return Self; } - public TextEmbeddingInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -107,7 +107,7 @@ public TextEmbeddingInferenceOptionsDescriptor Tokenization(TokenizationConfigDe return Self; } - public TextEmbeddingInferenceOptionsDescriptor Tokenization(Action configure) + public TextEmbeddingInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -138,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs index 2c38b23abc0..a15383089cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextEmbeddingInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class TextEmbeddingInferenceUpdateOptions { @@ -35,9 +35,9 @@ public sealed partial class TextEmbeddingInferenceUpdateOptions [JsonInclude, JsonPropertyName("results_field")] public string? ResultsField { get; set; } [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextEmbedding(textEmbeddingInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.TextEmbedding(textEmbeddingInferenceUpdateOptions); } public sealed partial class TextEmbeddingInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -49,9 +49,9 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -62,7 +62,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor ResultsField(string? result return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -70,7 +70,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Client return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -78,7 +78,7 @@ public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizatio return Self; } - public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextEmbeddingInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -103,7 +103,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs similarity index 76% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs index 9b8786b0f78..13a52cc09a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Text expansion inference options @@ -42,9 +42,9 @@ public sealed partial class TextExpansionInferenceOptions /// The tokenization options /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(TextExpansionInferenceOptions textExpansionInferenceOptions) => Ml.InferenceConfigCreate.TextExpansion(textExpansionInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(TextExpansionInferenceOptions textExpansionInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.TextExpansion(textExpansionInferenceOptions); } /// @@ -59,9 +59,9 @@ public TextExpansionInferenceOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -75,7 +75,7 @@ public TextExpansionInferenceOptionsDescriptor ResultsField(string? resultsField /// /// The tokenization options /// - public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -83,7 +83,7 @@ public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elas return Self; } - public TextExpansionInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public TextExpansionInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -91,7 +91,7 @@ public TextExpansionInferenceOptionsDescriptor Tokenization(TokenizationConfigDe return Self; } - public TextExpansionInferenceOptionsDescriptor Tokenization(Action configure) + public TextExpansionInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -116,7 +116,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs index cedffdff348..a9c8ead16af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TextExpansionInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class TextExpansionInferenceUpdateOptions { @@ -35,9 +35,9 @@ public sealed partial class TextExpansionInferenceUpdateOptions [JsonInclude, JsonPropertyName("results_field")] public string? ResultsField { get; set; } [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Ml.InferenceConfigUpdate.TextExpansion(textExpansionInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.TextExpansion(textExpansionInferenceUpdateOptions); } public sealed partial class TextExpansionInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -49,9 +49,9 @@ public TextExpansionInferenceUpdateOptionsDescriptor() : base() } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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. @@ -62,7 +62,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor ResultsField(string? result return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -70,7 +70,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Client return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -78,7 +78,7 @@ public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizatio return Self; } - public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public TextExpansionInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -103,7 +103,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs new file mode 100644 index 00000000000..c7e8a43699d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.MachineLearning; + +/// +/// Tokenization options stored in inference configuration +/// +[JsonConverter(typeof(TokenizationConfigConverter))] +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.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("bert", nlpBertTokenizationConfig); + public static TokenizationConfig Mpnet(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("mpnet", nlpBertTokenizationConfig); + public static TokenizationConfig Roberta(Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => new TokenizationConfig("roberta", nlpRobertaTokenizationConfig); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +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."); + } + + object? variantValue = default; + string? variantNameValue = 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 == "bert") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "mpnet") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "roberta") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'TokenizationConfig' from the response."); + } + + reader.Read(); + var result = new TokenizationConfig(variantNameValue, variantValue); + return result; + } + + 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.MachineLearning.NlpBertTokenizationConfig)value.Variant, options); + break; + case "mpnet": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, options); + break; + case "roberta": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.MachineLearning.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(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 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(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "bert"); + public TokenizationConfigDescriptor Bert(Action configure) => Set(configure, "bert"); + public TokenizationConfigDescriptor Mpnet(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig nlpBertTokenizationConfig) => Set(nlpBertTokenizationConfig, "mpnet"); + public TokenizationConfigDescriptor Mpnet(Action configure) => Set(configure, "mpnet"); + public TokenizationConfigDescriptor Roberta(Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig nlpRobertaTokenizationConfig) => Set(nlpRobertaTokenizationConfig, "roberta"); + public TokenizationConfigDescriptor Roberta(Action configure) => Set(configure, "roberta"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/MachineLearning/TopClassEntry.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs new file mode 100644 index 00000000000..519dbf7dda1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TopClassEntry +{ + [JsonInclude, JsonPropertyName("class_name")] + public string 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/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs new file mode 100644 index 00000000000..779f83f6b77 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TotalFeatureImportance +{ + /// + /// If the trained model is a classification model, feature importance statistics are gathered per target class value. + /// + [JsonInclude, JsonPropertyName("classes")] + public IReadOnlyCollection Classes { get; init; } + + /// + /// The feature for which this importance was calculated. + /// + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; init; } + + /// + /// A collection of feature importance statistics related to the training data set for this particular feature. + /// + [JsonInclude, JsonPropertyName("importance")] + public IReadOnlyCollection Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs new file mode 100644 index 00000000000..8e13475dc9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TotalFeatureImportanceClass +{ + /// + /// The target class value. Could be a string, boolean, or number. + /// + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + + /// + /// A collection of feature importance statistics related to the training data set for this particular feature. + /// + [JsonInclude, JsonPropertyName("importance")] + public IReadOnlyCollection Importance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs new file mode 100644 index 00000000000..8c16f4f9873 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TotalFeatureImportanceStatistics +{ + /// + /// The maximum importance value across all the training data for this feature. + /// + [JsonInclude, JsonPropertyName("max")] + public int Max { get; init; } + + /// + /// The average magnitude of this feature across all the training data. This value is the average of the absolute values of the importance for this feature. + /// + [JsonInclude, JsonPropertyName("mean_magnitude")] + public double MeanMagnitude { get; init; } + + /// + /// The minimum importance value across all the training data for this feature. + /// + [JsonInclude, JsonPropertyName("min")] + public int Min { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs new file mode 100644 index 00000000000..df5a3d8ad4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs @@ -0,0 +1,203 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModel +{ + /// + /// The definition for an ensemble model + /// + [JsonInclude, JsonPropertyName("ensemble")] + public Elastic.Clients.Elasticsearch.MachineLearning.Ensemble? Ensemble { get; set; } + + /// + /// The definition for a binary decision tree. + /// + [JsonInclude, JsonPropertyName("tree")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree? Tree { get; set; } + + /// + /// The definition of a node in a tree.
There are two major types of nodes: leaf nodes and not-leaf nodes.
- Leaf nodes only need node_index and leaf_value defined.
- All other nodes need split_feature, left_child, right_child, threshold, decision_type, and default_left defined.
+ ///
+ [JsonInclude, JsonPropertyName("tree_node")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode? TreeNode { get; set; } +} + +public sealed partial class TrainedModelDescriptor : SerializableDescriptor +{ + internal TrainedModelDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.MachineLearning.Ensemble? EnsembleValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.EnsembleDescriptor EnsembleDescriptor { get; set; } + private Action EnsembleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree? TreeValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeDescriptor TreeDescriptor { get; set; } + private Action TreeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode? TreeNodeValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor TreeNodeDescriptor { get; set; } + private Action TreeNodeDescriptorAction { get; set; } + + /// + /// The definition for an ensemble model + /// + public TrainedModelDescriptor Ensemble(Elastic.Clients.Elasticsearch.MachineLearning.Ensemble? ensemble) + { + EnsembleDescriptor = null; + EnsembleDescriptorAction = null; + EnsembleValue = ensemble; + return Self; + } + + public TrainedModelDescriptor Ensemble(Elastic.Clients.Elasticsearch.MachineLearning.EnsembleDescriptor descriptor) + { + EnsembleValue = null; + EnsembleDescriptorAction = null; + EnsembleDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor Ensemble(Action configure) + { + EnsembleValue = null; + EnsembleDescriptor = null; + EnsembleDescriptorAction = configure; + return Self; + } + + /// + /// The definition for a binary decision tree. + /// + public TrainedModelDescriptor Tree(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree? tree) + { + TreeDescriptor = null; + TreeDescriptorAction = null; + TreeValue = tree; + return Self; + } + + public TrainedModelDescriptor Tree(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeDescriptor descriptor) + { + TreeValue = null; + TreeDescriptorAction = null; + TreeDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor Tree(Action configure) + { + TreeValue = null; + TreeDescriptor = null; + TreeDescriptorAction = configure; + return Self; + } + + /// + /// The definition of a node in a tree.
There are two major types of nodes: leaf nodes and not-leaf nodes.
- Leaf nodes only need node_index and leaf_value defined.
- All other nodes need split_feature, left_child, right_child, threshold, decision_type, and default_left defined.
+ ///
+ public TrainedModelDescriptor TreeNode(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode? treeNode) + { + TreeNodeDescriptor = null; + TreeNodeDescriptorAction = null; + TreeNodeValue = treeNode; + return Self; + } + + public TrainedModelDescriptor TreeNode(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor descriptor) + { + TreeNodeValue = null; + TreeNodeDescriptorAction = null; + TreeNodeDescriptor = descriptor; + return Self; + } + + public TrainedModelDescriptor TreeNode(Action configure) + { + TreeNodeValue = null; + TreeNodeDescriptor = null; + TreeNodeDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (EnsembleDescriptor is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, EnsembleDescriptor, options); + } + else if (EnsembleDescriptorAction is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.EnsembleDescriptor(EnsembleDescriptorAction), options); + } + else if (EnsembleValue is not null) + { + writer.WritePropertyName("ensemble"); + JsonSerializer.Serialize(writer, EnsembleValue, options); + } + + if (TreeDescriptor is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, TreeDescriptor, options); + } + else if (TreeDescriptorAction is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeDescriptor(TreeDescriptorAction), options); + } + else if (TreeValue is not null) + { + writer.WritePropertyName("tree"); + JsonSerializer.Serialize(writer, TreeValue, options); + } + + if (TreeNodeDescriptor is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, TreeNodeDescriptor, options); + } + else if (TreeNodeDescriptorAction is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor(TreeNodeDescriptorAction), options); + } + else if (TreeNodeValue is not null) + { + writer.WritePropertyName("tree_node"); + JsonSerializer.Serialize(writer, TreeNodeValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs new file mode 100644 index 00000000000..1a91d2d7ec4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelAssignment +{ + /// + /// The overall assignment state. + /// + [JsonInclude, JsonPropertyName("assignment_state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState AssignmentState { get; init; } + [JsonInclude, JsonPropertyName("max_assigned_allocations")] + public int? MaxAssignedAllocations { get; init; } + + /// + /// The allocation state for each node. + /// + [JsonInclude, JsonPropertyName("routing_table")] + public IReadOnlyDictionary RoutingTable { get; init; } + + /// + /// The timestamp when the deployment started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset StartTime { get; init; } + [JsonInclude, JsonPropertyName("task_parameters")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters TaskParameters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs new file mode 100644 index 00000000000..77db1bb2faf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelAssignmentRoutingTable +{ + /// + /// Current number of allocations. + /// + [JsonInclude, JsonPropertyName("current_allocations")] + public int CurrentAllocations { get; init; } + + /// + /// The reason for the current state. It is usually populated only when the
`routing_state` is `failed`.
+ ///
+ [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + + /// + /// The current routing state. + /// + [JsonInclude, JsonPropertyName("routing_state")] + public Elastic.Clients.Elasticsearch.MachineLearning.RoutingState RoutingState { get; init; } + + /// + /// Target number of allocations. + /// + [JsonInclude, JsonPropertyName("target_allocations")] + public int TargetAllocations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs new file mode 100644 index 00000000000..ffcdf9cbfff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelAssignmentTaskParameters +{ + /// + /// The size of the trained model cache. + /// + [JsonInclude, JsonPropertyName("cache_size")] + public Elastic.Clients.Elasticsearch.ByteSize CacheSize { get; init; } + + /// + /// The unique identifier for the trained model deployment. + /// + [JsonInclude, JsonPropertyName("deployment_id")] + public string DeploymentId { get; init; } + + /// + /// The size of the trained model in bytes. + /// + [JsonInclude, JsonPropertyName("model_bytes")] + public int ModelBytes { get; init; } + + /// + /// The unique identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The total number of allocations this model is assigned across ML nodes. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + [JsonInclude, JsonPropertyName("priority")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority Priority { get; init; } + + /// + /// Number of inference requests are allowed in the queue at a time. + /// + [JsonInclude, JsonPropertyName("queue_capacity")] + public int QueueCapacity { get; init; } + + /// + /// Number of threads per allocation. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs new file mode 100644 index 00000000000..5dcaeacd2b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelConfig +{ + [JsonInclude, JsonPropertyName("compressed_definition")] + public string? CompressedDefinition { get; init; } + + /// + /// Information on the creator of the trained model. + /// + [JsonInclude, JsonPropertyName("created_by")] + public string? CreatedBy { get; init; } + + /// + /// The time when the trained model was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public DateTimeOffset? CreateTime { get; init; } + + /// + /// Any field map described in the inference configuration takes precedence. + /// + [JsonInclude, JsonPropertyName("default_field_map")] + public IReadOnlyDictionary? DefaultFieldMap { get; init; } + + /// + /// The free-text description of the trained model. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The estimated heap usage in bytes to keep the trained model in memory. + /// + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public int? EstimatedHeapMemoryUsageBytes { get; init; } + + /// + /// The estimated number of operations to use the trained model. + /// + [JsonInclude, JsonPropertyName("estimated_operations")] + public int? EstimatedOperations { get; init; } + + /// + /// True if the full model definition is present. + /// + [JsonInclude, JsonPropertyName("fully_defined")] + public bool? FullyDefined { get; init; } + + /// + /// The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required. + /// + [JsonInclude, JsonPropertyName("inference_config")] + public Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate? InferenceConfig { get; init; } + + /// + /// The input field names for the model definition. + /// + [JsonInclude, JsonPropertyName("input")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput Input { get; init; } + + /// + /// The license level of the trained model. + /// + [JsonInclude, JsonPropertyName("license_level")] + public string? LicenseLevel { get; init; } + [JsonInclude, JsonPropertyName("location")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation? Location { get; init; } + + /// + /// An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects. + /// + [JsonInclude, JsonPropertyName("metadata")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata? Metadata { get; init; } + + /// + /// Identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize? ModelSizeBytes { get; init; } + + /// + /// The model type + /// + [JsonInclude, JsonPropertyName("model_type")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? ModelType { get; init; } + [JsonInclude, JsonPropertyName("prefix_strings")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings? PrefixStrings { get; init; } + + /// + /// A comma delimited string of tags. A trained model can have many tags, or none. + /// + [JsonInclude, JsonPropertyName("tags")] + public IReadOnlyCollection Tags { get; init; } + + /// + /// The Elasticsearch version number in which the trained model was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs new file mode 100644 index 00000000000..36e3acd3c03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelConfigInput +{ + /// + /// An array of input field names for the model. + /// + [JsonInclude, JsonPropertyName("field_names")] + public IReadOnlyCollection FieldNames { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs new file mode 100644 index 00000000000..4bc5c9a095f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelConfigMetadata +{ + /// + /// An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class. + /// + [JsonInclude, JsonPropertyName("feature_importance_baseline")] + public IReadOnlyDictionary? FeatureImportanceBaseline { get; init; } + + /// + /// List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user. + /// + [JsonInclude, JsonPropertyName("hyperparameters")] + public IReadOnlyCollection? Hyperparameters { get; init; } + [JsonInclude, JsonPropertyName("model_aliases")] + public IReadOnlyCollection? ModelAliases { get; init; } + + /// + /// An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter. + /// + [JsonInclude, JsonPropertyName("total_feature_importance")] + public IReadOnlyCollection? TotalFeatureImportance { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs new file mode 100644 index 00000000000..b380686ff0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelDeploymentAllocationStatus +{ + /// + /// The current number of nodes where the model is allocated. + /// + [JsonInclude, JsonPropertyName("allocation_count")] + public int AllocationCount { get; init; } + + /// + /// The detailed allocation state related to the nodes. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState State { get; init; } + + /// + /// The desired number of nodes for model allocation. + /// + [JsonInclude, JsonPropertyName("target_allocation_count")] + public int TargetAllocationCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs new file mode 100644 index 00000000000..10d6e8bde1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelDeploymentNodesStats +{ + /// + /// The average time for each inference call to complete on this node. + /// + [JsonInclude, JsonPropertyName("average_inference_time_ms")] + public double AverageInferenceTimeMs { get; init; } + + /// + /// The number of errors when evaluating the trained model. + /// + [JsonInclude, JsonPropertyName("error_count")] + public int ErrorCount { get; init; } + + /// + /// The total number of inference calls made against this node for this model. + /// + [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The epoch time stamp of the last inference call for the model on this node. + /// + [JsonInclude, JsonPropertyName("last_access")] + public long LastAccess { get; init; } + + /// + /// Information pertaining to the node. + /// + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNode Node { get; init; } + + /// + /// The number of allocations assigned to this node. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + + /// + /// The number of inference requests queued to be processed. + /// + [JsonInclude, JsonPropertyName("number_of_pending_requests")] + public int NumberOfPendingRequests { get; init; } + + /// + /// The number of inference requests that were not processed because the queue was full. + /// + [JsonInclude, JsonPropertyName("rejection_execution_count")] + public int RejectionExecutionCount { get; init; } + + /// + /// The current routing state and reason for the current routing state for this allocation. + /// + [JsonInclude, JsonPropertyName("routing_state")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable RoutingState { get; init; } + + /// + /// The epoch timestamp when the allocation started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public long StartTime { get; init; } + + /// + /// The number of threads used by each allocation during inference. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } + + /// + /// The number of inference requests that timed out before being processed. + /// + [JsonInclude, JsonPropertyName("timeout_count")] + public int TimeoutCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs new file mode 100644 index 00000000000..a004b3946b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelDeploymentStats +{ + /// + /// The detailed allocation status for the deployment. + /// + [JsonInclude, JsonPropertyName("allocation_status")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus AllocationStatus { get; init; } + [JsonInclude, JsonPropertyName("cache_size")] + public Elastic.Clients.Elasticsearch.ByteSize? CacheSize { get; init; } + + /// + /// The unique identifier for the trained model deployment. + /// + [JsonInclude, JsonPropertyName("deployment_id")] + public string DeploymentId { get; init; } + + /// + /// The sum of `error_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("error_count")] + public int ErrorCount { get; init; } + + /// + /// The sum of `inference_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The unique identifier for the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// The deployment stats for each node that currently has the model allocated.
In serverless, stats are reported for a single unnamed virtual node.
+ ///
+ [JsonInclude, JsonPropertyName("nodes")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats Nodes { get; init; } + + /// + /// The number of allocations requested. + /// + [JsonInclude, JsonPropertyName("number_of_allocations")] + public int NumberOfAllocations { get; init; } + + /// + /// The number of inference requests that can be queued before new requests are rejected. + /// + [JsonInclude, JsonPropertyName("queue_capacity")] + public int QueueCapacity { get; init; } + + /// + /// The reason for the current deployment state. Usually only populated when
the model is not deployed to a node.
+ ///
+ [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + + /// + /// The sum of `rejected_execution_count` for all nodes in the deployment.
Individual nodes reject an inference request if the inference queue is full.
The queue size is controlled by the `queue_capacity` setting in the start
trained model deployment API.
+ ///
+ [JsonInclude, JsonPropertyName("rejected_execution_count")] + public int RejectedExecutionCount { get; init; } + + /// + /// The epoch timestamp when the deployment started. + /// + [JsonInclude, JsonPropertyName("start_time")] + public long StartTime { get; init; } + + /// + /// The overall state of the deployment. + /// + [JsonInclude, JsonPropertyName("state")] + public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentState State { get; init; } + + /// + /// The number of threads used be each allocation during inference. + /// + [JsonInclude, JsonPropertyName("threads_per_allocation")] + public int ThreadsPerAllocation { get; init; } + + /// + /// The sum of `timeout_count` for all nodes in the deployment. + /// + [JsonInclude, JsonPropertyName("timeout_count")] + public int TimeoutCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs new file mode 100644 index 00000000000..453bb725a1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelEntities +{ + [JsonInclude, JsonPropertyName("class_name")] + public string ClassName { get; init; } + [JsonInclude, JsonPropertyName("class_probability")] + public double ClassProbability { get; init; } + [JsonInclude, JsonPropertyName("end_pos")] + public int EndPos { get; init; } + [JsonInclude, JsonPropertyName("entity")] + public string Entity { get; init; } + [JsonInclude, JsonPropertyName("start_pos")] + public int StartPos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs new file mode 100644 index 00000000000..1c7680a98b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelInferenceClassImportance +{ + [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/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs new file mode 100644 index 00000000000..ecacc5f6e75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelInferenceFeatureImportance +{ + [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/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs new file mode 100644 index 00000000000..74a1dcabb97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelInferenceStats +{ + /// + /// The number of times the model was loaded for inference and was not retrieved from the cache.
If this number is close to the `inference_count`, the cache is not being appropriately used.
This can be solved by increasing the cache size or its time-to-live (TTL).
Refer to general machine learning settings for the appropriate settings.
+ ///
+ [JsonInclude, JsonPropertyName("cache_miss_count")] + public int CacheMissCount { get; init; } + + /// + /// The number of failures when using the model for inference. + /// + [JsonInclude, JsonPropertyName("failure_count")] + public int FailureCount { get; init; } + + /// + /// The total number of times the model has been called for inference.
This is across all inference contexts, including all pipelines.
+ ///
+ [JsonInclude, JsonPropertyName("inference_count")] + public int InferenceCount { get; init; } + + /// + /// The number of inference calls where all the training features for the model were missing. + /// + [JsonInclude, JsonPropertyName("missing_all_fields_count")] + public int MissingAllFieldsCount { get; init; } + + /// + /// The time when the statistics were last updated. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public DateTimeOffset Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs new file mode 100644 index 00000000000..fdff8a5fd07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelLocation +{ + [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex Index { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs new file mode 100644 index 00000000000..1fbc092e2d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelLocationIndex +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs new file mode 100644 index 00000000000..fe03bea4662 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelPrefixStrings +{ + /// + /// String prepended to input at ingest + /// + [JsonInclude, JsonPropertyName("ingest")] + public string? Ingest { get; set; } + + /// + /// String prepended to input at search + /// + [JsonInclude, JsonPropertyName("search")] + public string? Search { get; set; } +} + +public sealed partial class TrainedModelPrefixStringsDescriptor : SerializableDescriptor +{ + internal TrainedModelPrefixStringsDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelPrefixStringsDescriptor() : base() + { + } + + private string? IngestValue { get; set; } + private string? SearchValue { get; set; } + + /// + /// String prepended to input at ingest + /// + public TrainedModelPrefixStringsDescriptor Ingest(string? ingest) + { + IngestValue = ingest; + return Self; + } + + /// + /// String prepended to input at search + /// + public TrainedModelPrefixStringsDescriptor Search(string? search) + { + SearchValue = search; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(IngestValue)) + { + writer.WritePropertyName("ingest"); + writer.WriteStringValue(IngestValue); + } + + if (!string.IsNullOrEmpty(SearchValue)) + { + writer.WritePropertyName("search"); + writer.WriteStringValue(SearchValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs new file mode 100644 index 00000000000..4b1014743b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelSizeStats +{ + /// + /// The size of the model in bytes. + /// + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize ModelSizeBytes { get; init; } + + /// + /// The amount of memory required to load the model in bytes. + /// + [JsonInclude, JsonPropertyName("required_native_memory_bytes")] + public int RequiredNativeMemoryBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs new file mode 100644 index 00000000000..86303dea7e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelStats +{ + /// + /// A collection of deployment stats, which is present when the models are deployed. + /// + [JsonInclude, JsonPropertyName("deployment_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats? DeploymentStats { get; init; } + + /// + /// A collection of inference stats fields. + /// + [JsonInclude, JsonPropertyName("inference_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats? InferenceStats { get; init; } + + /// + /// A collection of ingest stats for the model across all nodes.
The values are summations of the individual node statistics.
The format matches the ingest section in the nodes stats API.
+ ///
+ [JsonInclude, JsonPropertyName("ingest")] + public IReadOnlyDictionary? Ingest { get; init; } + + /// + /// The unique identifier of the trained model. + /// + [JsonInclude, JsonPropertyName("model_id")] + public string ModelId { get; init; } + + /// + /// A collection of model size stats. + /// + [JsonInclude, JsonPropertyName("model_size_stats")] + public Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats ModelSizeStats { get; init; } + + /// + /// The number of ingest pipelines that currently refer to the model. + /// + [JsonInclude, JsonPropertyName("pipeline_count")] + public int PipelineCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs new file mode 100644 index 00000000000..999f4f1efd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelTree +{ + [JsonInclude, JsonPropertyName("classification_labels")] + public ICollection? ClassificationLabels { get; set; } + [JsonInclude, JsonPropertyName("feature_names")] + public ICollection FeatureNames { get; set; } + [JsonInclude, JsonPropertyName("target_type")] + public string? TargetType { get; set; } + [JsonInclude, JsonPropertyName("tree_structure")] + public ICollection TreeStructure { get; set; } +} + +public sealed partial class TrainedModelTreeDescriptor : SerializableDescriptor +{ + internal TrainedModelTreeDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelTreeDescriptor() : base() + { + } + + private ICollection? ClassificationLabelsValue { get; set; } + private ICollection FeatureNamesValue { get; set; } + private string? TargetTypeValue { get; set; } + private ICollection TreeStructureValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor TreeStructureDescriptor { get; set; } + private Action TreeStructureDescriptorAction { get; set; } + private Action[] TreeStructureDescriptorActions { get; set; } + + public TrainedModelTreeDescriptor ClassificationLabels(ICollection? classificationLabels) + { + ClassificationLabelsValue = classificationLabels; + return Self; + } + + public TrainedModelTreeDescriptor FeatureNames(ICollection featureNames) + { + FeatureNamesValue = featureNames; + return Self; + } + + public TrainedModelTreeDescriptor TargetType(string? targetType) + { + TargetTypeValue = targetType; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(ICollection treeStructure) + { + TreeStructureDescriptor = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = null; + TreeStructureValue = treeStructure; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor descriptor) + { + TreeStructureValue = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = null; + TreeStructureDescriptor = descriptor; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(Action configure) + { + TreeStructureValue = null; + TreeStructureDescriptor = null; + TreeStructureDescriptorActions = null; + TreeStructureDescriptorAction = configure; + return Self; + } + + public TrainedModelTreeDescriptor TreeStructure(params Action[] configure) + { + TreeStructureValue = null; + TreeStructureDescriptor = null; + TreeStructureDescriptorAction = null; + TreeStructureDescriptorActions = 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); + } + + writer.WritePropertyName("feature_names"); + JsonSerializer.Serialize(writer, FeatureNamesValue, options); + if (!string.IsNullOrEmpty(TargetTypeValue)) + { + writer.WritePropertyName("target_type"); + writer.WriteStringValue(TargetTypeValue); + } + + if (TreeStructureDescriptor is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, TreeStructureDescriptor, options); + writer.WriteEndArray(); + } + else if (TreeStructureDescriptorAction is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor(TreeStructureDescriptorAction), options); + writer.WriteEndArray(); + } + else if (TreeStructureDescriptorActions is not null) + { + writer.WritePropertyName("tree_structure"); + writer.WriteStartArray(); + foreach (var action in TreeStructureDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("tree_structure"); + JsonSerializer.Serialize(writer, TreeStructureValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs new file mode 100644 index 00000000000..6714345eada --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TrainedModelTreeNode +{ + [JsonInclude, JsonPropertyName("decision_type")] + public string? DecisionType { get; set; } + [JsonInclude, JsonPropertyName("default_left")] + public bool? DefaultLeft { get; set; } + [JsonInclude, JsonPropertyName("leaf_value")] + public double? LeafValue { get; set; } + [JsonInclude, JsonPropertyName("left_child")] + public int? LeftChild { get; set; } + [JsonInclude, JsonPropertyName("node_index")] + public int NodeIndex { get; set; } + [JsonInclude, JsonPropertyName("right_child")] + public int? RightChild { get; set; } + [JsonInclude, JsonPropertyName("split_feature")] + public int? SplitFeature { get; set; } + [JsonInclude, JsonPropertyName("split_gain")] + public int? SplitGain { get; set; } + [JsonInclude, JsonPropertyName("threshold")] + public double? Threshold { get; set; } +} + +public sealed partial class TrainedModelTreeNodeDescriptor : SerializableDescriptor +{ + internal TrainedModelTreeNodeDescriptor(Action configure) => configure.Invoke(this); + + public TrainedModelTreeNodeDescriptor() : base() + { + } + + private string? DecisionTypeValue { get; set; } + private bool? DefaultLeftValue { get; set; } + private double? LeafValueValue { get; set; } + private int? LeftChildValue { get; set; } + private int NodeIndexValue { get; set; } + private int? RightChildValue { get; set; } + private int? SplitFeatureValue { get; set; } + private int? SplitGainValue { get; set; } + private double? ThresholdValue { get; set; } + + public TrainedModelTreeNodeDescriptor DecisionType(string? decisionType) + { + DecisionTypeValue = decisionType; + return Self; + } + + public TrainedModelTreeNodeDescriptor DefaultLeft(bool? defaultLeft = true) + { + DefaultLeftValue = defaultLeft; + return Self; + } + + public TrainedModelTreeNodeDescriptor LeafValue(double? leafValue) + { + LeafValueValue = leafValue; + return Self; + } + + public TrainedModelTreeNodeDescriptor LeftChild(int? leftChild) + { + LeftChildValue = leftChild; + return Self; + } + + public TrainedModelTreeNodeDescriptor NodeIndex(int nodeIndex) + { + NodeIndexValue = nodeIndex; + return Self; + } + + public TrainedModelTreeNodeDescriptor RightChild(int? rightChild) + { + RightChildValue = rightChild; + return Self; + } + + public TrainedModelTreeNodeDescriptor SplitFeature(int? splitFeature) + { + SplitFeatureValue = splitFeature; + return Self; + } + + public TrainedModelTreeNodeDescriptor SplitGain(int? splitGain) + { + SplitGainValue = splitGain; + return Self; + } + + public TrainedModelTreeNodeDescriptor Threshold(double? threshold) + { + ThresholdValue = threshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(DecisionTypeValue)) + { + writer.WritePropertyName("decision_type"); + writer.WriteStringValue(DecisionTypeValue); + } + + if (DefaultLeftValue.HasValue) + { + writer.WritePropertyName("default_left"); + writer.WriteBooleanValue(DefaultLeftValue.Value); + } + + if (LeafValueValue.HasValue) + { + writer.WritePropertyName("leaf_value"); + writer.WriteNumberValue(LeafValueValue.Value); + } + + if (LeftChildValue.HasValue) + { + writer.WritePropertyName("left_child"); + writer.WriteNumberValue(LeftChildValue.Value); + } + + writer.WritePropertyName("node_index"); + writer.WriteNumberValue(NodeIndexValue); + if (RightChildValue.HasValue) + { + writer.WritePropertyName("right_child"); + writer.WriteNumberValue(RightChildValue.Value); + } + + if (SplitFeatureValue.HasValue) + { + writer.WritePropertyName("split_feature"); + writer.WriteNumberValue(SplitFeatureValue.Value); + } + + if (SplitGainValue.HasValue) + { + writer.WritePropertyName("split_gain"); + writer.WriteNumberValue(SplitGainValue.Value); + } + + if (ThresholdValue.HasValue) + { + writer.WritePropertyName("threshold"); + writer.WriteNumberValue(ThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs new file mode 100644 index 00000000000..1fce308f268 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class TransformAuthorization +{ + /// + /// If an API key was used for the most recent update to the transform, its name and identifier are listed in the response. + /// + [JsonInclude, JsonPropertyName("api_key")] + public Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization? ApiKey { get; init; } + + /// + /// If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// If a service account was used for the most recent update to the transform, the account name is listed in the response. + /// + [JsonInclude, JsonPropertyName("service_account")] + public string? ServiceAccount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/Vocabulary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs similarity index 97% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/Vocabulary.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs index fbfb5c30e22..67bd786aa45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/Vocabulary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class Vocabulary { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs new file mode 100644 index 00000000000..1be64ee8c9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +public sealed partial class Weights +{ + [JsonInclude, JsonPropertyName("weights")] + public double WeightsValue { get; set; } +} + +public sealed partial class WeightsDescriptor : SerializableDescriptor +{ + internal WeightsDescriptor(Action configure) => configure.Invoke(this); + + public WeightsDescriptor() : base() + { + } + + private double WeightsValueValue { get; set; } + + public WeightsDescriptor WeightsValue(double weightsValue) + { + WeightsValueValue = weightsValue; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("weights"); + writer.WriteNumberValue(WeightsValueValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs similarity index 84% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs index 59439debe2d..6960aa6a361 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; /// /// Zero shot classification configuration options @@ -66,9 +66,9 @@ public sealed partial class ZeroShotClassificationInferenceOptions /// The tokenization options to update when inferring /// [JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? Tokenization { get; set; } - public static implicit operator InferenceConfigCreate(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Ml.InferenceConfigCreate.ZeroShotClassification(zeroShotClassificationInferenceOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(ZeroShotClassificationInferenceOptions zeroShotClassificationInferenceOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate.ZeroShotClassification(zeroShotClassificationInferenceOptions); } /// @@ -87,9 +87,9 @@ public ZeroShotClassificationInferenceOptionsDescriptor() : base() private ICollection? LabelsValue { get; set; } private bool? MultiLabelValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? TokenizationValue { get; set; } - private TokenizationConfigDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.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
@@ -139,7 +139,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor ResultsField(string? res /// /// The tokenization options to update when inferring /// - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.TokenizationConfig? tokenization) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -147,7 +147,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Cli return Self; } - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(TokenizationConfigDescriptor descriptor) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -155,7 +155,7 @@ public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Tokenizatio return Self; } - public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Action configure) + public ZeroShotClassificationInferenceOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -200,7 +200,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new TokenizationConfigDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs similarity index 79% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs index da2974e61ae..611d5254469 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/ZeroShotClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs @@ -25,7 +25,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Elastic.Clients.Elasticsearch.Ml; +namespace Elastic.Clients.Elasticsearch.MachineLearning; public sealed partial class ZeroShotClassificationInferenceUpdateOptions { @@ -51,9 +51,9 @@ public sealed partial class ZeroShotClassificationInferenceUpdateOptions /// The tokenization options to update when inferring ///
[JsonInclude, JsonPropertyName("tokenization")] - public Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? Tokenization { get; set; } + public Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? Tokenization { get; set; } - public static implicit operator InferenceConfigUpdate(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Ml.InferenceConfigUpdate.ZeroShotClassification(zeroShotClassificationInferenceUpdateOptions); + public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(ZeroShotClassificationInferenceUpdateOptions zeroShotClassificationInferenceUpdateOptions) => Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate.ZeroShotClassification(zeroShotClassificationInferenceUpdateOptions); } public sealed partial class ZeroShotClassificationInferenceUpdateOptionsDescriptor : SerializableDescriptor @@ -67,9 +67,9 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor() : base() private ICollection LabelsValue { get; set; } private bool? MultiLabelValue { get; set; } private string? ResultsFieldValue { get; set; } - private Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } - private NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } - private Action TokenizationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? TokenizationValue { get; set; } + private Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor TokenizationDescriptor { get; set; } + private Action TokenizationDescriptorAction { get; set; } /// /// The labels to predict. @@ -101,7 +101,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor ResultsField(strin /// /// The tokenization options to update when inferring /// - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.Ml.NlpTokenizationUpdateOptions? tokenization) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions? tokenization) { TokenizationDescriptor = null; TokenizationDescriptorAction = null; @@ -109,7 +109,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elast return Self; } - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTokenizationUpdateOptionsDescriptor descriptor) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor descriptor) { TokenizationValue = null; TokenizationDescriptorAction = null; @@ -117,7 +117,7 @@ public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(NlpTo return Self; } - public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) + public ZeroShotClassificationInferenceUpdateOptionsDescriptor Tokenization(Action configure) { TokenizationValue = null; TokenizationDescriptor = null; @@ -150,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (TokenizationDescriptorAction is not null) { writer.WritePropertyName("tokenization"); - JsonSerializer.Serialize(writer, new NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsDescriptor(TokenizationDescriptorAction), options); } else if (TokenizationValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs index a1a62c3d238..dd81037948b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs @@ -37,6 +37,10 @@ public sealed partial class AggregateMetricDoubleProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("metrics")] @@ -85,15 +89,15 @@ public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -105,6 +109,9 @@ public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignor return Self; } + /// + /// Metadata about the field. + /// public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -123,15 +130,15 @@ public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Cli return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -239,15 +246,15 @@ public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) + public AggregateMetricDoublePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -259,6 +266,9 @@ public AggregateMetricDoublePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public AggregateMetricDoublePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -277,15 +287,15 @@ public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public AggregateMetricDoublePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) + public AggregateMetricDoublePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs index d45da411bd2..2e2edff572f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class BinaryProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Fields(Action> configure) + public BinaryPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Properties(Action> configure) + public BinaryPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pro return Self; } - public BinaryPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Fields(Action> configure) + public BinaryPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public BinaryPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public BinaryPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping return Self; } - public BinaryPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BinaryPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BinaryPropertyDescriptor Properties(Action> configure) + public BinaryPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs index fdda199c786..8f51e4e4800 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class BooleanProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -73,8 +77,8 @@ public BooleanPropertyDescriptor() : base() private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata? FielddataValue { get; set; } - private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } - private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -116,7 +120,7 @@ public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsea return Self; } - public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -124,7 +128,7 @@ public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFie return Self; } - public BooleanPropertyDescriptor Fielddata(Action configure) + public BooleanPropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -138,15 +142,15 @@ public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Fields(Action> configure) + public BooleanPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -164,6 +168,9 @@ public BooleanPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -182,15 +189,15 @@ public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Properties(Action> configure) + public BooleanPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -243,7 +250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -311,15 +318,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -359,8 +366,8 @@ public BooleanPropertyDescriptor() : base() private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata? FielddataValue { get; set; } - private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } - private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } @@ -402,7 +409,7 @@ public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexMa return Self; } - public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public BooleanPropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -410,7 +417,7 @@ public BooleanPropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescr return Self; } - public BooleanPropertyDescriptor Fielddata(Action configure) + public BooleanPropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -424,15 +431,15 @@ public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public BooleanPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Fields(Action> configure) + public BooleanPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -450,6 +457,9 @@ public BooleanPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public BooleanPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -468,15 +478,15 @@ public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappin return Self; } - public BooleanPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public BooleanPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public BooleanPropertyDescriptor Properties(Action> configure) + public BooleanPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -529,7 +539,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -597,15 +607,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs index 232f7e65b67..ec2c9b75a7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs @@ -47,10 +47,14 @@ public sealed partial class ByteNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] - public double? NullValue { get; set; } + public byte? NullValue { get; set; } [JsonInclude, JsonPropertyName("on_script_error")] public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -61,8 +65,16 @@ public sealed partial class ByteNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -88,7 +100,7 @@ public ByteNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private byte? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -133,15 +145,15 @@ public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Fields(Action> configure) + public ByteNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,13 +177,16 @@ public ByteNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ByteNumberPropertyDescriptor NullValue(double? nullValue) + public ByteNumberPropertyDescriptor NullValue(byte? nullValue) { NullValueValue = nullValue; return Self; @@ -189,15 +204,15 @@ public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Properties(Action> configure) + public ByteNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -296,10 +317,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -390,7 +411,7 @@ public ByteNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private byte? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -435,15 +456,15 @@ public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public ByteNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Fields(Action> configure) + public ByteNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,13 +488,16 @@ public ByteNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ByteNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ByteNumberPropertyDescriptor NullValue(double? nullValue) + public ByteNumberPropertyDescriptor NullValue(byte? nullValue) { NullValueValue = nullValue; return Self; @@ -491,15 +515,15 @@ public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public ByteNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ByteNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ByteNumberPropertyDescriptor Properties(Action> configure) + public ByteNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -598,10 +628,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs index caf23a9ddd1..8af9b697ea5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class CompletionProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("max_input_length")] public int? MaxInputLength { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("preserve_position_increments")] @@ -74,9 +78,9 @@ public CompletionPropertyDescriptor() : base() private string? AnalyzerValue { get; set; } private ICollection? ContextsValue { get; set; } - private SuggestContextDescriptor ContextsDescriptor { get; set; } - private Action> ContextsDescriptorAction { get; set; } - private Action>[] ContextsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action> ContextsDescriptorAction { get; set; } + private Action>[] ContextsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } @@ -106,7 +110,7 @@ public CompletionPropertyDescriptor Contexts(ICollection Contexts(SuggestContextDescriptor descriptor) + public CompletionPropertyDescriptor Contexts(Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor descriptor) { ContextsValue = null; ContextsDescriptorAction = null; @@ -115,7 +119,7 @@ public CompletionPropertyDescriptor Contexts(SuggestContextDescriptor return Self; } - public CompletionPropertyDescriptor Contexts(Action> configure) + public CompletionPropertyDescriptor Contexts(Action> configure) { ContextsValue = null; ContextsDescriptor = null; @@ -124,7 +128,7 @@ public CompletionPropertyDescriptor Contexts(Action Contexts(params Action>[] configure) + public CompletionPropertyDescriptor Contexts(params Action>[] configure) { ContextsValue = null; ContextsDescriptor = null; @@ -157,15 +161,15 @@ public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Fields(Action> configure) + public CompletionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -183,6 +187,9 @@ public CompletionPropertyDescriptor MaxInputLength(int? maxInputLengt return Self; } + /// + /// Metadata about the field. + /// public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -207,15 +214,15 @@ public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Properties(Action> configure) + public CompletionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -259,7 +266,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("contexts"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(ContextsDescriptorAction), options); writer.WriteEndArray(); } else if (ContextsDescriptorActions is not null) @@ -268,7 +275,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ContextsDescriptorActions) { - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(action), options); } writer.WriteEndArray(); @@ -362,10 +369,34 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } + private ICollection? BuildContexts() + { + if (ContextsValue is not null) + { + return ContextsValue; + } + + if ((object)ContextsDescriptor is IBuildableDescriptor?> buildable) + { + return buildable.Build(); + } + + if (ContextsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(ContextsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor?> buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + CompletionProperty IBuildableDescriptor.Build() => new() { - Contexts = ContextsValue, Analyzer = AnalyzerValue, + Contexts = BuildContexts(), CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, @@ -392,9 +423,9 @@ public CompletionPropertyDescriptor() : base() private string? AnalyzerValue { get; set; } private ICollection? ContextsValue { get; set; } - private SuggestContextDescriptor ContextsDescriptor { get; set; } - private Action ContextsDescriptorAction { get; set; } - private Action[] ContextsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor ContextsDescriptor { get; set; } + private Action ContextsDescriptorAction { get; set; } + private Action[] ContextsDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } @@ -424,7 +455,7 @@ public CompletionPropertyDescriptor Contexts(ICollection configure) + public CompletionPropertyDescriptor Contexts(Action configure) { ContextsValue = null; ContextsDescriptor = null; @@ -442,7 +473,7 @@ public CompletionPropertyDescriptor Contexts(Action co return Self; } - public CompletionPropertyDescriptor Contexts(params Action[] configure) + public CompletionPropertyDescriptor Contexts(params Action[] configure) { ContextsValue = null; ContextsDescriptor = null; @@ -475,15 +506,15 @@ public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public CompletionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Fields(Action> configure) + public CompletionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -501,6 +532,9 @@ public CompletionPropertyDescriptor MaxInputLength(int? maxInputLength) return Self; } + /// + /// Metadata about the field. + /// public CompletionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -525,15 +559,15 @@ public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public CompletionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public CompletionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public CompletionPropertyDescriptor Properties(Action> configure) + public CompletionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -577,7 +611,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("contexts"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(ContextsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(ContextsDescriptorAction), options); writer.WriteEndArray(); } else if (ContextsDescriptorActions is not null) @@ -586,7 +620,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ContextsDescriptorActions) { - JsonSerializer.Serialize(writer, new SuggestContextDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(action), options); } writer.WriteEndArray(); @@ -680,10 +714,34 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } + private ICollection? BuildContexts() + { + if (ContextsValue is not null) + { + return ContextsValue; + } + + if ((object)ContextsDescriptor is IBuildableDescriptor?> buildable) + { + return buildable.Build(); + } + + if (ContextsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.SuggestContextDescriptor(ContextsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor?> buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + CompletionProperty IBuildableDescriptor.Build() => new() { - Contexts = ContextsValue, Analyzer = AnalyzerValue, + Contexts = BuildContexts(), CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs index cb61b6154bf..e0da25347f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class ConstantKeywordProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -74,15 +78,15 @@ public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Fields(Action> configure) + public ConstantKeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -94,6 +98,9 @@ public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove return Self; } + /// + /// Metadata about the field. + /// public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -106,15 +113,15 @@ public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.E return Self; } - public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Properties(Action> configure) + public ConstantKeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -208,15 +215,15 @@ public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public ConstantKeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Fields(Action> configure) + public ConstantKeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -228,6 +235,9 @@ public ConstantKeywordPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ConstantKeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -240,15 +250,15 @@ public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public ConstantKeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ConstantKeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ConstantKeywordPropertyDescriptor Properties(Action> configure) + public ConstantKeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs index 1cef6a9de3f..1e488367faf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DateNanosProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -118,15 +122,15 @@ public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Fields(Action> configure) + public DateNanosPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -156,6 +160,9 @@ public DateNanosPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -180,15 +187,15 @@ public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Properties(Action> configure) + public DateNanosPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -378,15 +385,15 @@ public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public DateNanosPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Fields(Action> configure) + public DateNanosPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -416,6 +423,9 @@ public DateNanosPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateNanosPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -440,15 +450,15 @@ public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp return Self; } - public DateNanosPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateNanosPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateNanosPropertyDescriptor Properties(Action> configure) + public DateNanosPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs index 9346111c4bd..ff467cdef77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs @@ -51,6 +51,10 @@ public sealed partial class DateProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -81,8 +85,8 @@ public DatePropertyDescriptor() : base() private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata? FielddataValue { get; set; } - private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } - private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private string? FormatValue { get; set; } private int? IgnoreAboveValue { get; set; } @@ -128,7 +132,7 @@ public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch return Self; } - public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -136,7 +140,7 @@ public DatePropertyDescriptor Fielddata(IndexManagement.NumericFieldd return Self; } - public DatePropertyDescriptor Fielddata(Action configure) + public DatePropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -150,15 +154,15 @@ public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Fields(Action> configure) + public DatePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -194,6 +198,9 @@ public DatePropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -218,15 +225,15 @@ public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Properties(Action> configure) + public DatePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -279,7 +286,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -371,15 +378,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -423,8 +430,8 @@ public DatePropertyDescriptor() : base() private bool? DocValuesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata? FielddataValue { get; set; } - private IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } - private Action FielddataDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor FielddataDescriptor { get; set; } + private Action FielddataDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private string? FormatValue { get; set; } private int? IgnoreAboveValue { get; set; } @@ -470,7 +477,7 @@ public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexManag return Self; } - public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescriptor descriptor) + public DatePropertyDescriptor Fielddata(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor descriptor) { FielddataValue = null; FielddataDescriptorAction = null; @@ -478,7 +485,7 @@ public DatePropertyDescriptor Fielddata(IndexManagement.NumericFielddataDescript return Self; } - public DatePropertyDescriptor Fielddata(Action configure) + public DatePropertyDescriptor Fielddata(Action configure) { FielddataValue = null; FielddataDescriptor = null; @@ -492,15 +499,15 @@ public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Prope return Self; } - public DatePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Fields(Action> configure) + public DatePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -536,6 +543,9 @@ public DatePropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DatePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -560,15 +570,15 @@ public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public DatePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DatePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DatePropertyDescriptor Properties(Action> configure) + public DatePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -621,7 +631,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataDescriptorAction is not null) { writer.WritePropertyName("fielddata"); - JsonSerializer.Serialize(writer, new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction), options); } else if (FielddataValue is not null) { @@ -713,15 +723,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataValue; } - if (FielddataDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataDescriptorAction is not null) { - var descriptor = new IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataDescriptor(FielddataDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs index 7a91fa419fb..0ec837c0746 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DateRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -118,15 +122,15 @@ public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Fields(Action> configure) + public DateRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -150,6 +154,9 @@ public DateRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -162,15 +169,15 @@ public DateRangePropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Properties(Action> configure) + public DateRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -350,15 +357,15 @@ public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public DateRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Fields(Action> configure) + public DateRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -382,6 +389,9 @@ public DateRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DateRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -394,15 +404,15 @@ public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp return Self; } - public DateRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DateRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DateRangePropertyDescriptor Properties(Action> configure) + public DateRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 7b8ad51d17b..322c16649ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -37,7 +37,7 @@ public sealed partial class DenseVectorIndexOptions public string Type { get; set; } } -public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class DenseVectorIndexOptionsDescriptor : SerializableDescriptor { internal DenseVectorIndexOptionsDescriptor(Action configure) => configure.Invoke(this); @@ -78,11 +78,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Mapping/DenseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs index 124a8459584..82424e9a47c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; public sealed partial class DenseVectorProperty : IProperty { [JsonInclude, JsonPropertyName("dims")] - public int Dims { get; set; } + public int? Dims { get; set; } [JsonInclude, JsonPropertyName("dynamic")] public Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? Dynamic { get; set; } [JsonInclude, JsonPropertyName("fields")] @@ -41,6 +41,10 @@ public sealed partial class DenseVectorProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -60,19 +64,19 @@ public DenseVectorPropertyDescriptor() : base() { } - private int DimsValue { get; set; } + private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? IndexOptionsValue { get; set; } - private DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } - private Action IndexOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } + private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private string? SimilarityValue { get; set; } - public DenseVectorPropertyDescriptor Dims(int dims) + public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; return Self; @@ -90,15 +94,15 @@ public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Fields(Action> configure) + public DenseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -124,7 +128,7 @@ public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Ela return Self; } - public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor descriptor) { IndexOptionsValue = null; IndexOptionsDescriptorAction = null; @@ -132,7 +136,7 @@ public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOpt return Self; } - public DenseVectorPropertyDescriptor IndexOptions(Action configure) + public DenseVectorPropertyDescriptor IndexOptions(Action configure) { IndexOptionsValue = null; IndexOptionsDescriptor = null; @@ -140,6 +144,9 @@ public DenseVectorPropertyDescriptor IndexOptions(Action + /// Metadata about the field. + /// public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -152,15 +159,15 @@ public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Properties(Action> configure) + public DenseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -175,8 +182,12 @@ public DenseVectorPropertyDescriptor Similarity(string? similarity) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("dims"); - writer.WriteNumberValue(DimsValue); + if (DimsValue.HasValue) + { + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue.Value); + } + if (DynamicValue is not null) { writer.WritePropertyName("dynamic"); @@ -209,7 +220,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexOptionsDescriptorAction is not null) { writer.WritePropertyName("index_options"); - JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); } else if (IndexOptionsValue is not null) { @@ -247,15 +258,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexOptionsValue; } - if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + if ((object)IndexOptionsDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexOptionsDescriptorAction is not null) { - var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -286,19 +297,19 @@ public DenseVectorPropertyDescriptor() : base() { } - private int DimsValue { get; set; } + private int? DimsValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? IndexOptionsValue { get; set; } - private DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } - private Action IndexOptionsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor IndexOptionsDescriptor { get; set; } + private Action IndexOptionsDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private string? SimilarityValue { get; set; } - public DenseVectorPropertyDescriptor Dims(int dims) + public DenseVectorPropertyDescriptor Dims(int? dims) { DimsValue = dims; return Self; @@ -316,15 +327,15 @@ public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public DenseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Fields(Action> configure) + public DenseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -350,7 +361,7 @@ public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch. return Self; } - public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescriptor descriptor) + public DenseVectorPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor descriptor) { IndexOptionsValue = null; IndexOptionsDescriptorAction = null; @@ -358,7 +369,7 @@ public DenseVectorPropertyDescriptor IndexOptions(DenseVectorIndexOptionsDescrip return Self; } - public DenseVectorPropertyDescriptor IndexOptions(Action configure) + public DenseVectorPropertyDescriptor IndexOptions(Action configure) { IndexOptionsValue = null; IndexOptionsDescriptor = null; @@ -366,6 +377,9 @@ public DenseVectorPropertyDescriptor IndexOptions(Action + /// Metadata about the field. + ///
public DenseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -378,15 +392,15 @@ public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public DenseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DenseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DenseVectorPropertyDescriptor Properties(Action> configure) + public DenseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -401,8 +415,12 @@ public DenseVectorPropertyDescriptor Similarity(string? similarity) protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); - writer.WritePropertyName("dims"); - writer.WriteNumberValue(DimsValue); + if (DimsValue.HasValue) + { + writer.WritePropertyName("dims"); + writer.WriteNumberValue(DimsValue.Value); + } + if (DynamicValue is not null) { writer.WritePropertyName("dynamic"); @@ -435,7 +453,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexOptionsDescriptorAction is not null) { writer.WritePropertyName("index_options"); - JsonSerializer.Serialize(writer, new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction), options); } else if (IndexOptionsValue is not null) { @@ -473,15 +491,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexOptionsValue; } - if (IndexOptionsDescriptor is IBuildableDescriptor buildable) + if ((object)IndexOptionsDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexOptionsDescriptorAction is not null) { - var descriptor = new DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor(IndexOptionsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs index ec38d75c9be..438c908637d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class DoubleNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class DoubleNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Fields(Action> configure) + public DoubleNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public DoubleNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Properties(Action> configure) + public DoubleNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappi return Self; } - public DoubleNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Fields(Action> configure) + public DoubleNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public DoubleNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.M return Self; } - public DoubleNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleNumberPropertyDescriptor Properties(Action> configure) + public DoubleNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs index d4df3d93abc..a69f1a831f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class DoubleRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Fields(Action> configure) + public DoubleRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public DoubleRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Properties(Action> configure) + public DoubleRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public DoubleRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Fields(Action> configure) + public DoubleRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public DoubleRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public DoubleRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public DoubleRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DoubleRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DoubleRangePropertyDescriptor Properties(Action> configure) + public DoubleRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs index 918f556ed88..2ee5c403f65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs @@ -63,6 +63,10 @@ public sealed partial class DynamicProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } [JsonInclude, JsonPropertyName("locale")] public string? Locale { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -120,8 +124,8 @@ public DynamicPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptionsValue { get; set; } private bool? IndexPhrasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } - private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } - private Action IndexPrefixesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private string? LocaleValue { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } @@ -192,15 +196,15 @@ public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Fields(Action> configure) + public DynamicPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -250,7 +254,7 @@ public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasti return Self; } - public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -258,7 +262,7 @@ public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescr return Self; } - public DynamicPropertyDescriptor IndexPrefixes(Action configure) + public DynamicPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -272,6 +276,9 @@ public DynamicPropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -314,15 +321,15 @@ public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Properties(Action> configure) + public DynamicPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -471,7 +478,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -581,15 +588,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -658,8 +665,8 @@ public DynamicPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptionsValue { get; set; } private bool? IndexPhrasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } - private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } - private Action IndexPrefixesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private string? LocaleValue { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } @@ -730,15 +737,15 @@ public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public DynamicPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Fields(Action> configure) + public DynamicPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -788,7 +795,7 @@ public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Map return Self; } - public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public DynamicPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -796,7 +803,7 @@ public DynamicPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descr return Self; } - public DynamicPropertyDescriptor IndexPrefixes(Action configure) + public DynamicPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -810,6 +817,9 @@ public DynamicPropertyDescriptor Locale(string? locale) return Self; } + /// + /// Metadata about the field. + /// public DynamicPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -852,15 +862,15 @@ public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappin return Self; } - public DynamicPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public DynamicPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public DynamicPropertyDescriptor Properties(Action> configure) + public DynamicPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -1009,7 +1019,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -1119,15 +1129,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs index f603c73e42c..b55b842998d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -45,6 +45,113 @@ public sealed partial class DynamicTemplate 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.Mapping.IProperty? MappingValue { get; set; } + private string? MatchValue { get; set; } + private string? MatchMappingTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.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.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.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(); + } +} + public sealed partial class DynamicTemplateDescriptor : SerializableDescriptor { internal DynamicTemplateDescriptor(Action configure) => configure.Invoke(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs index efd04b0f67a..c00f33df9c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class FieldAliasProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("path")] @@ -73,15 +77,15 @@ public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Fields(Action> configure) + public FieldAliasPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -93,6 +97,9 @@ public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,21 +118,27 @@ public FieldAliasPropertyDescriptor Path(Expression Path(Expression> path) + { + PathValue = path; + return Self; + } + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public FieldAliasPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Properties(Action> configure) + public FieldAliasPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -213,15 +226,15 @@ public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public FieldAliasPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Fields(Action> configure) + public FieldAliasPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -233,6 +246,9 @@ public FieldAliasPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public FieldAliasPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -263,15 +279,15 @@ public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public FieldAliasPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FieldAliasPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FieldAliasPropertyDescriptor Properties(Action> configure) + public FieldAliasPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs index 167fc532d7f..1a5dc436108 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class FlattenedProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -121,15 +125,15 @@ public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Fields(Action> configure) + public FlattenedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elast return Self; } + /// + /// Metadata about the field. + /// public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Properties(Action> configure) + public FlattenedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -367,15 +374,15 @@ public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public FlattenedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Fields(Action> configure) + public FlattenedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -399,6 +406,9 @@ public FlattenedPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Ma return Self; } + /// + /// Metadata about the field. + /// public FlattenedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -417,15 +427,15 @@ public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp return Self; } - public FlattenedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FlattenedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FlattenedPropertyDescriptor Properties(Action> configure) + public FlattenedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs index fd4dd61f155..56377791f55 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class FloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class FloatNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Fields(Action> configure) + public FloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public FloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Properties(Action> configure) + public FloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public FloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Fields(Action> configure) + public FloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public FloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public FloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatNumberPropertyDescriptor Properties(Action> configure) + public FloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs index 1f322a052dc..8d0226ba413 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class FloatRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Fields(Action> configure) + public FloatRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public FloatRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Properties(Action> configure) + public FloatRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public FloatRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Fields(Action> configure) + public FloatRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public FloatRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public FloatRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public FloatRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public FloatRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public FloatRangePropertyDescriptor Properties(Action> configure) + public FloatRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs index 954a386a8ed..709b78ccf20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs @@ -43,12 +43,22 @@ public sealed partial class GeoPointProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + [JsonInclude, JsonPropertyName("index")] + public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] public Elastic.Clients.Elasticsearch.GeoLocation? NullValue { get; set; } + [JsonInclude, JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } [JsonInclude, JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } [JsonInclude, JsonPropertyName("similarity")] public string? Similarity { get; set; } [JsonInclude, JsonPropertyName("store")] @@ -73,9 +83,12 @@ public GeoPointPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private bool? IgnoreMalformedValue { get; set; } private bool? IgnoreZValueValue { get; set; } + private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.GeoLocation? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } @@ -103,15 +116,15 @@ public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Fields(Action> configure) + public GeoPointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -135,6 +148,15 @@ public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = t return Self; } + public GeoPointPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + /// + /// Metadata about the field. + /// public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -147,26 +169,38 @@ public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticse return Self; } + public GeoPointPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Properties(Action> configure) + public GeoPointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } + public GeoPointPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public GeoPointPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -224,6 +258,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreZValueValue.Value); } + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + if (MetaValue is not null) { writer.WritePropertyName("meta"); @@ -236,12 +276,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -268,9 +320,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, IgnoreZValue = IgnoreZValueValue, + Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, + Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue }; @@ -291,9 +346,12 @@ public GeoPointPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private bool? IgnoreMalformedValue { get; set; } private bool? IgnoreZValueValue { get; set; } + private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.GeoLocation? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } @@ -321,15 +379,15 @@ public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public GeoPointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Fields(Action> configure) + public GeoPointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -353,6 +411,15 @@ public GeoPointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + public GeoPointPropertyDescriptor Index(bool? index = true) + { + IndexValue = index; + return Self; + } + + /// + /// Metadata about the field. + /// public GeoPointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -365,26 +432,38 @@ public GeoPointPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.GeoLoc return Self; } + public GeoPointPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public GeoPointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoPointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoPointPropertyDescriptor Properties(Action> configure) + public GeoPointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } + public GeoPointPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public GeoPointPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -442,6 +521,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IgnoreZValueValue.Value); } + if (IndexValue.HasValue) + { + writer.WritePropertyName("index"); + writer.WriteBooleanValue(IndexValue.Value); + } + if (MetaValue is not null) { writer.WritePropertyName("meta"); @@ -454,12 +539,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -486,9 +583,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, IgnoreZValue = IgnoreZValueValue, + Index = IndexValue, Meta = MetaValue, NullValue = NullValueValue, + OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, + Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue }; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs index 4648d609962..40b74bc573d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; /// /// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapeProperty : IProperty { @@ -48,6 +49,10 @@ public sealed partial class GeoShapeProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("orientation")] @@ -67,6 +72,7 @@ public sealed partial class GeoShapeProperty : IProperty /// /// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor { @@ -121,15 +127,15 @@ public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Fields(Action> configure) + public GeoShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +159,9 @@ public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = t return Self; } + /// + /// Metadata about the field. + /// public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +180,15 @@ public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elastics return Self; } - public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Properties(Action> configure) + public GeoShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -316,6 +325,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o /// /// The `geo_shape` data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles
and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class GeoShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor { @@ -370,15 +380,15 @@ public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public GeoShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Fields(Action> configure) + public GeoShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -402,6 +412,9 @@ public GeoShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public GeoShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -420,15 +433,15 @@ public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappi return Self; } - public GeoShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public GeoShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public GeoShapePropertyDescriptor Properties(Action> configure) + public GeoShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs index e1b34072be2..f90f2ef2541 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class HalfFloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class HalfFloatNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public HalfFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.E return Self; } - public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public HalfFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Fields(Action> configure) + public HalfFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public HalfFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public HalfFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public HalfFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HalfFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HalfFloatNumberPropertyDescriptor Properties(Action> configure) + public HalfFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs index cd19a5ef476..5910340dddc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs @@ -37,6 +37,10 @@ public sealed partial class HistogramProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("ignore_malformed")] public bool? IgnoreMalformed { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -73,15 +77,15 @@ public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Fields(Action> configure) + public HistogramPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -99,6 +103,9 @@ public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalfor return Self; } + /// + /// Metadata about the field. + /// public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,15 +118,15 @@ public HistogramPropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Properties(Action> configure) + public HistogramPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -207,15 +214,15 @@ public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public HistogramPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Fields(Action> configure) + public HistogramPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -233,6 +240,9 @@ public HistogramPropertyDescriptor IgnoreMalformed(bool? ignoreMalformed = true) return Self; } + /// + /// Metadata about the field. + /// public HistogramPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -245,15 +255,15 @@ public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp return Self; } - public HistogramPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public HistogramPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public HistogramPropertyDescriptor Properties(Action> configure) + public HistogramPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs index db96d935b69..74f0b91488d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class IntegerNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class IntegerNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elastic return Self; } - public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Fields(Action> configure) + public IntegerNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public IntegerNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Ela return Self; } - public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Properties(Action> configure) + public IntegerNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapp return Self; } - public IntegerNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Fields(Action> configure) + public IntegerNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public IntegerNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch. return Self; } - public IntegerNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerNumberPropertyDescriptor Properties(Action> configure) + public IntegerNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs index 300d79230bc..3aeb69fba48 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IntegerRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Fields(Action> configure) + public IntegerRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public IntegerRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Properties(Action> configure) + public IntegerRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappi return Self; } - public IntegerRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Fields(Action> configure) + public IntegerRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public IntegerRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IntegerRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.M return Self; } - public IntegerRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IntegerRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IntegerRangePropertyDescriptor Properties(Action> configure) + public IntegerRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs index c959e00e23c..0ffd3af867c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IpProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -125,15 +129,15 @@ public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapp return Self; } - public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Fields(Action> configure) + public IpPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -157,6 +161,9 @@ public IpPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -181,15 +188,15 @@ public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch. return Self; } - public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Properties(Action> configure) + public IpPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -402,15 +409,15 @@ public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Propert return Self; } - public IpPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Fields(Action> configure) + public IpPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -434,6 +441,9 @@ public IpPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -458,15 +468,15 @@ public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Pro return Self; } - public IpPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpPropertyDescriptor Properties(Action> configure) + public IpPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs index fa4ddec643f..51da78a32fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class IpRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Fields(Action> configure) + public IpRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public IpRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Properties(Action> configure) + public IpRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public IpRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Fields(Action> configure) + public IpRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public IpRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public IpRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappin return Self; } - public IpRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public IpRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public IpRangePropertyDescriptor Properties(Action> configure) + public IpRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs index 71c2e515b8b..b82a61189b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs @@ -37,12 +37,16 @@ public sealed partial class JoinProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } [JsonInclude, JsonPropertyName("relations")] - public IDictionary>? Relations { get; set; } + public IDictionary>>? Relations { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type => "join"; @@ -62,7 +66,7 @@ public JoinPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } - private IDictionary>? RelationsValue { get; set; } + private IDictionary>>? RelationsValue { get; set; } public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { @@ -82,15 +86,15 @@ public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Fields(Action> configure) + public JoinPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -102,6 +106,9 @@ public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -114,23 +121,23 @@ public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Properties(Action> configure) + public JoinPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + public JoinPropertyDescriptor Relations(Func>>, FluentDictionary>>> selector) { - RelationsValue = selector?.Invoke(new FluentDictionary>()); + RelationsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } @@ -210,7 +217,7 @@ public JoinPropertyDescriptor() : base() private int? IgnoreAboveValue { get; set; } private IDictionary? MetaValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } - private IDictionary>? RelationsValue { get; set; } + private IDictionary>>? RelationsValue { get; set; } public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { @@ -230,15 +237,15 @@ public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Prope return Self; } - public JoinPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Fields(Action> configure) + public JoinPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -250,6 +257,9 @@ public JoinPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public JoinPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -262,23 +272,23 @@ public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public JoinPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public JoinPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Properties(Action> configure) + public JoinPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; } - public JoinPropertyDescriptor Relations(Func>, FluentDictionary>> selector) + public JoinPropertyDescriptor Relations(Func>>, FluentDictionary>>> selector) { - RelationsValue = selector?.Invoke(new FluentDictionary>()); + RelationsValue = selector?.Invoke(new FluentDictionary>>()); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs index de0efcb6f45..7fb1f6c981a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class KeywordProperty : IProperty public bool? Index { get; set; } [JsonInclude, JsonPropertyName("index_options")] public Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptions { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("normalizer")] @@ -137,15 +141,15 @@ public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Fields(Action> configure) + public KeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -169,6 +173,9 @@ public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elastic return Self; } + /// + /// Metadata about the field. + /// public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -199,15 +206,15 @@ public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Properties(Action> configure) + public KeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -442,15 +449,15 @@ public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public KeywordPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Fields(Action> configure) + public KeywordPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -474,6 +481,9 @@ public KeywordPropertyDescriptor IndexOptions(Elastic.Clients.Elasticsearch.Mapp return Self; } + /// + /// Metadata about the field. + /// public KeywordPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -504,15 +514,15 @@ public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappin return Self; } - public KeywordPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public KeywordPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public KeywordPropertyDescriptor Properties(Action> configure) + public KeywordPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs index 7ac875847d9..937b95e54f2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class LongNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class LongNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Fields(Action> configure) + public LongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public LongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Properties(Action> configure) + public LongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public LongNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public LongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Fields(Action> configure) + public LongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public LongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public LongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongNumberPropertyDescriptor Properties(Action> configure) + public LongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public LongNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs index 1b6a021f600..4992f5cf0c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class LongRangeProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -115,15 +119,15 @@ public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsear return Self; } - public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Fields(Action> configure) + public LongRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -141,6 +145,9 @@ public LongRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public LongRangePropertyDescriptor Properties(Elastic.Clients.Elastic return Self; } - public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Properties(Action> configure) + public LongRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -333,15 +340,15 @@ public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public LongRangePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Fields(Action> configure) + public LongRangePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -359,6 +366,9 @@ public LongRangePropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public LongRangePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapp return Self; } - public LongRangePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public LongRangePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public LongRangePropertyDescriptor Properties(Action> configure) + public LongRangePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs index 5217314e7b8..a947238545e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs @@ -87,21 +87,15 @@ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elastic 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) + public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.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) + public MatchOnlyTextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -183,21 +177,15 @@ public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapp 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) + public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.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) + public MatchOnlyTextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs index d24a787dde2..ed190e59917 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class Murmur3HashProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Fields(Action> configure) + public Murmur3HashPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Properties(Action> configure) + public Murmur3HashPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public Murmur3HashPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Fields(Action> configure) + public Murmur3HashPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public Murmur3HashPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public Murmur3HashPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public Murmur3HashPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public Murmur3HashPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public Murmur3HashPropertyDescriptor Properties(Action> configure) + public Murmur3HashPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs index fed963aefe5..244294b579e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs @@ -43,6 +43,10 @@ public sealed partial class NestedProperty : IProperty public bool? IncludeInParent { get; set; } [JsonInclude, JsonPropertyName("include_in_root")] public bool? IncludeInRoot { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -100,15 +104,15 @@ public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Fields(Action> configure) + public NestedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -132,6 +136,9 @@ public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = t return Self; } + /// + /// Metadata about the field. + /// public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -144,15 +151,15 @@ public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Properties(Action> configure) + public NestedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -304,15 +311,15 @@ public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pro return Self; } - public NestedPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Fields(Action> configure) + public NestedPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -336,6 +343,9 @@ public NestedPropertyDescriptor IncludeInRoot(bool? includeInRoot = true) return Self; } + /// + /// Metadata about the field. + /// public NestedPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -348,15 +358,15 @@ public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping return Self; } - public NestedPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public NestedPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public NestedPropertyDescriptor Properties(Action> configure) + public NestedPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs index de7a5cbde2c..b28c1b9835d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class ObjectProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -97,15 +101,15 @@ public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Fields(Action> configure) + public ObjectPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -117,6 +121,9 @@ public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -129,15 +136,15 @@ public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Properties(Action> configure) + public ObjectPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -287,15 +294,15 @@ public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pro return Self; } - public ObjectPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Fields(Action> configure) + public ObjectPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -307,6 +314,9 @@ public ObjectPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public ObjectPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -319,15 +329,15 @@ public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping return Self; } - public ObjectPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ObjectPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ObjectPropertyDescriptor Properties(Action> configure) + public ObjectPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs index de2eafc38ee..37eb93acaf4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class PercolatorProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -70,15 +74,15 @@ public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Fields(Action> configure) + public PercolatorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,6 +94,9 @@ public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -102,15 +109,15 @@ public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Properties(Action> configure) + public PercolatorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -190,15 +197,15 @@ public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public PercolatorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Fields(Action> configure) + public PercolatorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,6 +217,9 @@ public PercolatorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public PercolatorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -222,15 +232,15 @@ public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public PercolatorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PercolatorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PercolatorPropertyDescriptor Properties(Action> configure) + public PercolatorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs index dbcee00cd09..acefd42f69a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs @@ -43,6 +43,10 @@ public sealed partial class PointProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -103,15 +107,15 @@ public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.M return Self; } - public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Fields(Action> configure) + public PointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -135,6 +139,9 @@ public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true return Self; } + /// + /// Metadata about the field. + /// public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -153,15 +160,15 @@ public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsear return Self; } - public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Properties(Action> configure) + public PointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -321,15 +328,15 @@ public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Prop return Self; } - public PointPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Fields(Action> configure) + public PointPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -353,6 +360,9 @@ public PointPropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public PointPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -371,15 +381,15 @@ public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public PointPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public PointPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public PointPropertyDescriptor Properties(Action> configure) + public PointPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs index 3d54e0a49dc..15bfac73651 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Properties.g.cs @@ -30,22 +30,22 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -public partial class Properties : IsADictionary +public partial class Properties : IsADictionary { public Properties() { } - public Properties(IDictionary container) : base(container) + 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 void Add(Elastic.Clients.Elasticsearch.PropertyName name, IProperty property) => BackingDictionary.Add(Sanitize(name), property); + public bool TryGetProperty(Elastic.Clients.Elasticsearch.PropertyName name, [NotNullWhen(returnValue: true)] out IProperty property) => BackingDictionary.TryGetValue(Sanitize(name), out property); - public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValue: true)] out T? property) where T : class, IProperty + public bool TryGetProperty(Elastic.Clients.Elasticsearch.PropertyName name, [NotNullWhen(returnValue: true)] out T? property) where T : class, IProperty { - if (BackingDictionary.TryGetValue(Sanitize(propertyName), out var matchedValue) && matchedValue is T finalValue) + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) { property = finalValue; return true; @@ -56,7 +56,7 @@ public bool TryGetProperty(PropertyName propertyName, [NotNullWhen(returnValu } } -public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, PropertyName, IProperty> +public sealed partial class PropertiesDescriptor : IsADictionaryDescriptor, Properties, Elastic.Clients.Elasticsearch.PropertyName, IProperty> { public PropertiesDescriptor() : base(new Properties()) { @@ -66,241 +66,241 @@ public PropertiesDescriptor() : base(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 SparseVector(PropertyName propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); - public PropertiesDescriptor SparseVector(PropertyName propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); - public PropertiesDescriptor SparseVector(PropertyName propertyName, SparseVectorProperty sparseVectorProperty) => AssignVariant(propertyName, sparseVectorProperty); - public PropertiesDescriptor SparseVector(Expression> propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); - public PropertiesDescriptor SparseVector(Expression> propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(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); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, null); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, AggregateMetricDoubleProperty>(propertyName, configure); + public PropertiesDescriptor AggregateMetricDouble(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, BinaryProperty>(propertyName, null); + public PropertiesDescriptor Binary(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, BinaryProperty>(propertyName, configure); + public PropertiesDescriptor Binary(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, BooleanProperty>(propertyName, null); + public PropertiesDescriptor Boolean(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, BooleanProperty>(propertyName, configure); + public PropertiesDescriptor Boolean(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ByteNumberProperty>(propertyName, null); + public PropertiesDescriptor ByteNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ByteNumberProperty>(propertyName, configure); + public PropertiesDescriptor ByteNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, CompletionProperty>(propertyName, null); + public PropertiesDescriptor Completion(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, CompletionProperty>(propertyName, configure); + public PropertiesDescriptor Completion(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ConstantKeywordProperty>(propertyName, null); + public PropertiesDescriptor ConstantKeyword(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ConstantKeywordProperty>(propertyName, configure); + public PropertiesDescriptor ConstantKeyword(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DateNanosProperty>(propertyName, null); + public PropertiesDescriptor DateNanos(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DateNanosProperty>(propertyName, configure); + public PropertiesDescriptor DateNanos(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DateProperty>(propertyName, null); + public PropertiesDescriptor Date(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DateProperty>(propertyName, configure); + public PropertiesDescriptor Date(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DateRangeProperty>(propertyName, null); + public PropertiesDescriptor DateRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DateRangeProperty>(propertyName, configure); + public PropertiesDescriptor DateRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DenseVectorProperty>(propertyName, null); + public PropertiesDescriptor DenseVector(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DenseVectorProperty>(propertyName, configure); + public PropertiesDescriptor DenseVector(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DoubleNumberProperty>(propertyName, null); + public PropertiesDescriptor DoubleNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DoubleNumberProperty>(propertyName, configure); + public PropertiesDescriptor DoubleNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DoubleRangeProperty>(propertyName, null); + public PropertiesDescriptor DoubleRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DoubleRangeProperty>(propertyName, configure); + public PropertiesDescriptor DoubleRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, DynamicProperty>(propertyName, null); + public PropertiesDescriptor Dynamic(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, DynamicProperty>(propertyName, configure); + public PropertiesDescriptor Dynamic(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, FieldAliasProperty>(propertyName, null); + public PropertiesDescriptor FieldAlias(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, FieldAliasProperty>(propertyName, configure); + public PropertiesDescriptor FieldAlias(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, FlattenedProperty>(propertyName, null); + public PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, FlattenedProperty>(propertyName, configure); + public PropertiesDescriptor Flattened(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, FloatNumberProperty>(propertyName, null); + public PropertiesDescriptor FloatNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, FloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor FloatNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, FloatRangeProperty>(propertyName, null); + public PropertiesDescriptor FloatRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, FloatRangeProperty>(propertyName, configure); + public PropertiesDescriptor FloatRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, GeoPointProperty>(propertyName, null); + public PropertiesDescriptor GeoPoint(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, GeoPointProperty>(propertyName, configure); + public PropertiesDescriptor GeoPoint(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, GeoShapeProperty>(propertyName, null); + public PropertiesDescriptor GeoShape(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, GeoShapeProperty>(propertyName, configure); + public PropertiesDescriptor GeoShape(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, HalfFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor HalfFloatNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, HalfFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor HalfFloatNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, HistogramProperty>(propertyName, null); + public PropertiesDescriptor Histogram(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, HistogramProperty>(propertyName, configure); + public PropertiesDescriptor Histogram(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, IntegerNumberProperty>(propertyName, null); + public PropertiesDescriptor IntegerNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, IntegerNumberProperty>(propertyName, configure); + public PropertiesDescriptor IntegerNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, IntegerRangeProperty>(propertyName, null); + public PropertiesDescriptor IntegerRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, IntegerRangeProperty>(propertyName, configure); + public PropertiesDescriptor IntegerRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, IpProperty>(propertyName, null); + public PropertiesDescriptor Ip(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, IpProperty>(propertyName, configure); + public PropertiesDescriptor Ip(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, IpRangeProperty>(propertyName, null); + public PropertiesDescriptor IpRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, IpRangeProperty>(propertyName, configure); + public PropertiesDescriptor IpRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, JoinProperty>(propertyName, null); + public PropertiesDescriptor Join(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, JoinProperty>(propertyName, configure); + public PropertiesDescriptor Join(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, KeywordProperty>(propertyName, null); + public PropertiesDescriptor Keyword(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, KeywordProperty>(propertyName, configure); + public PropertiesDescriptor Keyword(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, LongNumberProperty>(propertyName, null); + public PropertiesDescriptor LongNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, LongNumberProperty>(propertyName, configure); + public PropertiesDescriptor LongNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, LongRangeProperty>(propertyName, null); + public PropertiesDescriptor LongRange(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, LongRangeProperty>(propertyName, configure); + public PropertiesDescriptor LongRange(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, MatchOnlyTextProperty>(propertyName, null); + public PropertiesDescriptor MatchOnlyText(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, MatchOnlyTextProperty>(propertyName, configure); + public PropertiesDescriptor MatchOnlyText(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, Murmur3HashProperty>(propertyName, null); + public PropertiesDescriptor Murmur3Hash(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, Murmur3HashProperty>(propertyName, configure); + public PropertiesDescriptor Murmur3Hash(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, NestedProperty>(propertyName, null); + public PropertiesDescriptor Nested(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, NestedProperty>(propertyName, configure); + public PropertiesDescriptor Nested(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ObjectProperty>(propertyName, null); + public PropertiesDescriptor Object(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ObjectProperty>(propertyName, configure); + public PropertiesDescriptor Object(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, PercolatorProperty>(propertyName, null); + public PropertiesDescriptor Percolator(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, PercolatorProperty>(propertyName, configure); + public PropertiesDescriptor Percolator(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, PointProperty>(propertyName, null); + public PropertiesDescriptor Point(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, PointProperty>(propertyName, configure); + public PropertiesDescriptor Point(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, RankFeatureProperty>(propertyName, null); + public PropertiesDescriptor RankFeature(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, RankFeatureProperty>(propertyName, configure); + public PropertiesDescriptor RankFeature(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, RankFeaturesProperty>(propertyName, null); + public PropertiesDescriptor RankFeatures(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, RankFeaturesProperty>(propertyName, configure); + public PropertiesDescriptor RankFeatures(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ScaledFloatNumberProperty>(propertyName, null); + public PropertiesDescriptor ScaledFloatNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ScaledFloatNumberProperty>(propertyName, configure); + public PropertiesDescriptor ScaledFloatNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, SearchAsYouTypeProperty>(propertyName, null); + public PropertiesDescriptor SearchAsYouType(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, SearchAsYouTypeProperty>(propertyName, configure); + public PropertiesDescriptor SearchAsYouType(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ShapeProperty>(propertyName, null); + public PropertiesDescriptor Shape(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ShapeProperty>(propertyName, configure); + public PropertiesDescriptor Shape(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, ShortNumberProperty>(propertyName, null); + public PropertiesDescriptor ShortNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, ShortNumberProperty>(propertyName, configure); + public PropertiesDescriptor ShortNumber(Elastic.Clients.Elasticsearch.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 SparseVector(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); + public PropertiesDescriptor SparseVector(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); + public PropertiesDescriptor SparseVector(Elastic.Clients.Elasticsearch.PropertyName propertyName, SparseVectorProperty sparseVectorProperty) => AssignVariant(propertyName, sparseVectorProperty); + public PropertiesDescriptor SparseVector(Expression> propertyName) => AssignVariant, SparseVectorProperty>(propertyName, null); + public PropertiesDescriptor SparseVector(Expression> propertyName, Action> configure) => AssignVariant, SparseVectorProperty>(propertyName, configure); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, TextProperty>(propertyName, null); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, TextProperty>(propertyName, configure); + public PropertiesDescriptor Text(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, TokenCountProperty>(propertyName, null); + public PropertiesDescriptor TokenCount(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, TokenCountProperty>(propertyName, configure); + public PropertiesDescriptor TokenCount(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, UnsignedLongNumberProperty>(propertyName, null); + public PropertiesDescriptor UnsignedLongNumber(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, UnsignedLongNumberProperty>(propertyName, configure); + public PropertiesDescriptor UnsignedLongNumber(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, VersionProperty>(propertyName, null); + public PropertiesDescriptor Version(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, VersionProperty>(propertyName, configure); + public PropertiesDescriptor Version(Elastic.Clients.Elasticsearch.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(Elastic.Clients.Elasticsearch.PropertyName propertyName) => AssignVariant, WildcardProperty>(propertyName, null); + public PropertiesDescriptor Wildcard(Elastic.Clients.Elasticsearch.PropertyName propertyName, Action> configure) => AssignVariant, WildcardProperty>(propertyName, configure); + public PropertiesDescriptor Wildcard(Elastic.Clients.Elasticsearch.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 @@ -317,105 +317,102 @@ public override IProperty Read(ref Utf8JsonReader reader, Type typeToConvert, Js 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 "aggregate_metric_double": + return JsonSerializer.Deserialize(ref reader, options); + case "binary": + return JsonSerializer.Deserialize(ref reader, options); + case "boolean": + return JsonSerializer.Deserialize(ref reader, options); + case "byte": + return JsonSerializer.Deserialize(ref reader, options); + case "completion": + return JsonSerializer.Deserialize(ref reader, options); + case "constant_keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "date_nanos": + return JsonSerializer.Deserialize(ref reader, options); + case "date": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "dense_vector": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "double_range": + return JsonSerializer.Deserialize(ref reader, options); + case "{dynamic_property}": + return JsonSerializer.Deserialize(ref reader, options); + case "alias": + return JsonSerializer.Deserialize(ref reader, options); + case "flattened": + return JsonSerializer.Deserialize(ref reader, options); + case "float": + return JsonSerializer.Deserialize(ref reader, options); + case "float_range": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "geo_shape": + return JsonSerializer.Deserialize(ref reader, options); + case "half_float": + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "integer": + return JsonSerializer.Deserialize(ref reader, options); + case "integer_range": + return JsonSerializer.Deserialize(ref reader, options); + case "ip": + return JsonSerializer.Deserialize(ref reader, options); + case "ip_range": + return JsonSerializer.Deserialize(ref reader, options); + case "join": + return JsonSerializer.Deserialize(ref reader, options); + case "keyword": + return JsonSerializer.Deserialize(ref reader, options); + case "long": + return JsonSerializer.Deserialize(ref reader, options); + case "long_range": + return JsonSerializer.Deserialize(ref reader, options); + case "match_only_text": + return JsonSerializer.Deserialize(ref reader, options); + case "murmur3": + return JsonSerializer.Deserialize(ref reader, options); case "nested": - return JsonSerializer.Deserialize(ref reader, options); - case "flattened": - return JsonSerializer.Deserialize(ref reader, options); + return JsonSerializer.Deserialize(ref reader, options); + case "object": + return JsonSerializer.Deserialize(ref reader, options); + case "percolator": + return JsonSerializer.Deserialize(ref reader, options); + case "point": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_feature": + return JsonSerializer.Deserialize(ref reader, options); + case "rank_features": + return JsonSerializer.Deserialize(ref reader, options); + case "scaled_float": + return JsonSerializer.Deserialize(ref reader, options); + case "search_as_you_type": + return JsonSerializer.Deserialize(ref reader, options); + case "shape": + return JsonSerializer.Deserialize(ref reader, options); + case "short": + return JsonSerializer.Deserialize(ref reader, options); case "sparse_vector": - 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); + 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); + return JsonSerializer.Deserialize(ref reader, options); + case "token_count": + return JsonSerializer.Deserialize(ref reader, options); + case "unsigned_long": + return JsonSerializer.Deserialize(ref reader, options); + case "version": + return JsonSerializer.Deserialize(ref reader, options); + case "wildcard": + return JsonSerializer.Deserialize(ref reader, options); default: - ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IProperty)); - return null; + return JsonSerializer.Deserialize(ref reader, options); } } @@ -429,146 +426,146 @@ public override void Write(Utf8JsonWriter writer, IProperty value, JsonSerialize switch (value.Type) { - case "long_range": - JsonSerializer.Serialize(writer, value, typeof(LongRangeProperty), options); - return; - case "ip_range": - JsonSerializer.Serialize(writer, value, typeof(IpRangeProperty), options); + case "aggregate_metric_double": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty), options); return; - case "integer_range": - JsonSerializer.Serialize(writer, value, typeof(IntegerRangeProperty), options); + case "binary": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.BinaryProperty), options); return; - case "float_range": - JsonSerializer.Serialize(writer, value, typeof(FloatRangeProperty), options); + case "boolean": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.BooleanProperty), options); return; - case "double_range": - JsonSerializer.Serialize(writer, value, typeof(DoubleRangeProperty), options); + case "byte": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty), options); return; - case "date_range": - JsonSerializer.Serialize(writer, value, typeof(DateRangeProperty), options); + case "completion": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.CompletionProperty), options); return; - case "unsigned_long": - JsonSerializer.Serialize(writer, value, typeof(UnsignedLongNumberProperty), options); + case "constant_keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty), options); return; - case "short": - JsonSerializer.Serialize(writer, value, typeof(ShortNumberProperty), options); + case "date_nanos": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty), options); return; - case "scaled_float": - JsonSerializer.Serialize(writer, value, typeof(ScaledFloatNumberProperty), options); + case "date": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DateProperty), options); return; - case "long": - JsonSerializer.Serialize(writer, value, typeof(LongNumberProperty), options); + case "date_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty), options); return; - case "integer": - JsonSerializer.Serialize(writer, value, typeof(IntegerNumberProperty), options); + case "dense_vector": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty), options); return; - case "half_float": - JsonSerializer.Serialize(writer, value, typeof(HalfFloatNumberProperty), options); + case "double": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty), options); return; - case "float": - JsonSerializer.Serialize(writer, value, typeof(FloatNumberProperty), options); + case "double_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty), options); return; - case "double": - JsonSerializer.Serialize(writer, value, typeof(DoubleNumberProperty), options); + case "{dynamic_property}": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.DynamicProperty), options); return; - case "byte": - JsonSerializer.Serialize(writer, value, typeof(ByteNumberProperty), options); + case "alias": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty), options); return; - case "shape": - JsonSerializer.Serialize(writer, value, typeof(ShapeProperty), options); + case "flattened": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty), options); return; - case "point": - JsonSerializer.Serialize(writer, value, typeof(PointProperty), options); + case "float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty), options); return; - case "geo_shape": - JsonSerializer.Serialize(writer, value, typeof(GeoShapeProperty), options); + case "float_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty), options); return; case "geo_point": - JsonSerializer.Serialize(writer, value, typeof(GeoPointProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty), options); return; - case "token_count": - JsonSerializer.Serialize(writer, value, typeof(TokenCountProperty), options); - return; - case "murmur3": - JsonSerializer.Serialize(writer, value, typeof(Murmur3HashProperty), options); + case "geo_shape": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty), options); return; - case "ip": - JsonSerializer.Serialize(writer, value, typeof(IpProperty), options); + case "half_float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty), options); return; case "histogram": - JsonSerializer.Serialize(writer, value, typeof(HistogramProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.HistogramProperty), options); return; - case "alias": - JsonSerializer.Serialize(writer, value, typeof(FieldAliasProperty), options); + case "integer": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty), options); return; - case "constant_keyword": - JsonSerializer.Serialize(writer, value, typeof(ConstantKeywordProperty), options); + case "integer_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty), options); return; - case "completion": - JsonSerializer.Serialize(writer, value, typeof(CompletionProperty), options); + case "ip": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.IpProperty), options); return; - case "object": - JsonSerializer.Serialize(writer, value, typeof(ObjectProperty), options); + case "ip_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty), options); return; - case "nested": - JsonSerializer.Serialize(writer, value, typeof(NestedProperty), options); + case "join": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.JoinProperty), options); return; - case "flattened": - JsonSerializer.Serialize(writer, value, typeof(FlattenedProperty), options); + case "keyword": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.KeywordProperty), options); return; - case "sparse_vector": - JsonSerializer.Serialize(writer, value, typeof(SparseVectorProperty), options); + case "long": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty), options); return; - case "dense_vector": - JsonSerializer.Serialize(writer, value, typeof(DenseVectorProperty), options); + case "long_range": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty), options); return; - case "aggregate_metric_double": - JsonSerializer.Serialize(writer, value, typeof(AggregateMetricDoubleProperty), options); + case "match_only_text": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty), options); return; - case "date": - JsonSerializer.Serialize(writer, value, typeof(DateProperty), options); + case "murmur3": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty), options); return; - case "date_nanos": - JsonSerializer.Serialize(writer, value, typeof(DateNanosProperty), options); + case "nested": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.NestedProperty), options); return; - case "wildcard": - JsonSerializer.Serialize(writer, value, typeof(WildcardProperty), options); + case "object": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ObjectProperty), options); return; - case "version": - JsonSerializer.Serialize(writer, value, typeof(VersionProperty), options); + case "percolator": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty), options); return; - case "text": - JsonSerializer.Serialize(writer, value, typeof(TextProperty), options); + case "point": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.PointProperty), options); return; - case "search_as_you_type": - JsonSerializer.Serialize(writer, value, typeof(SearchAsYouTypeProperty), options); + case "rank_feature": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty), options); return; case "rank_features": - JsonSerializer.Serialize(writer, value, typeof(RankFeaturesProperty), options); + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty), options); return; - case "rank_feature": - JsonSerializer.Serialize(writer, value, typeof(RankFeatureProperty), options); + case "scaled_float": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty), options); return; - case "percolator": - JsonSerializer.Serialize(writer, value, typeof(PercolatorProperty), options); + case "search_as_you_type": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty), options); return; - case "match_only_text": - JsonSerializer.Serialize(writer, value, typeof(MatchOnlyTextProperty), options); + case "shape": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ShapeProperty), options); return; - case "keyword": - JsonSerializer.Serialize(writer, value, typeof(KeywordProperty), options); + case "short": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty), options); return; - case "join": - JsonSerializer.Serialize(writer, value, typeof(JoinProperty), options); + case "sparse_vector": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty), options); return; - case "{dynamic_property}": - JsonSerializer.Serialize(writer, value, typeof(DynamicProperty), options); + case "text": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.TextProperty), options); return; - case "boolean": - JsonSerializer.Serialize(writer, value, typeof(BooleanProperty), options); + case "token_count": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty), options); return; - case "binary": - JsonSerializer.Serialize(writer, value, typeof(BinaryProperty), options); + case "unsigned_long": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty), options); + return; + case "version": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.VersionProperty), options); + return; + case "wildcard": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Mapping.WildcardProperty), options); return; default: var type = value.GetType(); @@ -581,5 +578,5 @@ public override void Write(Utf8JsonWriter writer, IProperty value, JsonSerialize [JsonConverter(typeof(PropertyInterfaceConverter))] public partial interface IProperty { - public string Type { get; } + public string? Type { get; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs index 0d6414f9efa..a4a878fb926 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class RankFeatureProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("positive_score_impact")] @@ -73,15 +77,15 @@ public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Fields(Action> configure) + public RankFeaturePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -93,6 +97,9 @@ public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -111,15 +118,15 @@ public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Properties(Action> configure) + public RankFeaturePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -207,15 +214,15 @@ public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public RankFeaturePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Fields(Action> configure) + public RankFeaturePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -227,6 +234,9 @@ public RankFeaturePropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -245,15 +255,15 @@ public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public RankFeaturePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturePropertyDescriptor Properties(Action> configure) + public RankFeaturePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs index 82f591ef976..4034a2482fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs @@ -35,8 +35,14 @@ public sealed partial class RankFeaturesProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [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.Mapping.Properties? Properties { get; set; } @@ -56,6 +62,7 @@ public RankFeaturesPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private IDictionary? MetaValue { get; set; } + private bool? PositiveScoreImpactValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } public RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) @@ -70,15 +77,15 @@ public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Fields(Action> configure) + public RankFeaturesPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,27 +97,36 @@ public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } + public RankFeaturesPropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Properties(Action> configure) + public RankFeaturesPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -143,6 +159,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -160,6 +182,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, + PositiveScoreImpact = PositiveScoreImpactValue, Properties = PropertiesValue }; } @@ -176,6 +199,7 @@ public RankFeaturesPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private IDictionary? MetaValue { get; set; } + private bool? PositiveScoreImpactValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } public RankFeaturesPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) @@ -190,15 +214,15 @@ public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappi return Self; } - public RankFeaturesPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Fields(Action> configure) + public RankFeaturesPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,27 +234,36 @@ public RankFeaturesPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public RankFeaturesPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } + public RankFeaturesPropertyDescriptor PositiveScoreImpact(bool? positiveScoreImpact = true) + { + PositiveScoreImpactValue = positiveScoreImpact; + return Self; + } + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; return Self; } - public RankFeaturesPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public RankFeaturesPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public RankFeaturesPropertyDescriptor Properties(Action> configure) + public RankFeaturesPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -263,6 +296,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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"); @@ -280,6 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, Meta = MetaValue, + PositiveScoreImpact = PositiveScoreImpactValue, Properties = PropertiesValue }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs index 95168f075f2..ed20ae6796d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs @@ -81,9 +81,9 @@ public RuntimeFieldDescriptor() : base() } private ICollection? FetchFieldsValue { get; set; } - private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } - private Action> FetchFieldsDescriptorAction { get; set; } - private Action>[] FetchFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } + private Action> FetchFieldsDescriptorAction { get; set; } + private Action>[] FetchFieldsDescriptorActions { get; set; } private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Field? InputFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -103,7 +103,7 @@ public RuntimeFieldDescriptor FetchFields(ICollection FetchFields(RuntimeFieldFetchFieldsDescriptor descriptor) + public RuntimeFieldDescriptor FetchFields(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor descriptor) { FetchFieldsValue = null; FetchFieldsDescriptorAction = null; @@ -112,7 +112,7 @@ public RuntimeFieldDescriptor FetchFields(RuntimeFieldFetchFieldsDesc return Self; } - public RuntimeFieldDescriptor FetchFields(Action> configure) + public RuntimeFieldDescriptor FetchFields(Action> configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -121,7 +121,7 @@ public RuntimeFieldDescriptor FetchFields(Action FetchFields(params Action>[] configure) + public RuntimeFieldDescriptor FetchFields(params Action>[] configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -157,6 +157,15 @@ public RuntimeFieldDescriptor InputField(Expression + /// For type `lookup` + ///
+ public RuntimeFieldDescriptor InputField(Expression> inputField) + { + InputFieldValue = inputField; + return Self; + } + /// /// Painless script executed at query time. /// @@ -184,6 +193,15 @@ public RuntimeFieldDescriptor TargetField(Expression + /// For type `lookup` + ///
+ public RuntimeFieldDescriptor TargetField(Expression> targetField) + { + TargetFieldValue = targetField; + return Self; + } + /// /// For type `lookup` /// @@ -216,7 +234,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fetch_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FetchFieldsDescriptorActions is not null) @@ -225,7 +243,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FetchFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor(action), options); } writer.WriteEndArray(); @@ -281,9 +299,9 @@ public RuntimeFieldDescriptor() : base() } private ICollection? FetchFieldsValue { get; set; } - private RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } - private Action FetchFieldsDescriptorAction { get; set; } - private Action[] FetchFieldsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor FetchFieldsDescriptor { get; set; } + private Action FetchFieldsDescriptorAction { get; set; } + private Action[] FetchFieldsDescriptorActions { get; set; } private string? FormatValue { get; set; } private Elastic.Clients.Elasticsearch.Field? InputFieldValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -303,7 +321,7 @@ public RuntimeFieldDescriptor FetchFields(ICollection configure) + public RuntimeFieldDescriptor FetchFields(Action configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -321,7 +339,7 @@ public RuntimeFieldDescriptor FetchFields(Action[] configure) + public RuntimeFieldDescriptor FetchFields(params Action[] configure) { FetchFieldsValue = null; FetchFieldsDescriptor = null; @@ -434,7 +452,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("fetch_fields"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor(FetchFieldsDescriptorAction), options); writer.WriteEndArray(); } else if (FetchFieldsDescriptorActions is not null) @@ -443,7 +461,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FetchFieldsDescriptorActions) { - JsonSerializer.Serialize(writer, new RuntimeFieldFetchFieldsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs index f5625d725c7..e541c98952f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs @@ -58,6 +58,12 @@ public RuntimeFieldFetchFieldsDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public RuntimeFieldFetchFieldsDescriptor Format(string? format) { FormatValue = format; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs index d258eaaf8e5..0bf03b234bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class ScaledFloatNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -63,8 +67,16 @@ public sealed partial class ScaledFloatNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -136,15 +148,15 @@ public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Ela return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -168,6 +180,9 @@ public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -192,15 +207,15 @@ public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -230,12 +245,18 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -452,15 +473,15 @@ public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch. return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) + public ScaledFloatNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -484,6 +505,9 @@ public ScaledFloatNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ScaledFloatNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -508,15 +532,15 @@ public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsea return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) + public ScaledFloatNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -546,12 +570,18 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs index 10158a85fb5..ce9c71e6272 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs @@ -45,6 +45,10 @@ public sealed partial class SearchAsYouTypeProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptions { get; set; } [JsonInclude, JsonPropertyName("max_shingle_size")] public int? MaxShingleSize { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -115,15 +119,15 @@ public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elast return Self; } - public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShing return Self; } + /// + /// Metadata about the field. + /// public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.E return Self; } - public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -389,15 +396,15 @@ public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public SearchAsYouTypePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Fields(Action> configure) + public SearchAsYouTypePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -427,6 +434,9 @@ public SearchAsYouTypePropertyDescriptor MaxShingleSize(int? maxShingleSize) return Self; } + /// + /// Metadata about the field. + /// public SearchAsYouTypePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -445,15 +455,15 @@ public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public SearchAsYouTypePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SearchAsYouTypePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SearchAsYouTypePropertyDescriptor Properties(Action> configure) + public SearchAsYouTypePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs index 682bd85fb60..771b77ef556 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs @@ -29,6 +29,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; /// /// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapeProperty : IProperty { @@ -48,6 +49,10 @@ public sealed partial class ShapeProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("ignore_z_value")] public bool? IgnoreZValue { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("orientation")] @@ -65,6 +70,7 @@ public sealed partial class ShapeProperty : IProperty /// /// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapePropertyDescriptor : SerializableDescriptor>, IBuildableDescriptor { @@ -118,15 +124,15 @@ public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.M return Self; } - public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Fields(Action> configure) + public ShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -150,6 +156,9 @@ public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true return Self; } + /// + /// Metadata about the field. + /// public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -168,15 +177,15 @@ public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsear return Self; } - public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Properties(Action> configure) + public ShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -300,6 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o /// /// The `shape` data type facilitates the indexing of and searching with arbitrary `x, y` cartesian shapes such as
rectangles and polygons.
+/// Learn more about this API in the Elasticsearch documentation. ///
public sealed partial class ShapePropertyDescriptor : SerializableDescriptor, IBuildableDescriptor { @@ -353,15 +363,15 @@ public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Prop return Self; } - public ShapePropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Fields(Action> configure) + public ShapePropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -385,6 +395,9 @@ public ShapePropertyDescriptor IgnoreZValue(bool? ignoreZValue = true) return Self; } + /// + /// Metadata about the field. + /// public ShapePropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -403,15 +416,15 @@ public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping. return Self; } - public ShapePropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShapePropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShapePropertyDescriptor Properties(Action> configure) + public ShapePropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs index 03308e52a4f..857658c3521 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs @@ -47,10 +47,14 @@ public sealed partial class ShortNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] - public double? NullValue { get; set; } + public short? NullValue { get; set; } [JsonInclude, JsonPropertyName("on_script_error")] public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -61,8 +65,16 @@ public sealed partial class ShortNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -88,7 +100,7 @@ public ShortNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private short? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -133,15 +145,15 @@ public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticse return Self; } - public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Fields(Action> configure) + public ShortNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,13 +177,16 @@ public ShortNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ShortNumberPropertyDescriptor NullValue(double? nullValue) + public ShortNumberPropertyDescriptor NullValue(short? nullValue) { NullValueValue = nullValue; return Self; @@ -189,15 +204,15 @@ public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elast return Self; } - public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Properties(Action> configure) + public ShortNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -296,10 +317,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) @@ -390,7 +411,7 @@ public ShortNumberPropertyDescriptor() : base() private bool? IgnoreMalformedValue { get; set; } private bool? IndexValue { get; set; } private IDictionary? MetaValue { get; set; } - private double? NullValueValue { get; set; } + private short? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -435,15 +456,15 @@ public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappin return Self; } - public ShortNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Fields(Action> configure) + public ShortNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,13 +488,16 @@ public ShortNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public ShortNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); return Self; } - public ShortNumberPropertyDescriptor NullValue(double? nullValue) + public ShortNumberPropertyDescriptor NullValue(short? nullValue) { NullValueValue = nullValue; return Self; @@ -491,15 +515,15 @@ public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Ma return Self; } - public ShortNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public ShortNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public ShortNumberPropertyDescriptor Properties(Action> configure) + public ShortNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -598,10 +628,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MetaValue, options); } - if (NullValueValue is not null) + if (NullValueValue.HasValue) { writer.WritePropertyName("null_value"); - JsonSerializer.Serialize(writer, NullValueValue, options); + writer.WriteNumberValue(NullValueValue.Value); } if (OnScriptErrorValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs index 9813b414160..50497331563 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs @@ -35,6 +35,10 @@ public sealed partial class SparseVectorProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -70,15 +74,15 @@ public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elastics return Self; } - public SparseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Fields(Action> configure) + public SparseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -90,6 +94,9 @@ public SparseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public SparseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -102,15 +109,15 @@ public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elas return Self; } - public SparseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Properties(Action> configure) + public SparseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -190,15 +197,15 @@ public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mappi return Self; } - public SparseVectorPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Fields(Action> configure) + public SparseVectorPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -210,6 +217,9 @@ public SparseVectorPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public SparseVectorPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -222,15 +232,15 @@ public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.M return Self; } - public SparseVectorPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public SparseVectorPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public SparseVectorPropertyDescriptor Properties(Action> configure) + public SparseVectorPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs index 7c144f4534f..b5734ee7257 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs @@ -34,7 +34,7 @@ public sealed partial class SuggestContext [JsonInclude, JsonPropertyName("path")] public Elastic.Clients.Elasticsearch.Field? Path { get; set; } [JsonInclude, JsonPropertyName("precision")] - public Union? Precision { get; set; } + public object? Precision { get; set; } [JsonInclude, JsonPropertyName("type")] public string Type { get; set; } } @@ -49,7 +49,7 @@ public SuggestContextDescriptor() : base() private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - private Union? PrecisionValue { get; set; } + private object? PrecisionValue { get; set; } private string TypeValue { get; set; } public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Name name) @@ -70,7 +70,13 @@ public SuggestContextDescriptor Path(Expression Precision(Union? precision) + public SuggestContextDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + + public SuggestContextDescriptor Precision(object? precision) { PrecisionValue = precision; return Self; @@ -115,7 +121,7 @@ public SuggestContextDescriptor() : base() private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } private Elastic.Clients.Elasticsearch.Field? PathValue { get; set; } - private Union? PrecisionValue { get; set; } + private object? PrecisionValue { get; set; } private string TypeValue { get; set; } public SuggestContextDescriptor Name(Elastic.Clients.Elasticsearch.Name name) @@ -142,7 +148,7 @@ public SuggestContextDescriptor Path(Expression? precision) + public SuggestContextDescriptor Precision(object? precision) { PrecisionValue = precision; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs index f55e55ce94d..5284b0a7a8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs @@ -35,7 +35,7 @@ public sealed partial class TextIndexPrefixes public int MinChars { get; set; } } -public sealed partial class TextIndexPrefixesDescriptor : SerializableDescriptor, IBuildableDescriptor +public sealed partial class TextIndexPrefixesDescriptor : SerializableDescriptor { internal TextIndexPrefixesDescriptor(Action configure) => configure.Invoke(this); @@ -67,10 +67,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o 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/_Generated/Types/Mapping/TextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs index 09d7d583b81..6fd45a2d632 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs @@ -55,6 +55,10 @@ public sealed partial class TextProperty : IProperty public bool? IndexPhrases { get; set; } [JsonInclude, JsonPropertyName("index_prefixes")] public Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixes { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("norms")] @@ -93,16 +97,16 @@ public TextPropertyDescriptor() : base() private bool? EagerGlobalOrdinalsValue { get; set; } private bool? FielddataValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter? FielddataFrequencyFilterValue { get; set; } - private IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } - private Action FielddataFrequencyFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } + private Action FielddataFrequencyFilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptionsValue { get; set; } private bool? IndexPhrasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } - private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } - private Action IndexPrefixesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } private int? PositionIncrementGapValue { get; set; } @@ -157,7 +161,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Client return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor descriptor) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptorAction = null; @@ -165,7 +169,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagemen return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptor = null; @@ -179,15 +183,15 @@ public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Ma return Self; } - public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Fields(Action> configure) + public TextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -225,7 +229,7 @@ public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticse return Self; } - public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -233,7 +237,7 @@ public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescript return Self; } - public TextPropertyDescriptor IndexPrefixes(Action configure) + public TextPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -241,6 +245,9 @@ public TextPropertyDescriptor IndexPrefixes(Action + /// Metadata about the field. + ///
public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -265,15 +272,15 @@ public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearc return Self; } - public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Properties(Action> configure) + public TextPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -356,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataFrequencyFilterDescriptorAction is not null) { writer.WritePropertyName("fielddata_frequency_filter"); - JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); } else if (FielddataFrequencyFilterValue is not null) { @@ -402,7 +409,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -476,15 +483,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataFrequencyFilterValue; } - if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataFrequencyFilterDescriptorAction is not null) { - var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -500,15 +507,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -559,16 +566,16 @@ public TextPropertyDescriptor() : base() private bool? EagerGlobalOrdinalsValue { get; set; } private bool? FielddataValue { get; set; } private Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter? FielddataFrequencyFilterValue { get; set; } - private IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } - private Action FielddataFrequencyFilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor FielddataFrequencyFilterDescriptor { get; set; } + private Action FielddataFrequencyFilterDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } private bool? IndexValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.IndexOptions? IndexOptionsValue { get; set; } private bool? IndexPhrasesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes? IndexPrefixesValue { get; set; } - private TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } - private Action IndexPrefixesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor IndexPrefixesDescriptor { get; set; } + private Action IndexPrefixesDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NormsValue { get; set; } private int? PositionIncrementGapValue { get; set; } @@ -623,7 +630,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticse return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.FielddataFrequencyFilterDescriptor descriptor) + public TextPropertyDescriptor FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor descriptor) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptorAction = null; @@ -631,7 +638,7 @@ public TextPropertyDescriptor FielddataFrequencyFilter(IndexManagement.Fielddata return Self; } - public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) + public TextPropertyDescriptor FielddataFrequencyFilter(Action configure) { FielddataFrequencyFilterValue = null; FielddataFrequencyFilterDescriptor = null; @@ -645,15 +652,15 @@ public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Prope return Self; } - public TextPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Fields(Action> configure) + public TextPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -691,7 +698,7 @@ public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Mappin return Self; } - public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descriptor) + public TextPropertyDescriptor IndexPrefixes(Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor descriptor) { IndexPrefixesValue = null; IndexPrefixesDescriptorAction = null; @@ -699,7 +706,7 @@ public TextPropertyDescriptor IndexPrefixes(TextIndexPrefixesDescriptor descript return Self; } - public TextPropertyDescriptor IndexPrefixes(Action configure) + public TextPropertyDescriptor IndexPrefixes(Action configure) { IndexPrefixesValue = null; IndexPrefixesDescriptor = null; @@ -707,6 +714,9 @@ public TextPropertyDescriptor IndexPrefixes(Action return Self; } + /// + /// Metadata about the field. + /// public TextPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -731,15 +741,15 @@ public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public TextPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TextPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TextPropertyDescriptor Properties(Action> configure) + public TextPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -822,7 +832,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FielddataFrequencyFilterDescriptorAction is not null) { writer.WritePropertyName("fielddata_frequency_filter"); - JsonSerializer.Serialize(writer, new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction), options); } else if (FielddataFrequencyFilterValue is not null) { @@ -868,7 +878,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexPrefixesDescriptorAction is not null) { writer.WritePropertyName("index_prefixes"); - JsonSerializer.Serialize(writer, new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction), options); } else if (IndexPrefixesValue is not null) { @@ -942,15 +952,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return FielddataFrequencyFilterValue; } - if (FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) + if ((object)FielddataFrequencyFilterDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (FielddataFrequencyFilterDescriptorAction is not null) { - var descriptor = new IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterDescriptor(FielddataFrequencyFilterDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } @@ -966,15 +976,15 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o return IndexPrefixesValue; } - if (IndexPrefixesDescriptor is IBuildableDescriptor buildable) + if ((object)IndexPrefixesDescriptor is IBuildableDescriptor buildable) { return buildable.Build(); } if (IndexPrefixesDescriptorAction is not null) { - var descriptor = new TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); - if (descriptor is IBuildableDescriptor buildableFromAction) + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesDescriptor(IndexPrefixesDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) { return buildableFromAction.Build(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs index 3b50c9e718c..b99e9ac7262 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class TokenCountProperty : IProperty public int? IgnoreAbove { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -127,15 +131,15 @@ public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsea return Self; } - public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Fields(Action> configure) + public TokenCountPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -153,6 +157,9 @@ public TokenCountPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -171,15 +178,15 @@ public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasti return Self; } - public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Properties(Action> configure) + public TokenCountPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -373,15 +380,15 @@ public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping return Self; } - public TokenCountPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Fields(Action> configure) + public TokenCountPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -399,6 +406,9 @@ public TokenCountPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public TokenCountPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -417,15 +427,15 @@ public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Map return Self; } - public TokenCountPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public TokenCountPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TokenCountPropertyDescriptor Properties(Action> configure) + public TokenCountPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs index 2230421e84b..ced1bb98c0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs @@ -29,20 +29,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping; public sealed partial class TypeMapping { - [JsonInclude, JsonPropertyName("_data_stream_timestamp")] - public Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp? DataStreamTimestamp { get; set; } - [JsonInclude, JsonPropertyName("_field_names")] - public Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNames { get; set; } - [JsonInclude, JsonPropertyName("_meta")] - public IDictionary? Meta { get; set; } - [JsonInclude, JsonPropertyName("_routing")] - public Elastic.Clients.Elasticsearch.Mapping.RoutingField? Routing { get; set; } - [JsonInclude, JsonPropertyName("_size")] - public Elastic.Clients.Elasticsearch.Mapping.SizeField? Size { get; set; } - [JsonInclude, JsonPropertyName("_source")] - public Elastic.Clients.Elasticsearch.Mapping.SourceField? Source { get; set; } [JsonInclude, JsonPropertyName("all_field")] public Elastic.Clients.Elasticsearch.Mapping.AllField? AllField { get; set; } + [JsonInclude, JsonPropertyName("_data_stream_timestamp")] + public Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp? DataStreamTimestamp { get; set; } [JsonInclude, JsonPropertyName("date_detection")] public bool? DateDetection { get; set; } [JsonInclude, JsonPropertyName("dynamic")] @@ -53,14 +43,24 @@ public sealed partial class TypeMapping public ICollection>? DynamicTemplates { get; set; } [JsonInclude, JsonPropertyName("enabled")] public bool? Enabled { get; set; } + [JsonInclude, JsonPropertyName("_field_names")] + public Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNames { get; set; } [JsonInclude, JsonPropertyName("index_field")] public Elastic.Clients.Elasticsearch.Mapping.IndexField? IndexField { get; set; } + [JsonInclude, JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("numeric_detection")] public bool? NumericDetection { get; set; } [JsonInclude, JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + [JsonInclude, JsonPropertyName("_routing")] + public Elastic.Clients.Elasticsearch.Mapping.RoutingField? Routing { get; set; } [JsonInclude, JsonPropertyName("runtime")] public IDictionary? Runtime { get; set; } + [JsonInclude, JsonPropertyName("_size")] + public Elastic.Clients.Elasticsearch.Mapping.SizeField? Size { get; set; } + [JsonInclude, JsonPropertyName("_source")] + public Elastic.Clients.Elasticsearch.Mapping.SourceField? Source { get; set; } [JsonInclude, JsonPropertyName("subobjects")] public bool? Subobjects { get; set; } } @@ -74,35 +74,35 @@ public TypeMappingDescriptor() : base() } private Elastic.Clients.Elasticsearch.Mapping.AllField? AllFieldValue { get; set; } - private AllFieldDescriptor AllFieldDescriptor { get; set; } - private Action AllFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp? DataStreamTimestampValue { get; set; } - private DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } - private Action DataStreamTimestampDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { get; set; } private bool? DateDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private bool? EnabledValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.IndexField? IndexFieldValue { get; set; } - private IndexFieldDescriptor IndexFieldDescriptor { get; set; } - private Action IndexFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.RoutingField? RoutingValue { get; set; } - private RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary> RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SizeField? SizeValue { get; set; } - private SizeFieldDescriptor SizeDescriptor { get; set; } - private Action SizeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor SizeDescriptor { get; set; } + private Action SizeDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SourceField? SourceValue { get; set; } - private SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } private bool? SubobjectsValue { get; set; } public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Mapping.AllField? allField) @@ -113,7 +113,7 @@ public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.M return Self; } - public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor descriptor) { AllFieldValue = null; AllFieldDescriptorAction = null; @@ -121,7 +121,7 @@ public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor AllField(Action configure) + public TypeMappingDescriptor AllField(Action configure) { AllFieldValue = null; AllFieldDescriptor = null; @@ -137,7 +137,7 @@ public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elas return Self; } - public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor descriptor) { DataStreamTimestampValue = null; DataStreamTimestampDescriptorAction = null; @@ -145,7 +145,7 @@ public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampD return Self; } - public TypeMappingDescriptor DataStreamTimestamp(Action configure) + public TypeMappingDescriptor DataStreamTimestamp(Action configure) { DataStreamTimestampValue = null; DataStreamTimestampDescriptor = null; @@ -191,7 +191,7 @@ public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -199,7 +199,7 @@ public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor des return Self; } - public TypeMappingDescriptor FieldNames(Action configure) + public TypeMappingDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -215,7 +215,7 @@ public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor descriptor) { IndexFieldValue = null; IndexFieldDescriptorAction = null; @@ -223,7 +223,7 @@ public TypeMappingDescriptor IndexField(IndexFieldDescriptor descript return Self; } - public TypeMappingDescriptor IndexField(Action configure) + public TypeMappingDescriptor IndexField(Action configure) { IndexFieldValue = null; IndexFieldDescriptor = null; @@ -249,15 +249,15 @@ public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch return Self; } - public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TypeMappingDescriptor Properties(Action> configure) + public TypeMappingDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -271,7 +271,7 @@ public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Ma return Self; } - public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -279,7 +279,7 @@ public TypeMappingDescriptor Routing(RoutingFieldDescriptor descripto return Self; } - public TypeMappingDescriptor Routing(Action configure) + public TypeMappingDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -287,9 +287,9 @@ public TypeMappingDescriptor Routing(Action c return Self; } - public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + public TypeMappingDescriptor Runtime(Func>, FluentDescriptorDictionary>> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary>()); return Self; } @@ -301,7 +301,7 @@ public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Mappi return Self; } - public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor descriptor) { SizeValue = null; SizeDescriptorAction = null; @@ -309,7 +309,7 @@ public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Size(Action configure) + public TypeMappingDescriptor Size(Action configure) { SizeValue = null; SizeDescriptor = null; @@ -325,7 +325,7 @@ public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Map return Self; } - public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -333,7 +333,7 @@ public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Source(Action configure) + public TypeMappingDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -358,7 +358,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllFieldDescriptorAction is not null) { writer.WritePropertyName("all_field"); - JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor(AllFieldDescriptorAction), options); } else if (AllFieldValue is not null) { @@ -374,7 +374,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamTimestampDescriptorAction is not null) { writer.WritePropertyName("_data_stream_timestamp"); - JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); } else if (DataStreamTimestampValue is not null) { @@ -420,7 +420,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -436,7 +436,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFieldDescriptorAction is not null) { writer.WritePropertyName("index_field"); - JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor(IndexFieldDescriptorAction), options); } else if (IndexFieldValue is not null) { @@ -470,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -492,7 +492,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SizeDescriptorAction is not null) { writer.WritePropertyName("_size"); - JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor(SizeDescriptorAction), options); } else if (SizeValue is not null) { @@ -508,7 +508,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { @@ -535,35 +535,35 @@ public TypeMappingDescriptor() : base() } private Elastic.Clients.Elasticsearch.Mapping.AllField? AllFieldValue { get; set; } - private AllFieldDescriptor AllFieldDescriptor { get; set; } - private Action AllFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor AllFieldDescriptor { get; set; } + private Action AllFieldDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp? DataStreamTimestampValue { get; set; } - private DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } - private Action DataStreamTimestampDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor DataStreamTimestampDescriptor { get; set; } + private Action DataStreamTimestampDescriptorAction { get; set; } private bool? DateDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } private ICollection? DynamicDateFormatsValue { get; set; } private ICollection>? DynamicTemplatesValue { get; set; } private bool? EnabledValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.FieldNamesField? FieldNamesValue { get; set; } - private FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } - private Action FieldNamesDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor FieldNamesDescriptor { get; set; } + private Action FieldNamesDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.IndexField? IndexFieldValue { get; set; } - private IndexFieldDescriptor IndexFieldDescriptor { get; set; } - private Action IndexFieldDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor IndexFieldDescriptor { get; set; } + private Action IndexFieldDescriptorAction { get; set; } private IDictionary? MetaValue { get; set; } private bool? NumericDetectionValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.RoutingField? RoutingValue { get; set; } - private RoutingFieldDescriptor RoutingDescriptor { get; set; } - private Action RoutingDescriptorAction { get; set; } - private IDictionary? RuntimeValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor RoutingDescriptor { get; set; } + private Action RoutingDescriptorAction { get; set; } + private IDictionary RuntimeValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SizeField? SizeValue { get; set; } - private SizeFieldDescriptor SizeDescriptor { get; set; } - private Action SizeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor SizeDescriptor { get; set; } + private Action SizeDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Mapping.SourceField? SourceValue { get; set; } - private SourceFieldDescriptor SourceDescriptor { get; set; } - private Action SourceDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor SourceDescriptor { get; set; } + private Action SourceDescriptorAction { get; set; } private bool? SubobjectsValue { get; set; } public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Mapping.AllField? allField) @@ -574,7 +574,7 @@ public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Mapping.AllF return Self; } - public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) + public TypeMappingDescriptor AllField(Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor descriptor) { AllFieldValue = null; AllFieldDescriptorAction = null; @@ -582,7 +582,7 @@ public TypeMappingDescriptor AllField(AllFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor AllField(Action configure) + public TypeMappingDescriptor AllField(Action configure) { AllFieldValue = null; AllFieldDescriptor = null; @@ -598,7 +598,7 @@ public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.M return Self; } - public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor descriptor) + public TypeMappingDescriptor DataStreamTimestamp(Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor descriptor) { DataStreamTimestampValue = null; DataStreamTimestampDescriptorAction = null; @@ -606,7 +606,7 @@ public TypeMappingDescriptor DataStreamTimestamp(DataStreamTimestampDescriptor d return Self; } - public TypeMappingDescriptor DataStreamTimestamp(Action configure) + public TypeMappingDescriptor DataStreamTimestamp(Action configure) { DataStreamTimestampValue = null; DataStreamTimestampDescriptor = null; @@ -652,7 +652,7 @@ public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapping.Fi return Self; } - public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) + public TypeMappingDescriptor FieldNames(Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor descriptor) { FieldNamesValue = null; FieldNamesDescriptorAction = null; @@ -660,7 +660,7 @@ public TypeMappingDescriptor FieldNames(FieldNamesFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor FieldNames(Action configure) + public TypeMappingDescriptor FieldNames(Action configure) { FieldNamesValue = null; FieldNamesDescriptor = null; @@ -676,7 +676,7 @@ public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Mapping.In return Self; } - public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) + public TypeMappingDescriptor IndexField(Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor descriptor) { IndexFieldValue = null; IndexFieldDescriptorAction = null; @@ -684,7 +684,7 @@ public TypeMappingDescriptor IndexField(IndexFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor IndexField(Action configure) + public TypeMappingDescriptor IndexField(Action configure) { IndexFieldValue = null; IndexFieldDescriptor = null; @@ -710,15 +710,15 @@ public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public TypeMappingDescriptor Properties(PropertiesDescriptor descriptor) + public TypeMappingDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public TypeMappingDescriptor Properties(Action> configure) + public TypeMappingDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -732,7 +732,7 @@ public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping.Routi return Self; } - public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) + public TypeMappingDescriptor Routing(Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor descriptor) { RoutingValue = null; RoutingDescriptorAction = null; @@ -740,7 +740,7 @@ public TypeMappingDescriptor Routing(RoutingFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Routing(Action configure) + public TypeMappingDescriptor Routing(Action configure) { RoutingValue = null; RoutingDescriptor = null; @@ -748,9 +748,9 @@ public TypeMappingDescriptor Routing(Action configure) return Self; } - public TypeMappingDescriptor Runtime(Func, FluentDictionary> selector) + public TypeMappingDescriptor Runtime(Func, FluentDescriptorDictionary> selector) { - RuntimeValue = selector?.Invoke(new FluentDictionary()); + RuntimeValue = selector?.Invoke(new FluentDescriptorDictionary()); return Self; } @@ -762,7 +762,7 @@ public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Mapping.SizeFiel return Self; } - public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) + public TypeMappingDescriptor Size(Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor descriptor) { SizeValue = null; SizeDescriptorAction = null; @@ -770,7 +770,7 @@ public TypeMappingDescriptor Size(SizeFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Size(Action configure) + public TypeMappingDescriptor Size(Action configure) { SizeValue = null; SizeDescriptor = null; @@ -786,7 +786,7 @@ public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Mapping.Source return Self; } - public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) + public TypeMappingDescriptor Source(Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor descriptor) { SourceValue = null; SourceDescriptorAction = null; @@ -794,7 +794,7 @@ public TypeMappingDescriptor Source(SourceFieldDescriptor descriptor) return Self; } - public TypeMappingDescriptor Source(Action configure) + public TypeMappingDescriptor Source(Action configure) { SourceValue = null; SourceDescriptor = null; @@ -819,7 +819,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (AllFieldDescriptorAction is not null) { writer.WritePropertyName("all_field"); - JsonSerializer.Serialize(writer, new AllFieldDescriptor(AllFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor(AllFieldDescriptorAction), options); } else if (AllFieldValue is not null) { @@ -835,7 +835,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (DataStreamTimestampDescriptorAction is not null) { writer.WritePropertyName("_data_stream_timestamp"); - JsonSerializer.Serialize(writer, new DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampDescriptor(DataStreamTimestampDescriptorAction), options); } else if (DataStreamTimestampValue is not null) { @@ -881,7 +881,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FieldNamesDescriptorAction is not null) { writer.WritePropertyName("_field_names"); - JsonSerializer.Serialize(writer, new FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldDescriptor(FieldNamesDescriptorAction), options); } else if (FieldNamesValue is not null) { @@ -897,7 +897,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IndexFieldDescriptorAction is not null) { writer.WritePropertyName("index_field"); - JsonSerializer.Serialize(writer, new IndexFieldDescriptor(IndexFieldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.IndexFieldDescriptor(IndexFieldDescriptorAction), options); } else if (IndexFieldValue is not null) { @@ -931,7 +931,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (RoutingDescriptorAction is not null) { writer.WritePropertyName("_routing"); - JsonSerializer.Serialize(writer, new RoutingFieldDescriptor(RoutingDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.RoutingFieldDescriptor(RoutingDescriptorAction), options); } else if (RoutingValue is not null) { @@ -953,7 +953,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SizeDescriptorAction is not null) { writer.WritePropertyName("_size"); - JsonSerializer.Serialize(writer, new SizeFieldDescriptor(SizeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SizeFieldDescriptor(SizeDescriptorAction), options); } else if (SizeValue is not null) { @@ -969,7 +969,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SourceDescriptorAction is not null) { writer.WritePropertyName("_source"); - JsonSerializer.Serialize(writer, new SourceFieldDescriptor(SourceDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Mapping.SourceFieldDescriptor(SourceDescriptorAction), options); } else if (SourceValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs index c952310b4cc..290d235b46a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs @@ -47,6 +47,10 @@ public sealed partial class UnsignedLongNumberProperty : IProperty public bool? IgnoreMalformed { get; set; } [JsonInclude, JsonPropertyName("index")] public bool? Index { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -61,8 +65,16 @@ public sealed partial class UnsignedLongNumberProperty : IProperty 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; } + + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// [JsonInclude, JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -133,15 +145,15 @@ public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.El return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -165,6 +177,9 @@ public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -189,15 +204,15 @@ public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Client return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -221,12 +236,18 @@ public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public UnsignedLongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -435,15 +456,15 @@ public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) + public UnsignedLongNumberPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -467,6 +488,9 @@ public UnsignedLongNumberPropertyDescriptor Index(bool? index = true) return Self; } + /// + /// Metadata about the field. + /// public UnsignedLongNumberPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -491,15 +515,15 @@ public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) + public UnsignedLongNumberPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -523,12 +547,18 @@ public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public UnsignedLongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) { TimeSeriesDimensionValue = timeSeriesDimension; return Self; } + /// + /// For internal use by Elastic only. Marks the field as a time series dimension. Defaults to false. + /// public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs index d42f21fc4a4..b04d5bb927f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class VersionProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("properties")] @@ -94,15 +98,15 @@ public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Fields(Action> configure) + public VersionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -114,6 +118,9 @@ public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -126,15 +133,15 @@ public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticse return Self; } - public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Properties(Action> configure) + public VersionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -270,15 +277,15 @@ public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Pr return Self; } - public VersionPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Fields(Action> configure) + public VersionPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -290,6 +297,9 @@ public VersionPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public VersionPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -302,15 +312,15 @@ public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappin return Self; } - public VersionPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public VersionPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public VersionPropertyDescriptor Properties(Action> configure) + public VersionPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs index 3469cbf742b..5f71a6ea621 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs @@ -39,6 +39,10 @@ public sealed partial class WildcardProperty : IProperty public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } [JsonInclude, JsonPropertyName("ignore_above")] public int? IgnoreAbove { get; set; } + + /// + /// Metadata about the field. + /// [JsonInclude, JsonPropertyName("meta")] public IDictionary? Meta { get; set; } [JsonInclude, JsonPropertyName("null_value")] @@ -97,15 +101,15 @@ public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearc return Self; } - public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Fields(Action> configure) + public WildcardPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -117,6 +121,9 @@ public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -135,15 +142,15 @@ public WildcardPropertyDescriptor Properties(Elastic.Clients.Elastics return Self; } - public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Properties(Action> configure) + public WildcardPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; @@ -287,15 +294,15 @@ public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.P return Self; } - public WildcardPropertyDescriptor Fields(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { FieldsValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Fields(Action> configure) + public WildcardPropertyDescriptor Fields(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); FieldsValue = descriptor.PromisedValue; return Self; @@ -307,6 +314,9 @@ public WildcardPropertyDescriptor IgnoreAbove(int? ignoreAbove) return Self; } + /// + /// Metadata about the field. + /// public WildcardPropertyDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -325,15 +335,15 @@ public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mappi return Self; } - public WildcardPropertyDescriptor Properties(PropertiesDescriptor descriptor) + public WildcardPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor descriptor) { PropertiesValue = descriptor.PromisedValue; return Self; } - public WildcardPropertyDescriptor Properties(Action> configure) + public WildcardPropertyDescriptor Properties(Action> configure) { - var descriptor = new PropertiesDescriptor(); + var descriptor = new Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor(); configure?.Invoke(descriptor); PropertiesValue = descriptor.PromisedValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigCreate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigCreate.g.cs deleted file mode 100644 index 4d0468a6da0..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigCreate.g.cs +++ /dev/null @@ -1,345 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.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.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigCreate("classification", classificationInferenceOptions); - public static InferenceConfigCreate FillMask(Elastic.Clients.Elasticsearch.Ml.FillMaskInferenceOptions fillMaskInferenceOptions) => new InferenceConfigCreate("fill_mask", fillMaskInferenceOptions); - public static InferenceConfigCreate Ner(Elastic.Clients.Elasticsearch.Ml.NerInferenceOptions nerInferenceOptions) => new InferenceConfigCreate("ner", nerInferenceOptions); - public static InferenceConfigCreate PassThrough(Elastic.Clients.Elasticsearch.Ml.PassThroughInferenceOptions passThroughInferenceOptions) => new InferenceConfigCreate("pass_through", passThroughInferenceOptions); - public static InferenceConfigCreate QuestionAnswering(Elastic.Clients.Elasticsearch.Ml.QuestionAnsweringInferenceOptions questionAnsweringInferenceOptions) => new InferenceConfigCreate("question_answering", questionAnsweringInferenceOptions); - public static InferenceConfigCreate Regression(Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigCreate("regression", regressionInferenceOptions); - public static InferenceConfigCreate TextClassification(Elastic.Clients.Elasticsearch.Ml.TextClassificationInferenceOptions textClassificationInferenceOptions) => new InferenceConfigCreate("text_classification", textClassificationInferenceOptions); - public static InferenceConfigCreate TextEmbedding(Elastic.Clients.Elasticsearch.Ml.TextEmbeddingInferenceOptions textEmbeddingInferenceOptions) => new InferenceConfigCreate("text_embedding", textEmbeddingInferenceOptions); - public static InferenceConfigCreate TextExpansion(Elastic.Clients.Elasticsearch.Ml.TextExpansionInferenceOptions textExpansionInferenceOptions) => new InferenceConfigCreate("text_expansion", textExpansionInferenceOptions); - public static InferenceConfigCreate ZeroShotClassification(Elastic.Clients.Elasticsearch.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.Ml.ClassificationInferenceOptions)value.Variant, options); - break; - case "fill_mask": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.FillMaskInferenceOptions)value.Variant, options); - break; - case "ner": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.NerInferenceOptions)value.Variant, options); - break; - case "pass_through": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.PassThroughInferenceOptions)value.Variant, options); - break; - case "question_answering": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.QuestionAnsweringInferenceOptions)value.Variant, options); - break; - case "regression": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions)value.Variant, options); - break; - case "text_classification": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextClassificationInferenceOptions)value.Variant, options); - break; - case "text_embedding": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextEmbeddingInferenceOptions)value.Variant, options); - break; - case "text_expansion": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextExpansionInferenceOptions)value.Variant, options); - break; - case "zero_shot_classification": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.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/_Generated/Types/Ml/InferenceConfigUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigUpdate.g.cs deleted file mode 100644 index 884c79b963a..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/InferenceConfigUpdate.g.cs +++ /dev/null @@ -1,342 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.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.Ml.ClassificationInferenceOptions classificationInferenceOptions) => new InferenceConfigUpdate("classification", classificationInferenceOptions); - public static InferenceConfigUpdate FillMask(Elastic.Clients.Elasticsearch.Ml.FillMaskInferenceUpdateOptions fillMaskInferenceUpdateOptions) => new InferenceConfigUpdate("fill_mask", fillMaskInferenceUpdateOptions); - public static InferenceConfigUpdate Ner(Elastic.Clients.Elasticsearch.Ml.NerInferenceUpdateOptions nerInferenceUpdateOptions) => new InferenceConfigUpdate("ner", nerInferenceUpdateOptions); - public static InferenceConfigUpdate PassThrough(Elastic.Clients.Elasticsearch.Ml.PassThroughInferenceUpdateOptions passThroughInferenceUpdateOptions) => new InferenceConfigUpdate("pass_through", passThroughInferenceUpdateOptions); - public static InferenceConfigUpdate QuestionAnswering(Elastic.Clients.Elasticsearch.Ml.QuestionAnsweringInferenceUpdateOptions questionAnsweringInferenceUpdateOptions) => new InferenceConfigUpdate("question_answering", questionAnsweringInferenceUpdateOptions); - public static InferenceConfigUpdate Regression(Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions regressionInferenceOptions) => new InferenceConfigUpdate("regression", regressionInferenceOptions); - public static InferenceConfigUpdate TextClassification(Elastic.Clients.Elasticsearch.Ml.TextClassificationInferenceUpdateOptions textClassificationInferenceUpdateOptions) => new InferenceConfigUpdate("text_classification", textClassificationInferenceUpdateOptions); - public static InferenceConfigUpdate TextEmbedding(Elastic.Clients.Elasticsearch.Ml.TextEmbeddingInferenceUpdateOptions textEmbeddingInferenceUpdateOptions) => new InferenceConfigUpdate("text_embedding", textEmbeddingInferenceUpdateOptions); - public static InferenceConfigUpdate TextExpansion(Elastic.Clients.Elasticsearch.Ml.TextExpansionInferenceUpdateOptions textExpansionInferenceUpdateOptions) => new InferenceConfigUpdate("text_expansion", textExpansionInferenceUpdateOptions); - public static InferenceConfigUpdate ZeroShotClassification(Elastic.Clients.Elasticsearch.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.Ml.ClassificationInferenceOptions)value.Variant, options); - break; - case "fill_mask": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.FillMaskInferenceUpdateOptions)value.Variant, options); - break; - case "ner": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.NerInferenceUpdateOptions)value.Variant, options); - break; - case "pass_through": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.PassThroughInferenceUpdateOptions)value.Variant, options); - break; - case "question_answering": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.QuestionAnsweringInferenceUpdateOptions)value.Variant, options); - break; - case "regression": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.RegressionInferenceOptions)value.Variant, options); - break; - case "text_classification": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextClassificationInferenceUpdateOptions)value.Variant, options); - break; - case "text_embedding": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextEmbeddingInferenceUpdateOptions)value.Variant, options); - break; - case "text_expansion": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.TextExpansionInferenceUpdateOptions)value.Variant, options); - break; - case "zero_shot_classification": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.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/_Generated/Types/Ml/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TokenizationConfig.g.cs deleted file mode 100644 index 4dc775c014d..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ml/TokenizationConfig.g.cs +++ /dev/null @@ -1,239 +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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Elastic.Clients.Elasticsearch.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.Ml.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("bert", nlpBertTokenizationConfig); - public static TokenizationConfig Mpnet(Elastic.Clients.Elasticsearch.Ml.NlpBertTokenizationConfig nlpBertTokenizationConfig) => new TokenizationConfig("mpnet", nlpBertTokenizationConfig); - public static TokenizationConfig Roberta(Elastic.Clients.Elasticsearch.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.Ml.NlpBertTokenizationConfig)value.Variant, options); - break; - case "mpnet": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Ml.NlpBertTokenizationConfig)value.Variant, options); - break; - case "roberta": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.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/_Generated/Types/NestedSortValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs index eb9c499b142..155c4903a9d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs @@ -48,12 +48,12 @@ public NestedSortValueDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field PathValue { get; set; } public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) @@ -64,7 +64,7 @@ public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch return Self; } - public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -72,7 +72,7 @@ public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor Filter(Action> configure) + public NestedSortValueDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -94,7 +94,7 @@ public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch return Self; } - public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -102,7 +102,7 @@ public NestedSortValueDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public NestedSortValueDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -122,6 +122,12 @@ public NestedSortValueDescriptor Path(Expression Path(Expression> path) + { + PathValue = path; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -133,7 +139,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -155,7 +161,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -178,12 +184,12 @@ public NestedSortValueDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.Query? FilterValue { get; set; } - private QueryDsl.QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field PathValue { get; set; } public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Query? filter) @@ -194,7 +200,7 @@ public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.Q return Self; } - public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) + public NestedSortValueDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -202,7 +208,7 @@ public NestedSortValueDescriptor Filter(QueryDsl.QueryDescriptor descriptor) return Self; } - public NestedSortValueDescriptor Filter(Action configure) + public NestedSortValueDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -224,7 +230,7 @@ public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSort return Self; } - public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) + public NestedSortValueDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -232,7 +238,7 @@ public NestedSortValueDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public NestedSortValueDescriptor Nested(Action configure) + public NestedSortValueDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -269,7 +275,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDsl.QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -291,7 +297,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs index 5ddb7b4b44f..5621406094b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs @@ -30,7 +30,7 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class NodeShard { [JsonInclude, JsonPropertyName("allocation_id")] - public IReadOnlyDictionary? AllocationId { get; init; } + public IReadOnlyDictionary? AllocationId { get; init; } [JsonInclude, JsonPropertyName("index")] public string Index { get; init; } [JsonInclude, JsonPropertyName("node")] @@ -38,7 +38,7 @@ public sealed partial class NodeShard [JsonInclude, JsonPropertyName("primary")] public bool Primary { get; init; } [JsonInclude, JsonPropertyName("recovery_source")] - public IReadOnlyDictionary? RecoverySource { get; init; } + public IReadOnlyDictionary? RecoverySource { get; init; } [JsonInclude, JsonPropertyName("relocating_node")] public string? RelocatingNode { get; init; } [JsonInclude, JsonPropertyName("relocation_failure_info")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs new file mode 100644 index 00000000000..105ffb588c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class AdaptiveSelection +{ + /// + /// The exponentially weighted moving average queue size of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_queue_size")] + public long? AvgQueueSize { get; init; } + + /// + /// The exponentially weighted moving average response time of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_response_time")] + public Elastic.Clients.Elasticsearch.Duration? AvgResponseTime { get; init; } + + /// + /// The exponentially weighted moving average response time, in nanoseconds, of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_response_time_ns")] + public long? AvgResponseTimeNs { get; init; } + + /// + /// The exponentially weighted moving average service time of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_service_time")] + public Elastic.Clients.Elasticsearch.Duration? AvgServiceTime { get; init; } + + /// + /// The exponentially weighted moving average service time, in nanoseconds, of search requests on the keyed node. + /// + [JsonInclude, JsonPropertyName("avg_service_time_ns")] + public long? AvgServiceTimeNs { get; init; } + + /// + /// The number of outstanding search requests to the keyed node from the node these stats are for. + /// + [JsonInclude, JsonPropertyName("outgoing_searches")] + public long? OutgoingSearches { get; init; } + + /// + /// The rank of this node; used for shard selection when routing search requests. + /// + [JsonInclude, JsonPropertyName("rank")] + public string? Rank { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs new file mode 100644 index 00000000000..b6f17421a7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Breaker +{ + /// + /// Estimated memory used for the operation. + /// + [JsonInclude, JsonPropertyName("estimated_size")] + public string? EstimatedSize { get; init; } + + /// + /// Estimated memory used, in bytes, for the operation. + /// + [JsonInclude, JsonPropertyName("estimated_size_in_bytes")] + public long? EstimatedSizeInBytes { get; init; } + + /// + /// Memory limit for the circuit breaker. + /// + [JsonInclude, JsonPropertyName("limit_size")] + public string? LimitSize { get; init; } + + /// + /// Memory limit, in bytes, for the circuit breaker. + /// + [JsonInclude, JsonPropertyName("limit_size_in_bytes")] + public long? LimitSizeInBytes { get; init; } + + /// + /// A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. + /// + [JsonInclude, JsonPropertyName("overhead")] + public float? Overhead { get; init; } + + /// + /// Total number of times the circuit breaker has been triggered and prevented an out of memory error. + /// + [JsonInclude, JsonPropertyName("tripped")] + public float? Tripped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs new file mode 100644 index 00000000000..620c586977d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Cgroup +{ + /// + /// Contains statistics about `cpu` control group for the node. + /// + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Nodes.CgroupCpu? Cpu { get; init; } + + /// + /// Contains statistics about `cpuacct` control group for the node. + /// + [JsonInclude, JsonPropertyName("cpuacct")] + public Elastic.Clients.Elasticsearch.Nodes.CpuAcct? Cpuacct { get; init; } + + /// + /// Contains statistics about the memory control group for the node. + /// + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Nodes.CgroupMemory? Memory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs new file mode 100644 index 00000000000..c3bc00e45bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class CgroupCpu +{ + /// + /// The period of time, in microseconds, for how regularly all tasks in the same cgroup as the Elasticsearch process should have their access to CPU resources reallocated. + /// + [JsonInclude, JsonPropertyName("cfs_period_micros")] + public int? CfsPeriodMicros { get; init; } + + /// + /// The total amount of time, in microseconds, for which all tasks in the same cgroup as the Elasticsearch process can run during one period `cfs_period_micros`. + /// + [JsonInclude, JsonPropertyName("cfs_quota_micros")] + public int? CfsQuotaMicros { get; init; } + + /// + /// The `cpu` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// Contains CPU statistics for the node. + /// + [JsonInclude, JsonPropertyName("stat")] + public Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat? Stat { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs new file mode 100644 index 00000000000..1788bf6f558 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class CgroupCpuStat +{ + /// + /// The number of reporting periods (as specified by `cfs_period_micros`) that have elapsed. + /// + [JsonInclude, JsonPropertyName("number_of_elapsed_periods")] + public long? NumberOfElapsedPeriods { get; init; } + + /// + /// The number of times all tasks in the same cgroup as the Elasticsearch process have been throttled. + /// + [JsonInclude, JsonPropertyName("number_of_times_throttled")] + public long? NumberOfTimesThrottled { get; init; } + + /// + /// The total amount of time, in nanoseconds, for which all tasks in the same cgroup as the Elasticsearch process have been throttled. + /// + [JsonInclude, JsonPropertyName("time_throttled_nanos")] + public long? TimeThrottledNanos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs new file mode 100644 index 00000000000..4841426b25f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class CgroupMemory +{ + /// + /// The `memory` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// The maximum amount of user memory (including file cache) allowed for all tasks in the same cgroup as the Elasticsearch process.
This value can be too big to store in a `long`, so is returned as a string so that the value returned can exactly match what the underlying operating system interface returns.
Any value that is too large to parse into a `long` almost certainly means no limit has been set for the cgroup.
+ ///
+ [JsonInclude, JsonPropertyName("limit_in_bytes")] + public string? LimitInBytes { get; init; } + + /// + /// The total current memory usage by processes in the cgroup, in bytes, by all tasks in the same cgroup as the Elasticsearch process.
This value is stored as a string for consistency with `limit_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("usage_in_bytes")] + public string? UsageInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs new file mode 100644 index 00000000000..db12ac86d73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Client +{ + /// + /// Reported agent for the HTTP client.
If unavailable, this property is not included in the response.
+ ///
+ [JsonInclude, JsonPropertyName("agent")] + public string? Agent { get; init; } + + /// + /// Time at which the client closed the connection if the connection is closed. + /// + [JsonInclude, JsonPropertyName("closed_time_millis")] + public long? ClosedTimeMillis { get; init; } + + /// + /// Unique ID for the HTTP client. + /// + [JsonInclude, JsonPropertyName("id")] + public long? Id { get; init; } + + /// + /// Time of the most recent request from this client. + /// + [JsonInclude, JsonPropertyName("last_request_time_millis")] + public long? LastRequestTimeMillis { get; init; } + + /// + /// The URI of the client’s most recent request. + /// + [JsonInclude, JsonPropertyName("last_uri")] + public string? LastUri { get; init; } + + /// + /// Local address for the HTTP connection. + /// + [JsonInclude, JsonPropertyName("local_address")] + public string? LocalAddress { get; init; } + + /// + /// Time at which the client opened the connection. + /// + [JsonInclude, JsonPropertyName("opened_time_millis")] + public long? OpenedTimeMillis { get; init; } + + /// + /// Remote address for the HTTP connection. + /// + [JsonInclude, JsonPropertyName("remote_address")] + public string? RemoteAddress { get; init; } + + /// + /// Number of requests from this client. + /// + [JsonInclude, JsonPropertyName("request_count")] + public long? RequestCount { get; init; } + + /// + /// Cumulative size in bytes of all requests from this client. + /// + [JsonInclude, JsonPropertyName("request_size_bytes")] + public long? RequestSizeBytes { get; init; } + + /// + /// Value from the client’s `x-opaque-id` HTTP header.
If unavailable, this property is not included in the response.
+ ///
+ [JsonInclude, JsonPropertyName("x_opaque_id")] + public string? XOpaqueId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs new file mode 100644 index 00000000000..184ca339b8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ClusterAppliedStats +{ + [JsonInclude, JsonPropertyName("recordings")] + public IReadOnlyCollection? Recordings { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs new file mode 100644 index 00000000000..79e05da95f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ClusterStateQueue +{ + /// + /// Number of committed cluster states in queue. + /// + [JsonInclude, JsonPropertyName("committed")] + public long? Committed { get; init; } + + /// + /// Number of pending cluster states in queue. + /// + [JsonInclude, JsonPropertyName("pending")] + public long? Pending { get; init; } + + /// + /// Total number of cluster states in queue. + /// + [JsonInclude, JsonPropertyName("total")] + public long? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs new file mode 100644 index 00000000000..f06209c153c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ClusterStateUpdate +{ + /// + /// The cumulative amount of time spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master. + /// + [JsonInclude, JsonPropertyName("commit_time")] + public Elastic.Clients.Elasticsearch.Duration? CommitTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to commit, which measures the time from the start of each publication until a majority of the master-eligible nodes have written the state to disk and confirmed the write to the elected master. + /// + [JsonInclude, JsonPropertyName("commit_time_millis")] + public long? CommitTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state. + /// + [JsonInclude, JsonPropertyName("completion_time")] + public Elastic.Clients.Elasticsearch.Duration? CompletionTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent waiting for a successful cluster state update to complete, which measures the time from the start of each publication until all the other nodes have notified the elected master that they have applied the cluster state. + /// + [JsonInclude, JsonPropertyName("completion_time_millis")] + public long? CompletionTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent computing no-op cluster state updates since the node started. + /// + [JsonInclude, JsonPropertyName("computation_time")] + public Elastic.Clients.Elasticsearch.Duration? ComputationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent computing no-op cluster state updates since the node started. + /// + [JsonInclude, JsonPropertyName("computation_time_millis")] + public long? ComputationTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent constructing a publication context since the node started for publications that ultimately succeeded.
This statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference.
+ ///
+ [JsonInclude, JsonPropertyName("context_construction_time")] + public Elastic.Clients.Elasticsearch.Duration? ContextConstructionTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent constructing a publication context since the node started for publications that ultimately succeeded.
This statistic includes the time spent computing the difference between the current and new cluster state preparing a serialized representation of this difference.
+ ///
+ [JsonInclude, JsonPropertyName("context_construction_time_millis")] + public long? ContextConstructionTimeMillis { get; init; } + + /// + /// The number of cluster state update attempts that did not change the cluster state since the node started. + /// + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + + /// + /// The cumulative amount of time spent successfully applying cluster state updates on the elected master since the node started. + /// + [JsonInclude, JsonPropertyName("master_apply_time")] + public Elastic.Clients.Elasticsearch.Duration? MasterApplyTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent successfully applying cluster state updates on the elected master since the node started. + /// + [JsonInclude, JsonPropertyName("master_apply_time_millis")] + public long? MasterApplyTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent notifying listeners of a no-op cluster state update since the node started. + /// + [JsonInclude, JsonPropertyName("notification_time")] + public Elastic.Clients.Elasticsearch.Duration? NotificationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent notifying listeners of a no-op cluster state update since the node started. + /// + [JsonInclude, JsonPropertyName("notification_time_millis")] + public long? NotificationTimeMillis { get; init; } + + /// + /// The cumulative amount of time spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.
This includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`.
+ ///
+ [JsonInclude, JsonPropertyName("publication_time")] + public Elastic.Clients.Elasticsearch.Duration? PublicationTime { get; init; } + + /// + /// The cumulative amount of time, in milliseconds, spent publishing cluster state updates which ultimately succeeded, which includes everything from the start of the publication (just after the computation of the new cluster state) until the publication has finished and the master node is ready to start processing the next state update.
This includes the time measured by `context_construction_time`, `commit_time`, `completion_time` and `master_apply_time`.
+ ///
+ [JsonInclude, JsonPropertyName("publication_time_millis")] + public long? PublicationTimeMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs new file mode 100644 index 00000000000..0a2e66b9b87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Context +{ + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + [JsonInclude, JsonPropertyName("context")] + public string? Context2 { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs new file mode 100644 index 00000000000..42ccf0f102b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Cpu +{ + [JsonInclude, JsonPropertyName("load_average")] + public IReadOnlyDictionary? LoadAverage { get; init; } + [JsonInclude, JsonPropertyName("percent")] + public int? Percent { get; init; } + [JsonInclude, JsonPropertyName("sys")] + public Elastic.Clients.Elasticsearch.Duration? Sys { get; init; } + [JsonInclude, JsonPropertyName("sys_in_millis")] + public long? SysInMillis { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Duration? Total { get; init; } + [JsonInclude, JsonPropertyName("total_in_millis")] + public long? TotalInMillis { get; init; } + [JsonInclude, JsonPropertyName("user")] + public Elastic.Clients.Elasticsearch.Duration? User { get; init; } + [JsonInclude, JsonPropertyName("user_in_millis")] + public long? UserInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs new file mode 100644 index 00000000000..a9952445cf7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class CpuAcct +{ + /// + /// The `cpuacct` control group to which the Elasticsearch process belongs. + /// + [JsonInclude, JsonPropertyName("control_group")] + public string? ControlGroup { get; init; } + + /// + /// The total CPU time, in nanoseconds, consumed by all tasks in the same cgroup as the Elasticsearch process. + /// + [JsonInclude, JsonPropertyName("usage_nanos")] + public long? UsageNanos { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs new file mode 100644 index 00000000000..24497306b61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class DataPathStats +{ + /// + /// Total amount of disk space available to this Java virtual machine on this file store. + /// + [JsonInclude, JsonPropertyName("available")] + public string? Available { get; init; } + + /// + /// Total number of bytes available to this Java virtual machine on this file store. + /// + [JsonInclude, JsonPropertyName("available_in_bytes")] + public long? AvailableInBytes { get; init; } + [JsonInclude, JsonPropertyName("disk_queue")] + public string? DiskQueue { get; init; } + [JsonInclude, JsonPropertyName("disk_reads")] + public long? DiskReads { get; init; } + [JsonInclude, JsonPropertyName("disk_read_size")] + public string? DiskReadSize { get; init; } + [JsonInclude, JsonPropertyName("disk_read_size_in_bytes")] + public long? DiskReadSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("disk_writes")] + public long? DiskWrites { get; init; } + [JsonInclude, JsonPropertyName("disk_write_size")] + public string? DiskWriteSize { get; init; } + [JsonInclude, JsonPropertyName("disk_write_size_in_bytes")] + public long? DiskWriteSizeInBytes { get; init; } + + /// + /// Total amount of unallocated disk space in the file store. + /// + [JsonInclude, JsonPropertyName("free")] + public string? Free { get; init; } + + /// + /// Total number of unallocated bytes in the file store. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Mount point of the file store (for example: `/dev/sda2`). + /// + [JsonInclude, JsonPropertyName("mount")] + public string? Mount { get; init; } + + /// + /// Path to the file store. + /// + [JsonInclude, JsonPropertyName("path")] + public string? Path { get; init; } + + /// + /// Total size of the file store. + /// + [JsonInclude, JsonPropertyName("total")] + public string? Total { get; init; } + + /// + /// Total size of the file store in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + + /// + /// Type of the file store (ex: ext4). + /// + [JsonInclude, JsonPropertyName("type")] + public string? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs new file mode 100644 index 00000000000..dd91cb8eef7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class DeprecationIndexing +{ + [JsonInclude, JsonPropertyName("enabled")] + public object Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs new file mode 100644 index 00000000000..b76b08f3157 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Discovery +{ + [JsonInclude, JsonPropertyName("cluster_applier_stats")] + public Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats? ClusterApplierStats { get; init; } + + /// + /// Contains statistics for the cluster state queue of the node. + /// + [JsonInclude, JsonPropertyName("cluster_state_queue")] + public Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue? ClusterStateQueue { get; init; } + + /// + /// Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master.
Omitted if the node is not master-eligible.
Every field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`.
The human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter.
+ ///
+ [JsonInclude, JsonPropertyName("cluster_state_update")] + public IReadOnlyDictionary? ClusterStateUpdate { get; init; } + + /// + /// Contains statistics for the published cluster states of the node. + /// + [JsonInclude, JsonPropertyName("published_cluster_states")] + public Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates? PublishedClusterStates { get; init; } + [JsonInclude, JsonPropertyName("serialized_cluster_states")] + public Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState? SerializedClusterStates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs new file mode 100644 index 00000000000..f12a133b96f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ExtendedMemoryStats +{ + /// + /// If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.
Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public long? AdjustedTotalInBytes { get; init; } + + /// + /// Amount of free physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Percentage of free memory. + /// + [JsonInclude, JsonPropertyName("free_percent")] + public int? FreePercent { get; init; } + [JsonInclude, JsonPropertyName("resident")] + public string? Resident { get; init; } + [JsonInclude, JsonPropertyName("resident_in_bytes")] + public long? ResidentInBytes { get; init; } + [JsonInclude, JsonPropertyName("share")] + public string? Share { get; init; } + [JsonInclude, JsonPropertyName("share_in_bytes")] + public long? ShareInBytes { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_virtual")] + public string? TotalVirtual { get; init; } + [JsonInclude, JsonPropertyName("total_virtual_in_bytes")] + public long? TotalVirtualInBytes { get; init; } + + /// + /// Amount of used physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } + + /// + /// Percentage of used memory. + /// + [JsonInclude, JsonPropertyName("used_percent")] + public int? UsedPercent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs new file mode 100644 index 00000000000..d08d5047a24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class FileSystem +{ + /// + /// List of all file stores. + /// + [JsonInclude, JsonPropertyName("data")] + public IReadOnlyCollection? Data { get; init; } + + /// + /// Contains I/O statistics for the node. + /// + [JsonInclude, JsonPropertyName("io_stats")] + public Elastic.Clients.Elasticsearch.Nodes.IoStats? IoStats { get; init; } + + /// + /// Last time the file stores statistics were refreshed.
Recorded in milliseconds since the Unix Epoch.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Contains statistics for all file stores of the node. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs new file mode 100644 index 00000000000..c59517edcdc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class FileSystemTotal +{ + /// + /// Total disk space available to this Java virtual machine on all file stores.
Depending on OS or process level restrictions, this might appear less than `free`.
This is the actual amount of free disk space the Elasticsearch node can utilise.
+ ///
+ [JsonInclude, JsonPropertyName("available")] + public string? Available { get; init; } + + /// + /// Total number of bytes available to this Java virtual machine on all file stores.
Depending on OS or process level restrictions, this might appear less than `free_in_bytes`.
This is the actual amount of free disk space the Elasticsearch node can utilise.
+ ///
+ [JsonInclude, JsonPropertyName("available_in_bytes")] + public long? AvailableInBytes { get; init; } + + /// + /// Total unallocated disk space in all file stores. + /// + [JsonInclude, JsonPropertyName("free")] + public string? Free { get; init; } + + /// + /// Total number of unallocated bytes in all file stores. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + + /// + /// Total size of all file stores. + /// + [JsonInclude, JsonPropertyName("total")] + public string? Total { get; init; } + + /// + /// Total size of all file stores in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs new file mode 100644 index 00000000000..b3ac6237096 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class GarbageCollector +{ + /// + /// Contains statistics about JVM garbage collectors for the node. + /// + [JsonInclude, JsonPropertyName("collectors")] + public IReadOnlyDictionary? Collectors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs new file mode 100644 index 00000000000..96cea5fcc94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class GarbageCollectorTotal +{ + /// + /// Total number of JVM garbage collectors that collect objects. + /// + [JsonInclude, JsonPropertyName("collection_count")] + public long? CollectionCount { get; init; } + + /// + /// Total time spent by JVM collecting objects. + /// + [JsonInclude, JsonPropertyName("collection_time")] + public string? CollectionTime { get; init; } + + /// + /// Total time, in milliseconds, spent by JVM collecting objects. + /// + [JsonInclude, JsonPropertyName("collection_time_in_millis")] + public long? CollectionTimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HotThread.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HotThread.g.cs new file mode 100644 index 00000000000..227961e3922 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HotThread.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class HotThread +{ + [JsonInclude, JsonPropertyName("hosts")] + public IReadOnlyCollection Hosts { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string NodeId { get; init; } + [JsonInclude, JsonPropertyName("node_name")] + public string NodeName { get; init; } + [JsonInclude, JsonPropertyName("threads")] + public IReadOnlyCollection Threads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs new file mode 100644 index 00000000000..34df5d0074c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Http +{ + /// + /// Information on current and recently-closed HTTP client connections.
Clients that have been closed longer than the `http.client_stats.closed_channels.max_age` setting will not be represented here.
+ ///
+ [JsonInclude, JsonPropertyName("clients")] + public IReadOnlyCollection? Clients { get; init; } + + /// + /// Current number of open HTTP connections for the node. + /// + [JsonInclude, JsonPropertyName("current_open")] + public int? CurrentOpen { get; init; } + + /// + /// Total number of HTTP connections opened for the node. + /// + [JsonInclude, JsonPropertyName("total_opened")] + public long? TotalOpened { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs new file mode 100644 index 00000000000..fa323ab808e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class IndexingPressure +{ + /// + /// Contains statistics for memory consumption from indexing load. + /// + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory? Memory { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs new file mode 100644 index 00000000000..9cb87559847 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class IndexingPressureMemory +{ + /// + /// Contains statistics for current indexing load. + /// + [JsonInclude, JsonPropertyName("current")] + public Elastic.Clients.Elasticsearch.Nodes.PressureMemory? Current { get; init; } + + /// + /// Configured memory limit for the indexing requests.
Replica requests have an automatic limit that is 1.5x this value.
+ ///
+ [JsonInclude, JsonPropertyName("limit")] + public Elastic.Clients.Elasticsearch.ByteSize? Limit { get; init; } + + /// + /// Configured memory limit, in bytes, for the indexing requests.
Replica requests have an automatic limit that is 1.5x this value.
+ ///
+ [JsonInclude, JsonPropertyName("limit_in_bytes")] + public long? LimitInBytes { get; init; } + + /// + /// Contains statistics for the cumulative indexing load since the node started. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Nodes.PressureMemory? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs new file mode 100644 index 00000000000..35c707a3545 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Ingest +{ + /// + /// Contains statistics about ingest pipelines for the node. + /// + [JsonInclude, JsonPropertyName("pipelines")] + public IReadOnlyDictionary? Pipelines { get; init; } + + /// + /// Contains statistics about ingest operations for the node. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Nodes.IngestTotal? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs new file mode 100644 index 00000000000..341a68b1d31 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class IngestTotal +{ + /// + /// Total number of documents ingested during the lifetime of this node. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Total number of documents currently being ingested. + /// + [JsonInclude, JsonPropertyName("current")] + public long? Current { get; init; } + + /// + /// Total number of failed ingest operations during the lifetime of this node. + /// + [JsonInclude, JsonPropertyName("failed")] + public long? Failed { get; init; } + + /// + /// Total number of ingest processors. + /// + [JsonInclude, JsonPropertyName("processors")] + public IReadOnlyCollection>? Processors { get; init; } + + /// + /// Total time, in milliseconds, spent preprocessing ingest documents during the lifetime of this node. + /// + [JsonInclude, JsonPropertyName("time_in_millis")] + public long? TimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs new file mode 100644 index 00000000000..d8f676bd24b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class IoStatDevice +{ + /// + /// The Linux device name. + /// + [JsonInclude, JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// The total number of read and write operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("operations")] + public long? Operations { get; init; } + + /// + /// The total number of kilobytes read for the device since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("read_kilobytes")] + public long? ReadKilobytes { get; init; } + + /// + /// The total number of read operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("read_operations")] + public long? ReadOperations { get; init; } + + /// + /// The total number of kilobytes written for the device since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("write_kilobytes")] + public long? WriteKilobytes { get; init; } + + /// + /// The total number of write operations for the device completed since starting Elasticsearch. + /// + [JsonInclude, JsonPropertyName("write_operations")] + public long? WriteOperations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs new file mode 100644 index 00000000000..2fe727493b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class IoStats +{ + /// + /// Array of disk metrics for each device that is backing an Elasticsearch data path.
These disk metrics are probed periodically and averages between the last probe and the current probe are computed.
+ ///
+ [JsonInclude, JsonPropertyName("devices")] + public IReadOnlyCollection? Devices { get; init; } + + /// + /// The sum of the disk metrics for all devices that back an Elasticsearch data path. + /// + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Nodes.IoStatDevice? Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs new file mode 100644 index 00000000000..6f9a26a0998 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Jvm +{ + /// + /// Contains statistics about JVM buffer pools for the node. + /// + [JsonInclude, JsonPropertyName("buffer_pools")] + public IReadOnlyDictionary? BufferPools { get; init; } + + /// + /// Contains statistics about classes loaded by JVM for the node. + /// + [JsonInclude, JsonPropertyName("classes")] + public Elastic.Clients.Elasticsearch.Nodes.JvmClasses? Classes { get; init; } + + /// + /// Contains statistics about JVM garbage collectors for the node. + /// + [JsonInclude, JsonPropertyName("gc")] + public Elastic.Clients.Elasticsearch.Nodes.GarbageCollector? Gc { get; init; } + + /// + /// Contains JVM memory usage statistics for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats? Mem { get; init; } + + /// + /// Contains statistics about JVM thread usage for the node. + /// + [JsonInclude, JsonPropertyName("threads")] + public Elastic.Clients.Elasticsearch.Nodes.JvmThreads? Threads { get; init; } + + /// + /// Last time JVM statistics were refreshed. + /// + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Human-readable JVM uptime.
Only returned if the `human` query parameter is `true`.
+ ///
+ [JsonInclude, JsonPropertyName("uptime")] + public string? Uptime { get; init; } + + /// + /// JVM uptime in milliseconds. + /// + [JsonInclude, JsonPropertyName("uptime_in_millis")] + public long? UptimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs new file mode 100644 index 00000000000..77153bc70ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class JvmClasses +{ + /// + /// Number of classes currently loaded by JVM. + /// + [JsonInclude, JsonPropertyName("current_loaded_count")] + public long? CurrentLoadedCount { get; init; } + + /// + /// Total number of classes loaded since the JVM started. + /// + [JsonInclude, JsonPropertyName("total_loaded_count")] + public long? TotalLoadedCount { get; init; } + + /// + /// Total number of classes unloaded since the JVM started. + /// + [JsonInclude, JsonPropertyName("total_unloaded_count")] + public long? TotalUnloadedCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs new file mode 100644 index 00000000000..6809efc55d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class JvmMemoryStats +{ + /// + /// Amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_committed_in_bytes")] + public long? HeapCommittedInBytes { get; init; } + + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public long? HeapMaxInBytes { get; init; } + + /// + /// Memory, in bytes, currently in use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_used_in_bytes")] + public long? HeapUsedInBytes { get; init; } + + /// + /// Percentage of memory currently in use by the heap. + /// + [JsonInclude, JsonPropertyName("heap_used_percent")] + public long? HeapUsedPercent { get; init; } + + /// + /// Amount of non-heap memory available, in bytes. + /// + [JsonInclude, JsonPropertyName("non_heap_committed_in_bytes")] + public long? NonHeapCommittedInBytes { get; init; } + + /// + /// Non-heap memory used, in bytes. + /// + [JsonInclude, JsonPropertyName("non_heap_used_in_bytes")] + public long? NonHeapUsedInBytes { get; init; } + + /// + /// Contains statistics about heap memory usage for the node. + /// + [JsonInclude, JsonPropertyName("pools")] + public IReadOnlyDictionary? Pools { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs new file mode 100644 index 00000000000..ff3fc323221 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class JvmThreads +{ + /// + /// Number of active threads in use by JVM. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Highest number of threads used by JVM. + /// + [JsonInclude, JsonPropertyName("peak_count")] + public long? PeakCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs new file mode 100644 index 00000000000..4660b5cfb13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class KeyedProcessor +{ + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Nodes.Processor? Stats { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs new file mode 100644 index 00000000000..9b6c205af7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class MemoryStats +{ + /// + /// If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes.
Otherwise it reports the same value as `total_in_bytes`.
+ ///
+ [JsonInclude, JsonPropertyName("adjusted_total_in_bytes")] + public long? AdjustedTotalInBytes { get; init; } + + /// + /// Amount of free physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("free_in_bytes")] + public long? FreeInBytes { get; init; } + [JsonInclude, JsonPropertyName("resident")] + public string? Resident { get; init; } + [JsonInclude, JsonPropertyName("resident_in_bytes")] + public long? ResidentInBytes { get; init; } + [JsonInclude, JsonPropertyName("share")] + public string? Share { get; init; } + [JsonInclude, JsonPropertyName("share_in_bytes")] + public long? ShareInBytes { get; init; } + + /// + /// Total amount of physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long? TotalInBytes { get; init; } + [JsonInclude, JsonPropertyName("total_virtual")] + public string? TotalVirtual { get; init; } + [JsonInclude, JsonPropertyName("total_virtual_in_bytes")] + public long? TotalVirtualInBytes { get; init; } + + /// + /// Amount of used physical memory in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs new file mode 100644 index 00000000000..ef9f23d75f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeBufferPool +{ + /// + /// Number of buffer pools. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Total capacity of buffer pools. + /// + [JsonInclude, JsonPropertyName("total_capacity")] + public string? TotalCapacity { get; init; } + + /// + /// Total capacity of buffer pools in bytes. + /// + [JsonInclude, JsonPropertyName("total_capacity_in_bytes")] + public long? TotalCapacityInBytes { get; init; } + + /// + /// Size of buffer pools. + /// + [JsonInclude, JsonPropertyName("used")] + public string? Used { get; init; } + + /// + /// Size of buffer pools in bytes. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs new file mode 100644 index 00000000000..fb19295124f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfo +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary? Aggregations { get; init; } + [JsonInclude, JsonPropertyName("attributes")] + public IReadOnlyDictionary Attributes { get; init; } + [JsonInclude, JsonPropertyName("build_flavor")] + public string BuildFlavor { get; init; } + + /// + /// Short hash of the last git commit in this release. + /// + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { get; init; } + [JsonInclude, JsonPropertyName("build_type")] + public string BuildType { get; init; } + + /// + /// The node’s host name. + /// + [JsonInclude, JsonPropertyName("host")] + public string Host { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp? Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest? Ingest { get; init; } + + /// + /// The node’s IP address. + /// + [JsonInclude, JsonPropertyName("ip")] + public string Ip { get; init; } + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo? Jvm { get; init; } + [JsonInclude, JsonPropertyName("modules")] + public IReadOnlyCollection? Modules { get; init; } + + /// + /// The node's name + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("network")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoNetwork? Network { get; init; } + [JsonInclude, JsonPropertyName("os")] + public Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo? Os { get; init; } + [JsonInclude, JsonPropertyName("plugins")] + public IReadOnlyCollection? Plugins { get; init; } + [JsonInclude, JsonPropertyName("process")] + public Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo? Process { get; init; } + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection Roles { get; init; } + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings? Settings { get; init; } + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { get; init; } + + /// + /// Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings. + /// + [JsonInclude, JsonPropertyName("total_indexing_buffer")] + public long? TotalIndexingBuffer { get; init; } + + /// + /// Same as total_indexing_buffer, but expressed in bytes. + /// + [JsonInclude, JsonPropertyName("total_indexing_buffer_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize? TotalIndexingBufferInBytes { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport? Transport { get; init; } + + /// + /// Host and port where transport HTTP connections are accepted. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string TransportAddress { get; init; } + + /// + /// Elasticsearch version running on this node. + /// + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs new file mode 100644 index 00000000000..2d64c1b9ea5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoAction +{ + [JsonInclude, JsonPropertyName("destructive_requires_name")] + public string DestructiveRequiresName { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs new file mode 100644 index 00000000000..73b52c6e3f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoAggregation +{ + [JsonInclude, JsonPropertyName("types")] + public IReadOnlyCollection Types { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs new file mode 100644 index 00000000000..50c4955a934 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoBootstrap +{ + [JsonInclude, JsonPropertyName("memory_lock")] + public string MemoryLock { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs new file mode 100644 index 00000000000..f064476a3f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoClient +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs new file mode 100644 index 00000000000..34de7e15206 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +internal sealed partial class NodeInfoDiscoverConverter : JsonConverter +{ + public override NodeInfoDiscover Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection? seedHosts = default; + IReadOnlyCollection? seedProviders = 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 == "seed_hosts") + { + seedHosts = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "seed_providers") + { + seedProviders = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + + if (property == "type") + { + type = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + additionalProperties ??= new Dictionary(); + var additionalValue = JsonSerializer.Deserialize(ref reader, options); + additionalProperties.Add(property, additionalValue); + } + } + + return new NodeInfoDiscover { SeedHosts = seedHosts, SeedProviders = seedProviders, Settings = additionalProperties, Type = type }; + } + + public override void Write(Utf8JsonWriter writer, NodeInfoDiscover value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NodeInfoDiscover' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NodeInfoDiscoverConverter))] +public sealed partial class NodeInfoDiscover +{ + public IReadOnlyCollection? SeedHosts { get; init; } + public IReadOnlyCollection? SeedProviders { get; init; } + + /// + /// Additional or alternative settings + /// + public IReadOnlyDictionary Settings { get; init; } + public string? Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs new file mode 100644 index 00000000000..2e4ac027378 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoHttp +{ + [JsonInclude, JsonPropertyName("bound_address")] + public IReadOnlyCollection BoundAddress { get; init; } + [JsonInclude, JsonPropertyName("max_content_length")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxContentLength { get; init; } + [JsonInclude, JsonPropertyName("max_content_length_in_bytes")] + public long MaxContentLengthInBytes { get; init; } + [JsonInclude, JsonPropertyName("publish_address")] + public string PublishAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs new file mode 100644 index 00000000000..d9ae0766eee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoIngest +{ + [JsonInclude, JsonPropertyName("processors")] + public IReadOnlyCollection Processors { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs new file mode 100644 index 00000000000..ac4fa4f3c42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoIngestDownloader +{ + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs new file mode 100644 index 00000000000..8044782be08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoIngestInfo +{ + [JsonInclude, JsonPropertyName("downloader")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader Downloader { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs new file mode 100644 index 00000000000..b8f99908cac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoIngestProcessor +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs new file mode 100644 index 00000000000..d8a639e25a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoJvmMemory +{ + [JsonInclude, JsonPropertyName("direct_max")] + public Elastic.Clients.Elasticsearch.ByteSize? DirectMax { get; init; } + [JsonInclude, JsonPropertyName("direct_max_in_bytes")] + public long DirectMaxInBytes { get; init; } + [JsonInclude, JsonPropertyName("heap_init")] + public Elastic.Clients.Elasticsearch.ByteSize? HeapInit { get; init; } + [JsonInclude, JsonPropertyName("heap_init_in_bytes")] + public long HeapInitInBytes { get; init; } + [JsonInclude, JsonPropertyName("heap_max")] + public Elastic.Clients.Elasticsearch.ByteSize? HeapMax { get; init; } + [JsonInclude, JsonPropertyName("heap_max_in_bytes")] + public long HeapMaxInBytes { get; init; } + [JsonInclude, JsonPropertyName("non_heap_init")] + public Elastic.Clients.Elasticsearch.ByteSize? NonHeapInit { get; init; } + [JsonInclude, JsonPropertyName("non_heap_init_in_bytes")] + public long NonHeapInitInBytes { get; init; } + [JsonInclude, JsonPropertyName("non_heap_max")] + public Elastic.Clients.Elasticsearch.ByteSize? NonHeapMax { get; init; } + [JsonInclude, JsonPropertyName("non_heap_max_in_bytes")] + public long NonHeapMaxInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs new file mode 100644 index 00000000000..61395f760b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoMemory +{ + [JsonInclude, JsonPropertyName("total")] + public string Total { get; init; } + [JsonInclude, JsonPropertyName("total_in_bytes")] + public long TotalInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetwork.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetwork.g.cs new file mode 100644 index 00000000000..da1d524b882 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetwork.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoNetwork +{ + [JsonInclude, JsonPropertyName("primary_interface")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoNetworkInterface PrimaryInterface { get; init; } + [JsonInclude, JsonPropertyName("refresh_interval")] + public int RefreshInterval { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetworkInterface.g.cs new file mode 100644 index 00000000000..efb7d96d678 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoNetworkInterface.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoNetworkInterface +{ + [JsonInclude, JsonPropertyName("address")] + public string Address { get; init; } + [JsonInclude, JsonPropertyName("mac_address")] + public string MacAddress { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs new file mode 100644 index 00000000000..d81b65ee069 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoOSCPU +{ + [JsonInclude, JsonPropertyName("cache_size")] + public string CacheSize { get; init; } + [JsonInclude, JsonPropertyName("cache_size_in_bytes")] + public int CacheSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("cores_per_socket")] + public int CoresPerSocket { get; init; } + [JsonInclude, JsonPropertyName("mhz")] + public int Mhz { get; init; } + [JsonInclude, JsonPropertyName("model")] + public string Model { get; init; } + [JsonInclude, JsonPropertyName("total_cores")] + public int TotalCores { get; init; } + [JsonInclude, JsonPropertyName("total_sockets")] + public int TotalSockets { get; init; } + [JsonInclude, JsonPropertyName("vendor")] + public string Vendor { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs new file mode 100644 index 00000000000..036a1efba08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoPath +{ + [JsonInclude, JsonPropertyName("data")] + public IReadOnlyCollection? Data { get; init; } + [JsonInclude, JsonPropertyName("home")] + public string? Home { get; init; } + [JsonInclude, JsonPropertyName("logs")] + public string? Logs { get; init; } + [JsonInclude, JsonPropertyName("repo")] + public IReadOnlyCollection? Repo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs new file mode 100644 index 00000000000..543b865db20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoRepositories +{ + [JsonInclude, JsonPropertyName("url")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl Url { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs new file mode 100644 index 00000000000..8b331278625 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoRepositoriesUrl +{ + [JsonInclude, JsonPropertyName("allowed_urls")] + public string AllowedUrls { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs new file mode 100644 index 00000000000..02ab55c6fd7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoScript +{ + [JsonInclude, JsonPropertyName("allowed_types")] + public string AllowedTypes { get; init; } + [JsonInclude, JsonPropertyName("disable_max_compilations_rate")] + public string DisableMaxCompilationsRate { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs new file mode 100644 index 00000000000..bdd14afe213 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSearch +{ + [JsonInclude, JsonPropertyName("remote")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote Remote { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs new file mode 100644 index 00000000000..7264d9627d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSearchRemote +{ + [JsonInclude, JsonPropertyName("connect")] + public string Connect { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs new file mode 100644 index 00000000000..7d30877163b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettings +{ + [JsonInclude, JsonPropertyName("action")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction? Action { get; init; } + [JsonInclude, JsonPropertyName("bootstrap")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap? Bootstrap { get; init; } + [JsonInclude, JsonPropertyName("client")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient Client { get; init; } + [JsonInclude, JsonPropertyName("cluster")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster Cluster { get; init; } + [JsonInclude, JsonPropertyName("discovery")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover? Discovery { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp Http { get; init; } + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest? Ingest { get; init; } + [JsonInclude, JsonPropertyName("network")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork? Network { get; init; } + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode Node { get; init; } + [JsonInclude, JsonPropertyName("path")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath? Path { get; init; } + [JsonInclude, JsonPropertyName("repositories")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories? Repositories { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript? Script { get; init; } + [JsonInclude, JsonPropertyName("search")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch? Search { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport Transport { get; init; } + [JsonInclude, JsonPropertyName("xpack")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack? Xpack { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs new file mode 100644 index 00000000000..0308d9c0a18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsCluster +{ + [JsonInclude, JsonPropertyName("deprecation_indexing")] + public Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing? DeprecationIndexing { get; init; } + [JsonInclude, JsonPropertyName("election")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection Election { get; init; } + [JsonInclude, JsonPropertyName("initial_master_nodes")] + public IReadOnlyCollection? InitialMasterNodes { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("routing")] + public Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting? Routing { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs new file mode 100644 index 00000000000..7ae65fdafe3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsClusterElection +{ + [JsonInclude, JsonPropertyName("strategy")] + public string Strategy { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs new file mode 100644 index 00000000000..accd4ab886e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsHttp +{ + [JsonInclude, JsonPropertyName("compression")] + public object? Compression { get; init; } + [JsonInclude, JsonPropertyName("port")] + public object? Port { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType Type { get; init; } + [JsonInclude, JsonPropertyName("type.default")] + public string? TypeDefault { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs new file mode 100644 index 00000000000..59254699ab8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsHttpType +{ + [JsonInclude, JsonPropertyName("default")] + public string Default { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs new file mode 100644 index 00000000000..312d3c9ac9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsIngest +{ + [JsonInclude, JsonPropertyName("append")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Append { get; init; } + [JsonInclude, JsonPropertyName("attachment")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Attachment { get; init; } + [JsonInclude, JsonPropertyName("bytes")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Bytes { get; init; } + [JsonInclude, JsonPropertyName("circle")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Circle { get; init; } + [JsonInclude, JsonPropertyName("convert")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Convert { get; init; } + [JsonInclude, JsonPropertyName("csv")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Csv { get; init; } + [JsonInclude, JsonPropertyName("date")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Date { get; init; } + [JsonInclude, JsonPropertyName("date_index_name")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? DateIndexName { get; init; } + [JsonInclude, JsonPropertyName("dissect")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Dissect { get; init; } + [JsonInclude, JsonPropertyName("dot_expander")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? DotExpander { get; init; } + [JsonInclude, JsonPropertyName("drop")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Drop { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Enrich { get; init; } + [JsonInclude, JsonPropertyName("fail")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Fail { get; init; } + [JsonInclude, JsonPropertyName("foreach")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Foreach { get; init; } + [JsonInclude, JsonPropertyName("geoip")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Geoip { get; init; } + [JsonInclude, JsonPropertyName("grok")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Grok { get; init; } + [JsonInclude, JsonPropertyName("gsub")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Gsub { get; init; } + [JsonInclude, JsonPropertyName("inference")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Inference { get; init; } + [JsonInclude, JsonPropertyName("join")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Join { get; init; } + [JsonInclude, JsonPropertyName("json")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Json { get; init; } + [JsonInclude, JsonPropertyName("kv")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Kv { get; init; } + [JsonInclude, JsonPropertyName("lowercase")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Lowercase { get; init; } + [JsonInclude, JsonPropertyName("pipeline")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Pipeline { get; init; } + [JsonInclude, JsonPropertyName("remove")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Remove { get; init; } + [JsonInclude, JsonPropertyName("rename")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Rename { get; init; } + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Script { get; init; } + [JsonInclude, JsonPropertyName("set")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Set { get; init; } + [JsonInclude, JsonPropertyName("set_security_user")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? SetSecurityUser { get; init; } + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Sort { get; init; } + [JsonInclude, JsonPropertyName("split")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Split { get; init; } + [JsonInclude, JsonPropertyName("trim")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Trim { get; init; } + [JsonInclude, JsonPropertyName("uppercase")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? Uppercase { get; init; } + [JsonInclude, JsonPropertyName("urldecode")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? UrlDecode { get; init; } + [JsonInclude, JsonPropertyName("user_agent")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo? UserAgent { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs new file mode 100644 index 00000000000..5d03a211a2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsNetwork +{ + [JsonInclude, JsonPropertyName("host")] + public string Host { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs new file mode 100644 index 00000000000..b80c6e372dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsNode +{ + [JsonInclude, JsonPropertyName("attr")] + public IReadOnlyDictionary Attr { get; init; } + [JsonInclude, JsonPropertyName("max_local_storage_nodes")] + public string? MaxLocalStorageNodes { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs new file mode 100644 index 00000000000..d4d6f35146e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsTransport +{ + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures? Features { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType Type { get; init; } + [JsonInclude, JsonPropertyName("type.default")] + public string? TypeDefault { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs new file mode 100644 index 00000000000..2cf50228502 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsTransportFeatures +{ + [JsonInclude, JsonPropertyName("x-pack")] + public string XPack { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs new file mode 100644 index 00000000000..4ffc3899a83 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoSettingsTransportType +{ + [JsonInclude, JsonPropertyName("default")] + public string Default { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs new file mode 100644 index 00000000000..f35843cc9aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoTransport +{ + [JsonInclude, JsonPropertyName("bound_address")] + public IReadOnlyCollection BoundAddress { get; init; } + [JsonInclude, JsonPropertyName("profiles")] + public IReadOnlyDictionary Profiles { get; init; } + [JsonInclude, JsonPropertyName("publish_address")] + public string PublishAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs new file mode 100644 index 00000000000..ecbfc902214 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpack +{ + [JsonInclude, JsonPropertyName("license")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense? License { get; init; } + [JsonInclude, JsonPropertyName("notification")] + public IReadOnlyDictionary? Notification { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity Security { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs new file mode 100644 index 00000000000..37dc8b495e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackLicense +{ + [JsonInclude, JsonPropertyName("self_generated")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType SelfGenerated { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs new file mode 100644 index 00000000000..74f541ddb91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackLicenseType +{ + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs new file mode 100644 index 00000000000..9302ad2254f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecurity +{ + [JsonInclude, JsonPropertyName("authc")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc? Authc { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl? Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs new file mode 100644 index 00000000000..f7adc9f5d06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthc +{ + [JsonInclude, JsonPropertyName("realms")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms Realms { get; init; } + [JsonInclude, JsonPropertyName("token")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken Token { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs new file mode 100644 index 00000000000..bb9bf0fb1db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcRealms +{ + [JsonInclude, JsonPropertyName("file")] + public IReadOnlyDictionary? File { get; init; } + [JsonInclude, JsonPropertyName("native")] + public IReadOnlyDictionary? Native { get; init; } + [JsonInclude, JsonPropertyName("pki")] + public IReadOnlyDictionary? Pki { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs new file mode 100644 index 00000000000..75c1627b2b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcRealmsStatus +{ + [JsonInclude, JsonPropertyName("enabled")] + public string? Enabled { get; init; } + [JsonInclude, JsonPropertyName("order")] + public string Order { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs new file mode 100644 index 00000000000..676999f8e03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecurityAuthcToken +{ + [JsonInclude, JsonPropertyName("enabled")] + public string Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs new file mode 100644 index 00000000000..f7702777a51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeInfoXpackSecuritySsl +{ + [JsonInclude, JsonPropertyName("ssl")] + public IReadOnlyDictionary Ssl { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs new file mode 100644 index 00000000000..47707519655 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +internal sealed partial class NodeJvmInfoConverter : JsonConverter +{ + public override NodeJvmInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + IReadOnlyCollection gcCollectors = default; + IReadOnlyCollection inputArguments = default; + Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory mem = default; + IReadOnlyCollection memoryPools = default; + int pid = default; + long startTimeInMillis = default; + bool usingBundledJdk = default; + object? usingCompressedOrdinaryObjectPointers = default; + string version = default; + string vmName = default; + string vmVendor = default; + string vmVersion = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "gc_collectors") + { + gcCollectors = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "input_arguments") + { + inputArguments = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "mem") + { + mem = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "memory_pools") + { + memoryPools = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + + if (property == "pid") + { + pid = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "start_time_in_millis") + { + startTimeInMillis = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "using_bundled_jdk" || property == "bundled_jdk") + { + usingBundledJdk = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "using_compressed_ordinary_object_pointers") + { + usingCompressedOrdinaryObjectPointers = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "version") + { + version = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_name") + { + vmName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_vendor") + { + vmVendor = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "vm_version") + { + vmVersion = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new NodeJvmInfo { GcCollectors = gcCollectors, InputArguments = inputArguments, Mem = mem, MemoryPools = memoryPools, Pid = pid, StartTimeInMillis = startTimeInMillis, UsingBundledJdk = usingBundledJdk, UsingCompressedOrdinaryObjectPointers = usingCompressedOrdinaryObjectPointers, Version = version, VmName = vmName, VmVendor = vmVendor, VmVersion = vmVersion }; + } + + public override void Write(Utf8JsonWriter writer, NodeJvmInfo value, JsonSerializerOptions options) + { + throw new NotImplementedException("'NodeJvmInfo' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(NodeJvmInfoConverter))] +public sealed partial class NodeJvmInfo +{ + public IReadOnlyCollection GcCollectors { get; init; } + public IReadOnlyCollection InputArguments { get; init; } + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory Mem { get; init; } + public IReadOnlyCollection MemoryPools { get; init; } + public int Pid { get; init; } + public long StartTimeInMillis { get; init; } + public bool UsingBundledJdk { get; init; } + public object? UsingCompressedOrdinaryObjectPointers { get; init; } + public string Version { get; init; } + public string VmName { get; init; } + public string VmVendor { get; init; } + public string VmVersion { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs new file mode 100644 index 00000000000..59ad7f2154c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeOperatingSystemInfo +{ + /// + /// The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS. + /// + [JsonInclude, JsonPropertyName("allocated_processors")] + public int? AllocatedProcessors { get; init; } + + /// + /// Name of the JVM architecture (ex: amd64, x86) + /// + [JsonInclude, JsonPropertyName("arch")] + public string Arch { get; init; } + + /// + /// Number of processors available to the Java virtual machine + /// + [JsonInclude, JsonPropertyName("available_processors")] + public int AvailableProcessors { get; init; } + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU? Cpu { get; init; } + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory? Mem { get; init; } + + /// + /// Name of the operating system (ex: Linux, Windows, Mac OS X) + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("pretty_name")] + public string PrettyName { get; init; } + + /// + /// Refresh interval for the OS statistics + /// + [JsonInclude, JsonPropertyName("refresh_interval_in_millis")] + public long RefreshIntervalInMillis { get; init; } + [JsonInclude, JsonPropertyName("swap")] + public Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory? Swap { get; init; } + + /// + /// Version of the operating system + /// + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs new file mode 100644 index 00000000000..4a8ea6f643a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeProcessInfo +{ + /// + /// Process identifier (PID) + /// + [JsonInclude, JsonPropertyName("id")] + public long Id { get; init; } + + /// + /// Indicates if the process address space has been successfully locked in memory + /// + [JsonInclude, JsonPropertyName("mlockall")] + public bool Mlockall { get; init; } + + /// + /// Refresh interval for the process statistics + /// + [JsonInclude, JsonPropertyName("refresh_interval_in_millis")] + public long RefreshIntervalInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadError.g.cs new file mode 100644 index 00000000000..0f97bac6e7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadError.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeReloadError +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("reload_exception")] + public Elastic.Clients.Elasticsearch.ErrorCause? ReloadException { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs new file mode 100644 index 00000000000..e0ad61a6cd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.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.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.Nodes; + +public sealed partial class NodeReloadResult : Union +{ + public NodeReloadResult(Elastic.Clients.Elasticsearch.Nodes.Stats Stats) : base(Stats) + { + } + + public NodeReloadResult(Elastic.Clients.Elasticsearch.Nodes.NodeReloadError Error) : base(Error) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs new file mode 100644 index 00000000000..82df7a018fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeThreadPoolInfo +{ + [JsonInclude, JsonPropertyName("core")] + public int? Core { get; init; } + [JsonInclude, JsonPropertyName("keep_alive")] + public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get; init; } + [JsonInclude, JsonPropertyName("max")] + public int? Max { get; init; } + [JsonInclude, JsonPropertyName("queue_size")] + public int QueueSize { get; init; } + [JsonInclude, JsonPropertyName("size")] + public int? Size { get; init; } + [JsonInclude, JsonPropertyName("type")] + public string Type { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs new file mode 100644 index 00000000000..a941b0e91db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class NodeUsage +{ + [JsonInclude, JsonPropertyName("aggregations")] + public IReadOnlyDictionary Aggregations { get; init; } + [JsonInclude, JsonPropertyName("rest_actions")] + public IReadOnlyDictionary RestActions { get; init; } + [JsonInclude, JsonPropertyName("since")] + public long Since { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs new file mode 100644 index 00000000000..94a8abd1f8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class OperatingSystem +{ + [JsonInclude, JsonPropertyName("cgroup")] + public Elastic.Clients.Elasticsearch.Nodes.Cgroup? Cgroup { get; init; } + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Nodes.Cpu? Cpu { get; init; } + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats? Mem { get; init; } + [JsonInclude, JsonPropertyName("swap")] + public Elastic.Clients.Elasticsearch.Nodes.MemoryStats? Swap { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs new file mode 100644 index 00000000000..ad9cafc9119 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Pool +{ + /// + /// Maximum amount of memory, in bytes, available for use by the heap. + /// + [JsonInclude, JsonPropertyName("max_in_bytes")] + public long? MaxInBytes { get; init; } + + /// + /// Largest amount of memory, in bytes, historically used by the heap. + /// + [JsonInclude, JsonPropertyName("peak_max_in_bytes")] + public long? PeakMaxInBytes { get; init; } + + /// + /// Largest amount of memory, in bytes, historically used by the heap. + /// + [JsonInclude, JsonPropertyName("peak_used_in_bytes")] + public long? PeakUsedInBytes { get; init; } + + /// + /// Memory, in bytes, used by the heap. + /// + [JsonInclude, JsonPropertyName("used_in_bytes")] + public long? UsedInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs new file mode 100644 index 00000000000..7e631d4d913 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class PressureMemory +{ + /// + /// Memory consumed by indexing requests in the coordinating, primary, or replica stage. + /// + [JsonInclude, JsonPropertyName("all")] + public Elastic.Clients.Elasticsearch.ByteSize? All { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage. + /// + [JsonInclude, JsonPropertyName("all_in_bytes")] + public long? AllInBytes { get; init; } + + /// + /// Memory consumed by indexing requests in the coordinating or primary stage.
This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.
+ ///
+ [JsonInclude, JsonPropertyName("combined_coordinating_and_primary")] + public Elastic.Clients.Elasticsearch.ByteSize? CombinedCoordinatingAndPrimary { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating or primary stage.
This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally.
+ ///
+ [JsonInclude, JsonPropertyName("combined_coordinating_and_primary_in_bytes")] + public long? CombinedCoordinatingAndPrimaryInBytes { get; init; } + + /// + /// Memory consumed by indexing requests in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating")] + public Elastic.Clients.Elasticsearch.ByteSize? Coordinating { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating_in_bytes")] + public long? CoordinatingInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the coordinating stage. + /// + [JsonInclude, JsonPropertyName("coordinating_rejections")] + public long? CoordinatingRejections { get; init; } + + /// + /// Memory consumed by indexing requests in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary")] + public Elastic.Clients.Elasticsearch.ByteSize? Primary { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary_in_bytes")] + public long? PrimaryInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the primary stage. + /// + [JsonInclude, JsonPropertyName("primary_rejections")] + public long? PrimaryRejections { get; init; } + + /// + /// Memory consumed by indexing requests in the replica stage. + /// + [JsonInclude, JsonPropertyName("replica")] + public Elastic.Clients.Elasticsearch.ByteSize? Replica { get; init; } + + /// + /// Memory consumed, in bytes, by indexing requests in the replica stage. + /// + [JsonInclude, JsonPropertyName("replica_in_bytes")] + public long? ReplicaInBytes { get; init; } + + /// + /// Number of indexing requests rejected in the replica stage. + /// + [JsonInclude, JsonPropertyName("replica_rejections")] + public long? ReplicaRejections { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs new file mode 100644 index 00000000000..28ba1b4628b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Process +{ + /// + /// Contains CPU statistics for the node. + /// + [JsonInclude, JsonPropertyName("cpu")] + public Elastic.Clients.Elasticsearch.Nodes.Cpu? Cpu { get; init; } + + /// + /// Maximum number of file descriptors allowed on the system, or `-1` if not supported. + /// + [JsonInclude, JsonPropertyName("max_file_descriptors")] + public int? MaxFileDescriptors { get; init; } + + /// + /// Contains virtual memory statistics for the node. + /// + [JsonInclude, JsonPropertyName("mem")] + public Elastic.Clients.Elasticsearch.Nodes.MemoryStats? Mem { get; init; } + + /// + /// Number of opened file descriptors associated with the current or `-1` if not supported. + /// + [JsonInclude, JsonPropertyName("open_file_descriptors")] + public int? OpenFileDescriptors { get; init; } + + /// + /// Last time the statistics were refreshed.
Recorded in milliseconds since the Unix Epoch.
+ ///
+ [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs new file mode 100644 index 00000000000..8ec057d8201 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Processor +{ + /// + /// Number of documents transformed by the processor. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// Number of documents currently being transformed by the processor. + /// + [JsonInclude, JsonPropertyName("current")] + public long? Current { get; init; } + + /// + /// Number of failed operations for the processor. + /// + [JsonInclude, JsonPropertyName("failed")] + public long? Failed { get; init; } + + /// + /// Time, in milliseconds, spent by the processor transforming documents. + /// + [JsonInclude, JsonPropertyName("time_in_millis")] + public long? TimeInMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs new file mode 100644 index 00000000000..c3bc6c4616f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class PublishedClusterStates +{ + /// + /// Number of compatible differences between published cluster states. + /// + [JsonInclude, JsonPropertyName("compatible_diffs")] + public long? CompatibleDiffs { get; init; } + + /// + /// Number of published cluster states. + /// + [JsonInclude, JsonPropertyName("full_states")] + public long? FullStates { get; init; } + + /// + /// Number of incompatible differences between published cluster states. + /// + [JsonInclude, JsonPropertyName("incompatible_diffs")] + public long? IncompatibleDiffs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs new file mode 100644 index 00000000000..fce3921ac60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Recording +{ + [JsonInclude, JsonPropertyName("cumulative_execution_count")] + public long? CumulativeExecutionCount { get; init; } + [JsonInclude, JsonPropertyName("cumulative_execution_time")] + public Elastic.Clients.Elasticsearch.Duration? CumulativeExecutionTime { get; init; } + [JsonInclude, JsonPropertyName("cumulative_execution_time_millis")] + public long? CumulativeExecutionTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs new file mode 100644 index 00000000000..7c0f76e6541 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class RepositoryLocation +{ + [JsonInclude, JsonPropertyName("base_path")] + public string BasePath { get; init; } + + /// + /// Bucket name (GCP, S3) + /// + [JsonInclude, JsonPropertyName("bucket")] + public string? Bucket { get; init; } + + /// + /// Container name (Azure) + /// + [JsonInclude, JsonPropertyName("container")] + public string? Container { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs new file mode 100644 index 00000000000..76f30c825c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class RepositoryMeteringInformation +{ + /// + /// A flag that tells whether or not this object has been archived. When a repository is closed or updated the
repository metering information is archived and kept for a certain period of time. This allows retrieving the
repository metering information of previous repository instantiations.
+ ///
+ [JsonInclude, JsonPropertyName("archived")] + public bool Archived { get; init; } + + /// + /// The cluster state version when this object was archived, this field can be used as a logical timestamp to delete
all the archived metrics up to an observed version. This field is only present for archived repository metering
information objects. The main purpose of this field is to avoid possible race conditions during repository metering
information deletions, i.e. deleting archived repositories metering information that we haven’t observed yet.
+ ///
+ [JsonInclude, JsonPropertyName("cluster_version")] + public long? ClusterVersion { get; init; } + + /// + /// An identifier that changes every time the repository is updated. + /// + [JsonInclude, JsonPropertyName("repository_ephemeral_id")] + public string RepositoryEphemeralId { get; init; } + + /// + /// Represents an unique location within the repository. + /// + [JsonInclude, JsonPropertyName("repository_location")] + public Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation RepositoryLocation { get; init; } + + /// + /// Repository name. + /// + [JsonInclude, JsonPropertyName("repository_name")] + public string RepositoryName { get; init; } + + /// + /// Time the repository was created or updated. Recorded in milliseconds since the Unix Epoch. + /// + [JsonInclude, JsonPropertyName("repository_started_at")] + public long RepositoryStartedAt { get; init; } + + /// + /// Time the repository was deleted or updated. Recorded in milliseconds since the Unix Epoch. + /// + [JsonInclude, JsonPropertyName("repository_stopped_at")] + public long? RepositoryStoppedAt { get; init; } + + /// + /// Repository type. + /// + [JsonInclude, JsonPropertyName("repository_type")] + public string RepositoryType { get; init; } + + /// + /// An object with the number of request performed against the repository grouped by request type. + /// + [JsonInclude, JsonPropertyName("request_counts")] + public Elastic.Clients.Elasticsearch.Nodes.RequestCounts RequestCounts { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs new file mode 100644 index 00000000000..d7be465f1f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class RequestCounts +{ + /// + /// Number of Get Blob requests (Azure) + /// + [JsonInclude, JsonPropertyName("GetBlob")] + public long? Getblob { get; init; } + + /// + /// Number of Get Blob Properties requests (Azure) + /// + [JsonInclude, JsonPropertyName("GetBlobProperties")] + public long? Getblobproperties { get; init; } + + /// + /// Number of get object requests (GCP, S3) + /// + [JsonInclude, JsonPropertyName("GetObject")] + public long? Getobject { get; init; } + + /// + /// Number of insert object requests, including simple, multipart and resumable uploads. Resumable uploads
can perform multiple http requests to insert a single object but they are considered as a single request
since they are billed as an individual operation. (GCP)
+ ///
+ [JsonInclude, JsonPropertyName("InsertObject")] + public long? Insertobject { get; init; } + + /// + /// Number of List Blobs requests (Azure) + /// + [JsonInclude, JsonPropertyName("ListBlobs")] + public long? Listblobs { get; init; } + + /// + /// Number of list objects requests (GCP, S3) + /// + [JsonInclude, JsonPropertyName("ListObjects")] + public long? Listobjects { get; init; } + + /// + /// Number of Put Blob requests (Azure) + /// + [JsonInclude, JsonPropertyName("PutBlob")] + public long? Putblob { get; init; } + + /// + /// Number of Put Block (Azure) + /// + [JsonInclude, JsonPropertyName("PutBlock")] + public long? Putblock { get; init; } + + /// + /// Number of Put Block List requests + /// + [JsonInclude, JsonPropertyName("PutBlockList")] + public long? Putblocklist { get; init; } + + /// + /// Number of Multipart requests, including CreateMultipartUpload, UploadPart and CompleteMultipartUpload requests (S3) + /// + [JsonInclude, JsonPropertyName("PutMultipartObject")] + public long? Putmultipartobject { get; init; } + + /// + /// Number of PutObject requests (S3) + /// + [JsonInclude, JsonPropertyName("PutObject")] + public long? Putobject { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs new file mode 100644 index 00000000000..6cfec7766ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ScriptCache +{ + /// + /// Total number of times the script cache has evicted old data. + /// + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + + /// + /// Total number of times the script compilation circuit breaker has limited inline script compilations. + /// + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + + /// + /// Total number of inline script compilations performed by the node. + /// + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + [JsonInclude, JsonPropertyName("context")] + public string? Context { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs new file mode 100644 index 00000000000..53d764b7307 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Scripting +{ + /// + /// Total number of times the script cache has evicted old data. + /// + [JsonInclude, JsonPropertyName("cache_evictions")] + public long? CacheEvictions { get; init; } + + /// + /// Total number of times the script compilation circuit breaker has limited inline script compilations. + /// + [JsonInclude, JsonPropertyName("compilation_limit_triggered")] + public long? CompilationLimitTriggered { get; init; } + + /// + /// Total number of inline script compilations performed by the node. + /// + [JsonInclude, JsonPropertyName("compilations")] + public long? Compilations { get; init; } + + /// + /// Contains this recent history of script compilations. + /// + [JsonInclude, JsonPropertyName("compilations_history")] + public IReadOnlyDictionary? CompilationsHistory { get; init; } + [JsonInclude, JsonPropertyName("contexts")] + public IReadOnlyCollection? Contexts { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs new file mode 100644 index 00000000000..71cd3ae3181 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class SerializedClusterState +{ + [JsonInclude, JsonPropertyName("diffs")] + public Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail? Diffs { get; init; } + + /// + /// Number of published cluster states. + /// + [JsonInclude, JsonPropertyName("full_states")] + public Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail? FullStates { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs new file mode 100644 index 00000000000..b57a19b0027 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class SerializedClusterStateDetail +{ + [JsonInclude, JsonPropertyName("compressed_size")] + public string? CompressedSize { get; init; } + [JsonInclude, JsonPropertyName("compressed_size_in_bytes")] + public long? CompressedSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + [JsonInclude, JsonPropertyName("uncompressed_size")] + public string? UncompressedSize { get; init; } + [JsonInclude, JsonPropertyName("uncompressed_size_in_bytes")] + public long? UncompressedSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs new file mode 100644 index 00000000000..45bf89b1a33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Stats +{ + /// + /// Statistics about adaptive replica selection. + /// + [JsonInclude, JsonPropertyName("adaptive_selection")] + public IReadOnlyDictionary? AdaptiveSelection { get; init; } + + /// + /// Contains a list of attributes for the node. + /// + [JsonInclude, JsonPropertyName("attributes")] + [ReadOnlyFieldDictionaryConverter(typeof(string))] + public IReadOnlyDictionary? Attributes { get; init; } + + /// + /// Statistics about the field data circuit breaker. + /// + [JsonInclude, JsonPropertyName("breakers")] + public IReadOnlyDictionary? Breakers { get; init; } + + /// + /// Contains node discovery statistics for the node. + /// + [JsonInclude, JsonPropertyName("discovery")] + public Elastic.Clients.Elasticsearch.Nodes.Discovery? Discovery { get; init; } + + /// + /// File system information, data path, free disk space, read/write stats. + /// + [JsonInclude, JsonPropertyName("fs")] + public Elastic.Clients.Elasticsearch.Nodes.FileSystem? Fs { get; init; } + + /// + /// Network host for the node, based on the network host setting. + /// + [JsonInclude, JsonPropertyName("host")] + public string? Host { get; init; } + + /// + /// HTTP connection information. + /// + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Nodes.Http? Http { get; init; } + + /// + /// Contains indexing pressure statistics for the node. + /// + [JsonInclude, JsonPropertyName("indexing_pressure")] + public Elastic.Clients.Elasticsearch.Nodes.IndexingPressure? IndexingPressure { get; init; } + + /// + /// Indices stats about size, document count, indexing and deletion times, search times, field cache size, merges and flushes. + /// + [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.IndexManagement.ShardStats? Indices { get; init; } + + /// + /// Statistics about ingest preprocessing. + /// + [JsonInclude, JsonPropertyName("ingest")] + public Elastic.Clients.Elasticsearch.Nodes.Ingest? Ingest { get; init; } + + /// + /// IP address and port for the node. + /// + [JsonInclude, JsonPropertyName("ip")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection? Ip { get; init; } + + /// + /// JVM stats, memory pool information, garbage collection, buffer pools, number of loaded/unloaded classes. + /// + [JsonInclude, JsonPropertyName("jvm")] + public Elastic.Clients.Elasticsearch.Nodes.Jvm? Jvm { get; init; } + + /// + /// Human-readable identifier for the node.
Based on the node name setting.
+ ///
+ [JsonInclude, JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Operating system stats, load average, mem, swap. + /// + [JsonInclude, JsonPropertyName("os")] + public Elastic.Clients.Elasticsearch.Nodes.OperatingSystem? Os { get; init; } + + /// + /// Process statistics, memory consumption, cpu usage, open file descriptors. + /// + [JsonInclude, JsonPropertyName("process")] + public Elastic.Clients.Elasticsearch.Nodes.Process? Process { get; init; } + + /// + /// Roles assigned to the node. + /// + [JsonInclude, JsonPropertyName("roles")] + public IReadOnlyCollection? Roles { get; init; } + + /// + /// Contains script statistics for the node. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Nodes.Scripting? Script { get; init; } + [JsonInclude, JsonPropertyName("script_cache")] + public IReadOnlyDictionary>>? ScriptCache { get; init; } + + /// + /// Statistics about each thread pool, including current size, queue and rejected tasks. + /// + [JsonInclude, JsonPropertyName("thread_pool")] + public IReadOnlyDictionary? ThreadPool { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } + + /// + /// Transport statistics about sent and received bytes in cluster communication. + /// + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Nodes.Transport? Transport { get; init; } + + /// + /// Host and port for the transport layer, used for internal communication between nodes in a cluster. + /// + [JsonInclude, JsonPropertyName("transport_address")] + public string? TransportAddress { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs new file mode 100644 index 00000000000..503b3357906 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class ThreadCount +{ + /// + /// Number of active threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("active")] + public long? Active { get; init; } + + /// + /// Number of tasks completed by the thread pool executor. + /// + [JsonInclude, JsonPropertyName("completed")] + public long? Completed { get; init; } + + /// + /// Highest number of active threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("largest")] + public long? Largest { get; init; } + + /// + /// Number of tasks in queue for the thread pool. + /// + [JsonInclude, JsonPropertyName("queue")] + public long? Queue { get; init; } + + /// + /// Number of tasks rejected by the thread pool executor. + /// + [JsonInclude, JsonPropertyName("rejected")] + public long? Rejected { get; init; } + + /// + /// Number of threads in the thread pool. + /// + [JsonInclude, JsonPropertyName("threads")] + public long? Threads { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs new file mode 100644 index 00000000000..a40e860a816 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class Transport +{ + /// + /// The distribution of the time spent handling each inbound message on a transport thread, represented as a histogram. + /// + [JsonInclude, JsonPropertyName("inbound_handling_time_histogram")] + public IReadOnlyCollection? InboundHandlingTimeHistogram { get; init; } + + /// + /// The distribution of the time spent sending each outbound transport message on a transport thread, represented as a histogram. + /// + [JsonInclude, JsonPropertyName("outbound_handling_time_histogram")] + public IReadOnlyCollection? OutboundHandlingTimeHistogram { get; init; } + + /// + /// Total number of RX (receive) packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_count")] + public long? RxCount { get; init; } + + /// + /// Size of RX packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_size")] + public string? RxSize { get; init; } + + /// + /// Size, in bytes, of RX packets received by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("rx_size_in_bytes")] + public long? RxSizeInBytes { get; init; } + + /// + /// Current number of inbound TCP connections used for internal communication between nodes. + /// + [JsonInclude, JsonPropertyName("server_open")] + public int? ServerOpen { get; init; } + + /// + /// The cumulative number of outbound transport connections that this node has opened since it started.
Each transport connection may comprise multiple TCP connections but is only counted once in this statistic.
Transport connections are typically long-lived so this statistic should remain constant in a stable cluster.
+ ///
+ [JsonInclude, JsonPropertyName("total_outbound_connections")] + public long? TotalOutboundConnections { get; init; } + + /// + /// Total number of TX (transmit) packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_count")] + public long? TxCount { get; init; } + + /// + /// Size of TX packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_size")] + public string? TxSize { get; init; } + + /// + /// Size, in bytes, of TX packets sent by the node during internal cluster communication. + /// + [JsonInclude, JsonPropertyName("tx_size_in_bytes")] + public long? TxSizeInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs new file mode 100644 index 00000000000..7b03c900508 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes; + +public sealed partial class TransportHistogram +{ + /// + /// The number of times a transport thread took a period of time within the bounds of this bucket to handle an inbound message. + /// + [JsonInclude, JsonPropertyName("count")] + public long? Count { get; init; } + + /// + /// The inclusive lower bound of the bucket in milliseconds. May be omitted on the first bucket if this bucket has no lower bound. + /// + [JsonInclude, JsonPropertyName("ge_millis")] + public long? GeMillis { get; init; } + + /// + /// The exclusive upper bound of the bucket in milliseconds.
May be omitted on the last bucket if this bucket has no upper bound.
+ ///
+ [JsonInclude, JsonPropertyName("lt_millis")] + public long? LtMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs index 60fd5a8353b..a66558094a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class BoolQuery : SearchQuery +public sealed partial class BoolQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -60,6 +61,8 @@ public sealed partial class BoolQuery : SearchQuery [JsonInclude, JsonPropertyName("must_not")] [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Query))] public ICollection? MustNot { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// The clause (query) should appear in the matching document. @@ -68,9 +71,7 @@ public sealed partial class BoolQuery : SearchQuery [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(BoolQuery boolQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Bool(boolQuery); } public sealed partial class BoolQueryDescriptor : SerializableDescriptor> @@ -83,24 +84,27 @@ public BoolQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } - private Action>[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } + private Action>[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private ICollection? MustValue { get; set; } - private QueryDescriptor MustDescriptor { get; set; } - private Action> MustDescriptorAction { get; set; } - private Action>[] MustDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor MustNotDescriptor { get; set; } + private Action> MustNotDescriptorAction { get; set; } + private Action>[] MustNotDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private ICollection? ShouldValue { get; set; } - private QueryDescriptor ShouldDescriptor { get; set; } - private Action> ShouldDescriptorAction { get; set; } - private Action>[] ShouldDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor ShouldDescriptor { get; set; } + private Action> ShouldDescriptorAction { get; set; } + private Action>[] ShouldDescriptorActions { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoolQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -119,7 +123,7 @@ public BoolQueryDescriptor Filter(ICollection Filter(QueryDescriptor descriptor) + public BoolQueryDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -128,7 +132,7 @@ public BoolQueryDescriptor Filter(QueryDescriptor descript return Self; } - public BoolQueryDescriptor Filter(Action> configure) + public BoolQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -137,7 +141,7 @@ public BoolQueryDescriptor Filter(Action> return Self; } - public BoolQueryDescriptor Filter(params Action>[] configure) + public BoolQueryDescriptor Filter(params Action>[] configure) { FilterValue = null; FilterDescriptor = null; @@ -167,7 +171,7 @@ public BoolQueryDescriptor Must(ICollection Must(QueryDescriptor descriptor) + public BoolQueryDescriptor Must(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { MustValue = null; MustDescriptorAction = null; @@ -176,7 +180,7 @@ public BoolQueryDescriptor Must(QueryDescriptor descriptor return Self; } - public BoolQueryDescriptor Must(Action> configure) + public BoolQueryDescriptor Must(Action> configure) { MustValue = null; MustDescriptor = null; @@ -185,7 +189,7 @@ public BoolQueryDescriptor Must(Action> co return Self; } - public BoolQueryDescriptor Must(params Action>[] configure) + public BoolQueryDescriptor Must(params Action>[] configure) { MustValue = null; MustDescriptor = null; @@ -206,7 +210,7 @@ public BoolQueryDescriptor MustNot(ICollection MustNot(QueryDescriptor descriptor) + public BoolQueryDescriptor MustNot(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { MustNotValue = null; MustNotDescriptorAction = null; @@ -215,7 +219,7 @@ public BoolQueryDescriptor MustNot(QueryDescriptor descrip return Self; } - public BoolQueryDescriptor MustNot(Action> configure) + public BoolQueryDescriptor MustNot(Action> configure) { MustNotValue = null; MustNotDescriptor = null; @@ -224,7 +228,7 @@ public BoolQueryDescriptor MustNot(Action> return Self; } - public BoolQueryDescriptor MustNot(params Action>[] configure) + public BoolQueryDescriptor MustNot(params Action>[] configure) { MustNotValue = null; MustNotDescriptor = null; @@ -251,7 +255,7 @@ public BoolQueryDescriptor Should(ICollection Should(QueryDescriptor descriptor) + public BoolQueryDescriptor Should(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { ShouldValue = null; ShouldDescriptorAction = null; @@ -260,7 +264,7 @@ public BoolQueryDescriptor Should(QueryDescriptor descript return Self; } - public BoolQueryDescriptor Should(Action> configure) + public BoolQueryDescriptor Should(Action> configure) { ShouldValue = null; ShouldDescriptor = null; @@ -269,7 +273,7 @@ public BoolQueryDescriptor Should(Action> return Self; } - public BoolQueryDescriptor Should(params Action>[] configure) + public BoolQueryDescriptor Should(params Action>[] configure) { ShouldValue = null; ShouldDescriptor = null; @@ -295,7 +299,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -304,7 +308,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -330,7 +334,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustDescriptorAction is not null) { writer.WritePropertyName("must"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MustDescriptorAction), options); } else if (MustDescriptorActions is not null) { @@ -339,7 +343,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (MustDescriptorActions.Length > 1) @@ -359,7 +363,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustNotDescriptorAction is not null) { writer.WritePropertyName("must_not"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MustNotDescriptorAction), options); } else if (MustNotDescriptorActions is not null) { @@ -368,7 +372,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustNotDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (MustNotDescriptorActions.Length > 1) @@ -394,7 +398,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ShouldDescriptorAction is not null) { writer.WritePropertyName("should"); - JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(ShouldDescriptorAction), options); } else if (ShouldDescriptorActions is not null) { @@ -403,7 +407,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ShouldDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (ShouldDescriptorActions.Length > 1) @@ -429,24 +433,27 @@ public BoolQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection? FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } - private Action[] FilterDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } + private Action[] FilterDescriptorActions { get; set; } private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private ICollection? MustValue { get; set; } - private QueryDescriptor MustDescriptor { get; set; } - private Action MustDescriptorAction { get; set; } - private Action[] MustDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor MustNotDescriptor { get; set; } + private Action MustNotDescriptorAction { get; set; } + private Action[] MustNotDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private ICollection? ShouldValue { get; set; } - private QueryDescriptor ShouldDescriptor { get; set; } - private Action ShouldDescriptorAction { get; set; } - private Action[] ShouldDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor ShouldDescriptor { get; set; } + private Action ShouldDescriptorAction { get; set; } + private Action[] ShouldDescriptorActions { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoolQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -465,7 +472,7 @@ public BoolQueryDescriptor Filter(ICollection configure) + public BoolQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -483,7 +490,7 @@ public BoolQueryDescriptor Filter(Action configure) return Self; } - public BoolQueryDescriptor Filter(params Action[] configure) + public BoolQueryDescriptor Filter(params Action[] configure) { FilterValue = null; FilterDescriptor = null; @@ -513,7 +520,7 @@ public BoolQueryDescriptor Must(ICollection configure) + public BoolQueryDescriptor Must(Action configure) { MustValue = null; MustDescriptor = null; @@ -531,7 +538,7 @@ public BoolQueryDescriptor Must(Action configure) return Self; } - public BoolQueryDescriptor Must(params Action[] configure) + public BoolQueryDescriptor Must(params Action[] configure) { MustValue = null; MustDescriptor = null; @@ -552,7 +559,7 @@ public BoolQueryDescriptor MustNot(ICollection configure) + public BoolQueryDescriptor MustNot(Action configure) { MustNotValue = null; MustNotDescriptor = null; @@ -570,7 +577,7 @@ public BoolQueryDescriptor MustNot(Action configure) return Self; } - public BoolQueryDescriptor MustNot(params Action[] configure) + public BoolQueryDescriptor MustNot(params Action[] configure) { MustNotValue = null; MustNotDescriptor = null; @@ -597,7 +604,7 @@ public BoolQueryDescriptor Should(ICollection configure) + public BoolQueryDescriptor Should(Action configure) { ShouldValue = null; ShouldDescriptor = null; @@ -615,7 +622,7 @@ public BoolQueryDescriptor Should(Action configure) return Self; } - public BoolQueryDescriptor Should(params Action[] configure) + public BoolQueryDescriptor Should(params Action[] configure) { ShouldValue = null; ShouldDescriptor = null; @@ -641,7 +648,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else if (FilterDescriptorActions is not null) { @@ -650,7 +657,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FilterDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (FilterDescriptorActions.Length > 1) @@ -676,7 +683,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustDescriptorAction is not null) { writer.WritePropertyName("must"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MustDescriptorAction), options); } else if (MustDescriptorActions is not null) { @@ -685,7 +692,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (MustDescriptorActions.Length > 1) @@ -705,7 +712,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MustNotDescriptorAction is not null) { writer.WritePropertyName("must_not"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MustNotDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MustNotDescriptorAction), options); } else if (MustNotDescriptorActions is not null) { @@ -714,7 +721,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in MustNotDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (MustNotDescriptorActions.Length > 1) @@ -740,7 +747,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ShouldDescriptorAction is not null) { writer.WritePropertyName("should"); - JsonSerializer.Serialize(writer, new QueryDescriptor(ShouldDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(ShouldDescriptorAction), options); } else if (ShouldDescriptorActions is not null) { @@ -749,7 +756,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ShouldDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } if (ShouldDescriptorActions.Length > 1) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs index 6b6630c9d45..a0c4bc869d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class BoostingQuery : SearchQuery +public sealed partial class BoostingQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -51,10 +52,10 @@ public sealed partial class BoostingQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("positive")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Positive { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(BoostingQuery boostingQuery) => QueryDsl.Query.Boosting(boostingQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("boosting", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(BoostingQuery boostingQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Boosting(boostingQuery); } public sealed partial class BoostingQueryDescriptor : SerializableDescriptor> @@ -67,14 +68,17 @@ public BoostingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query NegativeValue { get; set; } - private QueryDescriptor NegativeDescriptor { get; set; } - private Action> NegativeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor NegativeDescriptor { get; set; } + private Action> NegativeDescriptorAction { get; set; } private double NegativeBoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query PositiveValue { get; set; } - private QueryDescriptor PositiveDescriptor { get; set; } - private Action> PositiveDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PositiveDescriptor { get; set; } + private Action> PositiveDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoostingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -92,7 +96,7 @@ public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch return Self; } - public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { NegativeValue = null; NegativeDescriptorAction = null; @@ -100,7 +104,7 @@ public BoostingQueryDescriptor Negative(QueryDescriptor de return Self; } - public BoostingQueryDescriptor Negative(Action> configure) + public BoostingQueryDescriptor Negative(Action> configure) { NegativeValue = null; NegativeDescriptor = null; @@ -128,7 +132,7 @@ public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch return Self; } - public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PositiveValue = null; PositiveDescriptorAction = null; @@ -136,7 +140,7 @@ public BoostingQueryDescriptor Positive(QueryDescriptor de return Self; } - public BoostingQueryDescriptor Positive(Action> configure) + public BoostingQueryDescriptor Positive(Action> configure) { PositiveValue = null; PositiveDescriptor = null; @@ -167,7 +171,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NegativeDescriptorAction is not null) { writer.WritePropertyName("negative"); - JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(NegativeDescriptorAction), options); } else { @@ -185,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PositiveDescriptorAction is not null) { writer.WritePropertyName("positive"); - JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PositiveDescriptorAction), options); } else { @@ -213,14 +217,17 @@ public BoostingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query NegativeValue { get; set; } - private QueryDescriptor NegativeDescriptor { get; set; } - private Action NegativeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor NegativeDescriptor { get; set; } + private Action NegativeDescriptorAction { get; set; } private double NegativeBoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query PositiveValue { get; set; } - private QueryDescriptor PositiveDescriptor { get; set; } - private Action PositiveDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PositiveDescriptor { get; set; } + private Action PositiveDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public BoostingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -238,7 +245,7 @@ public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.QueryDsl.Q return Self; } - public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) + public BoostingQueryDescriptor Negative(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { NegativeValue = null; NegativeDescriptorAction = null; @@ -246,7 +253,7 @@ public BoostingQueryDescriptor Negative(QueryDescriptor descriptor) return Self; } - public BoostingQueryDescriptor Negative(Action configure) + public BoostingQueryDescriptor Negative(Action configure) { NegativeValue = null; NegativeDescriptor = null; @@ -274,7 +281,7 @@ public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.QueryDsl.Q return Self; } - public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) + public BoostingQueryDescriptor Positive(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { PositiveValue = null; PositiveDescriptorAction = null; @@ -282,7 +289,7 @@ public BoostingQueryDescriptor Positive(QueryDescriptor descriptor) return Self; } - public BoostingQueryDescriptor Positive(Action configure) + public BoostingQueryDescriptor Positive(Action configure) { PositiveValue = null; PositiveDescriptor = null; @@ -313,7 +320,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NegativeDescriptorAction is not null) { writer.WritePropertyName("negative"); - JsonSerializer.Serialize(writer, new QueryDescriptor(NegativeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(NegativeDescriptorAction), options); } else { @@ -331,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (PositiveDescriptorAction is not null) { writer.WritePropertyName("positive"); - JsonSerializer.Serialize(writer, new QueryDescriptor(PositiveDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(PositiveDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs index b7d278c5920..cc34a6da6a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class CombinedFieldsQuery : SearchQuery +public sealed partial class CombinedFieldsQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -44,7 +45,7 @@ public sealed partial class CombinedFieldsQuery : SearchQuery /// 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; } + public ICollection Fields { get; set; } /// /// Minimum number of clauses that must match for a document to be returned. @@ -63,6 +64,8 @@ public sealed partial class CombinedFieldsQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. @@ -70,9 +73,7 @@ public sealed partial class CombinedFieldsQuery : SearchQuery [JsonInclude, JsonPropertyName("zero_terms_query")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(CombinedFieldsQuery combinedFieldsQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.CombinedFields(combinedFieldsQuery); } public sealed partial class CombinedFieldsQueryDescriptor : SerializableDescriptor> @@ -85,7 +86,7 @@ public CombinedFieldsQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } - private Fields FieldsValue { get; set; } + private ICollection FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? OperatorValue { get; set; } private string QueryValue { get; set; } @@ -101,6 +102,9 @@ public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery( return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public CombinedFieldsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +114,7 @@ public CombinedFieldsQueryDescriptor Boost(float? boost) /// /// 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) + public CombinedFieldsQueryDescriptor Fields(ICollection fields) { FieldsValue = fields; return Self; @@ -128,9 +132,9 @@ public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clien /// /// Boolean logic used to interpret text in the query value. /// - public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? op) + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -215,7 +219,7 @@ public CombinedFieldsQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } - private Fields FieldsValue { get; set; } + private ICollection FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? OperatorValue { get; set; } private string QueryValue { get; set; } @@ -231,6 +235,9 @@ public CombinedFieldsQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoG return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public CombinedFieldsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -240,7 +247,7 @@ public CombinedFieldsQueryDescriptor Boost(float? boost) /// /// 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) + public CombinedFieldsQueryDescriptor Fields(ICollection fields) { FieldsValue = fields; return Self; @@ -258,9 +265,9 @@ public CombinedFieldsQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elastics /// /// Boolean logic used to interpret text in the query value. /// - public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? op) + public CombinedFieldsQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs index e3d04f9acd7..bfe6de3a8f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class ConstantScoreQuery : SearchQuery +public sealed partial class ConstantScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class ConstantScoreQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("filter")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Filter { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(ConstantScoreQuery constantScoreQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.ConstantScore(constantScoreQuery); } public sealed partial class ConstantScoreQueryDescriptor : SerializableDescriptor> @@ -55,10 +56,13 @@ public ConstantScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action> FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ConstantScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -76,7 +80,7 @@ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsea return Self; } - public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -84,7 +88,7 @@ public ConstantScoreQueryDescriptor Filter(QueryDescriptor return Self; } - public ConstantScoreQueryDescriptor Filter(Action> configure) + public ConstantScoreQueryDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -115,7 +119,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else { @@ -143,10 +147,13 @@ public ConstantScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query FilterValue { get; set; } - private QueryDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ConstantScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -164,7 +171,7 @@ public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDs return Self; } - public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) + public ConstantScoreQueryDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -172,7 +179,7 @@ public ConstantScoreQueryDescriptor Filter(QueryDescriptor descriptor) return Self; } - public ConstantScoreQueryDescriptor Filter(Action configure) + public ConstantScoreQueryDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -203,7 +210,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new QueryDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(FilterDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs index e5aef89e4a0..ac9aa353d68 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -118,98 +118,97 @@ public override void Write(Utf8JsonWriter writer, DateRangeQuery value, JsonSeri { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.From is not null) - { - writer.WritePropertyName("from"); - JsonSerializer.Serialize(writer, value.From, options); - } + if (!string.IsNullOrEmpty(value.Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(value.Format); + } - if (value.Gt is not null) - { - writer.WritePropertyName("gt"); - JsonSerializer.Serialize(writer, value.Gt, options); - } + if (value.From is not null) + { + writer.WritePropertyName("from"); + JsonSerializer.Serialize(writer, value.From, options); + } - if (value.Gte is not null) - { - writer.WritePropertyName("gte"); - JsonSerializer.Serialize(writer, value.Gte, options); - } + if (value.Gt is not null) + { + writer.WritePropertyName("gt"); + JsonSerializer.Serialize(writer, value.Gt, options); + } - if (value.Lt is not null) - { - writer.WritePropertyName("lt"); - JsonSerializer.Serialize(writer, value.Lt, options); - } + if (value.Gte is not null) + { + writer.WritePropertyName("gte"); + JsonSerializer.Serialize(writer, value.Gte, options); + } - if (value.Lte is not null) - { - writer.WritePropertyName("lte"); - JsonSerializer.Serialize(writer, value.Lte, options); - } + if (value.Lt is not null) + { + writer.WritePropertyName("lt"); + JsonSerializer.Serialize(writer, value.Lt, options); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.TimeZone is not null) - { - writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, value.TimeZone, options); - } + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } - if (value.To is not null) - { - writer.WritePropertyName("to"); - JsonSerializer.Serialize(writer, value.To, options); - } + if (!string.IsNullOrEmpty(value.TimeZone)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(value.TimeZone); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.To is not null) + { + writer.WritePropertyName("to"); + JsonSerializer.Serialize(writer, value.To, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(DateRangeQueryConverter))] -public sealed partial class DateRangeQuery : RangeQuery +public sealed partial class DateRangeQuery { - public DateRangeQuery(Field field) + public DateRangeQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Date format used to convert `date` values in the query. @@ -236,6 +235,11 @@ public DateRangeQuery(Field field) /// Less than or equal to. /// public Elastic.Clients.Elasticsearch.DateMath? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } /// @@ -243,33 +247,14 @@ public DateRangeQuery(Field field) /// public string? TimeZone { get; set; } public Elastic.Clients.Elasticsearch.DateMath? To { get; set; } - public Elastic.Clients.Elasticsearch.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) + public DateRangeQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -285,6 +270,9 @@ public DateRangeQueryDescriptor(Expression> field) private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.DateMath? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DateRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -303,6 +291,12 @@ public DateRangeQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Date format used to convert `date` values in the query. /// @@ -360,6 +354,9 @@ public DateRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -394,10 +391,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - if (FormatValue is not null) + if (!string.IsNullOrEmpty(FormatValue)) { writer.WritePropertyName("format"); - JsonSerializer.Serialize(writer, FormatValue, options); + writer.WriteStringValue(FormatValue); } if (FromValue is not null) @@ -442,10 +439,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RelationValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (ToValue is not null) @@ -463,15 +460,8 @@ public sealed partial class DateRangeQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal DateRangeQueryDescriptor() : base() - { - } - - public DateRangeQueryDescriptor(Field field) + public DateRangeQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -487,6 +477,9 @@ public DateRangeQueryDescriptor(Field field) private string? TimeZoneValue { get; set; } private Elastic.Clients.Elasticsearch.DateMath? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DateRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -568,6 +561,9 @@ public DateRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public DateRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -602,10 +598,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - if (FormatValue is not null) + if (!string.IsNullOrEmpty(FormatValue)) { writer.WritePropertyName("format"); - JsonSerializer.Serialize(writer, FormatValue, options); + writer.WriteStringValue(FormatValue); } if (FromValue is not null) @@ -650,10 +646,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RelationValue, options); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (ToValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs index 6238c55cfe7..52f2bfe27ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class DisMaxQuery : SearchQuery +public sealed partial class DisMaxQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,6 +40,8 @@ public sealed partial class DisMaxQuery : SearchQuery /// [JsonInclude, JsonPropertyName("queries")] public ICollection Queries { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses. @@ -46,9 +49,7 @@ public sealed partial class DisMaxQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(DisMaxQuery disMaxQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.DisMax(disMaxQuery); } public sealed partial class DisMaxQueryDescriptor : SerializableDescriptor> @@ -61,12 +62,15 @@ public DisMaxQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection QueriesValue { get; set; } - private QueryDescriptor QueriesDescriptor { get; set; } - private Action> QueriesDescriptorAction { get; set; } - private Action>[] QueriesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueriesDescriptor { get; set; } + private Action> QueriesDescriptorAction { get; set; } + private Action>[] QueriesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private double? TieBreakerValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DisMaxQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -85,7 +89,7 @@ public DisMaxQueryDescriptor Queries(ICollection Queries(QueryDescriptor descriptor) + public DisMaxQueryDescriptor Queries(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueriesValue = null; QueriesDescriptorAction = null; @@ -94,7 +98,7 @@ public DisMaxQueryDescriptor Queries(QueryDescriptor descr return Self; } - public DisMaxQueryDescriptor Queries(Action> configure) + public DisMaxQueryDescriptor Queries(Action> configure) { QueriesValue = null; QueriesDescriptor = null; @@ -103,7 +107,7 @@ public DisMaxQueryDescriptor Queries(Action Queries(params Action>[] configure) + public DisMaxQueryDescriptor Queries(params Action>[] configure) { QueriesValue = null; QueriesDescriptor = null; @@ -147,7 +151,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("queries"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueriesDescriptorAction), options); writer.WriteEndArray(); } else if (QueriesDescriptorActions is not null) @@ -156,7 +160,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in QueriesDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } writer.WriteEndArray(); @@ -193,12 +197,15 @@ public DisMaxQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection QueriesValue { get; set; } - private QueryDescriptor QueriesDescriptor { get; set; } - private Action QueriesDescriptorAction { get; set; } - private Action[] QueriesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueriesDescriptor { get; set; } + private Action QueriesDescriptorAction { get; set; } + private Action[] QueriesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } private double? TieBreakerValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public DisMaxQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -217,7 +224,7 @@ public DisMaxQueryDescriptor Queries(ICollection configure) + public DisMaxQueryDescriptor Queries(Action configure) { QueriesValue = null; QueriesDescriptor = null; @@ -235,7 +242,7 @@ public DisMaxQueryDescriptor Queries(Action configure) return Self; } - public DisMaxQueryDescriptor Queries(params Action[] configure) + public DisMaxQueryDescriptor Queries(params Action[] configure) { QueriesValue = null; QueriesDescriptor = null; @@ -279,7 +286,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("queries"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueriesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueriesDescriptorAction), options); writer.WriteEndArray(); } else if (QueriesDescriptorActions is not null) @@ -288,7 +295,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in QueriesDescriptorActions) { - JsonSerializer.Serialize(writer, new QueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs index 9afe19e2d27..b597b33ba4b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class ExistsQuery : SearchQuery +public sealed partial class ExistsQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class ExistsQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(ExistsQuery existsQuery) => QueryDsl.Query.Exists(existsQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("exists", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(ExistsQuery existsQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Exists(existsQuery); } public sealed partial class ExistsQueryDescriptor : SerializableDescriptor> @@ -57,6 +58,9 @@ public ExistsQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ExistsQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -81,6 +85,15 @@ public ExistsQueryDescriptor Field(Expression + /// Name of the field you wish to search. + /// + public ExistsQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + public ExistsQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -120,6 +133,9 @@ public ExistsQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ExistsQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs index 8dd7e953f9d..ba8d91a5502 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs @@ -80,6 +80,15 @@ public FieldAndFormatDescriptor Field(Expression + /// 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. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs index d88fe97a657..edffdcb767b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs @@ -53,7 +53,7 @@ public sealed partial class FieldValueFactorScoreFunction [JsonInclude, JsonPropertyName("modifier")] public Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier? Modifier { get; set; } - public static implicit operator FunctionScore(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => QueryDsl.FunctionScore.FieldValueFactor(fieldValueFactorScoreFunction); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore.FieldValueFactor(fieldValueFactorScoreFunction); } public sealed partial class FieldValueFactorScoreFunctionDescriptor : SerializableDescriptor> @@ -96,6 +96,15 @@ public FieldValueFactorScoreFunctionDescriptor Field(Expressi 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.
///
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs index 60a1aa51bdd..d0c08c16def 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -53,6 +54,18 @@ internal FunctionScore(string variantName, object variant) public Elastic.Clients.Elasticsearch.QueryDsl.Query? Filter { get; set; } [JsonInclude, JsonPropertyName("weight")] public double? Weight { get; set; } + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class FunctionScoreConverter : JsonConverter @@ -140,7 +153,7 @@ public override void Write(Utf8JsonWriter writer, FunctionScore value, JsonSeria writer.WriteNumberValue(value.Weight.Value); } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -193,61 +206,31 @@ private FunctionScoreDescriptor Set(object variant, string variantNam } private Elastic.Clients.Elasticsearch.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.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"); + public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action> configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action> configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (FilterValue is not null) { writer.WritePropertyName("filter"); JsonSerializer.Serialize(writer, FilterValue, options); @@ -308,63 +291,31 @@ private FunctionScoreDescriptor Set(object variant, string variantName) } private Elastic.Clients.Elasticsearch.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.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"); + public FunctionScoreDescriptor FieldValueFactor(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction fieldValueFactorScoreFunction) => Set(fieldValueFactorScoreFunction, "field_value_factor"); + public FunctionScoreDescriptor FieldValueFactor(Action configure) => Set(configure, "field_value_factor"); + public FunctionScoreDescriptor RandomScore(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction randomScoreFunction) => Set(randomScoreFunction, "random_score"); + public FunctionScoreDescriptor RandomScore(Action configure) => Set(configure, "random_score"); + public FunctionScoreDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (FilterValue is not null) { writer.WritePropertyName("filter"); JsonSerializer.Serialize(writer, FilterValue, options); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs index 76c68fc1ca4..42a50d3ac4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class FunctionScoreQuery : SearchQuery +public sealed partial class FunctionScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,6 +64,8 @@ public sealed partial class FunctionScoreQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Specifies how the computed scores are combined @@ -70,9 +73,7 @@ public sealed partial class FunctionScoreQuery : SearchQuery [JsonInclude, JsonPropertyName("score_mode")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(FunctionScoreQuery functionScoreQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.FunctionScore(functionScoreQuery); } public sealed partial class FunctionScoreQueryDescriptor : SerializableDescriptor> @@ -86,17 +87,20 @@ public FunctionScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } private ICollection? FunctionsValue { get; set; } - private FunctionScoreDescriptor FunctionsDescriptor { get; set; } - private Action> FunctionsDescriptorAction { get; set; } - private Action>[] FunctionsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action> FunctionsDescriptorAction { get; set; } + private Action>[] FunctionsDescriptorActions { get; set; } private double? MaxBoostValue { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FunctionScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -124,7 +128,7 @@ public FunctionScoreQueryDescriptor Functions(ICollection Functions(FunctionScoreDescriptor descriptor) + public FunctionScoreQueryDescriptor Functions(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor descriptor) { FunctionsValue = null; FunctionsDescriptorAction = null; @@ -133,7 +137,7 @@ public FunctionScoreQueryDescriptor Functions(FunctionScoreDescriptor return Self; } - public FunctionScoreQueryDescriptor Functions(Action> configure) + public FunctionScoreQueryDescriptor Functions(Action> configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -142,7 +146,7 @@ public FunctionScoreQueryDescriptor Functions(Action Functions(params Action>[] configure) + public FunctionScoreQueryDescriptor Functions(params Action>[] configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -180,7 +184,7 @@ public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsear return Self; } - public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -188,7 +192,7 @@ public FunctionScoreQueryDescriptor Query(QueryDescriptor return Self; } - public FunctionScoreQueryDescriptor Query(Action> configure) + public FunctionScoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -237,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("functions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor(FunctionsDescriptorAction), options); writer.WriteEndArray(); } else if (FunctionsDescriptorActions is not null) @@ -246,7 +250,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FunctionsDescriptorActions) { - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor(action), options); } writer.WriteEndArray(); @@ -277,7 +281,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { @@ -312,17 +316,20 @@ public FunctionScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? BoostModeValue { get; set; } private ICollection? FunctionsValue { get; set; } - private FunctionScoreDescriptor FunctionsDescriptor { get; set; } - private Action FunctionsDescriptorAction { get; set; } - private Action[] FunctionsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor FunctionsDescriptor { get; set; } + private Action FunctionsDescriptorAction { get; set; } + private Action[] FunctionsDescriptorActions { get; set; } private double? MaxBoostValue { get; set; } private double? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FunctionScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -350,7 +357,7 @@ public FunctionScoreQueryDescriptor Functions(ICollection configure) + public FunctionScoreQueryDescriptor Functions(Action configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -368,7 +375,7 @@ public FunctionScoreQueryDescriptor Functions(Action co return Self; } - public FunctionScoreQueryDescriptor Functions(params Action[] configure) + public FunctionScoreQueryDescriptor Functions(params Action[] configure) { FunctionsValue = null; FunctionsDescriptor = null; @@ -406,7 +413,7 @@ public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl return Self; } - public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) + public FunctionScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -414,7 +421,7 @@ public FunctionScoreQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public FunctionScoreQueryDescriptor Query(Action configure) + public FunctionScoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -463,7 +470,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("functions"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(FunctionsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor(FunctionsDescriptorAction), options); writer.WriteEndArray(); } else if (FunctionsDescriptorActions is not null) @@ -472,7 +479,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in FunctionsDescriptorActions) { - JsonSerializer.Serialize(writer, new FunctionScoreDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreDescriptor(action), options); } writer.WriteEndArray(); @@ -503,7 +510,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else if (QueryValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs index 93cf84fa4be..5f052468199 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs @@ -100,76 +100,75 @@ public override void Write(Utf8JsonWriter writer, FuzzyQuery value, JsonSerializ { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.Transpositions.HasValue) - { - writer.WritePropertyName("transpositions"); - writer.WriteBooleanValue(value.Transpositions.Value); - } + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); + } - writer.WritePropertyName("value"); - JsonSerializer.Serialize(writer, value.Value, options); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.Transpositions.HasValue) + { + writer.WritePropertyName("transpositions"); + writer.WriteBooleanValue(value.Transpositions.Value); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(FuzzyQueryConverter))] -public sealed partial class FuzzyQuery : SearchQuery +public sealed partial class FuzzyQuery { - public FuzzyQuery(Field field) + public FuzzyQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Maximum edit distance allowed for matching. @@ -185,6 +184,7 @@ public FuzzyQuery(Field field) /// Number of beginning characters left unchanged when creating expansions. /// public int? PrefixLength { get; set; } + public string? QueryName { get; set; } /// /// Number of beginning characters left unchanged when creating expansions. @@ -200,33 +200,16 @@ public FuzzyQuery(Field field) /// Term you wish to find in the provided field. /// public object Value { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(FuzzyQuery fuzzyQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Fuzzy(fuzzyQuery); } 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) + public FuzzyQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -239,6 +222,9 @@ public FuzzyQueryDescriptor(Expression> field) private bool? TranspositionsValue { get; set; } private object ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FuzzyQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -257,6 +243,12 @@ public FuzzyQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum edit distance allowed for matching. /// @@ -354,10 +346,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TranspositionsValue.HasValue) @@ -377,17 +369,10 @@ public sealed partial class FuzzyQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal FuzzyQueryDescriptor() : base() + public FuzzyQueryDescriptor() : base() { } - public FuzzyQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Fuzziness? FuzzinessValue { get; set; } @@ -398,6 +383,9 @@ public FuzzyQueryDescriptor(Field field) private bool? TranspositionsValue { get; set; } private object ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public FuzzyQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -519,10 +507,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TranspositionsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs index 7cbbde5a2ae..91da280854c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs @@ -116,9 +116,11 @@ public override void Write(Utf8JsonWriter writer, GeoBoundingBoxQuery value, Jso } [JsonConverter(typeof(GeoBoundingBoxQueryConverter))] -public sealed partial class GeoBoundingBoxQuery : SearchQuery +public sealed partial class GeoBoundingBoxQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.GeoBounds BoundingBox { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } @@ -127,15 +129,14 @@ public sealed partial class GeoBoundingBoxQuery : SearchQuery /// 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; } + public string? QueryName { 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.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(GeoBoundingBoxQuery geoBoundingBoxQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.GeoBoundingBox(geoBoundingBoxQuery); } public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor> @@ -147,57 +148,66 @@ public GeoBoundingBoxQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoBounds BoundingBoxValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.GeoBounds BoundingBoxValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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) + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.GeoBounds boundingBox) { - IgnoreUnmappedValue = ignoreUnmapped; + BoundingBoxValue = boundingBox; return Self; } - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - QueryNameValue = queryName; + FieldValue = field; 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.QueryDsl.GeoValidationMethod? validationMethod) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.GeoBounds boundingBox) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - BoundingBoxValue = boundingBox; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + /// + /// 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) { - FieldValue = field; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + 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.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; return Self; } @@ -248,63 +258,66 @@ public GeoBoundingBoxQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoBounds BoundingBoxValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.GeoBounds BoundingBoxValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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) + public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.GeoBounds boundingBox) { - IgnoreUnmappedValue = ignoreUnmapped; + BoundingBoxValue = boundingBox; return Self; } - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) + public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - QueryNameValue = queryName; + FieldValue = field; 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.QueryDsl.GeoValidationMethod? validationMethod) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor BoundingBox(Elastic.Clients.Elasticsearch.GeoBounds boundingBox) + public GeoBoundingBoxQueryDescriptor Field(Expression> field) { - BoundingBoxValue = boundingBox; + FieldValue = field; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + /// + /// 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) { - FieldValue = field; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoBoundingBoxQueryDescriptor Field(Expression> field) + /// + /// 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.QueryDsl.GeoValidationMethod? validationMethod) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs index 7c7e305dde8..90ac78371ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs @@ -106,7 +106,7 @@ public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSe } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, value.Distance, options); + writer.WriteStringValue(value.Distance); if (value.DistanceType is not null) { writer.WritePropertyName("distance_type"); @@ -136,9 +136,11 @@ public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSe } [JsonConverter(typeof(GeoDistanceQueryConverter))] -public sealed partial class GeoDistanceQuery : SearchQuery +public sealed partial class GeoDistanceQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } /// @@ -157,15 +159,14 @@ public sealed partial class GeoDistanceQuery : SearchQuery /// public bool? IgnoreUnmapped { get; set; } public Elastic.Clients.Elasticsearch.GeoLocation Location { get; set; } + public string? QueryName { 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.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(GeoDistanceQuery geoDistanceQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.GeoDistance(geoDistanceQuery); } public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor> @@ -179,12 +180,15 @@ public GeoDistanceQueryDescriptor() : base() private float? BoostValue { get; set; } private string DistanceValue { get; set; } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoLocation LocationValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private Elastic.Clients.Elasticsearch.GeoLocation LocationValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoDistanceQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -209,27 +213,30 @@ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasti 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor QueryName(string? queryName) + public GeoDistanceQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; + return Self; + } + + public GeoDistanceQueryDescriptor Field(Expression> field) + { + FieldValue = field; 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.
+ /// 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 GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) + public GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - ValidationMethodValue = validationMethod; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } @@ -239,15 +246,18 @@ public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsea return Self; } - public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public GeoDistanceQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + /// + /// 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.QueryDsl.GeoValidationMethod? validationMethod) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } @@ -268,7 +278,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); + writer.WriteStringValue(DistanceValue); if (DistanceTypeValue is not null) { writer.WritePropertyName("distance_type"); @@ -308,12 +318,15 @@ public GeoDistanceQueryDescriptor() : base() private float? BoostValue { get; set; } private string DistanceValue { get; set; } private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.GeoLocation LocationValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private Elastic.Clients.Elasticsearch.GeoLocation LocationValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoDistanceQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -338,51 +351,51 @@ public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.Geo 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor QueryName(string? queryName) + public GeoDistanceQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; 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.QueryDsl.GeoValidationMethod? validationMethod) + public GeoDistanceQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.GeoLocation location) + /// + /// 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 GeoDistanceQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - LocationValue = location; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoDistanceQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public GeoDistanceQueryDescriptor Location(Elastic.Clients.Elasticsearch.GeoLocation location) { - FieldValue = field; + LocationValue = location; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + public GeoDistanceQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoDistanceQueryDescriptor Field(Expression> field) + /// + /// 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.QueryDsl.GeoValidationMethod? validationMethod) { - FieldValue = field; + ValidationMethodValue = validationMethod; return Self; } @@ -403,7 +416,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); + writer.WriteStringValue(DistanceValue); if (DistanceTypeValue is not null) { writer.WritePropertyName("distance_type"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs index 97b2ea591a6..34223005677 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs @@ -116,18 +116,19 @@ public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSer } [JsonConverter(typeof(GeoPolygonQueryConverter))] -public sealed partial class GeoPolygonQuery : SearchQuery +public sealed partial class GeoPolygonQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } public bool? IgnoreUnmapped { get; set; } public Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints Polygon { get; set; } + public string? QueryName { get; set; } public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(GeoPolygonQuery geoPolygonQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.GeoPolygon(geoPolygonQuery); } public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> @@ -139,51 +140,56 @@ public GeoPolygonQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoPolygonQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor QueryName(string? queryName) + public GeoPolygonQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) + public GeoPolygonQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - PolygonValue = polygon; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) { - FieldValue = field; + PolygonDescriptor = null; + PolygonDescriptorAction = null; + PolygonValue = polygon; return Self; } - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor descriptor) { PolygonValue = null; PolygonDescriptorAction = null; @@ -191,7 +197,7 @@ public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor d return Self; } - public GeoPolygonQueryDescriptor Polygon(Action configure) + public GeoPolygonQueryDescriptor Polygon(Action configure) { PolygonValue = null; PolygonDescriptor = null; @@ -199,32 +205,26 @@ public GeoPolygonQueryDescriptor Polygon(Action Field(Expression> field) + public GeoPolygonQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + return Self; + } + + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) + { + ValidationMethodValue = validationMethod; 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)) + if (FieldValue is not null && PolygonValue 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); - } + JsonSerializer.Serialize(writer, PolygonValue, options); } if (BoostValue.HasValue) @@ -264,51 +264,56 @@ public GeoPolygonQueryDescriptor() : base() } private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } + private Action PolygonDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - private Action PolygonDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public GeoPolygonQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) + public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - IgnoreUnmappedValue = ignoreUnmapped; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor QueryName(string? queryName) + public GeoPolygonQueryDescriptor Field(Expression> field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) + public GeoPolygonQueryDescriptor Field(Expression> field) { - ValidationMethodValue = validationMethod; + FieldValue = field; return Self; } - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) + public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) { - PolygonValue = polygon; + IgnoreUnmappedValue = ignoreUnmapped; return Self; } - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) { - FieldValue = field; + PolygonDescriptor = null; + PolygonDescriptorAction = null; + PolygonValue = polygon; return Self; } - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) + public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsDescriptor descriptor) { PolygonValue = null; PolygonDescriptorAction = null; @@ -316,7 +321,7 @@ public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) return Self; } - public GeoPolygonQueryDescriptor Polygon(Action configure) + public GeoPolygonQueryDescriptor Polygon(Action configure) { PolygonValue = null; PolygonDescriptor = null; @@ -324,38 +329,26 @@ public GeoPolygonQueryDescriptor Polygon(Action conf return Self; } - public GeoPolygonQueryDescriptor Field(Expression> field) + public GeoPolygonQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public GeoPolygonQueryDescriptor Field(Expression> field) + public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) { - FieldValue = field; + ValidationMethodValue = validationMethod; 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)) + if (FieldValue is not null && PolygonValue 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); - } + JsonSerializer.Serialize(writer, PolygonValue, options); } if (BoostValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs index 367d29f1e10..a426f03fde5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class HasChildQuery : SearchQuery +public sealed partial class HasChildQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,6 +64,8 @@ public sealed partial class HasChildQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates how scores for matching child documents affect the root parent document’s relevance score. @@ -76,9 +79,7 @@ public sealed partial class HasChildQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(HasChildQuery hasChildQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.HasChild(hasChildQuery); } public sealed partial class HasChildQueryDescriptor : SerializableDescriptor> @@ -92,17 +93,20 @@ public HasChildQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private int? MinChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } private string TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasChildQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -129,7 +133,7 @@ public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearc return Self; } - public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -137,7 +141,7 @@ public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescrip return Self; } - public HasChildQueryDescriptor InnerHits(Action> configure) + public HasChildQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -174,7 +178,7 @@ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.Qu return Self; } - public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -182,7 +186,7 @@ public HasChildQueryDescriptor Query(QueryDescriptor descr return Self; } - public HasChildQueryDescriptor Query(Action> configure) + public HasChildQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -237,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -265,7 +269,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -286,7 +290,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); writer.WriteEndObject(); } } @@ -302,17 +306,20 @@ public HasChildQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private int? MaxChildrenValue { get; set; } private int? MinChildrenValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } private string TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasChildQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -339,7 +346,7 @@ public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Sear return Self; } - public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasChildQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -347,7 +354,7 @@ public HasChildQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descrip return Self; } - public HasChildQueryDescriptor InnerHits(Action configure) + public HasChildQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -384,7 +391,7 @@ public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Quer return Self; } - public HasChildQueryDescriptor Query(QueryDescriptor descriptor) + public HasChildQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -392,7 +399,7 @@ public HasChildQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public HasChildQueryDescriptor Query(Action configure) + public HasChildQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -447,7 +454,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -475,7 +482,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -496,7 +503,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs index 49abf7d34eb..303edbfab81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class HasParentQuery : SearchQuery +public sealed partial class HasParentQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -57,6 +58,8 @@ public sealed partial class HasParentQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Indicates whether the relevance score of a matching parent document is aggregated into its child documents. @@ -64,9 +67,7 @@ public sealed partial class HasParentQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(HasParentQuery hasParentQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.HasParent(hasParentQuery); } public sealed partial class HasParentQueryDescriptor : SerializableDescriptor> @@ -80,15 +81,18 @@ public HasParentQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private string ParentTypeValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private bool? ScoreValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasParentQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -115,7 +119,7 @@ public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsear return Self; } - public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -123,7 +127,7 @@ public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescri return Self; } - public HasParentQueryDescriptor InnerHits(Action> configure) + public HasParentQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -151,7 +155,7 @@ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.Q return Self; } - public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -159,7 +163,7 @@ public HasParentQueryDescriptor Query(QueryDescriptor desc return Self; } - public HasParentQueryDescriptor Query(Action> configure) + public HasParentQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -205,7 +209,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -214,7 +218,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("parent_type"); - JsonSerializer.Serialize(writer, ParentTypeValue, options); + writer.WriteStringValue(ParentTypeValue); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -223,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -258,15 +262,18 @@ public HasParentQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private string ParentTypeValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private bool? ScoreValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public HasParentQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -293,7 +300,7 @@ public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Sea return Self; } - public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public HasParentQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -301,7 +308,7 @@ public HasParentQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descri return Self; } - public HasParentQueryDescriptor InnerHits(Action configure) + public HasParentQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -329,7 +336,7 @@ public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Que return Self; } - public HasParentQueryDescriptor Query(QueryDescriptor descriptor) + public HasParentQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -337,7 +344,7 @@ public HasParentQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public HasParentQueryDescriptor Query(Action configure) + public HasParentQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -383,7 +390,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -392,7 +399,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("parent_type"); - JsonSerializer.Serialize(writer, ParentTypeValue, options); + writer.WriteStringValue(ParentTypeValue); if (QueryDescriptor is not null) { writer.WritePropertyName("query"); @@ -401,7 +408,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs index 5fe15e69ef4..ebf4235e555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs @@ -27,12 +27,15 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class IdsQuery : SearchQuery +public sealed partial class IdsQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// An array of document IDs. @@ -40,9 +43,7 @@ public sealed partial class IdsQuery : SearchQuery [JsonInclude, JsonPropertyName("values")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(IdsQuery idsQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Ids(idsQuery); } public sealed partial class IdsQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public IdsQueryDescriptor() : base() private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Ids? ValuesValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public IdsQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs index 682e514e8b1..d6da5645d0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -51,6 +52,18 @@ internal Intervals(string variantName, object variant) public static Intervals Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => new Intervals("match", intervalsMatch); public static Intervals Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => new Intervals("prefix", intervalsPrefix); public static Intervals Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard intervalsWildcard) => new Intervals("wildcard", intervalsWildcard); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class IntervalsConverter : JsonConverter @@ -62,63 +75,76 @@ public override Intervals Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "any_of") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "all_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fuzzy") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "any_of") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "fuzzy") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); - } + if (propertyName == "match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wildcard") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Intervals(propertyName, variant); + 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 'Intervals' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Intervals(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Intervals value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -179,37 +205,35 @@ private IntervalsDescriptor Set(object variant, string variantName) 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"); + public IntervalsDescriptor AllOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -245,43 +269,35 @@ private IntervalsDescriptor Set(object variant, string variantName) 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"); + public IntervalsDescriptor AllOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsDescriptor AnyOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs index 9d97b5dd8cd..0e9df82b831 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs @@ -52,6 +52,9 @@ public sealed partial class IntervalsAllOf ///
[JsonInclude, JsonPropertyName("ordered")] public bool? Ordered { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsAllOf intervalsAllOf) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.AllOf(intervalsAllOf); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsAllOf intervalsAllOf) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.AllOf(intervalsAllOf); } public sealed partial class IntervalsAllOfDescriptor : SerializableDescriptor> @@ -63,12 +66,12 @@ public IntervalsAllOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private ICollection IntervalsValue { get; set; } - private IntervalsDescriptor IntervalsDescriptor { get; set; } - private Action> IntervalsDescriptorAction { get; set; } - private Action>[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } @@ -83,7 +86,7 @@ public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -91,7 +94,7 @@ public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsAllOfDescriptor Filter(Action configure) + public IntervalsAllOfDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -111,7 +114,7 @@ public IntervalsAllOfDescriptor Intervals(ICollection Intervals(IntervalsDescriptor descriptor) + public IntervalsAllOfDescriptor Intervals(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor descriptor) { IntervalsValue = null; IntervalsDescriptorAction = null; @@ -120,7 +123,7 @@ public IntervalsAllOfDescriptor Intervals(IntervalsDescriptor Intervals(Action> configure) + public IntervalsAllOfDescriptor Intervals(Action> configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -129,7 +132,7 @@ public IntervalsAllOfDescriptor Intervals(Action Intervals(params Action>[] configure) + public IntervalsAllOfDescriptor Intervals(params Action>[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -167,7 +170,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -186,7 +189,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -195,7 +198,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); @@ -231,12 +234,12 @@ public IntervalsAllOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private ICollection IntervalsValue { get; set; } - private IntervalsDescriptor IntervalsDescriptor { get; set; } - private Action IntervalsDescriptorAction { get; set; } - private Action[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } @@ -251,7 +254,7 @@ public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.In return Self; } - public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAllOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -259,7 +262,7 @@ public IntervalsAllOfDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsAllOfDescriptor Filter(Action configure) + public IntervalsAllOfDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -279,7 +282,7 @@ public IntervalsAllOfDescriptor Intervals(ICollection configure) + public IntervalsAllOfDescriptor Intervals(Action configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -297,7 +300,7 @@ public IntervalsAllOfDescriptor Intervals(Action configure) return Self; } - public IntervalsAllOfDescriptor Intervals(params Action[] configure) + public IntervalsAllOfDescriptor Intervals(params Action[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -335,7 +338,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -354,7 +357,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -363,7 +366,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs index 1eaae533892..f2ffde78570 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs @@ -40,6 +40,9 @@ public sealed partial class IntervalsAnyOf ///
[JsonInclude, JsonPropertyName("intervals")] public ICollection Intervals { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsAnyOf intervalsAnyOf) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.AnyOf(intervalsAnyOf); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsAnyOf intervalsAnyOf) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.AnyOf(intervalsAnyOf); } public sealed partial class IntervalsAnyOfDescriptor : SerializableDescriptor> @@ -51,12 +54,12 @@ public IntervalsAnyOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private ICollection IntervalsValue { get; set; } - private IntervalsDescriptor IntervalsDescriptor { get; set; } - private Action> IntervalsDescriptorAction { get; set; } - private Action>[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action> IntervalsDescriptorAction { get; set; } + private Action>[] IntervalsDescriptorActions { get; set; } /// /// Rule used to filter returned intervals. @@ -69,7 +72,7 @@ public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -77,7 +80,7 @@ public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsAnyOfDescriptor Filter(Action configure) + public IntervalsAnyOfDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -97,7 +100,7 @@ public IntervalsAnyOfDescriptor Intervals(ICollection Intervals(IntervalsDescriptor descriptor) + public IntervalsAnyOfDescriptor Intervals(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor descriptor) { IntervalsValue = null; IntervalsDescriptorAction = null; @@ -106,7 +109,7 @@ public IntervalsAnyOfDescriptor Intervals(IntervalsDescriptor Intervals(Action> configure) + public IntervalsAnyOfDescriptor Intervals(Action> configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -115,7 +118,7 @@ public IntervalsAnyOfDescriptor Intervals(Action Intervals(params Action>[] configure) + public IntervalsAnyOfDescriptor Intervals(params Action>[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -135,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -154,7 +157,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -163,7 +166,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); @@ -187,12 +190,12 @@ public IntervalsAnyOfDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private ICollection IntervalsValue { get; set; } - private IntervalsDescriptor IntervalsDescriptor { get; set; } - private Action IntervalsDescriptorAction { get; set; } - private Action[] IntervalsDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor IntervalsDescriptor { get; set; } + private Action IntervalsDescriptorAction { get; set; } + private Action[] IntervalsDescriptorActions { get; set; } /// /// Rule used to filter returned intervals. @@ -205,7 +208,7 @@ public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.In return Self; } - public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsAnyOfDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -213,7 +216,7 @@ public IntervalsAnyOfDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsAnyOfDescriptor Filter(Action configure) + public IntervalsAnyOfDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -233,7 +236,7 @@ public IntervalsAnyOfDescriptor Intervals(ICollection configure) + public IntervalsAnyOfDescriptor Intervals(Action configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -251,7 +254,7 @@ public IntervalsAnyOfDescriptor Intervals(Action configure) return Self; } - public IntervalsAnyOfDescriptor Intervals(params Action[] configure) + public IntervalsAnyOfDescriptor Intervals(params Action[] configure) { IntervalsValue = null; IntervalsDescriptor = null; @@ -271,7 +274,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -290,7 +293,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("intervals"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new IntervalsDescriptor(IntervalsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(IntervalsDescriptorAction), options); writer.WriteEndArray(); } else if (IntervalsDescriptorActions is not null) @@ -299,7 +302,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in IntervalsDescriptorActions) { - JsonSerializer.Serialize(writer, new IntervalsDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs index b12dfd0c5fb..2f44d8af27b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -44,6 +45,28 @@ internal IntervalsFilter(string variantName, object variant) internal object Variant { get; } internal string VariantName { get; } + + public static IntervalsFilter After(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("after", intervalsContainer); + public static IntervalsFilter Before(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("before", intervalsContainer); + public static IntervalsFilter ContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("contained_by", intervalsContainer); + public static IntervalsFilter Containing(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("containing", intervalsContainer); + public static IntervalsFilter NotContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_contained_by", intervalsContainer); + public static IntervalsFilter NotContaining(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_containing", intervalsContainer); + public static IntervalsFilter NotOverlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("not_overlapping", intervalsContainer); + public static IntervalsFilter Overlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => new IntervalsFilter("overlapping", intervalsContainer); + public static IntervalsFilter Script(Elastic.Clients.Elasticsearch.Script script) => new IntervalsFilter("script", script); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class IntervalsFilterConverter : JsonConverter @@ -55,23 +78,129 @@ public override IntervalsFilter Read(ref Utf8JsonReader reader, Type typeToConve throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); + 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 == "after") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "before") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "contained_by") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_contained_by") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "not_overlapping") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "overlapping") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'IntervalsFilter' from the response."); } - var propertyName = reader.GetString(); reader.Read(); - throw new JsonException(); + var result = new IntervalsFilter(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, IntervalsFilter value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "after": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "before": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "contained_by": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "not_contained_by": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "not_containing": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "not_overlapping": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "overlapping": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, options); + break; + case "script": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.Script)value.Variant, options); + break; + } } writer.WriteEndObject(); @@ -109,24 +238,40 @@ private IntervalsFilterDescriptor Set(object variant, string variantN return Self; } + public IntervalsFilterDescriptor After(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "after"); + public IntervalsFilterDescriptor After(Action> configure) => Set(configure, "after"); + public IntervalsFilterDescriptor Before(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "before"); + public IntervalsFilterDescriptor Before(Action> configure) => Set(configure, "before"); + public IntervalsFilterDescriptor ContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "contained_by"); + public IntervalsFilterDescriptor ContainedBy(Action> configure) => Set(configure, "contained_by"); + public IntervalsFilterDescriptor Containing(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "containing"); + public IntervalsFilterDescriptor Containing(Action> configure) => Set(configure, "containing"); + public IntervalsFilterDescriptor NotContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_contained_by"); + public IntervalsFilterDescriptor NotContainedBy(Action> configure) => Set(configure, "not_contained_by"); + public IntervalsFilterDescriptor NotContaining(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_containing"); + public IntervalsFilterDescriptor NotContaining(Action> configure) => Set(configure, "not_containing"); + public IntervalsFilterDescriptor NotOverlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_overlapping"); + public IntervalsFilterDescriptor NotOverlapping(Action> configure) => Set(configure, "not_overlapping"); + public IntervalsFilterDescriptor Overlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "overlapping"); + public IntervalsFilterDescriptor Overlapping(Action> configure) => Set(configure, "overlapping"); + public IntervalsFilterDescriptor Script(Elastic.Clients.Elasticsearch.Script script) => Set(script, "script"); + 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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -162,24 +307,40 @@ private IntervalsFilterDescriptor Set(object variant, string variantName) return Self; } + public IntervalsFilterDescriptor After(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "after"); + public IntervalsFilterDescriptor After(Action configure) => Set(configure, "after"); + public IntervalsFilterDescriptor Before(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "before"); + public IntervalsFilterDescriptor Before(Action configure) => Set(configure, "before"); + public IntervalsFilterDescriptor ContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "contained_by"); + public IntervalsFilterDescriptor ContainedBy(Action configure) => Set(configure, "contained_by"); + public IntervalsFilterDescriptor Containing(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "containing"); + public IntervalsFilterDescriptor Containing(Action configure) => Set(configure, "containing"); + public IntervalsFilterDescriptor NotContainedBy(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_contained_by"); + public IntervalsFilterDescriptor NotContainedBy(Action configure) => Set(configure, "not_contained_by"); + public IntervalsFilterDescriptor NotContaining(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_containing"); + public IntervalsFilterDescriptor NotContaining(Action configure) => Set(configure, "not_containing"); + public IntervalsFilterDescriptor NotOverlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "not_overlapping"); + public IntervalsFilterDescriptor NotOverlapping(Action configure) => Set(configure, "not_overlapping"); + public IntervalsFilterDescriptor Overlapping(Elastic.Clients.Elasticsearch.QueryDsl.Intervals intervalsContainer) => Set(intervalsContainer, "overlapping"); + public IntervalsFilterDescriptor Overlapping(Action configure) => Set(configure, "overlapping"); + public IntervalsFilterDescriptor Script(Elastic.Clients.Elasticsearch.Script script) => Set(script, "script"); + 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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs index 138be9590b6..647253b4e60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs @@ -64,6 +64,9 @@ public sealed partial class IntervalsFuzzy /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsFuzzy intervalsFuzzy) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.Fuzzy(intervalsFuzzy); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsFuzzy intervalsFuzzy) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.Fuzzy(intervalsFuzzy); } public sealed partial class IntervalsFuzzyDescriptor : SerializableDescriptor> @@ -144,6 +147,15 @@ public IntervalsFuzzyDescriptor UseField(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs index 731532e5152..c812a3f1e4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs @@ -64,6 +64,9 @@ public sealed partial class IntervalsMatch /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsMatch intervalsMatch) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.Match(intervalsMatch); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsMatch intervalsMatch) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.Match(intervalsMatch); } public sealed partial class IntervalsMatchDescriptor : SerializableDescriptor> @@ -76,8 +79,8 @@ public IntervalsMatchDescriptor() : base() private string? AnalyzerValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action> FilterDescriptorAction { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } private string QueryValue { get; set; } @@ -103,7 +106,7 @@ public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch. return Self; } - public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -111,7 +114,7 @@ public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor desc return Self; } - public IntervalsMatchDescriptor Filter(Action configure) + public IntervalsMatchDescriptor Filter(Action> configure) { FilterValue = null; FilterDescriptor = null; @@ -164,6 +167,15 @@ public IntervalsMatchDescriptor UseField(Expression + /// 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(); @@ -181,7 +193,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { @@ -223,8 +235,8 @@ public IntervalsMatchDescriptor() : base() private string? AnalyzerValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter? FilterValue { get; set; } - private IntervalsFilterDescriptor FilterDescriptor { get; set; } - private Action FilterDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor FilterDescriptor { get; set; } + private Action FilterDescriptorAction { get; set; } private int? MaxGapsValue { get; set; } private bool? OrderedValue { get; set; } private string QueryValue { get; set; } @@ -250,7 +262,7 @@ public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.In return Self; } - public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) + public IntervalsMatchDescriptor Filter(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor descriptor) { FilterValue = null; FilterDescriptorAction = null; @@ -258,7 +270,7 @@ public IntervalsMatchDescriptor Filter(IntervalsFilterDescriptor descriptor) return Self; } - public IntervalsMatchDescriptor Filter(Action configure) + public IntervalsMatchDescriptor Filter(Action configure) { FilterValue = null; FilterDescriptor = null; @@ -337,7 +349,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (FilterDescriptorAction is not null) { writer.WritePropertyName("filter"); - JsonSerializer.Serialize(writer, new IntervalsFilterDescriptor(FilterDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterDescriptor(FilterDescriptorAction), options); } else if (FilterValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs index 0cac465b432..1cc18122447 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs @@ -46,6 +46,9 @@ public sealed partial class IntervalsPrefix /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsPrefix intervalsPrefix) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.Prefix(intervalsPrefix); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsPrefix intervalsPrefix) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.Prefix(intervalsPrefix); } public sealed partial class IntervalsPrefixDescriptor : SerializableDescriptor> @@ -96,6 +99,15 @@ public IntervalsPrefixDescriptor UseField(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs index bfbad9fe569..bb0a6334b5e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -28,11 +29,9 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; [JsonConverter(typeof(IntervalsQueryConverter))] -public sealed partial class IntervalsQuery : SearchQuery +public sealed partial class IntervalsQuery { - internal object Variant { get; } - - internal IntervalsQuery(Field field, string variantName, object variant) + internal IntervalsQuery(string variantName, object variant) { if (variantName is null) throw new ArgumentNullException(nameof(variantName)); @@ -40,32 +39,39 @@ internal IntervalsQuery(Field field, string variantName, object variant) 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 object Variant { get; } internal string VariantName { get; } - public static IntervalsQuery AllOf(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => new IntervalsQuery(field, "all_of", intervalsAllOf); - public static IntervalsQuery AnyOf(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => new IntervalsQuery(field, "any_of", intervalsAnyOf); - public static IntervalsQuery Fuzzy(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => new IntervalsQuery(field, "fuzzy", intervalsFuzzy); - public static IntervalsQuery Match(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => new IntervalsQuery(field, "match", intervalsMatch); - public static IntervalsQuery Prefix(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => new IntervalsQuery(field, "prefix", intervalsPrefix); - public static IntervalsQuery Wildcard(Field field, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard intervalsWildcard) => new IntervalsQuery(field, "wildcard", intervalsWildcard); + public static IntervalsQuery AllOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => new IntervalsQuery("all_of", intervalsAllOf); + public static IntervalsQuery AnyOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => new IntervalsQuery("any_of", intervalsAnyOf); + public static IntervalsQuery Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => new IntervalsQuery("fuzzy", intervalsFuzzy); + public static IntervalsQuery Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => new IntervalsQuery("match", intervalsMatch); + public static IntervalsQuery Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => new IntervalsQuery("prefix", intervalsPrefix); + public static IntervalsQuery Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard intervalsWildcard) => new IntervalsQuery("wildcard", intervalsWildcard); - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } - [JsonInclude, JsonPropertyName("field")] - public Elastic.Clients.Elasticsearch.Field Field { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(IntervalsQuery intervalsQuery) => QueryDsl.Query.Intervals(intervalsQuery); + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("intervals", this); + return false; + } } internal sealed partial class IntervalsQueryConverter : JsonConverter @@ -77,18 +83,10 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver 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; + string? queryNameValue = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -103,15 +101,15 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver var propertyName = reader.GetString(); reader.Read(); - if (propertyName == "_name") + if (propertyName == "boost") { - nameValue = JsonSerializer.Deserialize(ref reader, options); + boostValue = JsonSerializer.Deserialize(ref reader, options); continue; } - if (propertyName == "boost") + if (propertyName == "_name") { - boostValue = JsonSerializer.Deserialize(ref reader, options); + queryNameValue = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -161,65 +159,54 @@ public override IntervalsQuery Read(ref Utf8JsonReader reader, Type typeToConver } reader.Read(); - var result = new IntervalsQuery(fieldName, variantNameValue, variantValue); - result.QueryName = nameValue; + var result = new IntervalsQuery(variantNameValue, variantValue); result.Boost = boostValue; + result.QueryName = queryNameValue; 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(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) { - writer.WritePropertyName(value.VariantName); - switch (value.VariantName) - { - case "all_of": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, options); - break; - case "any_of": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, options); - break; - case "fuzzy": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, options); - break; - case "match": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, options); - break; - case "prefix": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, options); - break; - case "wildcard": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, options); - break; - } + case "all_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, options); + break; + case "any_of": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, options); + break; + case "fuzzy": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, options); + break; + case "match": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, options); + break; + case "prefix": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, options); + break; + case "wildcard": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, options); + break; } - - writer.WriteEndObject(); - writer.WriteEndObject(); - return; } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); } } @@ -227,17 +214,10 @@ public sealed partial class IntervalsQueryDescriptor : SerializableDe { internal IntervalsQueryDescriptor(Action> configure) => configure.Invoke(this); - internal IntervalsQueryDescriptor() : base() + public 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; } @@ -262,50 +242,38 @@ private IntervalsQueryDescriptor Set(object variant, string variantNa } private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public IntervalsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public IntervalsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public IntervalsQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - public IntervalsQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; 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"); + public IntervalsQueryDescriptor AllOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action> configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action> configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action> configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.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 (BoostValue.HasValue) { @@ -326,7 +294,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); writer.WriteEndObject(); - writer.WriteEndObject(); return; } @@ -334,7 +301,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WriteEndObject(); - writer.WriteEndObject(); } } @@ -342,17 +308,10 @@ public sealed partial class IntervalsQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal IntervalsQueryDescriptor() : base() + public 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; } @@ -377,62 +336,38 @@ private IntervalsQueryDescriptor Set(object variant, string variantName) } private float? BoostValue { get; set; } - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public IntervalsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public IntervalsQueryDescriptor Field(Elastic.Clients.Elasticsearch.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 QueryName(string? queryName) { QueryNameValue = queryName; 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"); + public IntervalsQueryDescriptor AllOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf intervalsAllOf) => Set(intervalsAllOf, "all_of"); + public IntervalsQueryDescriptor AllOf(Action configure) => Set(configure, "all_of"); + public IntervalsQueryDescriptor AnyOf(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf intervalsAnyOf) => Set(intervalsAnyOf, "any_of"); + public IntervalsQueryDescriptor AnyOf(Action configure) => Set(configure, "any_of"); + public IntervalsQueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy intervalsFuzzy) => Set(intervalsFuzzy, "fuzzy"); + public IntervalsQueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public IntervalsQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch intervalsMatch) => Set(intervalsMatch, "match"); + public IntervalsQueryDescriptor Match(Action configure) => Set(configure, "match"); + public IntervalsQueryDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix intervalsPrefix) => Set(intervalsPrefix, "prefix"); + public IntervalsQueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public IntervalsQueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.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 (BoostValue.HasValue) { @@ -453,7 +388,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); writer.WriteEndObject(); - writer.WriteEndObject(); return; } @@ -461,6 +395,5 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WriteEndObject(); - writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs index e5aeab699f5..1426a036f2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs @@ -46,6 +46,9 @@ public sealed partial class IntervalsWildcard /// [JsonInclude, JsonPropertyName("use_field")] public Elastic.Clients.Elasticsearch.Field? UseField { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Intervals(IntervalsWildcard intervalsWildcard) => Elastic.Clients.Elasticsearch.QueryDsl.Intervals.Wildcard(intervalsWildcard); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(IntervalsWildcard intervalsWildcard) => Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery.Wildcard(intervalsWildcard); } public sealed partial class IntervalsWildcardDescriptor : SerializableDescriptor> @@ -96,6 +99,15 @@ public IntervalsWildcardDescriptor UseField(Expression + /// 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(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs index b08214e3932..a383df14cf1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs @@ -30,13 +30,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; +/// +/// Text that we want similar documents for or a lookup to a document's field for the text. +/// Learn more about this API in the Elasticsearch documentation. +/// public sealed partial class Like : Union { - public Like(string text) : base(text) + public Like(string Text) : base(Text) { } - public Like(Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument document) : base(document) + public Like(Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument Document) : base(Document) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs index 1645a4a94d2..1e951a1636c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs @@ -29,6 +29,14 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; public sealed partial class LikeDocument { + /// + /// A document not present in the index. + /// + [JsonInclude, JsonPropertyName("doc")] + public object? Doc { get; set; } + [JsonInclude, JsonPropertyName("fields")] + public ICollection? Fields { get; set; } + /// /// ID of a document. /// @@ -40,14 +48,6 @@ public sealed partial class LikeDocument /// [JsonInclude, JsonPropertyName("_index")] public Elastic.Clients.Elasticsearch.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")] @@ -67,7 +67,7 @@ public LikeDocumentDescriptor() : base() } private object? DocValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Id? IdValue { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } @@ -84,7 +84,7 @@ public LikeDocumentDescriptor Doc(object? doc) return Self; } - public LikeDocumentDescriptor Fields(Fields? fields) + public LikeDocumentDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -171,10 +171,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -196,7 +196,7 @@ public LikeDocumentDescriptor() : base() } private object? DocValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Id? IdValue { get; set; } private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } private IDictionary? PerFieldAnalyzerValue { get; set; } @@ -213,7 +213,7 @@ public LikeDocumentDescriptor Doc(object? doc) return Self; } - public LikeDocumentDescriptor Fields(Fields? fields) + public LikeDocumentDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -300,10 +300,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs index 5e9658d7347..a8974a0b226 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class MatchAllQuery : SearchQuery +public sealed partial class MatchAllQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchAllQuery matchAllQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MatchAll(matchAllQuery); } public sealed partial class MatchAllQueryDescriptor : SerializableDescriptor @@ -50,6 +51,9 @@ public MatchAllQueryDescriptor() : base() private float? BoostValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchAllQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs index 9a3506456ed..21550b2de21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs @@ -118,99 +118,98 @@ public override void Write(Utf8JsonWriter writer, MatchBoolPrefixQuery value, Js { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.Fuzziness is not null) - { - writer.WritePropertyName("fuzziness"); - JsonSerializer.Serialize(writer, value.Fuzziness, options); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.FuzzyRewrite is not null) - { - writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.FuzzyTranspositions.HasValue) - { - writer.WritePropertyName("fuzzy_transpositions"); - writer.WriteBooleanValue(value.FuzzyTranspositions.Value); - } + if (!string.IsNullOrEmpty(value.FuzzyRewrite)) + { + writer.WritePropertyName("fuzzy_rewrite"); + writer.WriteStringValue(value.FuzzyRewrite); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.FuzzyTranspositions.HasValue) + { + writer.WritePropertyName("fuzzy_transpositions"); + writer.WriteBooleanValue(value.FuzzyTranspositions.Value); + } - if (value.MinimumShouldMatch is not null) - { - writer.WritePropertyName("minimum_should_match"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Operator is not null) - { - writer.WritePropertyName("operator"); - JsonSerializer.Serialize(writer, value.Operator, options); - } + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchBoolPrefixQueryConverter))] -public sealed partial class MatchBoolPrefixQuery : SearchQuery +public sealed partial class MatchBoolPrefixQuery { - public MatchBoolPrefixQuery(Field field) + public MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Maximum edit distance allowed for matching.
Can be applied to the term subqueries constructed for all terms but the final term.
@@ -251,35 +250,19 @@ public MatchBoolPrefixQuery(Field field) /// 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.Field Field { get; set; } - - public static implicit operator Query(MatchBoolPrefixQuery matchBoolPrefixQuery) => QueryDsl.Query.MatchBoolPrefix(matchBoolPrefixQuery); + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("match_bool_prefix", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchBoolPrefixQuery matchBoolPrefixQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MatchBoolPrefix(matchBoolPrefixQuery); } public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescriptor> { internal MatchBoolPrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchBoolPrefixQueryDescriptor() : base() + public 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? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -302,6 +285,9 @@ public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchBoolPrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -320,6 +306,12 @@ public MatchBoolPrefixQueryDescriptor Field(Expression 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.
///
@@ -368,9 +360,9 @@ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clie /// /// Boolean logic used to interpret text in the query value.
Applied to the constructed bool query.
///
- public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -423,10 +415,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -476,17 +468,10 @@ public sealed partial class MatchBoolPrefixQueryDescriptor : SerializableDescrip { internal MatchBoolPrefixQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchBoolPrefixQueryDescriptor() : base() + public MatchBoolPrefixQueryDescriptor() : base() { } - public MatchBoolPrefixQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -509,6 +494,9 @@ public MatchBoolPrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchBoolPrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -581,9 +569,9 @@ public MatchBoolPrefixQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elastic /// /// Boolean logic used to interpret text in the query value.
Applied to the constructed bool query.
///
- public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MatchBoolPrefixQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -636,10 +624,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs index 0375a3da343..693a06f70b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class MatchNoneQuery : SearchQuery +public sealed partial class MatchNoneQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchNoneQuery matchNoneQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MatchNone(matchNoneQuery); } public sealed partial class MatchNoneQueryDescriptor : SerializableDescriptor @@ -50,6 +51,9 @@ public MatchNoneQueryDescriptor() : base() private float? BoostValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchNoneQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs index de5e1e8b602..b84011f6afd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs @@ -94,75 +94,74 @@ public override void Write(Utf8JsonWriter writer, MatchPhrasePrefixQuery value, { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.MaxExpansions.HasValue) - { - writer.WritePropertyName("max_expansions"); - writer.WriteNumberValue(value.MaxExpansions.Value); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Slop.HasValue) - { - writer.WritePropertyName("slop"); - writer.WriteNumberValue(value.Slop.Value); - } + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchPhrasePrefixQueryConverter))] -public sealed partial class MatchPhrasePrefixQuery : SearchQuery +public sealed partial class MatchPhrasePrefixQuery { - public MatchPhrasePrefixQuery(Field field) + public MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Maximum number of terms to which the last provided term of the query value will expand. @@ -173,6 +172,7 @@ public MatchPhrasePrefixQuery(Field field) /// Text you wish to find in the provided field. /// public string Query { get; set; } + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -183,33 +183,16 @@ public MatchPhrasePrefixQuery(Field field) /// Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a `stop` filter. /// public Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MatchPhrasePrefix(matchPhrasePrefixQuery); } public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescriptor> { internal MatchPhrasePrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchPhrasePrefixQueryDescriptor() : base() - { - } - - public MatchPhrasePrefixQueryDescriptor(Field field) + public MatchPhrasePrefixQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -230,6 +213,9 @@ public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhrasePrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -248,6 +234,12 @@ public MatchPhrasePrefixQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum number of terms to which the last provided term of the query value will expand. /// @@ -344,17 +336,10 @@ public sealed partial class MatchPhrasePrefixQueryDescriptor : SerializableDescr { internal MatchPhrasePrefixQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchPhrasePrefixQueryDescriptor() : base() + public MatchPhrasePrefixQueryDescriptor() : base() { } - public MatchPhrasePrefixQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -373,6 +358,9 @@ public MatchPhrasePrefixQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhrasePrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs index 1c310ccd112..3632479eb15 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs @@ -88,74 +88,74 @@ public override void Write(Utf8JsonWriter writer, MatchPhraseQuery value, JsonSe { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - writer.WritePropertyName("query"); - writer.WriteStringValue(value.Query); - 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.Slop.HasValue) - { - writer.WritePropertyName("slop"); - writer.WriteNumberValue(value.Slop.Value); - } + writer.WritePropertyName("query"); + writer.WriteStringValue(value.Query); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + if (value.Slop.HasValue) + { + writer.WritePropertyName("slop"); + writer.WriteNumberValue(value.Slop.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchPhraseQueryConverter))] -public sealed partial class MatchPhraseQuery : SearchQuery +public sealed partial class MatchPhraseQuery { - public MatchPhraseQuery(Field field) + public MatchPhraseQuery(Elastic.Clients.Elasticsearch.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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Query terms that are analyzed and turned into a phrase query. /// public string Query { get; set; } + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -166,33 +166,16 @@ public MatchPhraseQuery(Field field) /// Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter. /// public Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchPhraseQuery matchPhraseQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MatchPhrase(matchPhraseQuery); } public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor> { internal MatchPhraseQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchPhraseQueryDescriptor() : base() - { - } - - public MatchPhraseQueryDescriptor(Field field) + public MatchPhraseQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -212,6 +195,9 @@ public MatchPhraseQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhraseQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -230,6 +216,12 @@ public MatchPhraseQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Query terms that are analyzed and turned into a phrase query. /// @@ -311,17 +303,10 @@ public sealed partial class MatchPhraseQueryDescriptor : SerializableDescriptor< { internal MatchPhraseQueryDescriptor(Action configure) => configure.Invoke(this); - internal MatchPhraseQueryDescriptor() : base() + public MatchPhraseQueryDescriptor() : base() { } - public MatchPhraseQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -339,6 +324,9 @@ public MatchPhraseQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchPhraseQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs index 88ed5380bb4..5ccecdf76f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs @@ -110,7 +110,7 @@ public override MatchQuery Read(ref Utf8JsonReader reader, Type typeToConvert, J if (property == "query") { - variant.Query = JsonSerializer.Deserialize(ref reader, options); + variant.Query = JsonSerializer.Deserialize(ref reader, options); continue; } @@ -136,112 +136,106 @@ public override void Write(Utf8JsonWriter writer, MatchQuery value, JsonSerializ { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(value.Analyzer)) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("analyzer"); + writer.WriteStringValue(value.Analyzer); + } - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } + if (value.AutoGenerateSynonymsPhraseQuery.HasValue) + { + writer.WritePropertyName("auto_generate_synonyms_phrase_query"); + writer.WriteBooleanValue(value.AutoGenerateSynonymsPhraseQuery.Value); + } - if (value.Fuzziness is not null) - { - writer.WritePropertyName("fuzziness"); - JsonSerializer.Serialize(writer, value.Fuzziness, options); - } + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.FuzzyRewrite is not null) - { - writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, value.FuzzyRewrite, options); - } + if (value.Fuzziness is not null) + { + writer.WritePropertyName("fuzziness"); + JsonSerializer.Serialize(writer, value.Fuzziness, options); + } - if (value.FuzzyTranspositions.HasValue) - { - writer.WritePropertyName("fuzzy_transpositions"); - writer.WriteBooleanValue(value.FuzzyTranspositions.Value); - } + if (!string.IsNullOrEmpty(value.FuzzyRewrite)) + { + writer.WritePropertyName("fuzzy_rewrite"); + writer.WriteStringValue(value.FuzzyRewrite); + } - if (value.Lenient.HasValue) - { - writer.WritePropertyName("lenient"); - writer.WriteBooleanValue(value.Lenient.Value); - } + 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.Lenient.HasValue) + { + writer.WritePropertyName("lenient"); + writer.WriteBooleanValue(value.Lenient.Value); + } - if (value.MinimumShouldMatch is not null) - { - writer.WritePropertyName("minimum_should_match"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); - } + if (value.MaxExpansions.HasValue) + { + writer.WritePropertyName("max_expansions"); + writer.WriteNumberValue(value.MaxExpansions.Value); + } - if (value.Operator is not null) - { - writer.WritePropertyName("operator"); - JsonSerializer.Serialize(writer, value.Operator, options); - } + if (value.MinimumShouldMatch is not null) + { + writer.WritePropertyName("minimum_should_match"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatch, options); + } - if (value.PrefixLength.HasValue) - { - writer.WritePropertyName("prefix_length"); - writer.WriteNumberValue(value.PrefixLength.Value); - } + if (value.Operator is not null) + { + writer.WritePropertyName("operator"); + JsonSerializer.Serialize(writer, value.Operator, options); + } - writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, value.Query, options); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + if (value.PrefixLength.HasValue) + { + writer.WritePropertyName("prefix_length"); + writer.WriteNumberValue(value.PrefixLength.Value); + } - if (value.ZeroTermsQuery is not null) - { - writer.WritePropertyName("zero_terms_query"); - JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); - } + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, value.Query, options); + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.ZeroTermsQuery is not null) + { + writer.WritePropertyName("zero_terms_query"); + JsonSerializer.Serialize(writer, value.ZeroTermsQuery, options); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(MatchQueryConverter))] -public sealed partial class MatchQuery : SearchQuery +public sealed partial class MatchQuery { - public MatchQuery(Field field) + public MatchQuery(Elastic.Clients.Elasticsearch.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. /// @@ -251,7 +245,12 @@ public MatchQuery(Field field) /// If `true`, match phrase queries are automatically created for multi-term synonyms. /// public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Maximum edit distance allowed for matching. @@ -296,39 +295,23 @@ public MatchQuery(Field field) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public string Query { get; set; } + public object Query { get; set; } + public string? QueryName { 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.QueryDsl.ZeroTermsQuery? ZeroTermsQuery { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MatchQuery matchQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Match(matchQuery); } public sealed partial class MatchQueryDescriptor : SerializableDescriptor> { internal MatchQueryDescriptor(Action> configure) => configure.Invoke(this); - internal MatchQueryDescriptor() : base() - { - } - - public MatchQueryDescriptor(Field field) + public MatchQueryDescriptor() : base() { - 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? AnalyzerValue { get; set; } @@ -343,7 +326,7 @@ public MatchQueryDescriptor(Expression> field) private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Operator? OperatorValue { get; set; } private int? PrefixLengthValue { get; set; } - private string QueryValue { get; set; } + private object QueryValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } @@ -365,6 +348,9 @@ public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? aut return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -383,6 +369,12 @@ public MatchQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Maximum edit distance allowed for matching. /// @@ -440,9 +432,9 @@ public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasti /// /// Boolean logic used to interpret text in the query value. /// - public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -458,7 +450,7 @@ public MatchQueryDescriptor PrefixLength(int? prefixLength) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public MatchQueryDescriptor Query(string query) + public MatchQueryDescriptor Query(object query) { QueryValue = query; return Self; @@ -510,10 +502,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -575,17 +567,10 @@ public sealed partial class MatchQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal MatchQueryDescriptor() : base() + public MatchQueryDescriptor() : base() { } - public MatchQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private string? AnalyzerValue { get; set; } private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } @@ -598,7 +583,7 @@ public MatchQueryDescriptor(Field field) private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Operator? OperatorValue { get; set; } private int? PrefixLengthValue { get; set; } - private string QueryValue { get; set; } + private object QueryValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? ZeroTermsQueryValue { get; set; } @@ -620,6 +605,9 @@ public MatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSy return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -701,9 +689,9 @@ public MatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearch.Min /// /// Boolean logic used to interpret text in the query value. /// - public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -719,7 +707,7 @@ public MatchQueryDescriptor PrefixLength(int? prefixLength) /// /// Text, number, boolean value or date you wish to find in the provided field. /// - public MatchQueryDescriptor Query(string query) + public MatchQueryDescriptor Query(object query) { QueryValue = query; return Self; @@ -771,10 +759,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs index 7a2e089afb0..5fba455f0e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class MoreLikeThisQuery : SearchQuery +public sealed partial class MoreLikeThisQuery { - [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -56,7 +57,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery /// 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; } + public ICollection? Fields { get; set; } /// /// Specifies whether the input documents should also be included in the search results returned. @@ -95,6 +96,12 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [JsonInclude, JsonPropertyName("min_doc_freq")] public int? MinDocFreq { 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.MinimumShouldMatch? MinimumShouldMatch { get; set; } + /// /// The minimum term frequency below which the terms are ignored from the input document. /// @@ -107,17 +114,13 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [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.MinimumShouldMatch? MinimumShouldMatch { get; set; } - /// /// Overrides the default analyzer. /// [JsonInclude, JsonPropertyName("per_field_analyzer")] public IDictionary? PerFieldAnalyzer { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } [JsonInclude, JsonPropertyName("routing")] public Elastic.Clients.Elasticsearch.Routing? Routing { get; set; } @@ -125,7 +128,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery /// An array of stop words.
Any word in this set is ignored.
///
[JsonInclude, JsonPropertyName("stop_words")] - [JsonConverter(typeof(StopWordsConverter))] + [SingleOrManyCollectionConverter(typeof(string))] public ICollection? StopWords { get; set; } /// @@ -139,9 +142,7 @@ public sealed partial class MoreLikeThisQuery : SearchQuery [JsonInclude, JsonPropertyName("version_type")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MoreLikeThisQuery moreLikeThisQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MoreLikeThis(moreLikeThisQuery); } public sealed partial class MoreLikeThisQueryDescriptor : SerializableDescriptor> @@ -156,7 +157,7 @@ public MoreLikeThisQueryDescriptor() : base() private float? BoostValue { get; set; } private double? BoostTermsValue { get; set; } private bool? FailOnUnsupportedFieldValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private bool? IncludeValue { get; set; } private ICollection LikeValue { get; set; } private int? MaxDocFreqValue { get; set; } @@ -183,6 +184,9 @@ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MoreLikeThisQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -210,7 +214,7 @@ public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failO /// /// 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) + public MoreLikeThisQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -461,10 +465,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) @@ -489,7 +493,7 @@ public MoreLikeThisQueryDescriptor() : base() private float? BoostValue { get; set; } private double? BoostTermsValue { get; set; } private bool? FailOnUnsupportedFieldValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private bool? IncludeValue { get; set; } private ICollection LikeValue { get; set; } private int? MaxDocFreqValue { get; set; } @@ -516,6 +520,9 @@ public MoreLikeThisQueryDescriptor Analyzer(string? analyzer) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MoreLikeThisQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -543,7 +550,7 @@ public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failOnUnsupporte /// /// 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) + public MoreLikeThisQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -794,10 +801,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o SingleOrManySerializationHelper.Serialize(UnlikeValue, writer, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } if (VersionTypeValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs index 715e844e8e7..6fb6c7fb0ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs @@ -27,11 +27,8 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class MultiMatchQuery : SearchQuery +public sealed partial class MultiMatchQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } - /// /// Analyzer used to convert the text in the query value into tokens. /// @@ -43,6 +40,10 @@ public sealed partial class MultiMatchQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("auto_generate_synonyms_phrase_query")] public bool? AutoGenerateSynonymsPhraseQuery { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -105,6 +106,8 @@ public sealed partial class MultiMatchQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Maximum number of positions allowed between matching tokens. @@ -130,9 +133,7 @@ public sealed partial class MultiMatchQuery : SearchQuery [JsonInclude, JsonPropertyName("zero_terms_query")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(MultiMatchQuery multiMatchQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.MultiMatch(multiMatchQuery); } public sealed partial class MultiMatchQueryDescriptor : SerializableDescriptor> @@ -180,6 +181,9 @@ public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MultiMatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -252,9 +256,9 @@ public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.E /// /// Boolean logic used to interpret text in the query value. /// - public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -351,10 +355,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -474,6 +478,9 @@ public MultiMatchQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGener return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public MultiMatchQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -546,9 +553,9 @@ public MultiMatchQueryDescriptor MinimumShouldMatch(Elastic.Clients.Elasticsearc /// /// Boolean logic used to interpret text in the query value. /// - public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? op) + public MultiMatchQueryDescriptor Operator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) { - OperatorValue = op; + OperatorValue = value; return Self; } @@ -645,10 +652,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FuzzinessValue, options); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs index 777d56afc0c..e7744e59d46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class NestedQuery : SearchQuery +public sealed partial class NestedQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -57,6 +58,8 @@ public sealed partial class NestedQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// How scores for matching child objects affect the root parent document’s relevance score. @@ -64,9 +67,7 @@ public sealed partial class NestedQuery : SearchQuery [JsonInclude, JsonPropertyName("score_mode")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(NestedQuery nestedQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Nested(nestedQuery); } public sealed partial class NestedQueryDescriptor : SerializableDescriptor> @@ -80,15 +81,18 @@ public NestedQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action> InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action> InnerHitsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field PathValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NestedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -115,7 +119,7 @@ public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch. return Self; } - public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -123,7 +127,7 @@ public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescripto return Self; } - public NestedQueryDescriptor InnerHits(Action> configure) + public NestedQueryDescriptor InnerHits(Action> configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -149,6 +153,15 @@ public NestedQueryDescriptor Path(Expression + /// Path to the nested object you wish to search. + ///
+ public NestedQueryDescriptor Path(Expression> path) + { + PathValue = path; + return Self; + } + /// /// Query you wish to run on nested objects in the path. /// @@ -160,7 +173,7 @@ public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.Quer return Self; } - public NestedQueryDescriptor Query(QueryDescriptor descriptor) + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -168,7 +181,7 @@ public NestedQueryDescriptor Query(QueryDescriptor descrip return Self; } - public NestedQueryDescriptor Query(Action> configure) + public NestedQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -214,7 +227,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -232,7 +245,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -267,15 +280,18 @@ public NestedQueryDescriptor() : base() private float? BoostValue { get; set; } private bool? IgnoreUnmappedValue { get; set; } private Elastic.Clients.Elasticsearch.Core.Search.InnerHits? InnerHitsValue { get; set; } - private Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } - private Action InnerHitsDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor InnerHitsDescriptor { get; set; } + private Action InnerHitsDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.Field PathValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? ScoreModeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NestedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -302,7 +318,7 @@ public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search return Self; } - public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descriptor) + public NestedQueryDescriptor InnerHits(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor descriptor) { InnerHitsValue = null; InnerHitsDescriptorAction = null; @@ -310,7 +326,7 @@ public NestedQueryDescriptor InnerHits(Core.Search.InnerHitsDescriptor descripto return Self; } - public NestedQueryDescriptor InnerHits(Action configure) + public NestedQueryDescriptor InnerHits(Action configure) { InnerHitsValue = null; InnerHitsDescriptor = null; @@ -356,7 +372,7 @@ public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query return Self; } - public NestedQueryDescriptor Query(QueryDescriptor descriptor) + public NestedQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -364,7 +380,7 @@ public NestedQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public NestedQueryDescriptor Query(Action configure) + public NestedQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -410,7 +426,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (InnerHitsDescriptorAction is not null) { writer.WritePropertyName("inner_hits"); - JsonSerializer.Serialize(writer, new Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor(InnerHitsDescriptorAction), options); } else if (InnerHitsValue is not null) { @@ -428,7 +444,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs index f38bff250de..5c7d25201f2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -106,86 +106,85 @@ public override void Write(Utf8JsonWriter writer, NumberRangeQuery value, JsonSe { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.From.HasValue) - { - writer.WritePropertyName("from"); - writer.WriteNumberValue(value.From.Value); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.Gt.HasValue) - { - writer.WritePropertyName("gt"); - writer.WriteNumberValue(value.Gt.Value); - } + if (value.From.HasValue) + { + writer.WritePropertyName("from"); + writer.WriteNumberValue(value.From.Value); + } - if (value.Gte.HasValue) - { - writer.WritePropertyName("gte"); - writer.WriteNumberValue(value.Gte.Value); - } + if (value.Gt.HasValue) + { + writer.WritePropertyName("gt"); + writer.WriteNumberValue(value.Gt.Value); + } - if (value.Lt.HasValue) - { - writer.WritePropertyName("lt"); - writer.WriteNumberValue(value.Lt.Value); - } + if (value.Gte.HasValue) + { + writer.WritePropertyName("gte"); + writer.WriteNumberValue(value.Gte.Value); + } - if (value.Lte.HasValue) - { - writer.WritePropertyName("lte"); - writer.WriteNumberValue(value.Lte.Value); - } + if (value.Lt.HasValue) + { + writer.WritePropertyName("lt"); + writer.WriteNumberValue(value.Lt.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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 (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (value.To.HasValue) - { - writer.WritePropertyName("to"); - writer.WriteNumberValue(value.To.Value); - } + if (value.Relation is not null) + { + writer.WritePropertyName("relation"); + JsonSerializer.Serialize(writer, value.Relation, options); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (value.To.HasValue) + { + writer.WritePropertyName("to"); + writer.WriteNumberValue(value.To.Value); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(NumberRangeQueryConverter))] -public sealed partial class NumberRangeQuery : RangeQuery +public sealed partial class NumberRangeQuery { - public NumberRangeQuery(Field field) + public NumberRangeQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } public double? From { get; set; } /// @@ -207,37 +206,23 @@ public NumberRangeQuery(Field field) /// Less than or equal to. /// public double? Lte { get; set; } + public string? QueryName { get; set; } + + /// + /// Indicates how the range query matches values for `range` fields. + /// public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } public double? To { get; set; } - public Elastic.Clients.Elasticsearch.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() : 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 float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private double? FromValue { get; set; } @@ -249,6 +234,9 @@ public NumberRangeQueryDescriptor(Expression> field) private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } private double? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NumberRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -267,6 +255,12 @@ public NumberRangeQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public NumberRangeQueryDescriptor From(double? from) { FromValue = from; @@ -315,6 +309,9 @@ public NumberRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) { RelationValue = relation; @@ -397,17 +394,10 @@ public sealed partial class NumberRangeQueryDescriptor : SerializableDescriptor< { internal NumberRangeQueryDescriptor(Action configure) => configure.Invoke(this); - internal NumberRangeQueryDescriptor() : base() + public NumberRangeQueryDescriptor() : base() { } - public NumberRangeQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private double? FromValue { get; set; } @@ -419,6 +409,9 @@ public NumberRangeQueryDescriptor(Field field) private Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? RelationValue { get; set; } private double? ToValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public NumberRangeQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -491,6 +484,9 @@ public NumberRangeQueryDescriptor QueryName(string? queryName) return Self; } + /// + /// Indicates how the range query matches values for `range` fields. + /// public NumberRangeQueryDescriptor Relation(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? relation) { RelationValue = relation; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs index 5ddb78d7935..61ef3a4c0f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class ParentIdQuery : SearchQuery +public sealed partial class ParentIdQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class ParentIdQuery : SearchQuery /// [JsonInclude, JsonPropertyName("ignore_unmapped")] public bool? IgnoreUnmapped { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Name of the child relationship mapped for the `join` field. @@ -52,9 +55,7 @@ public sealed partial class ParentIdQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(ParentIdQuery parentIdQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.ParentId(parentIdQuery); } public sealed partial class ParentIdQueryDescriptor : SerializableDescriptor @@ -71,6 +72,9 @@ public ParentIdQueryDescriptor() : base() private string? QueryNameValue { get; set; } private string? TypeValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ParentIdQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -137,10 +141,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (TypeValue is not null) + if (!string.IsNullOrEmpty(TypeValue)) { writer.WritePropertyName("type"); - JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteStringValue(TypeValue); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs index 8878c97f417..c676eabb891 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class PercolateQuery : SearchQuery +public sealed partial class PercolateQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -75,6 +76,8 @@ public sealed partial class PercolateQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("preference")] public string? Preference { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Routing used to fetch document to percolate. @@ -88,9 +91,7 @@ public sealed partial class PercolateQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(PercolateQuery percolateQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Percolate(percolateQuery); } public sealed partial class PercolateQueryDescriptor : SerializableDescriptor> @@ -113,6 +114,9 @@ public PercolateQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } private long? VersionValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PercolateQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -155,6 +159,15 @@ public PercolateQueryDescriptor Field(Expression + /// 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. /// @@ -274,10 +287,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); @@ -304,6 +317,9 @@ public PercolateQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.Routing? RoutingValue { get; set; } private long? VersionValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PercolateQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -474,10 +490,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, RoutingValue, options); } - if (VersionValue is not null) + if (VersionValue.HasValue) { writer.WritePropertyName("version"); - JsonSerializer.Serialize(writer, VersionValue, options); + writer.WriteNumberValue(VersionValue.Value); } writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs index 8d7aebe10b7..7759f0d2092 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -28,7 +29,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; [JsonConverter(typeof(PinnedQueryConverter))] -public sealed partial class PinnedQuery : SearchQuery +public sealed partial class PinnedQuery { internal PinnedQuery(string variantName, object variant) { @@ -45,11 +46,12 @@ internal PinnedQuery(string variantName, object 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); + public static PinnedQuery Docs(IReadOnlyCollection pinnedDoc) => new PinnedQuery("docs", pinnedDoc); + public static PinnedQuery Ids(IReadOnlyCollection id) => new PinnedQuery("ids", id); - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -58,10 +60,20 @@ internal PinnedQuery(string variantName, object variant) /// [JsonInclude, JsonPropertyName("organic")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Organic { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(PinnedQuery pinnedQuery) => QueryDsl.Query.Pinned(pinnedQuery); + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("pinned", this); + return false; + } } internal sealed partial class PinnedQueryConverter : JsonConverter @@ -75,9 +87,9 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, object? variantValue = default; string? variantNameValue = default; - string? nameValue = default; float? boostValue = default; Elastic.Clients.Elasticsearch.QueryDsl.Query organicValue = default; + string? queryNameValue = default; while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -92,12 +104,6 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, 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); @@ -110,6 +116,12 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, continue; } + if (propertyName == "_name") + { + queryNameValue = JsonSerializer.Deserialize(ref reader, options); + continue; + } + if (propertyName == "docs") { variantValue = JsonSerializer.Deserialize?>(ref reader, options); @@ -129,39 +141,43 @@ public override PinnedQuery Read(ref Utf8JsonReader reader, Type typeToConvert, reader.Read(); var result = new PinnedQuery(variantNameValue, variantValue); - result.QueryName = nameValue; result.Boost = boostValue; result.Organic = organicValue; + result.QueryName = queryNameValue; 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) + if (value.Organic is not null) + { + writer.WritePropertyName("organic"); + JsonSerializer.Serialize(writer, value.Organic, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + 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); + JsonSerializer.Serialize>(writer, (IReadOnlyCollection)value.Variant, options); break; case "ids": - JsonSerializer.Serialize>(writer, (ICollection)value.Variant, options); + JsonSerializer.Serialize>(writer, (IReadOnlyCollection)value.Variant, options); break; } } @@ -203,10 +219,11 @@ private PinnedQueryDescriptor Set(object variant, string variantName) private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action> OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PinnedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -218,34 +235,20 @@ public PinnedQueryDescriptor Boost(float? boost) /// public PinnedQueryDescriptor Organic(Elastic.Clients.Elasticsearch.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 Docs(IReadOnlyCollection pinnedDoc) => Set(pinnedDoc, "docs"); + public PinnedQueryDescriptor Docs(Action configure) => Set(configure, "docs"); + public PinnedQueryDescriptor Ids(IReadOnlyCollection id) => Set(id, "ids"); + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -255,17 +258,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - 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 + if (OrganicValue is not null) { writer.WritePropertyName("organic"); JsonSerializer.Serialize(writer, OrganicValue, options); @@ -327,10 +320,11 @@ private PinnedQueryDescriptor Set(object variant, string variantName) private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PinnedQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -342,34 +336,20 @@ public PinnedQueryDescriptor Boost(float? boost) /// public PinnedQueryDescriptor Organic(Elastic.Clients.Elasticsearch.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 Docs(IReadOnlyCollection pinnedDoc) => Set(pinnedDoc, "docs"); + public PinnedQueryDescriptor Docs(Action configure) => Set(configure, "docs"); + public PinnedQueryDescriptor Ids(IReadOnlyCollection id) => Set(id, "ids"); + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -379,17 +359,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(BoostValue.Value); } - 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 + if (OrganicValue is not null) { writer.WritePropertyName("organic"); JsonSerializer.Serialize(writer, OrganicValue, options); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs index c043457820c..ebd1b475d64 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs @@ -82,63 +82,63 @@ public override void Write(Utf8JsonWriter writer, PrefixQuery value, JsonSeriali { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(PrefixQueryConverter))] -public sealed partial class PrefixQuery : SearchQuery +public sealed partial class PrefixQuery { - public PrefixQuery(Field field) + public PrefixQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -149,33 +149,16 @@ public PrefixQuery(Field field) /// Beginning characters of terms you wish to find in the provided field. /// public string Value { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(PrefixQuery prefixQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Prefix(prefixQuery); } public sealed partial class PrefixQueryDescriptor : SerializableDescriptor> { internal PrefixQueryDescriptor(Action> configure) => configure.Invoke(this); - internal PrefixQueryDescriptor() : base() - { - } - - public PrefixQueryDescriptor(Field field) + public PrefixQueryDescriptor() : base() { - 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 float? BoostValue { get; set; } @@ -185,6 +168,9 @@ public PrefixQueryDescriptor(Expression> field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -212,6 +198,12 @@ public PrefixQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public PrefixQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -261,10 +253,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); @@ -278,15 +270,8 @@ public sealed partial class PrefixQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal PrefixQueryDescriptor() : base() - { - } - - public PrefixQueryDescriptor(Field field) + public PrefixQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -296,6 +281,9 @@ public PrefixQueryDescriptor(Field field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public PrefixQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -378,10 +366,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs index 7f7302728e8..4879683b0ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs @@ -21,16 +21,20 @@ using Elastic.Clients.Elasticsearch.Serialization; 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.QueryDsl; +/// +/// Learn more about this API in the Elasticsearch documentation. +/// [JsonConverter(typeof(QueryConverter))] public sealed partial class Query { - internal Query(string variantName, SearchQuery variant) + internal Query(string variantName, object variant) { if (variantName is null) throw new ArgumentNullException(nameof(variantName)); @@ -42,14 +46,8 @@ internal Query(string variantName, SearchQuery variant) 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; - } + internal object Variant { get; } + internal string VariantName { get; } public static Query Bool(Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery boolQuery) => new Query("bool", boolQuery); public static Query Boosting(Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery boostingQuery) => new Query("boosting", boostingQuery); @@ -102,8 +100,21 @@ internal void WrapVariant(string variantName, SearchQuery variant) public static Query Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery termsQuery) => new Query("terms", termsQuery); public static Query TermsSet(Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery termsSetQuery) => new Query("terms_set", termsSetQuery); public static Query TextExpansion(Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery textExpansionQuery) => new Query("text_expansion", textExpansionQuery); + public static Query WeightedTokens(Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery weightedTokensQuery) => new Query("weighted_tokens", weightedTokensQuery); public static Query Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery wildcardQuery) => new Query("wildcard", wildcardQuery); public static Query Wrapper(Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery wrapperQuery) => new Query("wrapper", wrapperQuery); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class QueryConverter : JsonConverter @@ -115,398 +126,412 @@ public override Query Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "bool") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "boosting") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "bool") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "combined_fields") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "boosting") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "constant_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "combined_fields") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "dis_max") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "constant_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "exists") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "dis_max") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "field_masking_span") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "exists") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "function_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "field_masking_span") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "fuzzy") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "function_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_bounding_box") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "fuzzy") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_distance") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_bounding_box") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "geo_polygon") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_distance") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "has_child") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "geo_polygon") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "has_parent") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "has_child") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "ids") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "has_parent") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "intervals") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "ids") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "knn") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "intervals") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "knn") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_all") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_bool_prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_all") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_none") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_bool_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_phrase") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_none") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "match_phrase_prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_phrase") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "more_like_this") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "match_phrase_prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "multi_match") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "more_like_this") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "nested") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "multi_match") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "parent_id") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "nested") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "percolate") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "parent_id") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "pinned") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "percolate") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "prefix") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "pinned") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "query_string") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "prefix") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "range") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "query_string") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rank_feature") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "range") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "raw_json") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "rank_feature") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "regexp") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "raw_json") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "rule_query") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "regexp") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "script") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "rule_query") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "script_score") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "script") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "simple_query_string") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "script_score") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_containing") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "simple_query_string") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_first") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_multi") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_first") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_near") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_multi") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_not") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_near") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_or") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_not") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_or") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_within") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "span_within") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms_set") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "text_expansion") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "terms_set") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wildcard") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); - } + if (propertyName == "text_expansion") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "wrapper") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new Query(propertyName, variant); + if (propertyName == "weighted_tokens") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "wildcard") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "wrapper") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Query' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Query(variantNameValue, variantValue); + return result; } 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) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -664,6 +689,9 @@ public override void Write(Utf8JsonWriter writer, Query value, JsonSerializerOpt case "text_expansion": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery)value.Variant, options); break; + case "weighted_tokens": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery)value.Variant, options); + break; case "wildcard": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, options); break; @@ -708,136 +736,129 @@ private QueryDescriptor Set(object variant, string variantName) 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 Knn(KnnQuery knnQuery) => Set(knnQuery, "knn"); - public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); - 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 Bool(Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action> configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action> configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action> configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action> configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action> configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action> configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action> configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action> configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action> configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action> configure) => Set(configure, "intervals"); + public QueryDescriptor Knn(Elastic.Clients.Elasticsearch.KnnQuery knnQuery) => Set(knnQuery, "knn"); + public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); + public QueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action> configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action> configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action> configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action> configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action> configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action> configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action> configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action> configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action> configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action> configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action> configure) => Set(configure, "query_string"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); + public QueryDescriptor RankFeature(Action> configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.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"); + public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action> configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action> configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action> configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action> configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action> configure) => Set(configure, "span_within"); + public QueryDescriptor Term(Elastic.Clients.Elasticsearch.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action> configure) => Set(configure, "term"); + public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action> configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action> configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action> configure) => Set(configure, "text_expansion"); + public QueryDescriptor WeightedTokens(Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery weightedTokensQuery) => Set(weightedTokensQuery, "weighted_tokens"); + public QueryDescriptor WeightedTokens(Action> configure) => Set(configure, "weighted_tokens"); + public QueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action> configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -873,182 +894,129 @@ private QueryDescriptor Set(object variant, string variantName) 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 Knn(KnnQuery knnQuery) => Set(knnQuery, "knn"); - public QueryDescriptor Knn(Action configure) => Set(configure, "knn"); - public QueryDescriptor Knn(Action> configure) => Set(configure, "knn"); - 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 Bool(Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery boolQuery) => Set(boolQuery, "bool"); + public QueryDescriptor Bool(Action configure) => Set(configure, "bool"); + public QueryDescriptor Boosting(Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery boostingQuery) => Set(boostingQuery, "boosting"); + public QueryDescriptor Boosting(Action configure) => Set(configure, "boosting"); + public QueryDescriptor CombinedFields(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery combinedFieldsQuery) => Set(combinedFieldsQuery, "combined_fields"); + public QueryDescriptor CombinedFields(Action configure) => Set(configure, "combined_fields"); + public QueryDescriptor ConstantScore(Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery constantScoreQuery) => Set(constantScoreQuery, "constant_score"); + public QueryDescriptor ConstantScore(Action configure) => Set(configure, "constant_score"); + public QueryDescriptor DisMax(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery disMaxQuery) => Set(disMaxQuery, "dis_max"); + public QueryDescriptor DisMax(Action configure) => Set(configure, "dis_max"); + public QueryDescriptor Exists(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery existsQuery) => Set(existsQuery, "exists"); + public QueryDescriptor Exists(Action configure) => Set(configure, "exists"); + public QueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public QueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public QueryDescriptor FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => Set(functionScoreQuery, "function_score"); + public QueryDescriptor FunctionScore(Action configure) => Set(configure, "function_score"); + public QueryDescriptor Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery fuzzyQuery) => Set(fuzzyQuery, "fuzzy"); + public QueryDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); + public QueryDescriptor GeoBoundingBox(Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => Set(geoBoundingBoxQuery, "geo_bounding_box"); + public QueryDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); + public QueryDescriptor GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => Set(geoDistanceQuery, "geo_distance"); + public QueryDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); + public QueryDescriptor GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => Set(geoPolygonQuery, "geo_polygon"); + public QueryDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); + public QueryDescriptor HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => Set(hasChildQuery, "has_child"); + public QueryDescriptor HasChild(Action configure) => Set(configure, "has_child"); + public QueryDescriptor HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => Set(hasParentQuery, "has_parent"); + public QueryDescriptor HasParent(Action configure) => Set(configure, "has_parent"); + public QueryDescriptor Ids(Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery idsQuery) => Set(idsQuery, "ids"); + public QueryDescriptor Ids(Action configure) => Set(configure, "ids"); + public QueryDescriptor Intervals(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery intervalsQuery) => Set(intervalsQuery, "intervals"); + public QueryDescriptor Intervals(Action configure) => Set(configure, "intervals"); + public QueryDescriptor Knn(Elastic.Clients.Elasticsearch.KnnQuery knnQuery) => Set(knnQuery, "knn"); + public QueryDescriptor Knn(Action configure) => Set(configure, "knn"); + public QueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery matchQuery) => Set(matchQuery, "match"); + public QueryDescriptor Match(Action configure) => Set(configure, "match"); + public QueryDescriptor MatchAll(Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery matchAllQuery) => Set(matchAllQuery, "match_all"); + public QueryDescriptor MatchAll(Action configure) => Set(configure, "match_all"); + public QueryDescriptor MatchBoolPrefix(Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery matchBoolPrefixQuery) => Set(matchBoolPrefixQuery, "match_bool_prefix"); + public QueryDescriptor MatchBoolPrefix(Action configure) => Set(configure, "match_bool_prefix"); + public QueryDescriptor MatchNone(Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery matchNoneQuery) => Set(matchNoneQuery, "match_none"); + public QueryDescriptor MatchNone(Action configure) => Set(configure, "match_none"); + public QueryDescriptor MatchPhrase(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery matchPhraseQuery) => Set(matchPhraseQuery, "match_phrase"); + public QueryDescriptor MatchPhrase(Action configure) => Set(configure, "match_phrase"); + public QueryDescriptor MatchPhrasePrefix(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery matchPhrasePrefixQuery) => Set(matchPhrasePrefixQuery, "match_phrase_prefix"); + public QueryDescriptor MatchPhrasePrefix(Action configure) => Set(configure, "match_phrase_prefix"); + public QueryDescriptor MoreLikeThis(Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery moreLikeThisQuery) => Set(moreLikeThisQuery, "more_like_this"); + public QueryDescriptor MoreLikeThis(Action configure) => Set(configure, "more_like_this"); + public QueryDescriptor MultiMatch(Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery multiMatchQuery) => Set(multiMatchQuery, "multi_match"); + public QueryDescriptor MultiMatch(Action configure) => Set(configure, "multi_match"); + public QueryDescriptor Nested(Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery nestedQuery) => Set(nestedQuery, "nested"); + public QueryDescriptor Nested(Action configure) => Set(configure, "nested"); + public QueryDescriptor ParentId(Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery parentIdQuery) => Set(parentIdQuery, "parent_id"); + public QueryDescriptor ParentId(Action configure) => Set(configure, "parent_id"); + public QueryDescriptor Percolate(Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery percolateQuery) => Set(percolateQuery, "percolate"); + public QueryDescriptor Percolate(Action configure) => Set(configure, "percolate"); + public QueryDescriptor Pinned(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery pinnedQuery) => Set(pinnedQuery, "pinned"); + public QueryDescriptor Pinned(Action configure) => Set(configure, "pinned"); + public QueryDescriptor Prefix(Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery prefixQuery) => Set(prefixQuery, "prefix"); + public QueryDescriptor Prefix(Action configure) => Set(configure, "prefix"); + public QueryDescriptor QueryString(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery) => Set(queryStringQuery, "query_string"); + public QueryDescriptor QueryString(Action configure) => Set(configure, "query_string"); + public QueryDescriptor Range(Elastic.Clients.Elasticsearch.QueryDsl.RangeQuery rangeQuery) => Set(rangeQuery, "range"); + public QueryDescriptor RankFeature(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery rankFeatureQuery) => Set(rankFeatureQuery, "rank_feature"); + public QueryDescriptor RankFeature(Action configure) => Set(configure, "rank_feature"); public QueryDescriptor RawJson(Elastic.Clients.Elasticsearch.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"); + public QueryDescriptor Regexp(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery regexpQuery) => Set(regexpQuery, "regexp"); + public QueryDescriptor Regexp(Action configure) => Set(configure, "regexp"); + public QueryDescriptor RuleQuery(Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery ruleQuery) => Set(ruleQuery, "rule_query"); + public QueryDescriptor RuleQuery(Action configure) => Set(configure, "rule_query"); + public QueryDescriptor Script(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery scriptQuery) => Set(scriptQuery, "script"); + public QueryDescriptor Script(Action configure) => Set(configure, "script"); + public QueryDescriptor ScriptScore(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery scriptScoreQuery) => Set(scriptScoreQuery, "script_score"); + public QueryDescriptor ScriptScore(Action configure) => Set(configure, "script_score"); + public QueryDescriptor SimpleQueryString(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery simpleQueryStringQuery) => Set(simpleQueryStringQuery, "simple_query_string"); + public QueryDescriptor SimpleQueryString(Action configure) => Set(configure, "simple_query_string"); + public QueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public QueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public QueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public QueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public QueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public QueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public QueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public QueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public QueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public QueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public QueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public QueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public QueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public QueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public QueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery spanWithinQuery) => Set(spanWithinQuery, "span_within"); + public QueryDescriptor SpanWithin(Action configure) => Set(configure, "span_within"); + public QueryDescriptor Term(Elastic.Clients.Elasticsearch.QueryDsl.TermQuery termQuery) => Set(termQuery, "term"); + public QueryDescriptor Term(Action configure) => Set(configure, "term"); + public QueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery termsQuery) => Set(termsQuery, "terms"); + public QueryDescriptor Terms(Action configure) => Set(configure, "terms"); + public QueryDescriptor TermsSet(Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery termsSetQuery) => Set(termsSetQuery, "terms_set"); + public QueryDescriptor TermsSet(Action configure) => Set(configure, "terms_set"); + public QueryDescriptor TextExpansion(Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery textExpansionQuery) => Set(textExpansionQuery, "text_expansion"); + public QueryDescriptor TextExpansion(Action configure) => Set(configure, "text_expansion"); + public QueryDescriptor WeightedTokens(Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery weightedTokensQuery) => Set(weightedTokensQuery, "weighted_tokens"); + public QueryDescriptor WeightedTokens(Action configure) => Set(configure, "weighted_tokens"); + public QueryDescriptor Wildcard(Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery wildcardQuery) => Set(wildcardQuery, "wildcard"); + public QueryDescriptor Wildcard(Action configure) => Set(configure, "wildcard"); + public QueryDescriptor Wrapper(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs index c3e2e2488f5..12efb5414ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs @@ -27,34 +27,35 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class QueryStringQuery : SearchQuery +public sealed partial class QueryStringQuery { - [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`, the query attempts to analyze wildcard terms in the query string. + /// + [JsonInclude, JsonPropertyName("analyze_wildcard")] + public bool? AnalyzeWildcard { 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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -82,7 +83,7 @@ public sealed partial class QueryStringQuery : SearchQuery /// Array of fields to search. Supports wildcards (`*`). /// [JsonInclude, JsonPropertyName("fields")] - public Fields? Fields { get; set; } + public ICollection? Fields { get; set; } /// /// Maximum edit distance allowed for fuzzy matching. @@ -143,6 +144,8 @@ public sealed partial class QueryStringQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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.
@@ -180,9 +183,7 @@ public sealed partial class QueryStringQuery : SearchQuery [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(QueryStringQuery queryStringQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.QueryString(queryStringQuery); } public sealed partial class QueryStringQueryDescriptor : SerializableDescriptor> @@ -202,7 +203,7 @@ public QueryStringQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; } private bool? EnablePositionIncrementsValue { get; set; } private bool? EscapeValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Fuzziness? FuzzinessValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } @@ -257,6 +258,9 @@ public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(boo return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public QueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -281,6 +285,15 @@ public QueryStringQueryDescriptor DefaultField(Expression + /// 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. /// @@ -308,7 +321,7 @@ public QueryStringQueryDescriptor Escape(bool? escape = true) /// /// Array of fields to search. Supports wildcards (`*`). /// - public QueryStringQueryDescriptor Fields(Fields? fields) + public QueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -545,10 +558,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -601,10 +614,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QuoteFieldSuffixValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TieBreakerValue.HasValue) @@ -613,10 +626,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(TieBreakerValue.Value); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (TypeValue is not null) @@ -646,7 +659,7 @@ public QueryStringQueryDescriptor() : base() private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; } private bool? EnablePositionIncrementsValue { get; set; } private bool? EscapeValue { get; set; } - private Fields? FieldsValue { get; set; } + private ICollection? FieldsValue { get; set; } private Elastic.Clients.Elasticsearch.Fuzziness? FuzzinessValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } @@ -701,6 +714,9 @@ public QueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? autoGene return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public QueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -761,7 +777,7 @@ public QueryStringQueryDescriptor Escape(bool? escape = true) /// /// Array of fields to search. Supports wildcards (`*`). /// - public QueryStringQueryDescriptor Fields(Fields? fields) + public QueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -998,10 +1014,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FuzzyPrefixLengthValue.Value); } - if (FuzzyRewriteValue is not null) + if (!string.IsNullOrEmpty(FuzzyRewriteValue)) { writer.WritePropertyName("fuzzy_rewrite"); - JsonSerializer.Serialize(writer, FuzzyRewriteValue, options); + writer.WriteStringValue(FuzzyRewriteValue); } if (FuzzyTranspositionsValue.HasValue) @@ -1054,10 +1070,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QuoteFieldSuffixValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (TieBreakerValue.HasValue) @@ -1066,10 +1082,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(TieBreakerValue.Value); } - if (TimeZoneValue is not null) + if (!string.IsNullOrEmpty(TimeZoneValue)) { writer.WritePropertyName("time_zone"); - JsonSerializer.Serialize(writer, TimeZoneValue, options); + writer.WriteStringValue(TimeZoneValue); } if (TypeValue is not null) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs index 11d66938cea..b6ff83606d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs @@ -32,9 +32,9 @@ public sealed partial class RandomScoreFunction [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field? Field { get; set; } [JsonInclude, JsonPropertyName("seed")] - public Union? Seed { get; set; } + public object? Seed { get; set; } - public static implicit operator FunctionScore(RandomScoreFunction randomScoreFunction) => QueryDsl.FunctionScore.RandomScore(randomScoreFunction); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(RandomScoreFunction randomScoreFunction) => Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore.RandomScore(randomScoreFunction); } public sealed partial class RandomScoreFunctionDescriptor : SerializableDescriptor> @@ -46,7 +46,7 @@ public RandomScoreFunctionDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private Union? SeedValue { get; set; } + private object? SeedValue { get; set; } public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { @@ -60,7 +60,13 @@ public RandomScoreFunctionDescriptor Field(Expression Seed(Union? seed) + public RandomScoreFunctionDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public RandomScoreFunctionDescriptor Seed(object? seed) { SeedValue = seed; return Self; @@ -94,7 +100,7 @@ public RandomScoreFunctionDescriptor() : base() } private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private Union? SeedValue { get; set; } + private object? SeedValue { get; set; } public RandomScoreFunctionDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) { @@ -114,7 +120,7 @@ public RandomScoreFunctionDescriptor Field(Expression? seed) + public RandomScoreFunctionDescriptor Seed(object? seed) { SeedValue = seed; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs new file mode 100644 index 00000000000..21533f145cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.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.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.QueryDsl; + +public sealed partial class RangeQuery : Union +{ + public RangeQuery(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Date) : base(Date) + { + } + + public RangeQuery(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Number) : base(Number) + { + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs index c5cc7d94116..d966813637c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs @@ -41,5 +41,7 @@ public RankFeatureFunctionLinearDescriptor() : base() protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { + writer.WriteStartObject(); + writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs index 84be1ed2a29..9a9027700e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class RankFeatureQuery : SearchQuery +public sealed partial class RankFeatureQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -51,6 +52,8 @@ public sealed partial class RankFeatureQuery : SearchQuery /// [JsonInclude, JsonPropertyName("log")] public Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm? Log { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Saturation function used to boost relevance scores based on the value of the rank feature `field`. @@ -64,9 +67,7 @@ public sealed partial class RankFeatureQuery : SearchQuery [JsonInclude, JsonPropertyName("sigmoid")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(RankFeatureQuery rankFeatureQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.RankFeature(rankFeatureQuery); } public sealed partial class RankFeatureQueryDescriptor : SerializableDescriptor> @@ -80,19 +81,22 @@ public RankFeatureQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear? LinearValue { get; set; } - private RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } - private Action LinearDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } + private Action LinearDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm? LogValue { get; set; } - private RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } - private Action LogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation? SaturationValue { get; set; } - private RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } - private Action SaturationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } + private Action SaturationDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid? SigmoidValue { get; set; } - private RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } - private Action SigmoidDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RankFeatureQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -117,6 +121,15 @@ public RankFeatureQueryDescriptor Field(Expression + /// `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`. /// @@ -128,7 +141,7 @@ public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearc return Self; } - public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor descriptor) { LinearValue = null; LinearDescriptorAction = null; @@ -136,7 +149,7 @@ public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDes return Self; } - public RankFeatureQueryDescriptor Linear(Action configure) + public RankFeatureQueryDescriptor Linear(Action configure) { LinearValue = null; LinearDescriptor = null; @@ -155,7 +168,7 @@ public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.Q return Self; } - public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor descriptor) { LogValue = null; LogDescriptorAction = null; @@ -163,7 +176,7 @@ public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDes return Self; } - public RankFeatureQueryDescriptor Log(Action configure) + public RankFeatureQueryDescriptor Log(Action configure) { LogValue = null; LogDescriptor = null; @@ -188,7 +201,7 @@ public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elastics return Self; } - public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor descriptor) { SaturationValue = null; SaturationDescriptorAction = null; @@ -196,7 +209,7 @@ public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSatur return Self; } - public RankFeatureQueryDescriptor Saturation(Action configure) + public RankFeatureQueryDescriptor Saturation(Action configure) { SaturationValue = null; SaturationDescriptor = null; @@ -215,7 +228,7 @@ public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsear return Self; } - public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor descriptor) { SigmoidValue = null; SigmoidDescriptorAction = null; @@ -223,7 +236,7 @@ public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidD return Self; } - public RankFeatureQueryDescriptor Sigmoid(Action configure) + public RankFeatureQueryDescriptor Sigmoid(Action configure) { SigmoidValue = null; SigmoidDescriptor = null; @@ -250,7 +263,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LinearDescriptorAction is not null) { writer.WritePropertyName("linear"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); } else if (LinearValue is not null) { @@ -266,7 +279,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LogDescriptorAction is not null) { writer.WritePropertyName("log"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); } else if (LogValue is not null) { @@ -288,7 +301,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SaturationDescriptorAction is not null) { writer.WritePropertyName("saturation"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); } else if (SaturationValue is not null) { @@ -304,7 +317,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SigmoidDescriptorAction is not null) { writer.WritePropertyName("sigmoid"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); } else if (SigmoidValue is not null) { @@ -327,19 +340,22 @@ public RankFeatureQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear? LinearValue { get; set; } - private RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } - private Action LinearDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor LinearDescriptor { get; set; } + private Action LinearDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm? LogValue { get; set; } - private RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } - private Action LogDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor LogDescriptor { get; set; } + private Action LogDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation? SaturationValue { get; set; } - private RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } - private Action SaturationDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor SaturationDescriptor { get; set; } + private Action SaturationDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid? SigmoidValue { get; set; } - private RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } - private Action SigmoidDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor SigmoidDescriptor { get; set; } + private Action SigmoidDescriptorAction { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RankFeatureQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -384,7 +400,7 @@ public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl. return Self; } - public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor descriptor) + public RankFeatureQueryDescriptor Linear(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor descriptor) { LinearValue = null; LinearDescriptorAction = null; @@ -392,7 +408,7 @@ public RankFeatureQueryDescriptor Linear(RankFeatureFunctionLinearDescriptor des return Self; } - public RankFeatureQueryDescriptor Linear(Action configure) + public RankFeatureQueryDescriptor Linear(Action configure) { LinearValue = null; LinearDescriptor = null; @@ -411,7 +427,7 @@ public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.QueryDsl.Ran return Self; } - public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor descriptor) + public RankFeatureQueryDescriptor Log(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor descriptor) { LogValue = null; LogDescriptorAction = null; @@ -419,7 +435,7 @@ public RankFeatureQueryDescriptor Log(RankFeatureFunctionLogarithmDescriptor des return Self; } - public RankFeatureQueryDescriptor Log(Action configure) + public RankFeatureQueryDescriptor Log(Action configure) { LogValue = null; LogDescriptor = null; @@ -444,7 +460,7 @@ public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.Query return Self; } - public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescriptor descriptor) + public RankFeatureQueryDescriptor Saturation(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor descriptor) { SaturationValue = null; SaturationDescriptorAction = null; @@ -452,7 +468,7 @@ public RankFeatureQueryDescriptor Saturation(RankFeatureFunctionSaturationDescri return Self; } - public RankFeatureQueryDescriptor Saturation(Action configure) + public RankFeatureQueryDescriptor Saturation(Action configure) { SaturationValue = null; SaturationDescriptor = null; @@ -471,7 +487,7 @@ public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.QueryDsl return Self; } - public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor descriptor) + public RankFeatureQueryDescriptor Sigmoid(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor descriptor) { SigmoidValue = null; SigmoidDescriptorAction = null; @@ -479,7 +495,7 @@ public RankFeatureQueryDescriptor Sigmoid(RankFeatureFunctionSigmoidDescriptor d return Self; } - public RankFeatureQueryDescriptor Sigmoid(Action configure) + public RankFeatureQueryDescriptor Sigmoid(Action configure) { SigmoidValue = null; SigmoidDescriptor = null; @@ -506,7 +522,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LinearDescriptorAction is not null) { writer.WritePropertyName("linear"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearDescriptor(LinearDescriptorAction), options); } else if (LinearValue is not null) { @@ -522,7 +538,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LogDescriptorAction is not null) { writer.WritePropertyName("log"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmDescriptor(LogDescriptorAction), options); } else if (LogValue is not null) { @@ -544,7 +560,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SaturationDescriptorAction is not null) { writer.WritePropertyName("saturation"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationDescriptor(SaturationDescriptorAction), options); } else if (SaturationValue is not null) { @@ -560,7 +576,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (SigmoidDescriptorAction is not null) { writer.WritePropertyName("sigmoid"); - JsonSerializer.Serialize(writer, new RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidDescriptor(SigmoidDescriptorAction), options); } else if (SigmoidValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs index 42f4c8e099d..1360294e7f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs @@ -94,75 +94,74 @@ public override void Write(Utf8JsonWriter writer, RegexpQuery value, JsonSeriali { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.Flags)) - { - writer.WritePropertyName("flags"); - writer.WriteStringValue(value.Flags); - } + if (value.CaseInsensitive.HasValue) + { + writer.WritePropertyName("case_insensitive"); + writer.WriteBooleanValue(value.CaseInsensitive.Value); + } - if (value.MaxDeterminizedStates.HasValue) - { - writer.WritePropertyName("max_determinized_states"); - writer.WriteNumberValue(value.MaxDeterminizedStates.Value); - } + if (!string.IsNullOrEmpty(value.Flags)) + { + writer.WritePropertyName("flags"); + writer.WriteStringValue(value.Flags); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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); - } + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(RegexpQueryConverter))] -public sealed partial class RegexpQuery : SearchQuery +public sealed partial class RegexpQuery { - public RegexpQuery(Field field) + public RegexpQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Enables optional operators for the regular expression. @@ -173,6 +172,7 @@ public RegexpQuery(Field field) /// Maximum number of automaton states required for the query. /// public int? MaxDeterminizedStates { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -183,35 +183,18 @@ public RegexpQuery(Field field) /// Regular expression for terms you wish to find in the provided field. /// public string Value { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(RegexpQuery regexpQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Regexp(regexpQuery); } public sealed partial class RegexpQueryDescriptor : SerializableDescriptor> { internal RegexpQueryDescriptor(Action> configure) => configure.Invoke(this); - internal RegexpQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -221,6 +204,9 @@ public RegexpQueryDescriptor(Expression> field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RegexpQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -248,6 +234,12 @@ public RegexpQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Enables optional operators for the regular expression. /// @@ -327,10 +319,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); @@ -344,17 +336,10 @@ public sealed partial class RegexpQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal RegexpQueryDescriptor() : base() + public RegexpQueryDescriptor() : base() { } - public RegexpQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -364,6 +349,9 @@ public RegexpQueryDescriptor(Field field) private string? RewriteValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RegexpQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -476,10 +464,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } writer.WritePropertyName("value"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs index 55bbb289dd4..4a1ec43bb88 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -27,22 +27,23 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class RuleQuery : SearchQuery +public sealed partial class RuleQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } [JsonInclude, JsonPropertyName("match_criteria")] public object MatchCriteria { get; set; } [JsonInclude, JsonPropertyName("organic")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Organic { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } [JsonInclude, JsonPropertyName("ruleset_id")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(RuleQuery ruleQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.RuleQuery(ruleQuery); } public sealed partial class RuleQueryDescriptor : SerializableDescriptor> @@ -56,11 +57,14 @@ public RuleQueryDescriptor() : base() private float? BoostValue { get; set; } private object MatchCriteriaValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action> OrganicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } + private Action> OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Id RulesetIdValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RuleQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -81,7 +85,7 @@ public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.Quer return Self; } - public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { OrganicValue = null; OrganicDescriptorAction = null; @@ -89,7 +93,7 @@ public RuleQueryDescriptor Organic(QueryDescriptor descrip return Self; } - public RuleQueryDescriptor Organic(Action> configure) + public RuleQueryDescriptor Organic(Action> configure) { OrganicValue = null; OrganicDescriptor = null; @@ -128,7 +132,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (OrganicDescriptorAction is not null) { writer.WritePropertyName("organic"); - JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(OrganicDescriptorAction), options); } else { @@ -159,11 +163,14 @@ public RuleQueryDescriptor() : base() private float? BoostValue { get; set; } private object MatchCriteriaValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query OrganicValue { get; set; } - private QueryDescriptor OrganicDescriptor { get; set; } - private Action OrganicDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor OrganicDescriptor { get; set; } + private Action OrganicDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Id RulesetIdValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public RuleQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -184,7 +191,7 @@ public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.QueryDsl.Query return Self; } - public RuleQueryDescriptor Organic(QueryDescriptor descriptor) + public RuleQueryDescriptor Organic(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { OrganicValue = null; OrganicDescriptorAction = null; @@ -192,7 +199,7 @@ public RuleQueryDescriptor Organic(QueryDescriptor descriptor) return Self; } - public RuleQueryDescriptor Organic(Action configure) + public RuleQueryDescriptor Organic(Action configure) { OrganicValue = null; OrganicDescriptor = null; @@ -231,7 +238,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (OrganicDescriptorAction is not null) { writer.WritePropertyName("organic"); - JsonSerializer.Serialize(writer, new QueryDescriptor(OrganicDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(OrganicDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs index d500a5087e9..3fd93eacd04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs @@ -27,12 +27,15 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class ScriptQuery : SearchQuery +public sealed partial class ScriptQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Contains a script to run as a query.
This script must return a boolean value, `true` or `false`.
@@ -40,9 +43,7 @@ public sealed partial class ScriptQuery : SearchQuery [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(ScriptQuery scriptQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Script(scriptQuery); } public sealed partial class ScriptQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public ScriptQueryDescriptor() : base() private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs index fed8aec5667..794cf9fa9f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs @@ -35,7 +35,7 @@ public sealed partial class ScriptScoreFunction [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script Script { get; set; } - public static implicit operator FunctionScore(ScriptScoreFunction scriptScoreFunction) => QueryDsl.FunctionScore.ScriptScore(scriptScoreFunction); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(ScriptScoreFunction scriptScoreFunction) => Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore.ScriptScore(scriptScoreFunction); } public sealed partial class ScriptScoreFunctionDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs index ba2aff293a5..ea755d18fa8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class ScriptScoreQuery : SearchQuery +public sealed partial class ScriptScoreQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class ScriptScoreQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { 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.
@@ -52,9 +55,7 @@ public sealed partial class ScriptScoreQuery : SearchQuery [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(ScriptScoreQuery scriptScoreQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.ScriptScore(scriptScoreQuery); } public sealed partial class ScriptScoreQueryDescriptor : SerializableDescriptor> @@ -68,11 +69,14 @@ public ScriptScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private float? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -99,7 +103,7 @@ public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch return Self; } - public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -107,7 +111,7 @@ public ScriptScoreQueryDescriptor Query(QueryDescriptor de return Self; } - public ScriptScoreQueryDescriptor Query(Action> configure) + public ScriptScoreQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -153,7 +157,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { @@ -184,11 +188,14 @@ public ScriptScoreQueryDescriptor() : base() private float? BoostValue { get; set; } private float? MinScoreValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query QueryValue { get; set; } - private QueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public ScriptScoreQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -215,7 +222,7 @@ public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Q return Self; } - public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) + public ScriptScoreQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -223,7 +230,7 @@ public ScriptScoreQueryDescriptor Query(QueryDescriptor descriptor) return Self; } - public ScriptScoreQueryDescriptor Query(Action configure) + public ScriptScoreQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -269,7 +276,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new QueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs index eaf6120d8f3..bde33a29ec9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs @@ -27,10 +27,13 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SimpleQueryStringQuery : SearchQuery +public sealed partial class SimpleQueryStringQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Analyzer used to convert text in the query string into tokens. + /// + [JsonInclude, JsonPropertyName("analyzer")] + public string? Analyzer { get; set; } /// /// If `true`, the query attempts to analyze wildcard terms in the query string. @@ -38,17 +41,15 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery [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; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -62,13 +63,13 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery /// 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; } + public ICollection? Fields { get; set; } /// /// List of enabled operators for the simple query string syntax. /// [JsonInclude, JsonPropertyName("flags")] - public Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? Flags { get; set; } + public Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlag? Flags { get; set; } /// /// Maximum number of terms to which the query expands for fuzzy matching. @@ -105,6 +106,8 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery /// [JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Suffix appended to quoted text in the query string. @@ -112,9 +115,7 @@ public sealed partial class SimpleQueryStringQuery : SearchQuery [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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SimpleQueryStringQuery simpleQueryStringQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SimpleQueryString(simpleQueryStringQuery); } public sealed partial class SimpleQueryStringQueryDescriptor : SerializableDescriptor> @@ -130,8 +131,8 @@ public SimpleQueryStringQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; } - private Fields? FieldsValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlag? FlagsValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } private bool? FuzzyTranspositionsValue { get; set; } @@ -168,6 +169,9 @@ public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQue return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SimpleQueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -186,7 +190,7 @@ public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clien /// /// 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) + public SimpleQueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -195,7 +199,7 @@ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) /// /// List of enabled operators for the simple query string syntax. /// - public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? flags) + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlag? flags) { FlagsValue = flags; return Self; @@ -376,8 +380,8 @@ public SimpleQueryStringQueryDescriptor() : base() private bool? AutoGenerateSynonymsPhraseQueryValue { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; } - private Fields? FieldsValue { get; set; } - private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; } + private ICollection? FieldsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlag? FlagsValue { get; set; } private int? FuzzyMaxExpansionsValue { get; set; } private int? FuzzyPrefixLengthValue { get; set; } private bool? FuzzyTranspositionsValue { get; set; } @@ -414,6 +418,9 @@ public SimpleQueryStringQueryDescriptor AutoGenerateSynonymsPhraseQuery(bool? au return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SimpleQueryStringQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -432,7 +439,7 @@ public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elastics /// /// 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) + public SimpleQueryStringQueryDescriptor Fields(ICollection? fields) { FieldsValue = fields; return Self; @@ -441,7 +448,7 @@ public SimpleQueryStringQueryDescriptor Fields(Fields? fields) /// /// List of enabled operators for the simple query string syntax. /// - public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? flags) + public SimpleQueryStringQueryDescriptor Flags(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlag? flags) { FlagsValue = flags; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs index c6e398c4dee..39eb753ccee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanContainingQuery : SearchQuery +public sealed partial class SpanContainingQuery { - [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.QueryDsl.SpanQuery Big { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanContainingQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("little")] public Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Little { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_containing", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanContainingQuery spanContainingQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanContaining(spanContainingQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanContainingQuery spanContainingQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanContaining(spanContainingQuery); } public sealed partial class SpanContainingQueryDescriptor : SerializableDescriptor> @@ -58,12 +62,12 @@ public SpanContainingQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery BigValue { get; set; } - private SpanQueryDescriptor BigDescriptor { get; set; } - private Action> BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action> LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -77,7 +81,7 @@ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearc return Self; } - public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -85,7 +89,7 @@ public SpanContainingQueryDescriptor Big(SpanQueryDescriptor Big(Action> configure) + public SpanContainingQueryDescriptor Big(Action> configure) { BigValue = null; BigDescriptor = null; @@ -93,6 +97,9 @@ public SpanContainingQueryDescriptor Big(Action + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanContainingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +117,7 @@ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticse return Self; } - public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -118,7 +125,7 @@ public SpanContainingQueryDescriptor Little(SpanQueryDescriptor Little(Action> configure) + public SpanContainingQueryDescriptor Little(Action> configure) { LittleValue = null; LittleDescriptor = null; @@ -143,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -165,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { @@ -192,12 +199,12 @@ public SpanContainingQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery BigValue { get; set; } - private SpanQueryDescriptor BigDescriptor { get; set; } - private Action BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -211,7 +218,7 @@ public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl. return Self; } - public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -219,7 +226,7 @@ public SpanContainingQueryDescriptor Big(SpanQueryDescriptor descriptor) return Self; } - public SpanContainingQueryDescriptor Big(Action configure) + public SpanContainingQueryDescriptor Big(Action configure) { BigValue = null; BigDescriptor = null; @@ -227,6 +234,9 @@ public SpanContainingQueryDescriptor Big(Action configure) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanContainingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -244,7 +254,7 @@ public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryD return Self; } - public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanContainingQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -252,7 +262,7 @@ public SpanContainingQueryDescriptor Little(SpanQueryDescriptor descriptor) return Self; } - public SpanContainingQueryDescriptor Little(Action configure) + public SpanContainingQueryDescriptor Little(Action configure) { LittleValue = null; LittleDescriptor = null; @@ -277,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -299,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs index 71353483a38..802c292739a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs @@ -27,18 +27,22 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanFieldMaskingQuery : SearchQuery +public sealed partial class SpanFieldMaskingQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } [JsonInclude, JsonPropertyName("field")] public Elastic.Clients.Elasticsearch.Field Field { get; set; } [JsonInclude, JsonPropertyName("query")] public Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("field_masking_span", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanFieldMaskingQuery spanFieldMaskingQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.FieldMaskingSpan(spanFieldMaskingQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanFieldMaskingQuery spanFieldMaskingQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.FieldMaskingSpan(spanFieldMaskingQuery); } public sealed partial class SpanFieldMaskingQueryDescriptor : SerializableDescriptor> @@ -52,10 +56,13 @@ public SpanFieldMaskingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery QueryValue { get; set; } - private SpanQueryDescriptor QueryDescriptor { get; set; } - private Action> QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFieldMaskingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -74,6 +81,12 @@ public SpanFieldMaskingQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery query) { QueryDescriptor = null; @@ -82,7 +95,7 @@ public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elastics return Self; } - public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -90,7 +103,7 @@ public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor Query(Action> configure) + public SpanFieldMaskingQueryDescriptor Query(Action> configure) { QueryValue = null; QueryDescriptor = null; @@ -123,7 +136,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(QueryDescriptorAction), options); } else { @@ -152,10 +165,13 @@ public SpanFieldMaskingQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery QueryValue { get; set; } - private SpanQueryDescriptor QueryDescriptor { get; set; } - private Action QueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFieldMaskingQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -188,7 +204,7 @@ public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.Query return Self; } - public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) + public SpanFieldMaskingQueryDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { QueryValue = null; QueryDescriptorAction = null; @@ -196,7 +212,7 @@ public SpanFieldMaskingQueryDescriptor Query(SpanQueryDescriptor descriptor) return Self; } - public SpanFieldMaskingQueryDescriptor Query(Action configure) + public SpanFieldMaskingQueryDescriptor Query(Action configure) { QueryValue = null; QueryDescriptor = null; @@ -229,7 +245,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (QueryDescriptorAction is not null) { writer.WritePropertyName("query"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(QueryDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(QueryDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs index 136bac1a35d..73652791045 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanFirstQuery : SearchQuery +public sealed partial class SpanFirstQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanFirstQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("match")] public Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Match { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_first", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanFirstQuery spanFirstQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanFirst(spanFirstQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanFirstQuery spanFirstQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanFirst(spanFirstQuery); } public sealed partial class SpanFirstQueryDescriptor : SerializableDescriptor> @@ -60,10 +64,13 @@ public SpanFirstQueryDescriptor() : base() private float? BoostValue { get; set; } private int EndValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery MatchValue { get; set; } - private SpanQueryDescriptor MatchDescriptor { get; set; } - private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFirstQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -90,7 +97,7 @@ public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.Q return Self; } - public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -98,7 +105,7 @@ public SpanFirstQueryDescriptor Match(SpanQueryDescriptor return Self; } - public SpanFirstQueryDescriptor Match(Action> configure) + public SpanFirstQueryDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -131,7 +138,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(MatchDescriptorAction), options); } else { @@ -160,10 +167,13 @@ public SpanFirstQueryDescriptor() : base() private float? BoostValue { get; set; } private int EndValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery MatchValue { get; set; } - private SpanQueryDescriptor MatchDescriptor { get; set; } - private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanFirstQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -190,7 +200,7 @@ public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.Spa return Self; } - public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) + public SpanFirstQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -198,7 +208,7 @@ public SpanFirstQueryDescriptor Match(SpanQueryDescriptor descriptor) return Self; } - public SpanFirstQueryDescriptor Match(Action configure) + public SpanFirstQueryDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -231,7 +241,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(MatchDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs index fab48652024..a8da29b32ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanMultiTermQuery : SearchQuery +public sealed partial class SpanMultiTermQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,8 +40,11 @@ public sealed partial class SpanMultiTermQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("match")] public Elastic.Clients.Elasticsearch.QueryDsl.Query Match { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_multi", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanMultiTermQuery spanMultiTermQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanMulti(spanMultiTermQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanMultiTermQuery spanMultiTermQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanMulti(spanMultiTermQuery); } public sealed partial class SpanMultiTermQueryDescriptor : SerializableDescriptor> @@ -53,10 +57,13 @@ public SpanMultiTermQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query MatchValue { get; set; } - private QueryDescriptor MatchDescriptor { get; set; } - private Action> MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor MatchDescriptor { get; set; } + private Action> MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanMultiTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -74,7 +81,7 @@ public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsear return Self; } - public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -82,7 +89,7 @@ public SpanMultiTermQueryDescriptor Match(QueryDescriptor return Self; } - public SpanMultiTermQueryDescriptor Match(Action> configure) + public SpanMultiTermQueryDescriptor Match(Action> configure) { MatchValue = null; MatchDescriptor = null; @@ -113,7 +120,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MatchDescriptorAction), options); } else { @@ -141,10 +148,13 @@ public SpanMultiTermQueryDescriptor() : base() private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.Query MatchValue { get; set; } - private QueryDescriptor MatchDescriptor { get; set; } - private Action MatchDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor MatchDescriptor { get; set; } + private Action MatchDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanMultiTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -162,7 +172,7 @@ public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl return Self; } - public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) + public SpanMultiTermQueryDescriptor Match(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) { MatchValue = null; MatchDescriptorAction = null; @@ -170,7 +180,7 @@ public SpanMultiTermQueryDescriptor Match(QueryDescriptor descriptor) return Self; } - public SpanMultiTermQueryDescriptor Match(Action configure) + public SpanMultiTermQueryDescriptor Match(Action configure) { MatchValue = null; MatchDescriptor = null; @@ -201,7 +211,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (MatchDescriptorAction is not null) { writer.WritePropertyName("match"); - JsonSerializer.Serialize(writer, new QueryDescriptor(MatchDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(MatchDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs index 69a0d69639d..dc808aacc87 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanNearQuery : SearchQuery +public sealed partial class SpanNearQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,6 +46,8 @@ public sealed partial class SpanNearQuery : SearchQuery /// [JsonInclude, JsonPropertyName("in_order")] public bool? InOrder { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } /// /// Controls the maximum number of intervening unmatched positions permitted. @@ -52,7 +55,8 @@ public sealed partial class SpanNearQuery : SearchQuery [JsonInclude, JsonPropertyName("slop")] public int? Slop { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_near", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanNearQuery spanNearQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanNear(spanNearQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanNearQuery spanNearQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanNear(spanNearQuery); } public sealed partial class SpanNearQueryDescriptor : SerializableDescriptor> @@ -65,13 +69,16 @@ public SpanNearQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action> ClausesDescriptorAction { get; set; } - private Action>[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } private bool? InOrderValue { get; set; } private string? QueryNameValue { get; set; } private int? SlopValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNearQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -90,7 +97,7 @@ public SpanNearQueryDescriptor Clauses(ICollection Clauses(SpanQueryDescriptor descriptor) + public SpanNearQueryDescriptor Clauses(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { ClausesValue = null; ClausesDescriptorAction = null; @@ -99,7 +106,7 @@ public SpanNearQueryDescriptor Clauses(SpanQueryDescriptor return Self; } - public SpanNearQueryDescriptor Clauses(Action> configure) + public SpanNearQueryDescriptor Clauses(Action> configure) { ClausesValue = null; ClausesDescriptor = null; @@ -108,7 +115,7 @@ public SpanNearQueryDescriptor Clauses(Action Clauses(params Action>[] configure) + public SpanNearQueryDescriptor Clauses(params Action>[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -161,7 +168,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -170,7 +177,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); @@ -213,13 +220,16 @@ public SpanNearQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action ClausesDescriptorAction { get; set; } - private Action[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } private bool? InOrderValue { get; set; } private string? QueryNameValue { get; set; } private int? SlopValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNearQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -238,7 +248,7 @@ public SpanNearQueryDescriptor Clauses(ICollection configure) + public SpanNearQueryDescriptor Clauses(Action configure) { ClausesValue = null; ClausesDescriptor = null; @@ -256,7 +266,7 @@ public SpanNearQueryDescriptor Clauses(Action configure) return Self; } - public SpanNearQueryDescriptor Clauses(params Action[] configure) + public SpanNearQueryDescriptor Clauses(params Action[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -309,7 +319,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -318,7 +328,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs index 9775d15a427..d625fb4552c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanNotQuery : SearchQuery +public sealed partial class SpanNotQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -63,8 +64,11 @@ public sealed partial class SpanNotQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("pre")] public int? Pre { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_not", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanNotQuery spanNotQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanNot(spanNotQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanNotQuery spanNotQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanNot(spanNotQuery); } public sealed partial class SpanNotQueryDescriptor : SerializableDescriptor> @@ -78,15 +82,18 @@ public SpanNotQueryDescriptor() : base() private float? BoostValue { get; set; } private int? DistValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery ExcludeValue { get; set; } - private SpanQueryDescriptor ExcludeDescriptor { get; set; } - private Action> ExcludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ExcludeDescriptor { get; set; } + private Action> ExcludeDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery IncludeValue { get; set; } - private SpanQueryDescriptor IncludeDescriptor { get; set; } - private Action> IncludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action> IncludeDescriptorAction { get; set; } private int? PostValue { get; set; } private int? PreValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNotQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -113,7 +120,7 @@ public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.Q return Self; } - public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { ExcludeValue = null; ExcludeDescriptorAction = null; @@ -121,7 +128,7 @@ public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor return Self; } - public SpanNotQueryDescriptor Exclude(Action> configure) + public SpanNotQueryDescriptor Exclude(Action> configure) { ExcludeValue = null; ExcludeDescriptor = null; @@ -140,7 +147,7 @@ public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.Q return Self; } - public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -148,7 +155,7 @@ public SpanNotQueryDescriptor Include(SpanQueryDescriptor return Self; } - public SpanNotQueryDescriptor Include(Action> configure) + public SpanNotQueryDescriptor Include(Action> configure) { IncludeValue = null; IncludeDescriptor = null; @@ -203,7 +210,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExcludeDescriptorAction is not null) { writer.WritePropertyName("exclude"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ExcludeDescriptorAction), options); } else { @@ -219,7 +226,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(IncludeDescriptorAction), options); } else { @@ -260,15 +267,18 @@ public SpanNotQueryDescriptor() : base() private float? BoostValue { get; set; } private int? DistValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery ExcludeValue { get; set; } - private SpanQueryDescriptor ExcludeDescriptor { get; set; } - private Action ExcludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ExcludeDescriptor { get; set; } + private Action ExcludeDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery IncludeValue { get; set; } - private SpanQueryDescriptor IncludeDescriptor { get; set; } - private Action IncludeDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor IncludeDescriptor { get; set; } + private Action IncludeDescriptorAction { get; set; } private int? PostValue { get; set; } private int? PreValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanNotQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -295,7 +305,7 @@ public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.QueryDsl.Spa return Self; } - public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Exclude(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { ExcludeValue = null; ExcludeDescriptorAction = null; @@ -303,7 +313,7 @@ public SpanNotQueryDescriptor Exclude(SpanQueryDescriptor descriptor) return Self; } - public SpanNotQueryDescriptor Exclude(Action configure) + public SpanNotQueryDescriptor Exclude(Action configure) { ExcludeValue = null; ExcludeDescriptor = null; @@ -322,7 +332,7 @@ public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.QueryDsl.Spa return Self; } - public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) + public SpanNotQueryDescriptor Include(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { IncludeValue = null; IncludeDescriptorAction = null; @@ -330,7 +340,7 @@ public SpanNotQueryDescriptor Include(SpanQueryDescriptor descriptor) return Self; } - public SpanNotQueryDescriptor Include(Action configure) + public SpanNotQueryDescriptor Include(Action configure) { IncludeValue = null; IncludeDescriptor = null; @@ -385,7 +395,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (ExcludeDescriptorAction is not null) { writer.WritePropertyName("exclude"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ExcludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ExcludeDescriptorAction), options); } else { @@ -401,7 +411,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (IncludeDescriptorAction is not null) { writer.WritePropertyName("include"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(IncludeDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(IncludeDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs index 382082eb6a7..ef0c00e2297 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanOrQuery : SearchQuery +public sealed partial class SpanOrQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,8 +40,11 @@ public sealed partial class SpanOrQuery : SearchQuery /// [JsonInclude, JsonPropertyName("clauses")] public ICollection Clauses { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_or", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanOrQuery spanOrQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanOr(spanOrQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanOrQuery spanOrQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanOr(spanOrQuery); } public sealed partial class SpanOrQueryDescriptor : SerializableDescriptor> @@ -53,11 +57,14 @@ public SpanOrQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action> ClausesDescriptorAction { get; set; } - private Action>[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action> ClausesDescriptorAction { get; set; } + private Action>[] ClausesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanOrQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -76,7 +83,7 @@ public SpanOrQueryDescriptor Clauses(ICollection Clauses(SpanQueryDescriptor descriptor) + public SpanOrQueryDescriptor Clauses(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { ClausesValue = null; ClausesDescriptorAction = null; @@ -85,7 +92,7 @@ public SpanOrQueryDescriptor Clauses(SpanQueryDescriptor d return Self; } - public SpanOrQueryDescriptor Clauses(Action> configure) + public SpanOrQueryDescriptor Clauses(Action> configure) { ClausesValue = null; ClausesDescriptor = null; @@ -94,7 +101,7 @@ public SpanOrQueryDescriptor Clauses(Action Clauses(params Action>[] configure) + public SpanOrQueryDescriptor Clauses(params Action>[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -129,7 +136,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -138,7 +145,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); @@ -169,11 +176,14 @@ public SpanOrQueryDescriptor() : base() private float? BoostValue { get; set; } private ICollection ClausesValue { get; set; } - private SpanQueryDescriptor ClausesDescriptor { get; set; } - private Action ClausesDescriptorAction { get; set; } - private Action[] ClausesDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor ClausesDescriptor { get; set; } + private Action ClausesDescriptorAction { get; set; } + private Action[] ClausesDescriptorActions { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanOrQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -192,7 +202,7 @@ public SpanOrQueryDescriptor Clauses(ICollection configure) + public SpanOrQueryDescriptor Clauses(Action configure) { ClausesValue = null; ClausesDescriptor = null; @@ -210,7 +220,7 @@ public SpanOrQueryDescriptor Clauses(Action configure) return Self; } - public SpanOrQueryDescriptor Clauses(params Action[] configure) + public SpanOrQueryDescriptor Clauses(params Action[] configure) { ClausesValue = null; ClausesDescriptor = null; @@ -245,7 +255,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o { writer.WritePropertyName("clauses"); writer.WriteStartArray(); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(ClausesDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(ClausesDescriptorAction), options); writer.WriteEndArray(); } else if (ClausesDescriptorActions is not null) @@ -254,7 +264,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStartArray(); foreach (var action in ClausesDescriptorActions) { - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(action), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(action), options); } writer.WriteEndArray(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs index 98ed6913ae5..0f97e5d6383 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -48,12 +49,25 @@ internal SpanQuery(string variantName, object variant) public static SpanQuery FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => new SpanQuery("field_masking_span", spanFieldMaskingQuery); public static SpanQuery SpanContaining(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery spanContainingQuery) => new SpanQuery("span_containing", spanContainingQuery); public static SpanQuery SpanFirst(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery spanFirstQuery) => new SpanQuery("span_first", spanFirstQuery); + public static SpanQuery SpanGap(IReadOnlyDictionary integer) => new SpanQuery("span_gap", integer); public static SpanQuery SpanMulti(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => new SpanQuery("span_multi", spanMultiTermQuery); public static SpanQuery SpanNear(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery spanNearQuery) => new SpanQuery("span_near", spanNearQuery); public static SpanQuery SpanNot(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery spanNotQuery) => new SpanQuery("span_not", spanNotQuery); public static SpanQuery SpanOr(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery spanOrQuery) => new SpanQuery("span_or", spanOrQuery); public static SpanQuery SpanTerm(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery spanTermQuery) => new SpanQuery("span_term", spanTermQuery); public static SpanQuery SpanWithin(Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery spanWithinQuery) => new SpanQuery("span_within", spanWithinQuery); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class SpanQueryConverter : JsonConverter @@ -65,84 +79,104 @@ public override SpanQuery Read(ref Utf8JsonReader reader, Type typeToConvert, Js throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "span_containing") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "field_masking_span") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_first") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_containing") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_multi") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_first") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_near") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_gap") + { + variantValue = JsonSerializer.Deserialize?>(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_not") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_multi") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_or") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_near") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_term") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); - } + if (propertyName == "span_not") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "span_within") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SpanQuery(propertyName, variant); + if (propertyName == "span_or") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "span_term") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "span_within") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'SpanQuery' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new SpanQuery(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, SpanQuery value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -156,6 +190,9 @@ public override void Write(Utf8JsonWriter writer, SpanQuery value, JsonSerialize case "span_first": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery)value.Variant, options); break; + case "span_gap": + JsonSerializer.Serialize>(writer, (IReadOnlyDictionary)value.Variant, options); + break; case "span_multi": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery)value.Variant, options); break; @@ -212,43 +249,42 @@ private SpanQueryDescriptor Set(object variant, string variantName) 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"); + public SpanQueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action> configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action> configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action> configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanGap(IReadOnlyDictionary integer) => Set(integer, "span_gap"); + public SpanQueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action> configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action> configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action> configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action> configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action> configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -284,52 +320,42 @@ private SpanQueryDescriptor Set(object variant, string variantName) 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"); + public SpanQueryDescriptor FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => Set(spanFieldMaskingQuery, "field_masking_span"); + public SpanQueryDescriptor FieldMaskingSpan(Action configure) => Set(configure, "field_masking_span"); + public SpanQueryDescriptor SpanContaining(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery spanContainingQuery) => Set(spanContainingQuery, "span_containing"); + public SpanQueryDescriptor SpanContaining(Action configure) => Set(configure, "span_containing"); + public SpanQueryDescriptor SpanFirst(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery spanFirstQuery) => Set(spanFirstQuery, "span_first"); + public SpanQueryDescriptor SpanFirst(Action configure) => Set(configure, "span_first"); + public SpanQueryDescriptor SpanGap(IReadOnlyDictionary integer) => Set(integer, "span_gap"); + public SpanQueryDescriptor SpanMulti(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery spanMultiTermQuery) => Set(spanMultiTermQuery, "span_multi"); + public SpanQueryDescriptor SpanMulti(Action configure) => Set(configure, "span_multi"); + public SpanQueryDescriptor SpanNear(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery spanNearQuery) => Set(spanNearQuery, "span_near"); + public SpanQueryDescriptor SpanNear(Action configure) => Set(configure, "span_near"); + public SpanQueryDescriptor SpanNot(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery spanNotQuery) => Set(spanNotQuery, "span_not"); + public SpanQueryDescriptor SpanNot(Action configure) => Set(configure, "span_not"); + public SpanQueryDescriptor SpanOr(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery spanOrQuery) => Set(spanOrQuery, "span_or"); + public SpanQueryDescriptor SpanOr(Action configure) => Set(configure, "span_or"); + public SpanQueryDescriptor SpanTerm(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery spanTermQuery) => Set(spanTermQuery, "span_term"); + public SpanQueryDescriptor SpanTerm(Action configure) => Set(configure, "span_term"); + public SpanQueryDescriptor SpanWithin(Elastic.Clients.Elasticsearch.QueryDsl.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs index 9414bba2e55..47c64889c2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs @@ -70,79 +70,68 @@ public override void Write(Utf8JsonWriter writer, SpanTermQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(SpanTermQueryConverter))] -public sealed partial class SpanTermQuery : SearchQuery +public sealed partial class SpanTermQuery { - public SpanTermQuery(Field field) + public SpanTermQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } - public string Value { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? QueryName { get; set; } + public string Value { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_term", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanTermQuery spanTermQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanTerm(spanTermQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanTermQuery spanTermQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanTerm(spanTermQuery); } public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor> { internal SpanTermQueryDescriptor(Action> configure) => configure.Invoke(this); - internal SpanTermQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanTermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -161,6 +150,12 @@ public SpanTermQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SpanTermQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -203,15 +198,8 @@ public sealed partial class SpanTermQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal SpanTermQueryDescriptor() : base() - { - } - - public SpanTermQueryDescriptor(Field field) + public SpanTermQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } @@ -219,6 +207,9 @@ public SpanTermQueryDescriptor(Field field) private string? QueryNameValue { get; set; } private string ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanTermQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs index 04df191e2e0..e2aaba8ef39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs @@ -27,16 +27,17 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class SpanWithinQuery : SearchQuery +public sealed partial class SpanWithinQuery { - [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.QueryDsl.SpanQuery Big { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -45,8 +46,11 @@ public sealed partial class SpanWithinQuery : SearchQuery /// [JsonInclude, JsonPropertyName("little")] public Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Little { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("span_within", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(SpanWithinQuery spanWithinQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.SpanWithin(spanWithinQuery); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(SpanWithinQuery spanWithinQuery) => Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery.SpanWithin(spanWithinQuery); } public sealed partial class SpanWithinQueryDescriptor : SerializableDescriptor> @@ -58,12 +62,12 @@ public SpanWithinQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery BigValue { get; set; } - private SpanQueryDescriptor BigDescriptor { get; set; } - private Action> BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor BigDescriptor { get; set; } + private Action> BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action> LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action> LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -77,7 +81,7 @@ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.Qu return Self; } - public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -85,7 +89,7 @@ public SpanWithinQueryDescriptor Big(SpanQueryDescriptor d return Self; } - public SpanWithinQueryDescriptor Big(Action> configure) + public SpanWithinQueryDescriptor Big(Action> configure) { BigValue = null; BigDescriptor = null; @@ -93,6 +97,9 @@ public SpanWithinQueryDescriptor Big(Action + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanWithinQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -110,7 +117,7 @@ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch return Self; } - public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -118,7 +125,7 @@ public SpanWithinQueryDescriptor Little(SpanQueryDescriptor Little(Action> configure) + public SpanWithinQueryDescriptor Little(Action> configure) { LittleValue = null; LittleDescriptor = null; @@ -143,7 +150,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -165,7 +172,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { @@ -192,12 +199,12 @@ public SpanWithinQueryDescriptor() : base() } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery BigValue { get; set; } - private SpanQueryDescriptor BigDescriptor { get; set; } - private Action BigDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor BigDescriptor { get; set; } + private Action BigDescriptorAction { get; set; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery LittleValue { get; set; } - private SpanQueryDescriptor LittleDescriptor { get; set; } - private Action LittleDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor LittleDescriptor { get; set; } + private Action LittleDescriptorAction { get; set; } private string? QueryNameValue { get; set; } /// @@ -211,7 +218,7 @@ public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl.Span return Self; } - public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Big(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { BigValue = null; BigDescriptorAction = null; @@ -219,7 +226,7 @@ public SpanWithinQueryDescriptor Big(SpanQueryDescriptor descriptor) return Self; } - public SpanWithinQueryDescriptor Big(Action configure) + public SpanWithinQueryDescriptor Big(Action configure) { BigValue = null; BigDescriptor = null; @@ -227,6 +234,9 @@ public SpanWithinQueryDescriptor Big(Action configure) return Self; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public SpanWithinQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -244,7 +254,7 @@ public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryDsl.S return Self; } - public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) + public SpanWithinQueryDescriptor Little(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor descriptor) { LittleValue = null; LittleDescriptorAction = null; @@ -252,7 +262,7 @@ public SpanWithinQueryDescriptor Little(SpanQueryDescriptor descriptor) return Self; } - public SpanWithinQueryDescriptor Little(Action configure) + public SpanWithinQueryDescriptor Little(Action configure) { LittleValue = null; LittleDescriptor = null; @@ -277,7 +287,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (BigDescriptorAction is not null) { writer.WritePropertyName("big"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(BigDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(BigDescriptorAction), options); } else { @@ -299,7 +309,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (LittleDescriptorAction is not null) { writer.WritePropertyName("little"); - JsonSerializer.Serialize(writer, new SpanQueryDescriptor(LittleDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryDescriptor(LittleDescriptorAction), options); } else { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs index b88a42069bd..d77735afed0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs @@ -76,97 +76,83 @@ public override void Write(Utf8JsonWriter writer, TermQuery value, JsonSerialize { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("value"); + JsonSerializer.Serialize(writer, value.Value, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TermQueryConverter))] -public sealed partial class TermQuery : SearchQuery +public sealed partial class TermQuery { - public TermQuery(Field field) + public TermQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? QueryName { get; set; } /// /// Term you wish to find in the provided field. /// public Elastic.Clients.Elasticsearch.FieldValue Value { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(TermQuery termQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Term(termQuery); } public sealed partial class TermQueryDescriptor : SerializableDescriptor> { internal TermQueryDescriptor(Action> configure) => configure.Invoke(this); - internal TermQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.FieldValue ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -194,6 +180,12 @@ public TermQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public TermQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -245,23 +237,19 @@ public sealed partial class TermQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal TermQueryDescriptor() : base() + public TermQueryDescriptor() : base() { } - public TermQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.FieldValue ValueValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs index d94cd2320a5..66466c122fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs @@ -76,6 +76,12 @@ public TermsLookupDescriptor Path(Expression Path(Expression> path) + { + PathValue = path; + return Self; + } + public TermsLookupDescriptor Routing(Elastic.Clients.Elasticsearch.Routing? routing) { RoutingValue = routing; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs index 25e4310fd77..cccaea2d829 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -92,16 +92,17 @@ public override void Write(Utf8JsonWriter writer, TermsQuery value, JsonSerializ } [JsonConverter(typeof(TermsQueryConverter))] -public sealed partial class TermsQuery : SearchQuery +public sealed partial class TermsQuery { - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? QueryName { get; set; } public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(TermsQuery termsQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Terms(termsQuery); } public sealed partial class TermsQueryDescriptor : SerializableDescriptor> @@ -113,37 +114,46 @@ public TermsQueryDescriptor() : base() } private float? BoostValue { get; set; } - private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public TermsQueryDescriptor QueryName(string? queryName) + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Field(Expression> field) { - TermsValue = terms; + FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public TermsQueryDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; + return Self; + } + + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) + { + TermsValue = terms; return Self; } @@ -182,43 +192,46 @@ public TermsQueryDescriptor() : base() } private float? BoostValue { get; set; } - private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private string? QueryNameValue { get; set; } private Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsQueryDescriptor Boost(float? boost) { BoostValue = boost; return Self; } - public TermsQueryDescriptor QueryName(string? queryName) + public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) { - QueryNameValue = queryName; + FieldValue = field; return Self; } - public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) + public TermsQueryDescriptor Field(Expression> field) { - TermsValue = terms; + FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + public TermsQueryDescriptor Field(Expression> field) { FieldValue = field; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor QueryName(string? queryName) { - FieldValue = field; + QueryNameValue = queryName; return Self; } - public TermsQueryDescriptor Field(Expression> field) + public TermsQueryDescriptor Terms(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField terms) { - FieldValue = field; + TermsValue = terms; return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs index 23765afb9c4..3f56dc6eba9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; public sealed partial class TermsQueryField : Union, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup> { - public TermsQueryField(IReadOnlyCollection value) : base(value) + public TermsQueryField(IReadOnlyCollection Value) : base(Value) { } - public TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup lookup) : base(lookup) + public TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup Lookup) : base(Lookup) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs index 93cf744a0b1..b0daba5f8ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs @@ -82,58 +82,57 @@ public override void Write(Utf8JsonWriter writer, TermsSetQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (value.MinimumShouldMatchScript is not null) - { - writer.WritePropertyName("minimum_should_match_script"); - JsonSerializer.Serialize(writer, value.MinimumShouldMatchScript, options); - } + if (value.MinimumShouldMatchField is not null) + { + writer.WritePropertyName("minimum_should_match_field"); + JsonSerializer.Serialize(writer, value.MinimumShouldMatchField, options); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, value.Terms, options); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TermsSetQueryConverter))] -public sealed partial class TermsSetQuery : SearchQuery +public sealed partial class TermsSetQuery { - public TermsSetQuery(Field field) + public TermsSetQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// Numeric field containing the number of matching terms required to return a document. @@ -144,38 +143,22 @@ public TermsSetQuery(Field field) /// Custom script containing the number of matching terms required to return a document. /// public Elastic.Clients.Elasticsearch.Script? MinimumShouldMatchScript { get; set; } + public string? QueryName { get; set; } /// /// Array of terms you wish to find in the provided field. /// public ICollection Terms { get; set; } - public Elastic.Clients.Elasticsearch.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(TermsSetQuery termsSetQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.TermsSet(termsSetQuery); } public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor> { internal TermsSetQueryDescriptor(Action> configure) => configure.Invoke(this); - internal TermsSetQueryDescriptor() : base() - { - } - - public TermsSetQueryDescriptor(Field field) + public TermsSetQueryDescriptor() : base() { - 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 float? BoostValue { get; set; } @@ -185,6 +168,9 @@ public TermsSetQueryDescriptor(Expression> field) private string? QueryNameValue { get; set; } private ICollection TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsSetQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -203,6 +189,12 @@ public TermsSetQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// Numeric field containing the number of matching terms required to return a document. /// @@ -221,6 +213,15 @@ public TermsSetQueryDescriptor MinimumShouldMatchField(Expres 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. /// @@ -287,17 +288,10 @@ public sealed partial class TermsSetQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal TermsSetQueryDescriptor() : base() + public TermsSetQueryDescriptor() : base() { } - public TermsSetQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private Elastic.Clients.Elasticsearch.Field? MinimumShouldMatchFieldValue { get; set; } @@ -305,6 +299,9 @@ public TermsSetQueryDescriptor(Field field) private string? QueryNameValue { get; set; } private ICollection TermsValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TermsSetQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs index e352e010ac7..bc2c5666b24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs @@ -60,6 +60,12 @@ public override TextExpansionQuery Read(ref Utf8JsonReader reader, Type typeToCo continue; } + if (property == "pruning_config") + { + variant.PruningConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + if (property == "_name") { variant.QueryName = JsonSerializer.Deserialize(ref reader, options); @@ -76,48 +82,53 @@ public override void Write(Utf8JsonWriter writer, TextExpansionQuery value, Json { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - writer.WritePropertyName("model_id"); - writer.WriteStringValue(value.ModelId); - writer.WritePropertyName("model_text"); - writer.WriteStringValue(value.ModelText); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + writer.WritePropertyName("model_id"); + writer.WriteStringValue(value.ModelId); + writer.WritePropertyName("model_text"); + writer.WriteStringValue(value.ModelText); + if (value.PruningConfig is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, value.PruningConfig, options); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(TextExpansionQueryConverter))] -public sealed partial class TextExpansionQuery : SearchQuery +public sealed partial class TextExpansionQuery { - public TextExpansionQuery(Field field) + public TextExpansionQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } /// /// The text expansion NLP model to use @@ -128,41 +139,36 @@ public TextExpansionQuery(Field field) /// The query text /// public string ModelText { get; set; } - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - public static implicit operator Query(TextExpansionQuery textExpansionQuery) => QueryDsl.Query.TextExpansion(textExpansionQuery); + /// + /// Token pruning configurations + /// + public Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfig { get; set; } + public string? QueryName { get; set; } - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("text_expansion", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(TextExpansionQuery textExpansionQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.TextExpansion(textExpansionQuery); } 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) + public TextExpansionQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string ModelIdValue { get; set; } private string ModelTextValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TextExpansionQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -181,6 +187,12 @@ public TextExpansionQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + /// /// The text expansion NLP model to use /// @@ -199,6 +211,33 @@ public TextExpansionQueryDescriptor ModelText(string modelText) return Self; } + /// + /// Token pruning configurations + /// + public TextExpansionQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public TextExpansionQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public TextExpansionQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + public TextExpansionQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -222,6 +261,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(ModelIdValue); writer.WritePropertyName("model_text"); writer.WriteStringValue(ModelTextValue); + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + if (!string.IsNullOrEmpty(QueryNameValue)) { writer.WritePropertyName("_name"); @@ -237,23 +292,22 @@ public sealed partial class TextExpansionQueryDescriptor : SerializableDescripto { internal TextExpansionQueryDescriptor(Action configure) => configure.Invoke(this); - internal TextExpansionQueryDescriptor() : base() - { - } - - public TextExpansionQueryDescriptor(Field field) + public TextExpansionQueryDescriptor() : base() { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; } private float? BoostValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } private string ModelIdValue { get; set; } private string ModelTextValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public TextExpansionQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -296,6 +350,33 @@ public TextExpansionQueryDescriptor ModelText(string modelText) return Self; } + /// + /// Token pruning configurations + /// + public TextExpansionQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public TextExpansionQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public TextExpansionQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + public TextExpansionQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -319,6 +400,22 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(ModelIdValue); writer.WritePropertyName("model_text"); writer.WriteStringValue(ModelTextValue); + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + if (!string.IsNullOrEmpty(QueryNameValue)) { writer.WritePropertyName("_name"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TokenPruningConfig.g.cs new file mode 100644 index 00000000000..a7300a7f415 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TokenPruningConfig.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +public sealed partial class TokenPruningConfig +{ + /// + /// Whether to only score pruned tokens, vs only scoring kept tokens. + /// + [JsonInclude, JsonPropertyName("only_score_pruned_tokens")] + public bool? OnlyScorePrunedTokens { get; set; } + + /// + /// Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned. + /// + [JsonInclude, JsonPropertyName("tokens_freq_ratio_threshold")] + public int? TokensFreqRatioThreshold { get; set; } + + /// + /// Tokens whose weight is less than this threshold are considered nonsignificant and pruned. + /// + [JsonInclude, JsonPropertyName("tokens_weight_threshold")] + public float? TokensWeightThreshold { get; set; } +} + +public sealed partial class TokenPruningConfigDescriptor : SerializableDescriptor +{ + internal TokenPruningConfigDescriptor(Action configure) => configure.Invoke(this); + + public TokenPruningConfigDescriptor() : base() + { + } + + private bool? OnlyScorePrunedTokensValue { get; set; } + private int? TokensFreqRatioThresholdValue { get; set; } + private float? TokensWeightThresholdValue { get; set; } + + /// + /// Whether to only score pruned tokens, vs only scoring kept tokens. + /// + public TokenPruningConfigDescriptor OnlyScorePrunedTokens(bool? onlyScorePrunedTokens = true) + { + OnlyScorePrunedTokensValue = onlyScorePrunedTokens; + return Self; + } + + /// + /// Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned. + /// + public TokenPruningConfigDescriptor TokensFreqRatioThreshold(int? tokensFreqRatioThreshold) + { + TokensFreqRatioThresholdValue = tokensFreqRatioThreshold; + return Self; + } + + /// + /// Tokens whose weight is less than this threshold are considered nonsignificant and pruned. + /// + public TokenPruningConfigDescriptor TokensWeightThreshold(float? tokensWeightThreshold) + { + TokensWeightThresholdValue = tokensWeightThreshold; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (OnlyScorePrunedTokensValue.HasValue) + { + writer.WritePropertyName("only_score_pruned_tokens"); + writer.WriteBooleanValue(OnlyScorePrunedTokensValue.Value); + } + + if (TokensFreqRatioThresholdValue.HasValue) + { + writer.WritePropertyName("tokens_freq_ratio_threshold"); + writer.WriteNumberValue(TokensFreqRatioThresholdValue.Value); + } + + if (TokensWeightThresholdValue.HasValue) + { + writer.WritePropertyName("tokens_weight_threshold"); + writer.WriteNumberValue(TokensWeightThresholdValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs new file mode 100644 index 00000000000..8c705034ed4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +internal sealed partial class WeightedTokensQueryConverter : JsonConverter +{ + public override WeightedTokensQuery 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 WeightedTokensQuery(fieldName); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "boost") + { + variant.Boost = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "pruning_config") + { + variant.PruningConfig = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "_name") + { + variant.QueryName = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "tokens") + { + variant.Tokens = JsonSerializer.Deserialize>(ref reader, options); + continue; + } + } + } + + reader.Read(); + return variant; + } + + public override void Write(Utf8JsonWriter writer, WeightedTokensQuery value, JsonSerializerOptions options) + { + if (value.Field is null) + throw new JsonException("Unable to serialize WeightedTokensQuery because the `Field` property is not set. Field name queries must include a valid field name."); + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(value.Boost.Value); + } + + if (value.PruningConfig is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, value.PruningConfig, options); + } + + if (!string.IsNullOrEmpty(value.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, value.Tokens, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(WeightedTokensQueryConverter))] +public sealed partial class WeightedTokensQuery +{ + public WeightedTokensQuery(Elastic.Clients.Elasticsearch.Field field) + { + if (field is null) + throw new ArgumentNullException(nameof(field)); + Field = field; + } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public float? Boost { get; set; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Token pruning configurations + /// + public Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfig { get; set; } + public string? QueryName { get; set; } + + /// + /// The tokens representing this query + /// + public IDictionary Tokens { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(WeightedTokensQuery weightedTokensQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.WeightedTokens(weightedTokensQuery); +} + +public sealed partial class WeightedTokensQueryDescriptor : SerializableDescriptor> +{ + internal WeightedTokensQueryDescriptor(Action> configure) => configure.Invoke(this); + + public WeightedTokensQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private IDictionary TokensValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public WeightedTokensQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Token pruning configurations + /// + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + + public WeightedTokensQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The tokens representing this query + /// + public WeightedTokensQueryDescriptor Tokens(Func, FluentDictionary> selector) + { + TokensValue = selector?.Invoke(new FluentDictionary()); + 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 (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, TokensValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} + +public sealed partial class WeightedTokensQueryDescriptor : SerializableDescriptor +{ + internal WeightedTokensQueryDescriptor(Action configure) => configure.Invoke(this); + + public WeightedTokensQueryDescriptor() : base() + { + } + + private float? BoostValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? PruningConfigValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor PruningConfigDescriptor { get; set; } + private Action PruningConfigDescriptorAction { get; set; } + private string? QueryNameValue { get; set; } + private IDictionary TokensValue { get; set; } + + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
+ public WeightedTokensQueryDescriptor Boost(float? boost) + { + BoostValue = boost; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + public WeightedTokensQueryDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Token pruning configurations + /// + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfig? pruningConfig) + { + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = null; + PruningConfigValue = pruningConfig; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor descriptor) + { + PruningConfigValue = null; + PruningConfigDescriptorAction = null; + PruningConfigDescriptor = descriptor; + return Self; + } + + public WeightedTokensQueryDescriptor PruningConfig(Action configure) + { + PruningConfigValue = null; + PruningConfigDescriptor = null; + PruningConfigDescriptorAction = configure; + return Self; + } + + public WeightedTokensQueryDescriptor QueryName(string? queryName) + { + QueryNameValue = queryName; + return Self; + } + + /// + /// The tokens representing this query + /// + public WeightedTokensQueryDescriptor Tokens(Func, FluentDictionary> selector) + { + TokensValue = selector?.Invoke(new FluentDictionary()); + 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 (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (PruningConfigDescriptor is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigDescriptor, options); + } + else if (PruningConfigDescriptorAction is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.TokenPruningConfigDescriptor(PruningConfigDescriptorAction), options); + } + else if (PruningConfigValue is not null) + { + writer.WritePropertyName("pruning_config"); + JsonSerializer.Serialize(writer, PruningConfigValue, options); + } + + if (!string.IsNullOrEmpty(QueryNameValue)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(QueryNameValue); + } + + writer.WritePropertyName("tokens"); + JsonSerializer.Serialize(writer, TokensValue, options); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs index 825b0efb14f..640e55fc6b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs @@ -88,73 +88,73 @@ public override void Write(Utf8JsonWriter writer, WildcardQuery value, JsonSeria { 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)) + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteStartObject(); + writer.WritePropertyName(settings.Inferrer.Field(value.Field)); + writer.WriteStartObject(); + if (value.Boost.HasValue) { - writer.WriteStartObject(); - writer.WritePropertyName(settings.Inferrer.Field(value.Field)); - writer.WriteStartObject(); - 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("boost"); + writer.WriteNumberValue(value.Boost.Value); + } - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } + 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.QueryName)) + { + writer.WritePropertyName("_name"); + writer.WriteStringValue(value.QueryName); + } - if (!string.IsNullOrEmpty(value.Value)) - { - writer.WritePropertyName("value"); - writer.WriteStringValue(value.Value); - } + if (!string.IsNullOrEmpty(value.Rewrite)) + { + writer.WritePropertyName("rewrite"); + writer.WriteStringValue(value.Rewrite); + } - if (!string.IsNullOrEmpty(value.Wildcard)) - { - writer.WritePropertyName("wildcard"); - writer.WriteStringValue(value.Wildcard); - } + if (!string.IsNullOrEmpty(value.Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(value.Value); + } - writer.WriteEndObject(); - writer.WriteEndObject(); - return; + if (!string.IsNullOrEmpty(value.Wildcard)) + { + writer.WritePropertyName("wildcard"); + writer.WriteStringValue(value.Wildcard); } - throw new JsonException("Unable to retrieve client settings required to infer field."); + writer.WriteEndObject(); + writer.WriteEndObject(); } } [JsonConverter(typeof(WildcardQueryConverter))] -public sealed partial class WildcardQuery : SearchQuery +public sealed partial class WildcardQuery { - public WildcardQuery(Field field) + public WildcardQuery(Elastic.Clients.Elasticsearch.Field field) { if (field is null) throw new ArgumentNullException(nameof(field)); Field = field; } - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
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; } + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? QueryName { get; set; } /// /// Method used to rewrite the query. @@ -170,35 +170,18 @@ public WildcardQuery(Field field) /// 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.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 static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(WildcardQuery wildcardQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Wildcard(wildcardQuery); } public sealed partial class WildcardQueryDescriptor : SerializableDescriptor> { internal WildcardQueryDescriptor(Action> configure) => configure.Invoke(this); - internal WildcardQueryDescriptor() : base() + public 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 float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -207,6 +190,9 @@ public WildcardQueryDescriptor(Expression> field) private string? ValueValue { get; set; } private string? WildcardValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WildcardQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -234,6 +220,12 @@ public WildcardQueryDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public WildcardQueryDescriptor QueryName(string? queryName) { QueryNameValue = queryName; @@ -292,10 +284,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (!string.IsNullOrEmpty(ValueValue)) @@ -319,17 +311,10 @@ public sealed partial class WildcardQueryDescriptor : SerializableDescriptor configure) => configure.Invoke(this); - internal WildcardQueryDescriptor() : base() + public WildcardQueryDescriptor() : base() { } - public WildcardQueryDescriptor(Field field) - { - if (field is null) - throw new ArgumentNullException(nameof(field)); - FieldValue = field; - } - private float? BoostValue { get; set; } private bool? CaseInsensitiveValue { get; set; } private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } @@ -338,6 +323,9 @@ public WildcardQueryDescriptor(Field field) private string? ValueValue { get; set; } private string? WildcardValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WildcardQueryDescriptor Boost(float? boost) { BoostValue = boost; @@ -429,10 +417,10 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(QueryNameValue); } - if (RewriteValue is not null) + if (!string.IsNullOrEmpty(RewriteValue)) { writer.WritePropertyName("rewrite"); - JsonSerializer.Serialize(writer, RewriteValue, options); + writer.WriteStringValue(RewriteValue); } if (!string.IsNullOrEmpty(ValueValue)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs index 7e0d098cc6f..72d06554a4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs @@ -27,10 +27,11 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class WrapperQuery : SearchQuery +public sealed partial class WrapperQuery { - [JsonInclude, JsonPropertyName("_name")] - public string? QueryName { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
[JsonInclude, JsonPropertyName("boost")] public float? Boost { get; set; } @@ -39,10 +40,10 @@ public sealed partial class WrapperQuery : SearchQuery ///
[JsonInclude, JsonPropertyName("query")] public string Query { get; set; } + [JsonInclude, JsonPropertyName("_name")] + public string? QueryName { get; set; } - public static implicit operator Query(WrapperQuery wrapperQuery) => QueryDsl.Query.Wrapper(wrapperQuery); - - internal override void InternalWrapInContainer(Query container) => container.WrapVariant("wrapper", this); + public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.Query(WrapperQuery wrapperQuery) => Elastic.Clients.Elasticsearch.QueryDsl.Query.Wrapper(wrapperQuery); } public sealed partial class WrapperQueryDescriptor : SerializableDescriptor @@ -57,6 +58,9 @@ public WrapperQueryDescriptor() : base() private string QueryValue { get; set; } private string? QueryNameValue { get; set; } + /// + /// Floating point number used to decrease or increase the relevance scores of the query.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
+ ///
public WrapperQueryDescriptor Boost(float? boost) { BoostValue = boost; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs new file mode 100644 index 00000000000..878c42c5a54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRule.g.cs @@ -0,0 +1,188 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class QueryRule +{ + [JsonInclude, JsonPropertyName("actions")] + public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions Actions { get; set; } + [JsonInclude, JsonPropertyName("criteria")] + public ICollection Criteria { get; set; } + [JsonInclude, JsonPropertyName("rule_id")] + public Elastic.Clients.Elasticsearch.Id RuleId { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType Type { get; set; } +} + +public sealed partial class QueryRuleDescriptor : SerializableDescriptor +{ + internal QueryRuleDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions ActionsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor ActionsDescriptor { get; set; } + private Action ActionsDescriptorAction { get; set; } + private ICollection CriteriaValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor CriteriaDescriptor { get; set; } + private Action CriteriaDescriptorAction { get; set; } + private Action[] CriteriaDescriptorActions { get; set; } + private Elastic.Clients.Elasticsearch.Id RuleIdValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType TypeValue { get; set; } + + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActions actions) + { + ActionsDescriptor = null; + ActionsDescriptorAction = null; + ActionsValue = actions; + return Self; + } + + public QueryRuleDescriptor Actions(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor descriptor) + { + ActionsValue = null; + ActionsDescriptorAction = null; + ActionsDescriptor = descriptor; + return Self; + } + + public QueryRuleDescriptor Actions(Action configure) + { + ActionsValue = null; + ActionsDescriptor = null; + ActionsDescriptorAction = configure; + return Self; + } + + public QueryRuleDescriptor Criteria(ICollection criteria) + { + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaValue = criteria; + return Self; + } + + public QueryRuleDescriptor Criteria(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor descriptor) + { + CriteriaValue = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = null; + CriteriaDescriptor = descriptor; + return Self; + } + + public QueryRuleDescriptor Criteria(Action configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorActions = null; + CriteriaDescriptorAction = configure; + return Self; + } + + public QueryRuleDescriptor Criteria(params Action[] configure) + { + CriteriaValue = null; + CriteriaDescriptor = null; + CriteriaDescriptorAction = null; + CriteriaDescriptorActions = configure; + return Self; + } + + public QueryRuleDescriptor RuleId(Elastic.Clients.Elasticsearch.Id ruleId) + { + RuleIdValue = ruleId; + return Self; + } + + public QueryRuleDescriptor Type(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleType type) + { + TypeValue = type; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ActionsDescriptor is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsDescriptor, options); + } + else if (ActionsDescriptorAction is not null) + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleActionsDescriptor(ActionsDescriptorAction), options); + } + else + { + writer.WritePropertyName("actions"); + JsonSerializer.Serialize(writer, ActionsValue, options); + } + + if (CriteriaDescriptor is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, CriteriaDescriptor, options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorAction is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor(CriteriaDescriptorAction), options); + writer.WriteEndArray(); + } + else if (CriteriaDescriptorActions is not null) + { + writer.WritePropertyName("criteria"); + writer.WriteStartArray(); + foreach (var action in CriteriaDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaDescriptor(action), options); + } + + writer.WriteEndArray(); + } + else + { + writer.WritePropertyName("criteria"); + JsonSerializer.Serialize(writer, CriteriaValue, options); + } + + writer.WritePropertyName("rule_id"); + JsonSerializer.Serialize(writer, RuleIdValue, options); + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.g.cs new file mode 100644 index 00000000000..9eea979c195 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleActions.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class QueryRuleActions +{ + [JsonInclude, JsonPropertyName("docs")] + public ICollection? Docs { get; set; } + [JsonInclude, JsonPropertyName("ids")] + public ICollection? Ids { get; set; } +} + +public sealed partial class QueryRuleActionsDescriptor : SerializableDescriptor +{ + internal QueryRuleActionsDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleActionsDescriptor() : base() + { + } + + private ICollection? DocsValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.PinnedDocDescriptor DocsDescriptor { get; set; } + private Action DocsDescriptorAction { get; set; } + private Action[] DocsDescriptorActions { get; set; } + private ICollection? IdsValue { get; set; } + + public QueryRuleActionsDescriptor Docs(ICollection? docs) + { + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsValue = docs; + return Self; + } + + public QueryRuleActionsDescriptor Docs(Elastic.Clients.Elasticsearch.QueryDsl.PinnedDocDescriptor descriptor) + { + DocsValue = null; + DocsDescriptorAction = null; + DocsDescriptorActions = null; + DocsDescriptor = descriptor; + return Self; + } + + public QueryRuleActionsDescriptor Docs(Action configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorActions = null; + DocsDescriptorAction = configure; + return Self; + } + + public QueryRuleActionsDescriptor Docs(params Action[] configure) + { + DocsValue = null; + DocsDescriptor = null; + DocsDescriptorAction = null; + DocsDescriptorActions = configure; + return Self; + } + + public QueryRuleActionsDescriptor 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 Elastic.Clients.Elasticsearch.QueryDsl.PinnedDocDescriptor(DocsDescriptorAction), options); + writer.WriteEndArray(); + } + else if (DocsDescriptorActions is not null) + { + writer.WritePropertyName("docs"); + writer.WriteStartArray(); + foreach (var action in DocsDescriptorActions) + { + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.QueryDsl.PinnedDocDescriptor(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/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.g.cs new file mode 100644 index 00000000000..05b88647b75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRuleCriteria.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class QueryRuleCriteria +{ + [JsonInclude, JsonPropertyName("metadata")] + public string Metadata { get; set; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType Type { get; set; } + [JsonInclude, JsonPropertyName("values")] + public ICollection? Values { get; set; } +} + +public sealed partial class QueryRuleCriteriaDescriptor : SerializableDescriptor +{ + internal QueryRuleCriteriaDescriptor(Action configure) => configure.Invoke(this); + + public QueryRuleCriteriaDescriptor() : base() + { + } + + private string MetadataValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType TypeValue { get; set; } + private ICollection? ValuesValue { get; set; } + + public QueryRuleCriteriaDescriptor Metadata(string metadata) + { + MetadataValue = metadata; + return Self; + } + + public QueryRuleCriteriaDescriptor Type(Elastic.Clients.Elasticsearch.QueryRuleset.QueryRuleCriteriaType type) + { + TypeValue = type; + return Self; + } + + public QueryRuleCriteriaDescriptor Values(ICollection? values) + { + ValuesValue = values; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("metadata"); + writer.WriteStringValue(MetadataValue); + writer.WritePropertyName("type"); + JsonSerializer.Serialize(writer, TypeValue, options); + 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/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.g.cs new file mode 100644 index 00000000000..e42e31365e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRuleset/QueryRulesetListItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRuleset; + +public sealed partial class QueryRulesetListItem +{ + /// + /// The number of rules associated with this ruleset + /// + [JsonInclude, JsonPropertyName("rules_count")] + public int RulesCount { get; init; } + + /// + /// Ruleset unique identifier + /// + [JsonInclude, JsonPropertyName("ruleset_id")] + public string RulesetId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs index 7d79d7a6f23..130e50ef66e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -46,6 +47,18 @@ internal QueryVectorBuilder(string variantName, object variant) internal string VariantName { get; } public static QueryVectorBuilder TextEmbedding(Elastic.Clients.Elasticsearch.TextEmbedding textEmbedding) => new QueryVectorBuilder("text_embedding", textEmbedding); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class QueryVectorBuilderConverter : JsonConverter @@ -57,28 +70,41 @@ public override QueryVectorBuilder Read(ref Utf8JsonReader reader, Type typeToCo throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "text_embedding") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + 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(); - return new QueryVectorBuilder(propertyName, variant); + if (propertyName == "text_embedding") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'QueryVectorBuilder' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new QueryVectorBuilder(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, QueryVectorBuilder value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -124,27 +150,25 @@ private QueryVectorBuilderDescriptor Set(object variant, string varia return Self; } - public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); - public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -180,27 +204,25 @@ private QueryVectorBuilderDescriptor Set(object variant, string variantName) return Self; } - public QueryVectorBuilderDescriptor TextEmbedding(TextEmbedding textEmbedding) => Set(textEmbedding, "text_embedding"); - public QueryVectorBuilderDescriptor TextEmbedding(Action configure) => Set(configure, "text_embedding"); + public QueryVectorBuilderDescriptor TextEmbedding(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs index ba55ac58f3b..86991ef645d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -46,6 +47,18 @@ internal Rank(string variantName, object variant) internal string VariantName { get; } public static Rank Rrf(Elastic.Clients.Elasticsearch.RrfRank rrfRank) => new Rank("rrf", rrfRank); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class RankConverter : JsonConverter @@ -57,28 +70,41 @@ public override Rank Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - var propertyName = reader.GetString(); - reader.Read(); - if (propertyName == "rrf") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + 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(); - return new Rank(propertyName, variant); + if (propertyName == "rrf") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Rank' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new Rank(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, Rank value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -124,27 +150,25 @@ private RankDescriptor Set(object variant, string variantName) return Self; } - public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); - public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + public RankDescriptor Rrf(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -180,27 +204,25 @@ private RankDescriptor Set(object variant, string variantName) return Self; } - public RankDescriptor Rrf(RrfRank rrfRank) => Set(rrfRank, "rrf"); - public RankDescriptor Rrf(Action configure) => Set(configure, "rrf"); + public RankDescriptor Rrf(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs new file mode 100644 index 00000000000..4d3075b3918 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs @@ -0,0 +1,337 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class DateHistogramGrouping +{ + /// + /// The interval of time buckets to be generated when rolling up. + /// + [JsonInclude, JsonPropertyName("calendar_interval")] + public Elastic.Clients.Elasticsearch.Duration? CalendarInterval { get; set; } + + /// + /// How long to wait before rolling up new documents.
By default, the indexer attempts to roll up all data that is available.
However, it is not uncommon for data to arrive out of order.
The indexer is unable to deal with data that arrives after a time-span has been rolled up.
You need to specify a delay that matches the longest period of time you expect out-of-order data to arrive.
+ ///
+ [JsonInclude, JsonPropertyName("delay")] + public Elastic.Clients.Elasticsearch.Duration? Delay { get; set; } + + /// + /// The date field that is to be rolled up. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// The interval of time buckets to be generated when rolling up. + /// + [JsonInclude, JsonPropertyName("fixed_interval")] + public Elastic.Clients.Elasticsearch.Duration? FixedInterval { get; set; } + [JsonInclude, JsonPropertyName("format")] + public string? Format { get; set; } + [JsonInclude, JsonPropertyName("interval")] + public Elastic.Clients.Elasticsearch.Duration? Interval { get; set; } + + /// + /// Defines what `time_zone` the rollup documents are stored as.
Unlike raw data, which can shift timezones on the fly, rolled documents have to be stored with a specific timezone.
By default, rollup documents are stored in `UTC`.
+ ///
+ [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } +} + +public sealed partial class DateHistogramGroupingDescriptor : SerializableDescriptor> +{ + internal DateHistogramGroupingDescriptor(Action> configure) => configure.Invoke(this); + + public DateHistogramGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? IntervalValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The interval of time buckets to be generated when rolling up. + /// + public DateHistogramGroupingDescriptor CalendarInterval(Elastic.Clients.Elasticsearch.Duration? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// How long to wait before rolling up new documents.
By default, the indexer attempts to roll up all data that is available.
However, it is not uncommon for data to arrive out of order.
The indexer is unable to deal with data that arrives after a time-span has been rolled up.
You need to specify a delay that matches the longest period of time you expect out-of-order data to arrive.
+ ///
+ public DateHistogramGroupingDescriptor Delay(Elastic.Clients.Elasticsearch.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The interval of time buckets to be generated when rolling up. + /// + public DateHistogramGroupingDescriptor FixedInterval(Elastic.Clients.Elasticsearch.Duration? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public DateHistogramGroupingDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateHistogramGroupingDescriptor Interval(Elastic.Clients.Elasticsearch.Duration? interval) + { + IntervalValue = interval; + return Self; + } + + /// + /// Defines what `time_zone` the rollup documents are stored as.
Unlike raw data, which can shift timezones on the fly, rolled documents have to be stored with a specific timezone.
By default, rollup documents are stored in `UTC`.
+ ///
+ public DateHistogramGroupingDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CalendarIntervalValue is not null) + { + writer.WritePropertyName("calendar_interval"); + JsonSerializer.Serialize(writer, CalendarIntervalValue, options); + } + + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + 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 (IntervalValue is not null) + { + writer.WritePropertyName("interval"); + JsonSerializer.Serialize(writer, IntervalValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class DateHistogramGroupingDescriptor : SerializableDescriptor +{ + internal DateHistogramGroupingDescriptor(Action configure) => configure.Invoke(this); + + public DateHistogramGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? CalendarIntervalValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? FixedIntervalValue { get; set; } + private string? FormatValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? IntervalValue { get; set; } + private string? TimeZoneValue { get; set; } + + /// + /// The interval of time buckets to be generated when rolling up. + /// + public DateHistogramGroupingDescriptor CalendarInterval(Elastic.Clients.Elasticsearch.Duration? calendarInterval) + { + CalendarIntervalValue = calendarInterval; + return Self; + } + + /// + /// How long to wait before rolling up new documents.
By default, the indexer attempts to roll up all data that is available.
However, it is not uncommon for data to arrive out of order.
The indexer is unable to deal with data that arrives after a time-span has been rolled up.
You need to specify a delay that matches the longest period of time you expect out-of-order data to arrive.
+ ///
+ public DateHistogramGroupingDescriptor Delay(Elastic.Clients.Elasticsearch.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is to be rolled up. + /// + public DateHistogramGroupingDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The interval of time buckets to be generated when rolling up. + /// + public DateHistogramGroupingDescriptor FixedInterval(Elastic.Clients.Elasticsearch.Duration? fixedInterval) + { + FixedIntervalValue = fixedInterval; + return Self; + } + + public DateHistogramGroupingDescriptor Format(string? format) + { + FormatValue = format; + return Self; + } + + public DateHistogramGroupingDescriptor Interval(Elastic.Clients.Elasticsearch.Duration? interval) + { + IntervalValue = interval; + return Self; + } + + /// + /// Defines what `time_zone` the rollup documents are stored as.
Unlike raw data, which can shift timezones on the fly, rolled documents have to be stored with a specific timezone.
By default, rollup documents are stored in `UTC`.
+ ///
+ public DateHistogramGroupingDescriptor TimeZone(string? timeZone) + { + TimeZoneValue = timeZone; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (CalendarIntervalValue is not null) + { + writer.WritePropertyName("calendar_interval"); + JsonSerializer.Serialize(writer, CalendarIntervalValue, options); + } + + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + 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 (IntervalValue is not null) + { + writer.WritePropertyName("interval"); + JsonSerializer.Serialize(writer, IntervalValue, options); + } + + if (!string.IsNullOrEmpty(TimeZoneValue)) + { + writer.WritePropertyName("time_zone"); + writer.WriteStringValue(TimeZoneValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs new file mode 100644 index 00000000000..c9aacd09467 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class FieldMetric +{ + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// An array of metrics to collect for the field. At least one metric must be configured. + /// + [JsonInclude, JsonPropertyName("metrics")] + public ICollection Metrics { get; set; } +} + +public sealed partial class FieldMetricDescriptor : SerializableDescriptor> +{ + internal FieldMetricDescriptor(Action> configure) => configure.Invoke(this); + + public FieldMetricDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private ICollection MetricsValue { get; set; } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// An array of metrics to collect for the field. At least one metric must be configured. + /// + public FieldMetricDescriptor Metrics(ICollection metrics) + { + MetricsValue = metrics; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class FieldMetricDescriptor : SerializableDescriptor +{ + internal FieldMetricDescriptor(Action configure) => configure.Invoke(this); + + public FieldMetricDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private ICollection MetricsValue { get; set; } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The field to collect metrics for. This must be a numeric of some kind. + /// + public FieldMetricDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// An array of metrics to collect for the field. At least one metric must be configured. + /// + public FieldMetricDescriptor Metrics(ICollection metrics) + { + MetricsValue = metrics; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WritePropertyName("metrics"); + JsonSerializer.Serialize(writer, MetricsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs new file mode 100644 index 00000000000..d1d306bbfff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class Groupings +{ + /// + /// A date histogram group aggregates a date field into time-based buckets.
This group is mandatory; you currently cannot roll up documents without a timestamp and a `date_histogram` group.
+ ///
+ [JsonInclude, JsonPropertyName("date_histogram")] + public Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping? DateHistogram { get; set; } + + /// + /// The histogram group aggregates one or more numeric fields into numeric histogram intervals. + /// + [JsonInclude, JsonPropertyName("histogram")] + public Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping? Histogram { get; set; } + + /// + /// The terms group can be used on keyword or numeric fields to allow bucketing via the terms aggregation at a later point.
The indexer enumerates and stores all values of a field for each time-period.
This can be potentially costly for high-cardinality groups such as IP addresses, especially if the time-bucket is particularly sparse.
+ ///
+ [JsonInclude, JsonPropertyName("terms")] + public Elastic.Clients.Elasticsearch.Rollup.TermsGrouping? Terms { get; set; } +} + +public sealed partial class GroupingsDescriptor : SerializableDescriptor> +{ + internal GroupingsDescriptor(Action> configure) => configure.Invoke(this); + + public GroupingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor DateHistogramDescriptor { get; set; } + private Action> DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor HistogramDescriptor { get; set; } + private Action> HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.TermsGrouping? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor TermsDescriptor { get; set; } + private Action> TermsDescriptorAction { get; set; } + + /// + /// A date histogram group aggregates a date field into time-based buckets.
This group is mandatory; you currently cannot roll up documents without a timestamp and a `date_histogram` group.
+ ///
+ public GroupingsDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public GroupingsDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor DateHistogram(Action> configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// The histogram group aggregates one or more numeric fields into numeric histogram intervals. + /// + public GroupingsDescriptor Histogram(Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public GroupingsDescriptor Histogram(Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor Histogram(Action> configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// The terms group can be used on keyword or numeric fields to allow bucketing via the terms aggregation at a later point.
The indexer enumerates and stores all values of a field for each time-period.
This can be potentially costly for high-cardinality groups such as IP addresses, especially if the time-bucket is particularly sparse.
+ ///
+ public GroupingsDescriptor Terms(Elastic.Clients.Elasticsearch.Rollup.TermsGrouping? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public GroupingsDescriptor Terms(Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor Terms(Action> configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class GroupingsDescriptor : SerializableDescriptor +{ + internal GroupingsDescriptor(Action configure) => configure.Invoke(this); + + public GroupingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping? DateHistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor DateHistogramDescriptor { get; set; } + private Action DateHistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping? HistogramValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor HistogramDescriptor { get; set; } + private Action HistogramDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.TermsGrouping? TermsValue { get; set; } + private Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor TermsDescriptor { get; set; } + private Action TermsDescriptorAction { get; set; } + + /// + /// A date histogram group aggregates a date field into time-based buckets.
This group is mandatory; you currently cannot roll up documents without a timestamp and a `date_histogram` group.
+ ///
+ public GroupingsDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping? dateHistogram) + { + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = null; + DateHistogramValue = dateHistogram; + return Self; + } + + public GroupingsDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor descriptor) + { + DateHistogramValue = null; + DateHistogramDescriptorAction = null; + DateHistogramDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor DateHistogram(Action configure) + { + DateHistogramValue = null; + DateHistogramDescriptor = null; + DateHistogramDescriptorAction = configure; + return Self; + } + + /// + /// The histogram group aggregates one or more numeric fields into numeric histogram intervals. + /// + public GroupingsDescriptor Histogram(Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping? histogram) + { + HistogramDescriptor = null; + HistogramDescriptorAction = null; + HistogramValue = histogram; + return Self; + } + + public GroupingsDescriptor Histogram(Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor descriptor) + { + HistogramValue = null; + HistogramDescriptorAction = null; + HistogramDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor Histogram(Action configure) + { + HistogramValue = null; + HistogramDescriptor = null; + HistogramDescriptorAction = configure; + return Self; + } + + /// + /// The terms group can be used on keyword or numeric fields to allow bucketing via the terms aggregation at a later point.
The indexer enumerates and stores all values of a field for each time-period.
This can be potentially costly for high-cardinality groups such as IP addresses, especially if the time-bucket is particularly sparse.
+ ///
+ public GroupingsDescriptor Terms(Elastic.Clients.Elasticsearch.Rollup.TermsGrouping? terms) + { + TermsDescriptor = null; + TermsDescriptorAction = null; + TermsValue = terms; + return Self; + } + + public GroupingsDescriptor Terms(Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor descriptor) + { + TermsValue = null; + TermsDescriptorAction = null; + TermsDescriptor = descriptor; + return Self; + } + + public GroupingsDescriptor Terms(Action configure) + { + TermsValue = null; + TermsDescriptor = null; + TermsDescriptorAction = configure; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DateHistogramDescriptor is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramDescriptor, options); + } + else if (DateHistogramDescriptorAction is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingDescriptor(DateHistogramDescriptorAction), options); + } + else if (DateHistogramValue is not null) + { + writer.WritePropertyName("date_histogram"); + JsonSerializer.Serialize(writer, DateHistogramValue, options); + } + + if (HistogramDescriptor is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramDescriptor, options); + } + else if (HistogramDescriptorAction is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingDescriptor(HistogramDescriptorAction), options); + } + else if (HistogramValue is not null) + { + writer.WritePropertyName("histogram"); + JsonSerializer.Serialize(writer, HistogramValue, options); + } + + if (TermsDescriptor is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsDescriptor, options); + } + else if (TermsDescriptorAction is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.Rollup.TermsGroupingDescriptor(TermsDescriptorAction), options); + } + else if (TermsValue is not null) + { + writer.WritePropertyName("terms"); + JsonSerializer.Serialize(writer, TermsValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs new file mode 100644 index 00000000000..0fdea00013e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class HistogramGrouping +{ + /// + /// The set of fields that you wish to build histograms for.
All fields specified must be some kind of numeric.
Order does not matter.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Fields Fields { get; set; } + + /// + /// The interval of histogram buckets to be generated when rolling up.
For example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).
Note that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.
+ ///
+ [JsonInclude, JsonPropertyName("interval")] + public long Interval { get; set; } +} + +public sealed partial class HistogramGroupingDescriptor : SerializableDescriptor> +{ + internal HistogramGroupingDescriptor(Action> configure) => configure.Invoke(this); + + public HistogramGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + private long IntervalValue { get; set; } + + /// + /// The set of fields that you wish to build histograms for.
All fields specified must be some kind of numeric.
Order does not matter.
+ ///
+ public HistogramGroupingDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// The interval of histogram buckets to be generated when rolling up.
For example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).
Note that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.
+ ///
+ public HistogramGroupingDescriptor Interval(long interval) + { + IntervalValue = interval; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + writer.WritePropertyName("interval"); + writer.WriteNumberValue(IntervalValue); + writer.WriteEndObject(); + } +} + +public sealed partial class HistogramGroupingDescriptor : SerializableDescriptor +{ + internal HistogramGroupingDescriptor(Action configure) => configure.Invoke(this); + + public HistogramGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + private long IntervalValue { get; set; } + + /// + /// The set of fields that you wish to build histograms for.
All fields specified must be some kind of numeric.
Order does not matter.
+ ///
+ public HistogramGroupingDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + /// + /// The interval of histogram buckets to be generated when rolling up.
For example, a value of `5` creates buckets that are five units wide (`0-5`, `5-10`, etc).
Note that only one interval can be specified in the histogram group, meaning that all fields being grouped via the histogram must share the same interval.
+ ///
+ public HistogramGroupingDescriptor Interval(long interval) + { + IntervalValue = interval; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + writer.WritePropertyName("interval"); + writer.WriteNumberValue(IntervalValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs new file mode 100644 index 00000000000..6e42a89542c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class IndexCapabilities +{ + [JsonInclude, JsonPropertyName("rollup_jobs")] + public IReadOnlyCollection RollupJobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs new file mode 100644 index 00000000000..bfd22219cc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupCapabilities +{ + [JsonInclude, JsonPropertyName("rollup_jobs")] + public IReadOnlyCollection RollupJobs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs new file mode 100644 index 00000000000..45fffa5a070 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupCapabilitySummary +{ + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] + public IReadOnlyDictionary> Fields { get; init; } + [JsonInclude, JsonPropertyName("index_pattern")] + public string IndexPattern { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("rollup_index")] + public string RollupIndex { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs new file mode 100644 index 00000000000..86e1f711161 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupFieldSummary +{ + [JsonInclude, JsonPropertyName("agg")] + public string Agg { get; init; } + [JsonInclude, JsonPropertyName("calendar_interval")] + public Elastic.Clients.Elasticsearch.Duration? CalendarInterval { get; init; } + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs new file mode 100644 index 00000000000..824f882f957 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJob +{ + [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration Config { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Rollup.RollupJobStats Stats { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs new file mode 100644 index 00000000000..a0533b83fe7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJobConfiguration +{ + [JsonInclude, JsonPropertyName("cron")] + public string Cron { get; init; } + [JsonInclude, JsonPropertyName("groups")] + public Elastic.Clients.Elasticsearch.Rollup.Groupings Groups { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("index_pattern")] + public string IndexPattern { get; init; } + [JsonInclude, JsonPropertyName("metrics")] + public IReadOnlyCollection Metrics { get; init; } + [JsonInclude, JsonPropertyName("page_size")] + public long PageSize { get; init; } + [JsonInclude, JsonPropertyName("rollup_index")] + public string RollupIndex { get; init; } + [JsonInclude, JsonPropertyName("timeout")] + public Elastic.Clients.Elasticsearch.Duration Timeout { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs new file mode 100644 index 00000000000..bad88c5d7e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJobStats +{ + [JsonInclude, JsonPropertyName("documents_processed")] + public long DocumentsProcessed { get; init; } + [JsonInclude, JsonPropertyName("index_failures")] + public long IndexFailures { get; init; } + [JsonInclude, JsonPropertyName("index_time_in_ms")] + public long IndexTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("index_total")] + public long IndexTotal { get; init; } + [JsonInclude, JsonPropertyName("pages_processed")] + public long PagesProcessed { get; init; } + [JsonInclude, JsonPropertyName("processing_time_in_ms")] + public long ProcessingTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("processing_total")] + public long ProcessingTotal { get; init; } + [JsonInclude, JsonPropertyName("rollups_indexed")] + public long RollupsIndexed { get; init; } + [JsonInclude, JsonPropertyName("search_failures")] + public long SearchFailures { get; init; } + [JsonInclude, JsonPropertyName("search_time_in_ms")] + public long SearchTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("search_total")] + public long SearchTotal { get; init; } + [JsonInclude, JsonPropertyName("trigger_count")] + public long TriggerCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs new file mode 100644 index 00000000000..2da0b9dbdce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJobStatus +{ + [JsonInclude, JsonPropertyName("current_position")] + public IReadOnlyDictionary? CurrentPosition { get; init; } + [JsonInclude, JsonPropertyName("job_state")] + public Elastic.Clients.Elasticsearch.Rollup.IndexingJobState JobState { get; init; } + [JsonInclude, JsonPropertyName("upgraded_doc_id")] + public bool? UpgradedDocId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs new file mode 100644 index 00000000000..a015ca60a97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJobSummary +{ + [JsonInclude, JsonPropertyName("fields")] + [ReadOnlyFieldDictionaryConverter(typeof(IReadOnlyCollection))] + public IReadOnlyDictionary> Fields { get; init; } + [JsonInclude, JsonPropertyName("index_pattern")] + public string IndexPattern { get; init; } + [JsonInclude, JsonPropertyName("job_id")] + public string JobId { get; init; } + [JsonInclude, JsonPropertyName("rollup_index")] + public string RollupIndex { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs new file mode 100644 index 00000000000..2e85c3cf30e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class RollupJobSummaryField +{ + [JsonInclude, JsonPropertyName("agg")] + public string Agg { get; init; } + [JsonInclude, JsonPropertyName("calendar_interval")] + public Elastic.Clients.Elasticsearch.Duration? CalendarInterval { get; init; } + [JsonInclude, JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs new file mode 100644 index 00000000000..34df9eaac4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +public sealed partial class TermsGrouping +{ + /// + /// The set of fields that you wish to collect terms for.
This array can contain fields that are both keyword and numerics.
Order does not matter.
+ ///
+ [JsonInclude, JsonPropertyName("fields")] + public Elastic.Clients.Elasticsearch.Fields Fields { get; set; } +} + +public sealed partial class TermsGroupingDescriptor : SerializableDescriptor> +{ + internal TermsGroupingDescriptor(Action> configure) => configure.Invoke(this); + + public TermsGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + + /// + /// The set of fields that you wish to collect terms for.
This array can contain fields that are both keyword and numerics.
Order does not matter.
+ ///
+ public TermsGroupingDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TermsGroupingDescriptor : SerializableDescriptor +{ + internal TermsGroupingDescriptor(Action configure) => configure.Invoke(this); + + public TermsGroupingDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Fields FieldsValue { get; set; } + + /// + /// The set of fields that you wish to collect terms for.
This array can contain fields that are both keyword and numerics.
Order does not matter.
+ ///
+ public TermsGroupingDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) + { + FieldsValue = fields; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("fields"); + JsonSerializer.Serialize(writer, FieldsValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs index b0efa1f780e..d8572b3ef8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs @@ -41,7 +41,7 @@ public sealed partial class RrfRank [JsonInclude, JsonPropertyName("window_size")] public long? WindowSize { get; set; } - public static implicit operator Rank(RrfRank rrfRank) => Rank.Rrf(rrfRank); + public static implicit operator Elastic.Clients.Elasticsearch.Rank(RrfRank rrfRank) => Elastic.Clients.Elasticsearch.Rank.Rrf(rrfRank); } public sealed partial class RrfRankDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs index c14824fc468..0414af2d2bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class Script : Union { - public Script(Elastic.Clients.Elasticsearch.InlineScript inline) : base(inline) + public Script(Elastic.Clients.Elasticsearch.InlineScript Inline) : base(Inline) { } - public Script(Elastic.Clients.Elasticsearch.StoredScriptId stored) : base(stored) + public Script(Elastic.Clients.Elasticsearch.StoredScriptId Stored) : base(Stored) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs index 41dd3503ccf..d0599c54f4e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs @@ -40,7 +40,7 @@ public sealed partial class ScriptSort [JsonInclude, JsonPropertyName("type")] public Elastic.Clients.Elasticsearch.ScriptSortType? Type { get; set; } - public static implicit operator SortOptions(ScriptSort scriptSort) => SortOptions.Script(scriptSort); + public static implicit operator Elastic.Clients.Elasticsearch.SortOptions(ScriptSort scriptSort) => Elastic.Clients.Elasticsearch.SortOptions.Script(scriptSort); } public sealed partial class ScriptSortDescriptor : SerializableDescriptor> @@ -53,8 +53,8 @@ public ScriptSortDescriptor() : base() private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action> NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action> NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.ScriptSortType? TypeValue { get; set; } @@ -73,7 +73,7 @@ public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.Nest return Self; } - public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -81,7 +81,7 @@ public ScriptSortDescriptor Nested(NestedSortValueDescriptor Nested(Action> configure) + public ScriptSortDescriptor Nested(Action> configure) { NestedValue = null; NestedDescriptor = null; @@ -124,7 +124,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { @@ -160,8 +160,8 @@ public ScriptSortDescriptor() : base() private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.NestedSortValue? NestedValue { get; set; } - private NestedSortValueDescriptor NestedDescriptor { get; set; } - private Action NestedDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.NestedSortValueDescriptor NestedDescriptor { get; set; } + private Action NestedDescriptorAction { get; set; } private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script ScriptValue { get; set; } private Elastic.Clients.Elasticsearch.ScriptSortType? TypeValue { get; set; } @@ -180,7 +180,7 @@ public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValue return Self; } - public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) + public ScriptSortDescriptor Nested(Elastic.Clients.Elasticsearch.NestedSortValueDescriptor descriptor) { NestedValue = null; NestedDescriptorAction = null; @@ -188,7 +188,7 @@ public ScriptSortDescriptor Nested(NestedSortValueDescriptor descriptor) return Self; } - public ScriptSortDescriptor Nested(Action configure) + public ScriptSortDescriptor Nested(Action configure) { NestedValue = null; NestedDescriptor = null; @@ -231,7 +231,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o else if (NestedDescriptorAction is not null) { writer.WritePropertyName("nested"); - JsonSerializer.Serialize(writer, new NestedSortValueDescriptor(NestedDescriptorAction), options); + JsonSerializer.Serialize(writer, new Elastic.Clients.Elasticsearch.NestedSortValueDescriptor(NestedDescriptorAction), options); } else if (NestedValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs new file mode 100644 index 00000000000..9ef84ef0e41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class AnalyticsCollection +{ + /// + /// Data stream for the collection. + /// + [JsonInclude, JsonPropertyName("event_data_stream")] + public Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream EventDataStream { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs new file mode 100644 index 00000000000..a498d360239 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class EventDataStream +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs new file mode 100644 index 00000000000..30b5379020b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs @@ -0,0 +1,175 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class SearchApplication +{ + /// + /// Analytics collection associated to the Search Application. + /// + [JsonInclude, JsonPropertyName("analytics_collection_name")] + public Elastic.Clients.Elasticsearch.Name? AnalyticsCollectionName { get; set; } + + /// + /// Indices that are part of the Search Application. + /// + [JsonInclude, JsonPropertyName("indices")] + public ICollection Indices { get; set; } + + /// + /// Search Application name. + /// + [JsonInclude, JsonPropertyName("name")] + public Elastic.Clients.Elasticsearch.Name Name { get; set; } + + /// + /// Search template to use on search operations. + /// + [JsonInclude, JsonPropertyName("template")] + public Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate? Template { get; set; } + + /// + /// Last time the Search Application was updated. + /// + [JsonInclude, JsonPropertyName("updated_at_millis")] + public long UpdatedAtMillis { get; set; } +} + +public sealed partial class SearchApplicationDescriptor : SerializableDescriptor +{ + internal SearchApplicationDescriptor(Action configure) => configure.Invoke(this); + + public SearchApplicationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Name? AnalyticsCollectionNameValue { get; set; } + private ICollection IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.Name NameValue { get; set; } + private Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate? TemplateValue { get; set; } + private Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplateDescriptor TemplateDescriptor { get; set; } + private Action TemplateDescriptorAction { get; set; } + private long UpdatedAtMillisValue { get; set; } + + /// + /// Analytics collection associated to the Search Application. + /// + public SearchApplicationDescriptor AnalyticsCollectionName(Elastic.Clients.Elasticsearch.Name? analyticsCollectionName) + { + AnalyticsCollectionNameValue = analyticsCollectionName; + return Self; + } + + /// + /// Indices that are part of the Search Application. + /// + public SearchApplicationDescriptor Indices(ICollection indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Search Application name. + /// + public SearchApplicationDescriptor Name(Elastic.Clients.Elasticsearch.Name name) + { + NameValue = name; + return Self; + } + + /// + /// Search template to use on search operations. + /// + public SearchApplicationDescriptor Template(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate? template) + { + TemplateDescriptor = null; + TemplateDescriptorAction = null; + TemplateValue = template; + return Self; + } + + public SearchApplicationDescriptor Template(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplateDescriptor descriptor) + { + TemplateValue = null; + TemplateDescriptorAction = null; + TemplateDescriptor = descriptor; + return Self; + } + + public SearchApplicationDescriptor Template(Action configure) + { + TemplateValue = null; + TemplateDescriptor = null; + TemplateDescriptorAction = configure; + return Self; + } + + /// + /// Last time the Search Application was updated. + /// + public SearchApplicationDescriptor UpdatedAtMillis(long updatedAtMillis) + { + UpdatedAtMillisValue = updatedAtMillis; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AnalyticsCollectionNameValue is not null) + { + writer.WritePropertyName("analytics_collection_name"); + JsonSerializer.Serialize(writer, AnalyticsCollectionNameValue, options); + } + + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + writer.WritePropertyName("name"); + JsonSerializer.Serialize(writer, NameValue, options); + 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 Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplateDescriptor(TemplateDescriptorAction), options); + } + else if (TemplateValue is not null) + { + writer.WritePropertyName("template"); + JsonSerializer.Serialize(writer, TemplateValue, options); + } + + writer.WritePropertyName("updated_at_millis"); + writer.WriteNumberValue(UpdatedAtMillisValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationListItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationListItem.g.cs new file mode 100644 index 00000000000..24ad41c93b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationListItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class SearchApplicationListItem +{ + /// + /// Analytics collection associated to the Search Application + /// + [JsonInclude, JsonPropertyName("analytics_collection_name")] + public string? AnalyticsCollectionName { get; init; } + + /// + /// Indices that are part of the Search Application + /// + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + + /// + /// Search Application name + /// + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + + /// + /// Last time the Search Application was updated + /// + [JsonInclude, JsonPropertyName("updated_at_millis")] + public long UpdatedAtMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs new file mode 100644 index 00000000000..f3ca44e548f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +public sealed partial class SearchApplicationTemplate +{ + /// + /// The associated mustache template. + /// + [JsonInclude, JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.InlineScript Script { get; set; } +} + +public sealed partial class SearchApplicationTemplateDescriptor : SerializableDescriptor +{ + internal SearchApplicationTemplateDescriptor(Action configure) => configure.Invoke(this); + + public SearchApplicationTemplateDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.InlineScript ScriptValue { get; set; } + private Elastic.Clients.Elasticsearch.InlineScriptDescriptor ScriptDescriptor { get; set; } + private Action ScriptDescriptorAction { get; set; } + + /// + /// The associated mustache template. + /// + public SearchApplicationTemplateDescriptor Script(Elastic.Clients.Elasticsearch.InlineScript script) + { + ScriptDescriptor = null; + ScriptDescriptorAction = null; + ScriptValue = script; + return Self; + } + + public SearchApplicationTemplateDescriptor Script(Elastic.Clients.Elasticsearch.InlineScriptDescriptor descriptor) + { + ScriptValue = null; + ScriptDescriptorAction = null; + ScriptDescriptor = descriptor; + return Self; + } + + public SearchApplicationTemplateDescriptor 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 Elastic.Clients.Elasticsearch.InlineScriptDescriptor(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/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs new file mode 100644 index 00000000000..09a36fd71df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class MountedSnapshot +{ + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs new file mode 100644 index 00000000000..fc6c79ffd08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class Node +{ + [JsonInclude, JsonPropertyName("shared_cache")] + public Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared SharedCache { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs new file mode 100644 index 00000000000..af238a5419c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +public sealed partial class Shared +{ + [JsonInclude, JsonPropertyName("bytes_read_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize BytesReadInBytes { get; init; } + [JsonInclude, JsonPropertyName("bytes_written_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize BytesWrittenInBytes { get; init; } + [JsonInclude, JsonPropertyName("evictions")] + public long Evictions { get; init; } + [JsonInclude, JsonPropertyName("num_regions")] + public int NumRegions { get; init; } + [JsonInclude, JsonPropertyName("reads")] + public long Reads { get; init; } + [JsonInclude, JsonPropertyName("region_size_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize RegionSizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("size_in_bytes")] + public Elastic.Clients.Elasticsearch.ByteSize SizeInBytes { get; init; } + [JsonInclude, JsonPropertyName("writes")] + public long Writes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs index 502442bc4aa..13fa6dae98b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs @@ -129,18 +129,6 @@ public sealed partial class SegmentsStats [JsonInclude, JsonPropertyName("stored_memory")] public Elastic.Clients.Elasticsearch.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.ByteSize? TermVectoryMemory { get; init; } - /// /// Total amount of memory used for terms across all shards assigned to selected nodes. /// @@ -153,6 +141,18 @@ public sealed partial class SegmentsStats [JsonInclude, JsonPropertyName("terms_memory_in_bytes")] public long TermsMemoryInBytes { 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.ByteSize? TermVectoryMemory { get; init; } + /// /// Total amount of memory used by all version maps across all shards assigned to selected nodes. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs index 276b869289c..f0ae833c493 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs @@ -61,6 +61,12 @@ public SlicedScrollDescriptor Field(Expression Field(Expression> field) + { + FieldValue = field; + return Self; + } + public SlicedScrollDescriptor Id(Elastic.Clients.Elasticsearch.Id id) { IdValue = id; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs index 5e9b6410a24..7d1cbaf4684 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs @@ -30,13 +30,16 @@ namespace Elastic.Clients.Elasticsearch; +/// +/// Slices configuration used to parallelize a process. +/// public sealed partial class Slices : Union { - public Slices(int value) : base(value) + public Slices(int Value) : base(Value) { } - public Slices(Elastic.Clients.Elasticsearch.SlicesCalculation computed) : base(computed) + public Slices(Elastic.Clients.Elasticsearch.SlicesCalculation Computed) : base(Computed) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs new file mode 100644 index 00000000000..3e1a7221ce1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class AzureRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "azure"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class AzureRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal AzureRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public AzureRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public AzureRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public AzureRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public AzureRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public AzureRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("azure"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + AzureRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs new file mode 100644 index 00000000000..8e1d1f9b10d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class AzureRepositorySettings +{ + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("container")] + public string? Container { get; set; } + [JsonInclude, JsonPropertyName("location_mode")] + public string? LocationMode { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class AzureRepositorySettingsDescriptor : SerializableDescriptor +{ + internal AzureRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public AzureRepositorySettingsDescriptor() : base() + { + } + + private string? BasePathValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private string? ContainerValue { get; set; } + private string? LocationModeValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public AzureRepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public AzureRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public AzureRepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public AzureRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public AzureRepositorySettingsDescriptor Container(string? container) + { + ContainerValue = container; + return Self; + } + + public AzureRepositorySettingsDescriptor LocationMode(string? locationMode) + { + LocationModeValue = locationMode; + return Self; + } + + public AzureRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public AzureRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public AzureRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (!string.IsNullOrEmpty(ContainerValue)) + { + writer.WritePropertyName("container"); + writer.WriteStringValue(ContainerValue); + } + + if (!string.IsNullOrEmpty(LocationModeValue)) + { + writer.WritePropertyName("location_mode"); + writer.WriteStringValue(LocationModeValue); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs new file mode 100644 index 00000000000..bb920aa8d5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CleanupRepositoryResults +{ + /// + /// Number of binary large objects (blobs) removed during cleanup. + /// + [JsonInclude, JsonPropertyName("deleted_blobs")] + public long DeletedBlobs { get; init; } + + /// + /// Number of bytes freed by cleanup operations. + /// + [JsonInclude, JsonPropertyName("deleted_bytes")] + public long DeletedBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs new file mode 100644 index 00000000000..cdbd4a37456 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class CompactNodeInfo +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs new file mode 100644 index 00000000000..41353f26cf0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class FileCountSnapshotStats +{ + [JsonInclude, JsonPropertyName("file_count")] + public int FileCount { 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/_Generated/Types/Snapshot/GcsRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs new file mode 100644 index 00000000000..1fc0527dc81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class GcsRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "gcs"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class GcsRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal GcsRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public GcsRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public GcsRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public GcsRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public GcsRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public GcsRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("gcs"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + GcsRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs new file mode 100644 index 00000000000..7fd1822ac1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class GcsRepositorySettings +{ + [JsonInclude, JsonPropertyName("application_name")] + public string? ApplicationName { get; set; } + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("bucket")] + public string Bucket { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class GcsRepositorySettingsDescriptor : SerializableDescriptor +{ + internal GcsRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public GcsRepositorySettingsDescriptor() : base() + { + } + + private string? ApplicationNameValue { get; set; } + private string? BasePathValue { get; set; } + private string BucketValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public GcsRepositorySettingsDescriptor ApplicationName(string? applicationName) + { + ApplicationNameValue = applicationName; + return Self; + } + + public GcsRepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public GcsRepositorySettingsDescriptor Bucket(string bucket) + { + BucketValue = bucket; + return Self; + } + + public GcsRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public GcsRepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public GcsRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public GcsRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public GcsRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public GcsRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(ApplicationNameValue)) + { + writer.WritePropertyName("application_name"); + writer.WriteStringValue(ApplicationNameValue); + } + + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + writer.WritePropertyName("bucket"); + writer.WriteStringValue(BucketValue); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs new file mode 100644 index 00000000000..d11e38a9995 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class IndexDetails +{ + [JsonInclude, JsonPropertyName("max_segments_per_shard")] + public long MaxSegmentsPerShard { get; init; } + [JsonInclude, JsonPropertyName("shard_count")] + public int ShardCount { get; init; } + [JsonInclude, JsonPropertyName("size")] + public Elastic.Clients.Elasticsearch.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/_Generated/Types/Snapshot/InfoFeatureState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs new file mode 100644 index 00000000000..f5dfd870fd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class InfoFeatureState +{ + [JsonInclude, JsonPropertyName("feature_name")] + public string FeatureName { get; init; } + [JsonInclude, JsonPropertyName("indices")] + [SingleOrManyCollectionConverter(typeof(string))] + public IReadOnlyCollection Indices { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs new file mode 100644 index 00000000000..5f41854cdd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class ReadOnlyUrlRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "url"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class ReadOnlyUrlRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal ReadOnlyUrlRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public ReadOnlyUrlRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public ReadOnlyUrlRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public ReadOnlyUrlRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("url"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + ReadOnlyUrlRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs new file mode 100644 index 00000000000..1a839f7de98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs @@ -0,0 +1,164 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class ReadOnlyUrlRepositorySettings +{ + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("http_max_retries")] + public int? HttpMaxRetries { get; set; } + [JsonInclude, JsonPropertyName("http_socket_timeout")] + public Elastic.Clients.Elasticsearch.Duration? HttpSocketTimeout { get; set; } + [JsonInclude, JsonPropertyName("max_number_of_snapshots")] + public int? MaxNumberOfSnapshots { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("url")] + public string Url { get; set; } +} + +public sealed partial class ReadOnlyUrlRepositorySettingsDescriptor : SerializableDescriptor +{ + internal ReadOnlyUrlRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public ReadOnlyUrlRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private int? HttpMaxRetriesValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? HttpSocketTimeoutValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private string UrlValue { get; set; } + + public ReadOnlyUrlRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor HttpMaxRetries(int? httpMaxRetries) + { + HttpMaxRetriesValue = httpMaxRetries; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor HttpSocketTimeout(Elastic.Clients.Elasticsearch.Duration? httpSocketTimeout) + { + HttpSocketTimeoutValue = httpSocketTimeout; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public ReadOnlyUrlRepositorySettingsDescriptor Url(string url) + { + UrlValue = url; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (HttpMaxRetriesValue.HasValue) + { + writer.WritePropertyName("http_max_retries"); + writer.WriteNumberValue(HttpMaxRetriesValue.Value); + } + + if (HttpSocketTimeoutValue is not null) + { + writer.WritePropertyName("http_socket_timeout"); + JsonSerializer.Serialize(writer, HttpSocketTimeoutValue, options); + } + + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + writer.WritePropertyName("url"); + writer.WriteStringValue(UrlValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs new file mode 100644 index 00000000000..09ae30fd4b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Core; +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.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.Snapshot; + +public partial class Repositories : IsADictionary +{ + public Repositories() + { + } + + public Repositories(IDictionary container) : base(container) + { + } + + public void Add(string name, IRepository repository) => BackingDictionary.Add(Sanitize(name), repository); + public bool TryGetRepository(string name, [NotNullWhen(returnValue: true)] out IRepository repository) => BackingDictionary.TryGetValue(Sanitize(name), out repository); + + public bool TryGetRepository(string name, [NotNullWhen(returnValue: true)] out T? repository) where T : class, IRepository + { + if (BackingDictionary.TryGetValue(Sanitize(name), out var matchedValue) && matchedValue is T finalValue) + { + repository = finalValue; + return true; + } + + repository = null; + return false; + } +} + +public sealed partial class RepositoriesDescriptor : IsADictionaryDescriptor +{ + public RepositoriesDescriptor() : base(new Repositories()) + { + } + + public RepositoriesDescriptor(Repositories repositories) : base(repositories ?? new Repositories()) + { + } + + public RepositoriesDescriptor Azure(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor Azure(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor Azure(string repositoryName, AzureRepository azureRepository) => AssignVariant(repositoryName, azureRepository); + public RepositoriesDescriptor Gcs(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor Gcs(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor Gcs(string repositoryName, GcsRepository gcsRepository) => AssignVariant(repositoryName, gcsRepository); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor ReadOnlyUrl(string repositoryName, ReadOnlyUrlRepository readOnlyUrlRepository) => AssignVariant(repositoryName, readOnlyUrlRepository); + public RepositoriesDescriptor S3(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor S3(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor S3(string repositoryName, S3Repository s3Repository) => AssignVariant(repositoryName, s3Repository); + public RepositoriesDescriptor SharedFileSystem(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor SharedFileSystem(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor SharedFileSystem(string repositoryName, SharedFileSystemRepository sharedFileSystemRepository) => AssignVariant(repositoryName, sharedFileSystemRepository); + public RepositoriesDescriptor SourceOnly(string repositoryName) => AssignVariant(repositoryName, null); + public RepositoriesDescriptor SourceOnly(string repositoryName, Action configure) => AssignVariant(repositoryName, configure); + public RepositoriesDescriptor SourceOnly(string repositoryName, SourceOnlyRepository sourceOnlyRepository) => AssignVariant(repositoryName, sourceOnlyRepository); +} + +internal sealed partial class RepositoryInterfaceConverter : JsonConverter +{ + public override IRepository 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 "azure": + return JsonSerializer.Deserialize(ref reader, options); + case "gcs": + return JsonSerializer.Deserialize(ref reader, options); + case "url": + return JsonSerializer.Deserialize(ref reader, options); + case "s3": + return JsonSerializer.Deserialize(ref reader, options); + case "fs": + return JsonSerializer.Deserialize(ref reader, options); + case "source": + return JsonSerializer.Deserialize(ref reader, options); + default: + ThrowHelper.ThrowUnknownTaggedUnionVariantJsonException(type, typeof(IRepository)); + return null; + } + } + + public override void Write(Utf8JsonWriter writer, IRepository value, JsonSerializerOptions options) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + switch (value.Type) + { + case "azure": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.AzureRepository), options); + return; + case "gcs": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.GcsRepository), options); + return; + case "url": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository), options); + return; + case "s3": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.S3Repository), options); + return; + case "fs": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository), options); + return; + case "source": + JsonSerializer.Serialize(writer, value, typeof(Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository), options); + return; + default: + var type = value.GetType(); + JsonSerializer.Serialize(writer, value, type, options); + return; + } + } +} + +[JsonConverter(typeof(RepositoryInterfaceConverter))] +public partial interface IRepository +{ + public string? Type { get; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs new file mode 100644 index 00000000000..9c5b626d63f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class S3Repository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "s3"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class S3RepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal S3RepositoryDescriptor(Action configure) => configure.Invoke(this); + + public S3RepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public S3RepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public S3RepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public S3RepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public S3RepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("s3"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + S3Repository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs new file mode 100644 index 00000000000..b2aad005d0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class S3RepositorySettings +{ + [JsonInclude, JsonPropertyName("base_path")] + public string? BasePath { get; set; } + [JsonInclude, JsonPropertyName("bucket")] + public string Bucket { get; set; } + [JsonInclude, JsonPropertyName("buffer_size")] + public Elastic.Clients.Elasticsearch.ByteSize? BufferSize { get; set; } + [JsonInclude, JsonPropertyName("canned_acl")] + public string? CannedAcl { get; set; } + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("client")] + public string? Client { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } + [JsonInclude, JsonPropertyName("server_side_encryption")] + public bool? ServerSideEncryption { get; set; } + [JsonInclude, JsonPropertyName("storage_class")] + public string? StorageClass { get; set; } +} + +public sealed partial class S3RepositorySettingsDescriptor : SerializableDescriptor +{ + internal S3RepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public S3RepositorySettingsDescriptor() : base() + { + } + + private string? BasePathValue { get; set; } + private string BucketValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? BufferSizeValue { get; set; } + private string? CannedAclValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private string? ClientValue { get; set; } + private bool? CompressValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + private bool? ServerSideEncryptionValue { get; set; } + private string? StorageClassValue { get; set; } + + public S3RepositorySettingsDescriptor BasePath(string? basePath) + { + BasePathValue = basePath; + return Self; + } + + public S3RepositorySettingsDescriptor Bucket(string bucket) + { + BucketValue = bucket; + return Self; + } + + public S3RepositorySettingsDescriptor BufferSize(Elastic.Clients.Elasticsearch.ByteSize? bufferSize) + { + BufferSizeValue = bufferSize; + return Self; + } + + public S3RepositorySettingsDescriptor CannedAcl(string? cannedAcl) + { + CannedAclValue = cannedAcl; + return Self; + } + + public S3RepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public S3RepositorySettingsDescriptor Client(string? client) + { + ClientValue = client; + return Self; + } + + public S3RepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public S3RepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public S3RepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public S3RepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + public S3RepositorySettingsDescriptor ServerSideEncryption(bool? serverSideEncryption = true) + { + ServerSideEncryptionValue = serverSideEncryption; + return Self; + } + + public S3RepositorySettingsDescriptor StorageClass(string? storageClass) + { + StorageClassValue = storageClass; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (!string.IsNullOrEmpty(BasePathValue)) + { + writer.WritePropertyName("base_path"); + writer.WriteStringValue(BasePathValue); + } + + writer.WritePropertyName("bucket"); + writer.WriteStringValue(BucketValue); + if (BufferSizeValue is not null) + { + writer.WritePropertyName("buffer_size"); + JsonSerializer.Serialize(writer, BufferSizeValue, options); + } + + if (!string.IsNullOrEmpty(CannedAclValue)) + { + writer.WritePropertyName("canned_acl"); + writer.WriteStringValue(CannedAclValue); + } + + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (!string.IsNullOrEmpty(ClientValue)) + { + writer.WritePropertyName("client"); + writer.WriteStringValue(ClientValue); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + if (ServerSideEncryptionValue.HasValue) + { + writer.WritePropertyName("server_side_encryption"); + writer.WriteBooleanValue(ServerSideEncryptionValue.Value); + } + + if (!string.IsNullOrEmpty(StorageClassValue)) + { + writer.WritePropertyName("storage_class"); + writer.WriteStringValue(StorageClassValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs new file mode 100644 index 00000000000..cdf6c2f9e05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class ShardsStats +{ + [JsonInclude, JsonPropertyName("done")] + public long Done { get; init; } + [JsonInclude, JsonPropertyName("failed")] + public long Failed { get; init; } + [JsonInclude, JsonPropertyName("finalizing")] + public long Finalizing { get; init; } + [JsonInclude, JsonPropertyName("initializing")] + public long Initializing { get; init; } + [JsonInclude, JsonPropertyName("started")] + public long Started { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs new file mode 100644 index 00000000000..8fa7773db2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class ShardsStatsSummary +{ + [JsonInclude, JsonPropertyName("incremental")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem Incremental { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("time")] + public Elastic.Clients.Elasticsearch.Duration? Time { get; init; } + [JsonInclude, JsonPropertyName("time_in_millis")] + public long TimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs new file mode 100644 index 00000000000..789afdb5cc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class ShardsStatsSummaryItem +{ + [JsonInclude, JsonPropertyName("file_count")] + public long FileCount { 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/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs new file mode 100644 index 00000000000..ada5c85a200 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SharedFileSystemRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "fs"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class SharedFileSystemRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SharedFileSystemRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public SharedFileSystemRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public SharedFileSystemRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public SharedFileSystemRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("fs"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + SharedFileSystemRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs new file mode 100644 index 00000000000..9da76da8497 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SharedFileSystemRepositorySettings +{ + [JsonInclude, JsonPropertyName("chunk_size")] + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + [JsonInclude, JsonPropertyName("compress")] + public bool? Compress { get; set; } + [JsonInclude, JsonPropertyName("location")] + public string Location { get; set; } + [JsonInclude, JsonPropertyName("max_number_of_snapshots")] + public int? MaxNumberOfSnapshots { get; set; } + [JsonInclude, JsonPropertyName("max_restore_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("max_snapshot_bytes_per_sec")] + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + [JsonInclude, JsonPropertyName("readonly")] + public bool? Readonly { get; set; } +} + +public sealed partial class SharedFileSystemRepositorySettingsDescriptor : SerializableDescriptor +{ + internal SharedFileSystemRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public SharedFileSystemRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private string LocationValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadonlyValue { get; set; } + + public SharedFileSystemRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Location(string location) + { + LocationValue = location; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public SharedFileSystemRepositorySettingsDescriptor Readonly(bool? value = true) + { + ReadonlyValue = value; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + writer.WritePropertyName("location"); + writer.WriteStringValue(LocationValue); + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadonlyValue.HasValue) + { + writer.WritePropertyName("readonly"); + writer.WriteBooleanValue(ReadonlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs new file mode 100644 index 00000000000..a0dbb2c6e49 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotIndexStats +{ + [JsonInclude, JsonPropertyName("shards")] + public IReadOnlyDictionary Shards { get; init; } + [JsonInclude, JsonPropertyName("shards_stats")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStats ShardsStats { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs new file mode 100644 index 00000000000..0d1f801f65a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotInfo +{ + [JsonInclude, JsonPropertyName("data_streams")] + public IReadOnlyCollection DataStreams { get; init; } + [JsonInclude, JsonPropertyName("duration")] + public Elastic.Clients.Elasticsearch.Duration? Duration { get; init; } + [JsonInclude, JsonPropertyName("duration_in_millis")] + public long? DurationInMillis { get; init; } + [JsonInclude, JsonPropertyName("end_time")] + public DateTimeOffset? EndTime { get; init; } + [JsonInclude, JsonPropertyName("end_time_in_millis")] + public long? EndTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("failures")] + public IReadOnlyCollection? Failures { get; init; } + [JsonInclude, JsonPropertyName("feature_states")] + public IReadOnlyCollection? FeatureStates { get; init; } + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; init; } + [JsonInclude, JsonPropertyName("index_details")] + [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.IndexDetails))] + public IReadOnlyDictionary? IndexDetails { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection? Indices { get; init; } + [JsonInclude, JsonPropertyName("metadata")] + public IReadOnlyDictionary? Metadata { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string? Repository { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } + [JsonInclude, JsonPropertyName("start_time")] + public DateTimeOffset? StartTime { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long? StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string? State { get; init; } + [JsonInclude, JsonPropertyName("uuid")] + public string Uuid { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } + [JsonInclude, JsonPropertyName("version_id")] + public long? VersionId { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs new file mode 100644 index 00000000000..6dfadcde582 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotResponseItem +{ + [JsonInclude, JsonPropertyName("error")] + public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("snapshots")] + public IReadOnlyCollection? Snapshots { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs new file mode 100644 index 00000000000..7b79e00fc45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotRestore +{ + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyCollection Indices { get; init; } + [JsonInclude, JsonPropertyName("shards")] + public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs new file mode 100644 index 00000000000..7609f772fa3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotShardFailure +{ + [JsonInclude, JsonPropertyName("index")] + public string Index { get; init; } + [JsonInclude, JsonPropertyName("node_id")] + public string? NodeId { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string Reason { get; init; } + [JsonInclude, JsonPropertyName("shard_id")] + public string ShardId { get; init; } + [JsonInclude, JsonPropertyName("status")] + public string Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs new file mode 100644 index 00000000000..a28bd85020c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotShardsStatus +{ + [JsonInclude, JsonPropertyName("stage")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage Stage { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs new file mode 100644 index 00000000000..4d458c7f528 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SnapshotStats +{ + [JsonInclude, JsonPropertyName("incremental")] + public Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats Incremental { get; init; } + [JsonInclude, JsonPropertyName("start_time_in_millis")] + public long StartTimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("time")] + public Elastic.Clients.Elasticsearch.Duration? Time { get; init; } + [JsonInclude, JsonPropertyName("time_in_millis")] + public long TimeInMillis { get; init; } + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs new file mode 100644 index 00000000000..74aff93a8a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class SourceOnlyRepository : IRepository +{ + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings Settings { get; set; } + + [JsonInclude, JsonPropertyName("type")] + public string Type => "source"; + + [JsonInclude, JsonPropertyName("uuid")] + public string? Uuid { get; set; } +} + +public sealed partial class SourceOnlyRepositoryDescriptor : SerializableDescriptor, IBuildableDescriptor +{ + internal SourceOnlyRepositoryDescriptor(Action configure) => configure.Invoke(this); + + public SourceOnlyRepositoryDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings SettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettingsDescriptor SettingsDescriptor { get; set; } + private Action SettingsDescriptorAction { get; set; } + private string? UuidValue { get; set; } + + public SourceOnlyRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings settings) + { + SettingsDescriptor = null; + SettingsDescriptorAction = null; + SettingsValue = settings; + return Self; + } + + public SourceOnlyRepositoryDescriptor Settings(Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettingsDescriptor descriptor) + { + SettingsValue = null; + SettingsDescriptorAction = null; + SettingsDescriptor = descriptor; + return Self; + } + + public SourceOnlyRepositoryDescriptor Settings(Action configure) + { + SettingsValue = null; + SettingsDescriptor = null; + SettingsDescriptorAction = configure; + return Self; + } + + public SourceOnlyRepositoryDescriptor Uuid(string? uuid) + { + UuidValue = uuid; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettingsDescriptor(SettingsDescriptorAction), options); + } + else + { + writer.WritePropertyName("settings"); + JsonSerializer.Serialize(writer, SettingsValue, options); + } + + writer.WritePropertyName("type"); + writer.WriteStringValue("source"); + if (!string.IsNullOrEmpty(UuidValue)) + { + writer.WritePropertyName("uuid"); + writer.WriteStringValue(UuidValue); + } + + writer.WriteEndObject(); + } + + private Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings BuildSettings() + { + if (SettingsValue is not null) + { + return SettingsValue; + } + + if ((object)SettingsDescriptor is IBuildableDescriptor buildable) + { + return buildable.Build(); + } + + if (SettingsDescriptorAction is not null) + { + var descriptor = new Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettingsDescriptor(SettingsDescriptorAction); + if ((object)descriptor is IBuildableDescriptor buildableFromAction) + { + return buildableFromAction.Build(); + } + } + + return null; + } + + SourceOnlyRepository IBuildableDescriptor.Build() => new() + { + Settings = BuildSettings(), + Uuid = UuidValue + }; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs new file mode 100644 index 00000000000..2645bb9292e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +internal sealed partial class SourceOnlyRepositorySettingsConverter : JsonConverter +{ + public override SourceOnlyRepositorySettings Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new SourceOnlyRepositorySettings(); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "chunk_size") + { + variant.ChunkSize = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "compress") + { + variant.Compress = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "delegate_type") + { + variant.DelegateType = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_number_of_snapshots") + { + variant.MaxNumberOfSnapshots = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_restore_bytes_per_sec") + { + variant.MaxRestoreBytesPerSec = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "max_snapshot_bytes_per_sec") + { + variant.MaxSnapshotBytesPerSec = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "read_only" || property == "readonly") + { + variant.ReadOnly = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, SourceOnlyRepositorySettings value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.ChunkSize is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, value.ChunkSize, options); + } + + if (value.Compress.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(value.Compress.Value); + } + + if (!string.IsNullOrEmpty(value.DelegateType)) + { + writer.WritePropertyName("delegate_type"); + writer.WriteStringValue(value.DelegateType); + } + + if (value.MaxNumberOfSnapshots.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(value.MaxNumberOfSnapshots.Value); + } + + if (value.MaxRestoreBytesPerSec is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, value.MaxRestoreBytesPerSec, options); + } + + if (value.MaxSnapshotBytesPerSec is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, value.MaxSnapshotBytesPerSec, options); + } + + if (value.ReadOnly.HasValue) + { + writer.WritePropertyName("read_only"); + writer.WriteBooleanValue(value.ReadOnly.Value); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(SourceOnlyRepositorySettingsConverter))] +public sealed partial class SourceOnlyRepositorySettings +{ + public Elastic.Clients.Elasticsearch.ByteSize? ChunkSize { get; set; } + public bool? Compress { get; set; } + public string? DelegateType { get; set; } + public int? MaxNumberOfSnapshots { get; set; } + public Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSec { get; set; } + public Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSec { get; set; } + public bool? ReadOnly { get; set; } +} + +public sealed partial class SourceOnlyRepositorySettingsDescriptor : SerializableDescriptor +{ + internal SourceOnlyRepositorySettingsDescriptor(Action configure) => configure.Invoke(this); + + public SourceOnlyRepositorySettingsDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.ByteSize? ChunkSizeValue { get; set; } + private bool? CompressValue { get; set; } + private string? DelegateTypeValue { get; set; } + private int? MaxNumberOfSnapshotsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxRestoreBytesPerSecValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxSnapshotBytesPerSecValue { get; set; } + private bool? ReadOnlyValue { get; set; } + + public SourceOnlyRepositorySettingsDescriptor ChunkSize(Elastic.Clients.Elasticsearch.ByteSize? chunkSize) + { + ChunkSizeValue = chunkSize; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor Compress(bool? compress = true) + { + CompressValue = compress; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor DelegateType(string? delegateType) + { + DelegateTypeValue = delegateType; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxNumberOfSnapshots(int? maxNumberOfSnapshots) + { + MaxNumberOfSnapshotsValue = maxNumberOfSnapshots; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxRestoreBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxRestoreBytesPerSec) + { + MaxRestoreBytesPerSecValue = maxRestoreBytesPerSec; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor MaxSnapshotBytesPerSec(Elastic.Clients.Elasticsearch.ByteSize? maxSnapshotBytesPerSec) + { + MaxSnapshotBytesPerSecValue = maxSnapshotBytesPerSec; + return Self; + } + + public SourceOnlyRepositorySettingsDescriptor ReadOnly(bool? readOnly = true) + { + ReadOnlyValue = readOnly; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (ChunkSizeValue is not null) + { + writer.WritePropertyName("chunk_size"); + JsonSerializer.Serialize(writer, ChunkSizeValue, options); + } + + if (CompressValue.HasValue) + { + writer.WritePropertyName("compress"); + writer.WriteBooleanValue(CompressValue.Value); + } + + if (!string.IsNullOrEmpty(DelegateTypeValue)) + { + writer.WritePropertyName("delegate_type"); + writer.WriteStringValue(DelegateTypeValue); + } + + if (MaxNumberOfSnapshotsValue.HasValue) + { + writer.WritePropertyName("max_number_of_snapshots"); + writer.WriteNumberValue(MaxNumberOfSnapshotsValue.Value); + } + + if (MaxRestoreBytesPerSecValue is not null) + { + writer.WritePropertyName("max_restore_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxRestoreBytesPerSecValue, options); + } + + if (MaxSnapshotBytesPerSecValue is not null) + { + writer.WritePropertyName("max_snapshot_bytes_per_sec"); + JsonSerializer.Serialize(writer, MaxSnapshotBytesPerSecValue, options); + } + + if (ReadOnlyValue.HasValue) + { + writer.WritePropertyName("read_only"); + writer.WriteBooleanValue(ReadOnlyValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs new file mode 100644 index 00000000000..cbd65a9c293 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +public sealed partial class Status +{ + [JsonInclude, JsonPropertyName("include_global_state")] + public bool IncludeGlobalState { get; init; } + [JsonInclude, JsonPropertyName("indices")] + public IReadOnlyDictionary Indices { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("shards_stats")] + public Elastic.Clients.Elasticsearch.Snapshot.ShardsStats ShardsStats { get; init; } + [JsonInclude, JsonPropertyName("snapshot")] + public string Snapshot { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats Stats { get; init; } + [JsonInclude, JsonPropertyName("uuid")] + public string Uuid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs new file mode 100644 index 00000000000..54c1a3ce72b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class InProgress +{ + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("start_time_millis")] + public long StartTimeMillis { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } + [JsonInclude, JsonPropertyName("uuid")] + public string Uuid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs new file mode 100644 index 00000000000..81733de41ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class Invocation +{ + [JsonInclude, JsonPropertyName("snapshot_name")] + public string SnapshotName { get; init; } + [JsonInclude, JsonPropertyName("time")] + public DateTimeOffset Time { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs new file mode 100644 index 00000000000..34bce79ce51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class Retention +{ + /// + /// Time period after which a snapshot is considered expired and eligible for deletion. SLM deletes expired snapshots based on the slm.retention_schedule. + /// + [JsonInclude, JsonPropertyName("expire_after")] + public Elastic.Clients.Elasticsearch.Duration ExpireAfter { get; set; } + + /// + /// Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots. + /// + [JsonInclude, JsonPropertyName("max_count")] + public int MaxCount { get; set; } + + /// + /// Minimum number of snapshots to retain, even if the snapshots have expired. + /// + [JsonInclude, JsonPropertyName("min_count")] + public int MinCount { get; set; } +} + +public sealed partial class RetentionDescriptor : SerializableDescriptor +{ + internal RetentionDescriptor(Action configure) => configure.Invoke(this); + + public RetentionDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration ExpireAfterValue { get; set; } + private int MaxCountValue { get; set; } + private int MinCountValue { get; set; } + + /// + /// Time period after which a snapshot is considered expired and eligible for deletion. SLM deletes expired snapshots based on the slm.retention_schedule. + /// + public RetentionDescriptor ExpireAfter(Elastic.Clients.Elasticsearch.Duration expireAfter) + { + ExpireAfterValue = expireAfter; + return Self; + } + + /// + /// Maximum number of snapshots to retain, even if the snapshots have not yet expired. If the number of snapshots in the repository exceeds this limit, the policy retains the most recent snapshots and deletes older snapshots. + /// + public RetentionDescriptor MaxCount(int maxCount) + { + MaxCountValue = maxCount; + return Self; + } + + /// + /// Minimum number of snapshots to retain, even if the snapshots have expired. + /// + public RetentionDescriptor MinCount(int minCount) + { + MinCountValue = minCount; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("expire_after"); + JsonSerializer.Serialize(writer, ExpireAfterValue, options); + writer.WritePropertyName("max_count"); + writer.WriteNumberValue(MaxCountValue); + writer.WritePropertyName("min_count"); + writer.WriteNumberValue(MinCountValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs new file mode 100644 index 00000000000..1fb8f0f1d0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class SlmConfiguration +{ + /// + /// A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.
Each feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.
+ ///
+ [JsonInclude, JsonPropertyName("feature_states")] + public ICollection? FeatureStates { get; set; } + + /// + /// If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices. + /// + [JsonInclude, JsonPropertyName("ignore_unavailable")] + public bool? IgnoreUnavailable { get; set; } + + /// + /// If true, the current global state is included in the snapshot. + /// + [JsonInclude, JsonPropertyName("include_global_state")] + public bool? IncludeGlobalState { get; set; } + + /// + /// A comma-separated list of data streams and indices to include in the snapshot. Multi-index syntax is supported.
By default, a snapshot includes all data streams and indices in the cluster. If this argument is provided, the snapshot only includes the specified data streams and clusters.
+ ///
+ [JsonInclude, JsonPropertyName("indices")] + public Elastic.Clients.Elasticsearch.Indices? Indices { get; set; } + + /// + /// Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes. + /// + [JsonInclude, JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + + /// + /// If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + [JsonInclude, JsonPropertyName("partial")] + public bool? Partial { get; set; } +} + +public sealed partial class SlmConfigurationDescriptor : SerializableDescriptor +{ + internal SlmConfigurationDescriptor(Action configure) => configure.Invoke(this); + + public SlmConfigurationDescriptor() : base() + { + } + + private ICollection? FeatureStatesValue { get; set; } + private bool? IgnoreUnavailableValue { get; set; } + private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } + private IDictionary? MetadataValue { get; set; } + private bool? PartialValue { get; set; } + + /// + /// A list of feature states to be included in this snapshot. A list of features available for inclusion in the snapshot and their descriptions be can be retrieved using the get features API.
Each feature state includes one or more system indices containing data necessary for the function of that feature. Providing an empty array will include no feature states in the snapshot, regardless of the value of include_global_state. By default, all available feature states will be included in the snapshot if include_global_state is true, or no feature states if include_global_state is false.
+ ///
+ public SlmConfigurationDescriptor FeatureStates(ICollection? featureStates) + { + FeatureStatesValue = featureStates; + return Self; + } + + /// + /// If false, the snapshot fails if any data stream or index in indices is missing or closed. If true, the snapshot ignores missing or closed data streams and indices. + /// + public SlmConfigurationDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) + { + IgnoreUnavailableValue = ignoreUnavailable; + return Self; + } + + /// + /// If true, the current global state is included in the snapshot. + /// + public SlmConfigurationDescriptor IncludeGlobalState(bool? includeGlobalState = true) + { + IncludeGlobalStateValue = includeGlobalState; + return Self; + } + + /// + /// A comma-separated list of data streams and indices to include in the snapshot. Multi-index syntax is supported.
By default, a snapshot includes all data streams and indices in the cluster. If this argument is provided, the snapshot only includes the specified data streams and clusters.
+ ///
+ public SlmConfigurationDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// Attaches arbitrary metadata to the snapshot, such as a record of who took the snapshot, why it was taken, or any other useful data. Metadata must be less than 1024 bytes. + /// + public SlmConfigurationDescriptor Metadata(Func, FluentDictionary> selector) + { + MetadataValue = selector?.Invoke(new FluentDictionary()); + return Self; + } + + /// + /// If false, the entire snapshot will fail if one or more indices included in the snapshot do not have all primary shards available. + /// + public SlmConfigurationDescriptor Partial(bool? partial = true) + { + PartialValue = partial; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (FeatureStatesValue is not null) + { + writer.WritePropertyName("feature_states"); + JsonSerializer.Serialize(writer, FeatureStatesValue, options); + } + + if (IgnoreUnavailableValue.HasValue) + { + writer.WritePropertyName("ignore_unavailable"); + writer.WriteBooleanValue(IgnoreUnavailableValue.Value); + } + + if (IncludeGlobalStateValue.HasValue) + { + writer.WritePropertyName("include_global_state"); + writer.WriteBooleanValue(IncludeGlobalStateValue.Value); + } + + if (IndicesValue is not null) + { + writer.WritePropertyName("indices"); + JsonSerializer.Serialize(writer, IndicesValue, options); + } + + if (MetadataValue is not null) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, MetadataValue, options); + } + + if (PartialValue.HasValue) + { + writer.WritePropertyName("partial"); + writer.WriteBooleanValue(PartialValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs new file mode 100644 index 00000000000..4a8d4f7b298 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class SlmPolicy +{ + [JsonInclude, JsonPropertyName("config")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration? Config { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("repository")] + public string Repository { get; init; } + [JsonInclude, JsonPropertyName("retention")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention? Retention { get; init; } + [JsonInclude, JsonPropertyName("schedule")] + public string Schedule { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs new file mode 100644 index 00000000000..e502de544fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +public sealed partial class SnapshotLifecycle +{ + [JsonInclude, JsonPropertyName("in_progress")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress? InProgress { get; init; } + [JsonInclude, JsonPropertyName("last_failure")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation? LastFailure { get; init; } + [JsonInclude, JsonPropertyName("last_success")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation? LastSuccess { get; init; } + [JsonInclude, JsonPropertyName("modified_date")] + public DateTimeOffset? ModifiedDate { get; init; } + [JsonInclude, JsonPropertyName("modified_date_millis")] + public long ModifiedDateMillis { get; init; } + [JsonInclude, JsonPropertyName("next_execution")] + public DateTimeOffset? NextExecution { get; init; } + [JsonInclude, JsonPropertyName("next_execution_millis")] + public long NextExecutionMillis { get; init; } + [JsonInclude, JsonPropertyName("policy")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy Policy { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics Stats { get; init; } + [JsonInclude, JsonPropertyName("version")] + public long Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs new file mode 100644 index 00000000000..60a4d0467ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; + +internal sealed partial class StatisticsConverter : JsonConverter +{ + public override Statistics Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + string? policy = default; + Elastic.Clients.Elasticsearch.Duration? retentionDeletionTime = default; + long? retentionDeletionTimeMillis = default; + long? retentionFailed = default; + long? retentionRuns = default; + long? retentionTimedOut = default; + long? totalSnapshotDeletionFailures = default; + long? totalSnapshotsDeleted = default; + long? totalSnapshotsFailed = default; + long? totalSnapshotsTaken = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + if (reader.TokenType == JsonTokenType.PropertyName) + { + var property = reader.GetString(); + if (property == "policy") + { + policy = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_deletion_time") + { + retentionDeletionTime = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_deletion_time_millis") + { + retentionDeletionTimeMillis = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_failed") + { + retentionFailed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_runs") + { + retentionRuns = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "retention_timed_out") + { + retentionTimedOut = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshot_deletion_failures" || property == "snapshot_deletion_failures") + { + totalSnapshotDeletionFailures = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_deleted" || property == "snapshots_deleted") + { + totalSnapshotsDeleted = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_failed" || property == "snapshots_failed") + { + totalSnapshotsFailed = JsonSerializer.Deserialize(ref reader, options); + continue; + } + + if (property == "total_snapshots_taken" || property == "snapshots_taken") + { + totalSnapshotsTaken = JsonSerializer.Deserialize(ref reader, options); + continue; + } + } + } + + return new Statistics { Policy = policy, RetentionDeletionTime = retentionDeletionTime, RetentionDeletionTimeMillis = retentionDeletionTimeMillis, RetentionFailed = retentionFailed, RetentionRuns = retentionRuns, RetentionTimedOut = retentionTimedOut, TotalSnapshotDeletionFailures = totalSnapshotDeletionFailures, TotalSnapshotsDeleted = totalSnapshotsDeleted, TotalSnapshotsFailed = totalSnapshotsFailed, TotalSnapshotsTaken = totalSnapshotsTaken }; + } + + public override void Write(Utf8JsonWriter writer, Statistics value, JsonSerializerOptions options) + { + throw new NotImplementedException("'Statistics' is a readonly type, used only on responses and does not support being written to JSON."); + } +} + +[JsonConverter(typeof(StatisticsConverter))] +public sealed partial class Statistics +{ + public string? Policy { get; init; } + public Elastic.Clients.Elasticsearch.Duration? RetentionDeletionTime { get; init; } + public long? RetentionDeletionTimeMillis { get; init; } + public long? RetentionFailed { get; init; } + public long? RetentionRuns { get; init; } + public long? RetentionTimedOut { get; init; } + public long? TotalSnapshotDeletionFailures { get; init; } + public long? TotalSnapshotsDeleted { get; init; } + public long? TotalSnapshotsFailed { get; init; } + public long? TotalSnapshotsTaken { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs index 1ebfddafa0c..4a1c125bc51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs @@ -293,4 +293,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } -} \ No newline at end of file +} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecUtils/OverloadOf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecUtils/OverloadOf.g.cs new file mode 100644 index 00000000000..811443b107f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecUtils/OverloadOf.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.SpecUtils; + +/// +/// A class that implements `OverloadOf` should have the exact same properties with the same types.
It can change if a property is required or not. There is no need to port the descriptions
and js doc tags, the compiler will do that for you.
+///
+public sealed partial class OverloadOf +{ +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScriptId.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScriptId.g.cs index f6e0c9f31b1..550288bb3c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScriptId.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScriptId.g.cs @@ -34,6 +34,10 @@ public sealed partial class StoredScriptId /// [JsonInclude, JsonPropertyName("id")] public Elastic.Clients.Elasticsearch.Id Id { get; set; } + + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
[JsonInclude, JsonPropertyName("params")] public IDictionary? Params { get; set; } } @@ -58,6 +62,9 @@ public StoredScriptIdDescriptor Id(Elastic.Clients.Elasticsearch.Id id) return Self; } + /// + /// Specifies any named parameters that are passed into the script as variables.
Use parameters instead of hard-coded values to decrease compile time.
+ ///
public StoredScriptIdDescriptor Params(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs new file mode 100644 index 00000000000..3f0990a34f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class SynonymRule +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public Elastic.Clients.Elasticsearch.Id? Id { get; set; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; set; } +} + +public sealed partial class SynonymRuleDescriptor : SerializableDescriptor +{ + internal SynonymRuleDescriptor(Action configure) => configure.Invoke(this); + + public SynonymRuleDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Id? IdValue { get; set; } + private string SynonymsValue { get; set; } + + /// + /// Synonym Rule identifier + /// + public SynonymRuleDescriptor Id(Elastic.Clients.Elasticsearch.Id? id) + { + IdValue = id; + return Self; + } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + public SynonymRuleDescriptor Synonyms(string synonyms) + { + SynonymsValue = synonyms; + 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.WritePropertyName("synonyms"); + writer.WriteStringValue(SynonymsValue); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs new file mode 100644 index 00000000000..d691c217aa3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class SynonymRuleRead +{ + /// + /// Synonym Rule identifier + /// + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + + /// + /// Synonyms, in Solr format, that conform the synonym rule. See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html#_solr_synonyms_2 + /// + [JsonInclude, JsonPropertyName("synonyms")] + public string Synonyms { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs new file mode 100644 index 00000000000..e6e3aef8af4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms; + +public sealed partial class SynonymsSetItem +{ + /// + /// Number of synonym rules that the synonym set contains + /// + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + + /// + /// Synonyms set identifier + /// + [JsonInclude, JsonPropertyName("synonyms_set")] + public string SynonymsSet { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs index a13c87ac7f6..3af81683aee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs @@ -53,6 +53,10 @@ public sealed partial class ParentTaskInfo 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")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs index 1db7ebe55df..2edf37ad483 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs @@ -32,11 +32,11 @@ namespace Elastic.Clients.Elasticsearch.Tasks; public sealed partial class TaskInfos : Union, IReadOnlyDictionary> { - public TaskInfos(IReadOnlyCollection flat) : base(flat) + public TaskInfos(IReadOnlyCollection Flat) : base(Flat) { } - public TaskInfos(IReadOnlyDictionary grouped) : base(grouped) + public TaskInfos(IReadOnlyDictionary Grouped) : base(Grouped) { } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs index 0b09b510989..c5af95d55f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs @@ -34,7 +34,7 @@ public sealed partial class TextEmbedding [JsonInclude, JsonPropertyName("model_text")] public string ModelText { get; set; } - public static implicit operator QueryVectorBuilder(TextEmbedding textEmbedding) => QueryVectorBuilder.TextEmbedding(textEmbedding); + public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(TextEmbedding textEmbedding) => Elastic.Clients.Elasticsearch.QueryVectorBuilder.TextEmbedding(textEmbedding); } public sealed partial class TextEmbeddingDescriptor : SerializableDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs new file mode 100644 index 00000000000..c2ba885d920 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +public sealed partial class MatchedField +{ + [JsonInclude, JsonPropertyName("length")] + public int Length { get; init; } + [JsonInclude, JsonPropertyName("match")] + public string Match { get; init; } + [JsonInclude, JsonPropertyName("offset")] + public int Offset { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs new file mode 100644 index 00000000000..3b075c8cffd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +public sealed partial class MatchedText +{ + [JsonInclude, JsonPropertyName("fields")] + public IReadOnlyDictionary>? Fields { get; init; } + [JsonInclude, JsonPropertyName("matched")] + public bool Matched { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs new file mode 100644 index 00000000000..f2d241771cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class CheckpointStats +{ + [JsonInclude, JsonPropertyName("checkpoint")] + public long Checkpoint { get; init; } + [JsonInclude, JsonPropertyName("checkpoint_progress")] + public Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress? CheckpointProgress { get; init; } + [JsonInclude, JsonPropertyName("timestamp")] + public DateTimeOffset? Timestamp { get; init; } + [JsonInclude, JsonPropertyName("timestamp_millis")] + public long? TimestampMillis { get; init; } + [JsonInclude, JsonPropertyName("time_upper_bound")] + public DateTimeOffset? TimeUpperBound { get; init; } + [JsonInclude, JsonPropertyName("time_upper_bound_millis")] + public long? TimeUpperBoundMillis { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs new file mode 100644 index 00000000000..24f858b5113 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class Checkpointing +{ + [JsonInclude, JsonPropertyName("changes_last_detected_at")] + public long? ChangesLastDetectedAt { get; init; } + [JsonInclude, JsonPropertyName("changes_last_detected_at_date_time")] + public DateTimeOffset? ChangesLastDetectedAtDateTime { get; init; } + [JsonInclude, JsonPropertyName("last")] + public Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats Last { get; init; } + [JsonInclude, JsonPropertyName("last_search_time")] + public long? LastSearchTime { get; init; } + [JsonInclude, JsonPropertyName("next")] + public Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats? Next { get; init; } + [JsonInclude, JsonPropertyName("operations_behind")] + public long? OperationsBehind { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs new file mode 100644 index 00000000000..f5cfe612803 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class Destination +{ + /// + /// The destination index for the transform. The mappings of the destination index are deduced based on the source
fields when possible. If alternate mappings are required, use the create index API prior to starting the
transform.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.IndexName? Index { get; set; } + + /// + /// The unique identifier for an ingest pipeline. + /// + [JsonInclude, JsonPropertyName("pipeline")] + public string? Pipeline { get; set; } +} + +public sealed partial class DestinationDescriptor : SerializableDescriptor +{ + internal DestinationDescriptor(Action configure) => configure.Invoke(this); + + public DestinationDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.IndexName? IndexValue { get; set; } + private string? PipelineValue { get; set; } + + /// + /// The destination index for the transform. The mappings of the destination index are deduced based on the source
fields when possible. If alternate mappings are required, use the create index API prior to starting the
transform.
+ ///
+ public DestinationDescriptor Index(Elastic.Clients.Elasticsearch.IndexName? index) + { + IndexValue = index; + return Self; + } + + /// + /// The unique identifier for an ingest pipeline. + /// + public DestinationDescriptor Pipeline(string? pipeline) + { + PipelineValue = pipeline; + 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 (!string.IsNullOrEmpty(PipelineValue)) + { + writer.WritePropertyName("pipeline"); + writer.WriteStringValue(PipelineValue); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs new file mode 100644 index 00000000000..c34b83e86c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class Latest +{ + /// + /// Specifies the date field that is used to identify the latest documents. + /// + [JsonInclude, JsonPropertyName("sort")] + public Elastic.Clients.Elasticsearch.Field Sort { get; set; } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + [JsonInclude, JsonPropertyName("unique_key")] + public ICollection UniqueKey { get; set; } +} + +public sealed partial class LatestDescriptor : SerializableDescriptor> +{ + internal LatestDescriptor(Action> configure) => configure.Invoke(this); + + public LatestDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field SortValue { get; set; } + private ICollection UniqueKeyValue { get; set; } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Elastic.Clients.Elasticsearch.Field sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + public LatestDescriptor UniqueKey(ICollection uniqueKey) + { + UniqueKeyValue = uniqueKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + writer.WritePropertyName("unique_key"); + JsonSerializer.Serialize(writer, UniqueKeyValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class LatestDescriptor : SerializableDescriptor +{ + internal LatestDescriptor(Action configure) => configure.Invoke(this); + + public LatestDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field SortValue { get; set; } + private ICollection UniqueKeyValue { get; set; } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Elastic.Clients.Elasticsearch.Field sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies the date field that is used to identify the latest documents. + /// + public LatestDescriptor Sort(Expression> sort) + { + SortValue = sort; + return Self; + } + + /// + /// Specifies an array of one or more fields that are used to group the data. + /// + public LatestDescriptor UniqueKey(ICollection uniqueKey) + { + UniqueKeyValue = uniqueKey; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("sort"); + JsonSerializer.Serialize(writer, SortValue, options); + writer.WritePropertyName("unique_key"); + JsonSerializer.Serialize(writer, UniqueKeyValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs new file mode 100644 index 00000000000..9e1c6a6251f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +internal sealed partial class PivotConverter : JsonConverter +{ + public override Pivot Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + throw new JsonException("Unexpected JSON detected."); + var variant = new Pivot(); + 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 == "group_by") + { + variant.GroupBy = JsonSerializer.Deserialize?>(ref reader, options); + continue; + } + } + } + + return variant; + } + + public override void Write(Utf8JsonWriter writer, Pivot value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.Aggregations is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, value.Aggregations, options); + } + + if (value.GroupBy is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, value.GroupBy, options); + } + + writer.WriteEndObject(); + } +} + +[JsonConverter(typeof(PivotConverter))] +public sealed partial class Pivot +{ + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public IDictionary? Aggregations { get; set; } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public IDictionary? GroupBy { get; set; } +} + +public sealed partial class PivotDescriptor : SerializableDescriptor> +{ + internal PivotDescriptor(Action> configure) => configure.Invoke(this); + + public PivotDescriptor() : base() + { + } + + private IDictionary> AggregationsValue { get; set; } + private IDictionary> GroupByValue { get; set; } + + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public PivotDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public PivotDescriptor GroupBy(Func>, FluentDescriptorDictionary>> selector) + { + GroupByValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (GroupByValue is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, GroupByValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class PivotDescriptor : SerializableDescriptor +{ + internal PivotDescriptor(Action configure) => configure.Invoke(this); + + public PivotDescriptor() : base() + { + } + + private IDictionary AggregationsValue { get; set; } + private IDictionary GroupByValue { get; set; } + + /// + /// Defines how to aggregate the grouped data. The following aggregations are currently supported: average, bucket
script, bucket selector, cardinality, filter, geo bounds, geo centroid, geo line, max, median absolute deviation,
min, missing, percentiles, rare terms, scripted metric, stats, sum, terms, top metrics, value count, weighted
average.
+ ///
+ public PivotDescriptor Aggregations(Func, FluentDescriptorDictionary> selector) + { + AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + /// + /// Defines how to group the data. More than one grouping can be defined per pivot. The following groupings are
currently supported: date histogram, geotile grid, histogram, terms.
+ ///
+ public PivotDescriptor GroupBy(Func, FluentDescriptorDictionary> selector) + { + GroupByValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AggregationsValue is not null) + { + writer.WritePropertyName("aggregations"); + JsonSerializer.Serialize(writer, AggregationsValue, options); + } + + if (GroupByValue is not null) + { + writer.WritePropertyName("group_by"); + JsonSerializer.Serialize(writer, GroupByValue, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs index aba94236c32..07b597d9553 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs @@ -21,6 +21,7 @@ using Elastic.Clients.Elasticsearch.Serialization; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Text.Json; using System.Text.Json.Serialization; @@ -49,6 +50,18 @@ internal PivotGroupBy(string variantName, object variant) public static PivotGroupBy GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => new PivotGroupBy("geotile_grid", geotileGridAggregation); public static PivotGroupBy Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => new PivotGroupBy("histogram", histogramAggregation); public static PivotGroupBy Terms(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation termsAggregation) => new PivotGroupBy("terms", termsAggregation); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } } internal sealed partial class PivotGroupByConverter : JsonConverter @@ -60,49 +73,62 @@ public override PivotGroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, throw new JsonException("Expected start token."); } - reader.Read(); - if (reader.TokenType != JsonTokenType.PropertyName) + object? variantValue = default; + string? variantNameValue = default; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { - throw new JsonException("Expected a property name token representing the variant held within this container."); - } + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token."); + } - 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 (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException("Expected a property name token representing the name of an Elasticsearch field."); + } - if (propertyName == "geotile_grid") - { - var variant = JsonSerializer.Deserialize(ref reader, options); + var propertyName = reader.GetString(); reader.Read(); - return new PivotGroupBy(propertyName, variant); - } + if (propertyName == "date_histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "histogram") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new PivotGroupBy(propertyName, variant); - } + if (propertyName == "geotile_grid") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } - if (propertyName == "terms") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new PivotGroupBy(propertyName, variant); + if (propertyName == "histogram") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + if (propertyName == "terms") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'PivotGroupBy' from the response."); } - throw new JsonException(); + reader.Read(); + var result = new PivotGroupBy(variantNameValue, variantValue); + return result; } public override void Write(Utf8JsonWriter writer, PivotGroupBy value, JsonSerializerOptions options) { writer.WriteStartObject(); - if (value.VariantName is not null & value.Variant is not null) + if (value.VariantName is not null && value.Variant is not null) { writer.WritePropertyName(value.VariantName); switch (value.VariantName) @@ -157,33 +183,31 @@ private PivotGroupByDescriptor Set(object variant, string variantName 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"); + public PivotGroupByDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action> configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action> configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action> configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } @@ -219,37 +243,31 @@ private PivotGroupByDescriptor Set(object variant, string variantName) 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"); + public PivotGroupByDescriptor DateHistogram(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation dateHistogramAggregation) => Set(dateHistogramAggregation, "date_histogram"); + public PivotGroupByDescriptor DateHistogram(Action configure) => Set(configure, "date_histogram"); + public PivotGroupByDescriptor GeotileGrid(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation geotileGridAggregation) => Set(geotileGridAggregation, "geotile_grid"); + public PivotGroupByDescriptor GeotileGrid(Action configure) => Set(configure, "geotile_grid"); + public PivotGroupByDescriptor Histogram(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation histogramAggregation) => Set(histogramAggregation, "histogram"); + public PivotGroupByDescriptor Histogram(Action configure) => Set(configure, "histogram"); + public PivotGroupByDescriptor Terms(Elastic.Clients.Elasticsearch.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) + if (!string.IsNullOrEmpty(ContainedVariantName)) { - JsonSerializer.Serialize(writer, Variant, Variant.GetType(), options); - writer.WriteEndObject(); - return; + 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); } - JsonSerializer.Serialize(writer, Descriptor, Descriptor.GetType(), options); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs new file mode 100644 index 00000000000..f42b0ff351c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.TransformManagement; + +[JsonConverter(typeof(RetentionPolicyConverter))] +public sealed partial class RetentionPolicy +{ + internal RetentionPolicy(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 RetentionPolicy Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy retentionPolicy) => new RetentionPolicy("time", retentionPolicy); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class RetentionPolicyConverter : JsonConverter +{ + public override RetentionPolicy 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; + 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 == "time") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'RetentionPolicy' from the response."); + } + + reader.Read(); + var result = new RetentionPolicy(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, RetentionPolicy value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "time": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class RetentionPolicyDescriptor : SerializableDescriptor> +{ + internal RetentionPolicyDescriptor(Action> configure) => configure.Invoke(this); + + public RetentionPolicyDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RetentionPolicyDescriptor 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 RetentionPolicyDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RetentionPolicyDescriptor Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy retentionPolicy) => Set(retentionPolicy, "time"); + public RetentionPolicyDescriptor Time(Action> configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 RetentionPolicyDescriptor : SerializableDescriptor +{ + internal RetentionPolicyDescriptor(Action configure) => configure.Invoke(this); + + public RetentionPolicyDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private RetentionPolicyDescriptor 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 RetentionPolicyDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public RetentionPolicyDescriptor Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy retentionPolicy) => Set(retentionPolicy, "time"); + public RetentionPolicyDescriptor Time(Action configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/TransformManagement/Settings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs new file mode 100644 index 00000000000..db3d066654e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +/// +/// The source of the data for the transform. +/// +public sealed partial class Settings +{ + /// + /// Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align
checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the
transform config. As a result, less document updates in the destination index will be performed thus improving
overall performance.
+ ///
+ [JsonInclude, JsonPropertyName("align_checkpoints")] + public bool? AlignCheckpoints { get; set; } + + /// + /// Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was
the default for transforms created before version 7.11. For compatible output set this value to `true`.
+ ///
+ [JsonInclude, JsonPropertyName("dates_as_epoch_millis")] + public bool? DatesAsEpochMillis { get; set; } + + /// + /// Specifies whether the transform should deduce the destination index mappings from the transform configuration. + /// + [JsonInclude, JsonPropertyName("deduce_mappings")] + public bool? DeduceMappings { get; set; } + + /// + /// Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a
wait time between search requests. The default value is null, which disables throttling.
+ ///
+ [JsonInclude, JsonPropertyName("docs_per_second")] + public float? DocsPerSecond { get; set; } + + /// + /// Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker
exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the
maximum is `65,536`.
+ ///
+ [JsonInclude, JsonPropertyName("max_page_search_size")] + public int? MaxPageSearchSize { get; set; } + + /// + /// If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case
of an error which means the transform never fails. Setting the number of retries other than infinite fails in
validation.
+ ///
+ [JsonInclude, JsonPropertyName("unattended")] + public bool? Unattended { get; set; } +} + +/// +/// The source of the data for the transform. +/// +public sealed partial class SettingsDescriptor : SerializableDescriptor +{ + internal SettingsDescriptor(Action configure) => configure.Invoke(this); + + public SettingsDescriptor() : base() + { + } + + private bool? AlignCheckpointsValue { get; set; } + private bool? DatesAsEpochMillisValue { get; set; } + private bool? DeduceMappingsValue { get; set; } + private float? DocsPerSecondValue { get; set; } + private int? MaxPageSearchSizeValue { get; set; } + private bool? UnattendedValue { get; set; } + + /// + /// Specifies whether the transform checkpoint ranges should be optimized for performance. Such optimization can align
checkpoint ranges with the date histogram interval when date histogram is specified as a group source in the
transform config. As a result, less document updates in the destination index will be performed thus improving
overall performance.
+ ///
+ public SettingsDescriptor AlignCheckpoints(bool? alignCheckpoints = true) + { + AlignCheckpointsValue = alignCheckpoints; + return Self; + } + + /// + /// Defines if dates in the ouput should be written as ISO formatted string or as millis since epoch. epoch_millis was
the default for transforms created before version 7.11. For compatible output set this value to `true`.
+ ///
+ public SettingsDescriptor DatesAsEpochMillis(bool? datesAsEpochMillis = true) + { + DatesAsEpochMillisValue = datesAsEpochMillis; + return Self; + } + + /// + /// Specifies whether the transform should deduce the destination index mappings from the transform configuration. + /// + public SettingsDescriptor DeduceMappings(bool? deduceMappings = true) + { + DeduceMappingsValue = deduceMappings; + return Self; + } + + /// + /// Specifies a limit on the number of input documents per second. This setting throttles the transform by adding a
wait time between search requests. The default value is null, which disables throttling.
+ ///
+ public SettingsDescriptor DocsPerSecond(float? docsPerSecond) + { + DocsPerSecondValue = docsPerSecond; + return Self; + } + + /// + /// Defines the initial page size to use for the composite aggregation for each checkpoint. If circuit breaker
exceptions occur, the page size is dynamically adjusted to a lower value. The minimum value is `10` and the
maximum is `65,536`.
+ ///
+ public SettingsDescriptor MaxPageSearchSize(int? maxPageSearchSize) + { + MaxPageSearchSizeValue = maxPageSearchSize; + return Self; + } + + /// + /// If `true`, the transform runs in unattended mode. In unattended mode, the transform retries indefinitely in case
of an error which means the transform never fails. Setting the number of retries other than infinite fails in
validation.
+ ///
+ public SettingsDescriptor Unattended(bool? unattended = true) + { + UnattendedValue = unattended; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (AlignCheckpointsValue.HasValue) + { + writer.WritePropertyName("align_checkpoints"); + writer.WriteBooleanValue(AlignCheckpointsValue.Value); + } + + if (DatesAsEpochMillisValue.HasValue) + { + writer.WritePropertyName("dates_as_epoch_millis"); + writer.WriteBooleanValue(DatesAsEpochMillisValue.Value); + } + + if (DeduceMappingsValue.HasValue) + { + writer.WritePropertyName("deduce_mappings"); + writer.WriteBooleanValue(DeduceMappingsValue.Value); + } + + if (DocsPerSecondValue.HasValue) + { + writer.WritePropertyName("docs_per_second"); + writer.WriteNumberValue(DocsPerSecondValue.Value); + } + + if (MaxPageSearchSizeValue.HasValue) + { + writer.WritePropertyName("max_page_search_size"); + writer.WriteNumberValue(MaxPageSearchSizeValue.Value); + } + + if (UnattendedValue.HasValue) + { + writer.WritePropertyName("unattended"); + writer.WriteBooleanValue(UnattendedValue.Value); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs new file mode 100644 index 00000000000..beaa76ae71e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs @@ -0,0 +1,229 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class Source +{ + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ [JsonInclude, JsonPropertyName("index")] + public Elastic.Clients.Elasticsearch.Indices Indices { get; set; } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + [JsonInclude, JsonPropertyName("query")] + public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")] + public IDictionary? RuntimeMappings { get; set; } +} + +public sealed partial class SourceDescriptor : SerializableDescriptor> +{ + internal SourceDescriptor(Action> configure) => configure.Invoke(this); + + public SourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action> QueryDescriptorAction { get; set; } + private IDictionary> RuntimeMappingsValue { get; set; } + + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SourceDescriptor Query(Action> configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ public SourceDescriptor RuntimeMappings(Func>, FluentDescriptorDictionary>> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary>()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, options); + } + + if (RuntimeMappingsValue is not null) + { + writer.WritePropertyName("runtime_mappings"); + JsonSerializer.Serialize(writer, RuntimeMappingsValue, options); + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SourceDescriptor : SerializableDescriptor +{ + internal SourceDescriptor(Action configure) => configure.Invoke(this); + + public SourceDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Indices IndicesValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; } + private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; } + private Action QueryDescriptorAction { get; set; } + private IDictionary RuntimeMappingsValue { get; set; } + + /// + /// The source indices for the transform. It can be a single index, an index pattern (for example, `"my-index-*""`), an
array of indices (for example, `["my-index-000001", "my-index-000002"]`), or an array of index patterns (for
example, `["my-index-*", "my-other-index-*"]`. For remote indices use the syntax `"remote_name:index_name"`. If
any indices are in remote clusters then the master node and at least one transform node must have the `remote_cluster_client` node role.
+ ///
+ public SourceDescriptor Indices(Elastic.Clients.Elasticsearch.Indices indices) + { + IndicesValue = indices; + return Self; + } + + /// + /// A query clause that retrieves a subset of data from the source index. + /// + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.Query? query) + { + QueryDescriptor = null; + QueryDescriptorAction = null; + QueryValue = query; + return Self; + } + + public SourceDescriptor Query(Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor descriptor) + { + QueryValue = null; + QueryDescriptorAction = null; + QueryDescriptor = descriptor; + return Self; + } + + public SourceDescriptor Query(Action configure) + { + QueryValue = null; + QueryDescriptor = null; + QueryDescriptorAction = configure; + return Self; + } + + /// + /// Definitions of search-time runtime fields that can be used by the transform. For search runtime fields all data
nodes, including remote nodes, must be 7.12 or later.
+ ///
+ public SourceDescriptor RuntimeMappings(Func, FluentDescriptorDictionary> selector) + { + RuntimeMappingsValue = selector?.Invoke(new FluentDescriptorDictionary()); + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + writer.WritePropertyName("index"); + JsonSerializer.Serialize(writer, IndicesValue, 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 Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor(QueryDescriptorAction), options); + } + else if (QueryValue is not null) + { + writer.WritePropertyName("query"); + JsonSerializer.Serialize(writer, QueryValue, 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/_Generated/Types/TransformManagement/Sync.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs new file mode 100644 index 00000000000..c3f62d90585 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs @@ -0,0 +1,228 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +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.TransformManagement; + +[JsonConverter(typeof(SyncConverter))] +public sealed partial class Sync +{ + internal Sync(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 Sync Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeSync timeSync) => new Sync("time", timeSync); + + public bool TryGet([NotNullWhen(true)] out T? result) where T : class + { + result = default; + if (Variant is T variant) + { + result = variant; + return true; + } + + return false; + } +} + +internal sealed partial class SyncConverter : JsonConverter +{ + public override Sync 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; + 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 == "time") + { + variantValue = JsonSerializer.Deserialize(ref reader, options); + variantNameValue = propertyName; + continue; + } + + throw new JsonException($"Unknown property name '{propertyName}' received while deserializing the 'Sync' from the response."); + } + + reader.Read(); + var result = new Sync(variantNameValue, variantValue); + return result; + } + + public override void Write(Utf8JsonWriter writer, Sync value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + if (value.VariantName is not null && value.Variant is not null) + { + writer.WritePropertyName(value.VariantName); + switch (value.VariantName) + { + case "time": + JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.TransformManagement.TimeSync)value.Variant, options); + break; + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class SyncDescriptor : SerializableDescriptor> +{ + internal SyncDescriptor(Action> configure) => configure.Invoke(this); + + public SyncDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SyncDescriptor 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 SyncDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SyncDescriptor Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeSync timeSync) => Set(timeSync, "time"); + public SyncDescriptor Time(Action> configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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 SyncDescriptor : SerializableDescriptor +{ + internal SyncDescriptor(Action configure) => configure.Invoke(this); + + public SyncDescriptor() : base() + { + } + + private bool ContainsVariant { get; set; } + private string ContainedVariantName { get; set; } + private object Variant { get; set; } + private Descriptor Descriptor { get; set; } + + private SyncDescriptor 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 SyncDescriptor Set(object variant, string variantName) + { + Variant = variant; + ContainedVariantName = variantName; + ContainsVariant = true; + return Self; + } + + public SyncDescriptor Time(Elastic.Clients.Elasticsearch.TransformManagement.TimeSync timeSync) => Set(timeSync, "time"); + public SyncDescriptor Time(Action configure) => Set(configure, "time"); + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + 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/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs new file mode 100644 index 00000000000..bf35fe6c1bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TimeRetentionPolicy +{ + /// + /// The date field that is used to calculate the age of the document. + /// + [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ [JsonInclude, JsonPropertyName("max_age")] + public Elastic.Clients.Elasticsearch.Duration MaxAge { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy(TimeRetentionPolicy timeRetentionPolicy) => Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy.Time(timeRetentionPolicy); +} + +public sealed partial class TimeRetentionPolicyDescriptor : SerializableDescriptor> +{ + internal TimeRetentionPolicyDescriptor(Action> configure) => configure.Invoke(this); + + public TimeRetentionPolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration MaxAgeValue { get; set; } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ public TimeRetentionPolicyDescriptor MaxAge(Elastic.Clients.Elasticsearch.Duration maxAge) + { + MaxAgeValue = maxAge; + 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_age"); + JsonSerializer.Serialize(writer, MaxAgeValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TimeRetentionPolicyDescriptor : SerializableDescriptor +{ + internal TimeRetentionPolicyDescriptor(Action configure) => configure.Invoke(this); + + public TimeRetentionPolicyDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration MaxAgeValue { get; set; } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to calculate the age of the document. + /// + public TimeRetentionPolicyDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// Specifies the maximum age of a document in the destination index. Documents that are older than the configured
value are removed from the destination index.
+ ///
+ public TimeRetentionPolicyDescriptor MaxAge(Elastic.Clients.Elasticsearch.Duration maxAge) + { + MaxAgeValue = maxAge; + 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_age"); + JsonSerializer.Serialize(writer, MaxAgeValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs new file mode 100644 index 00000000000..7795e561dae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs @@ -0,0 +1,169 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using Elastic.Clients.Elasticsearch.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TimeSync +{ + /// + /// The time delay between the current time and the latest input data time. + /// + [JsonInclude, JsonPropertyName("delay")] + public Elastic.Clients.Elasticsearch.Duration? Delay { get; set; } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ [JsonInclude, JsonPropertyName("field")] + public Elastic.Clients.Elasticsearch.Field Field { get; set; } + + public static implicit operator Elastic.Clients.Elasticsearch.TransformManagement.Sync(TimeSync timeSync) => Elastic.Clients.Elasticsearch.TransformManagement.Sync.Time(timeSync); +} + +public sealed partial class TimeSyncDescriptor : SerializableDescriptor> +{ + internal TimeSyncDescriptor(Action> configure) => configure.Invoke(this); + + public TimeSyncDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + /// + /// The time delay between the current time and the latest input data time. + /// + public TimeSyncDescriptor Delay(Elastic.Clients.Elasticsearch.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} + +public sealed partial class TimeSyncDescriptor : SerializableDescriptor +{ + internal TimeSyncDescriptor(Action configure) => configure.Invoke(this); + + public TimeSyncDescriptor() : base() + { + } + + private Elastic.Clients.Elasticsearch.Duration? DelayValue { get; set; } + private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } + + /// + /// The time delay between the current time and the latest input data time. + /// + public TimeSyncDescriptor Delay(Elastic.Clients.Elasticsearch.Duration? delay) + { + DelayValue = delay; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Elastic.Clients.Elasticsearch.Field field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + /// + /// The date field that is used to identify new documents in the source. In general, it’s a good idea to use a field
that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it
accounts for data transmission delays.
+ ///
+ public TimeSyncDescriptor Field(Expression> field) + { + FieldValue = field; + return Self; + } + + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + writer.WriteStartObject(); + if (DelayValue is not null) + { + writer.WritePropertyName("delay"); + JsonSerializer.Serialize(writer, DelayValue, options); + } + + writer.WritePropertyName("field"); + JsonSerializer.Serialize(writer, FieldValue, options); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs new file mode 100644 index 00000000000..3945f47f036 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TransformIndexerStats +{ + [JsonInclude, JsonPropertyName("delete_time_in_ms")] + public long? DeleteTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("documents_deleted")] + public long? DocumentsDeleted { get; init; } + [JsonInclude, JsonPropertyName("documents_indexed")] + public long DocumentsIndexed { get; init; } + [JsonInclude, JsonPropertyName("documents_processed")] + public long DocumentsProcessed { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_checkpoint_duration_ms")] + public double ExponentialAvgCheckpointDurationMs { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_documents_indexed")] + public double ExponentialAvgDocumentsIndexed { get; init; } + [JsonInclude, JsonPropertyName("exponential_avg_documents_processed")] + public double ExponentialAvgDocumentsProcessed { get; init; } + [JsonInclude, JsonPropertyName("index_failures")] + public long IndexFailures { get; init; } + [JsonInclude, JsonPropertyName("index_time_in_ms")] + public long IndexTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("index_total")] + public long IndexTotal { get; init; } + [JsonInclude, JsonPropertyName("pages_processed")] + public long PagesProcessed { get; init; } + [JsonInclude, JsonPropertyName("processing_time_in_ms")] + public long ProcessingTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("processing_total")] + public long ProcessingTotal { get; init; } + [JsonInclude, JsonPropertyName("search_failures")] + public long SearchFailures { get; init; } + [JsonInclude, JsonPropertyName("search_time_in_ms")] + public long SearchTimeInMs { get; init; } + [JsonInclude, JsonPropertyName("search_total")] + public long SearchTotal { get; init; } + [JsonInclude, JsonPropertyName("trigger_count")] + public long TriggerCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs new file mode 100644 index 00000000000..a389e36a8f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TransformProgress +{ + [JsonInclude, JsonPropertyName("docs_indexed")] + public long DocsIndexed { get; init; } + [JsonInclude, JsonPropertyName("docs_processed")] + public long DocsProcessed { get; init; } + [JsonInclude, JsonPropertyName("docs_remaining")] + public long DocsRemaining { get; init; } + [JsonInclude, JsonPropertyName("percent_complete")] + public double PercentComplete { get; init; } + [JsonInclude, JsonPropertyName("total_docs")] + public long TotalDocs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs new file mode 100644 index 00000000000..3f0df8267b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TransformStats +{ + [JsonInclude, JsonPropertyName("checkpointing")] + public Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing Checkpointing { get; init; } + [JsonInclude, JsonPropertyName("health")] + public Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth? Health { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("node")] + public Elastic.Clients.Elasticsearch.NodeAttributes? Node { get; init; } + [JsonInclude, JsonPropertyName("reason")] + public string? Reason { get; init; } + [JsonInclude, JsonPropertyName("state")] + public string State { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs new file mode 100644 index 00000000000..90f6734a7e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TransformStatsHealth +{ + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.HealthStatus Status { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs new file mode 100644 index 00000000000..7acfca87ac9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement; + +public sealed partial class TransformSummary +{ + /// + /// The security privileges that the transform uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the transform, this property is omitted. + /// + [JsonInclude, JsonPropertyName("authorization")] + public Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization? Authorization { get; init; } + + /// + /// The time the transform was created. + /// + [JsonInclude, JsonPropertyName("create_time")] + public long? CreateTime { get; init; } + + /// + /// Free text description of the transform. + /// + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// The destination for the transform. + /// + [JsonInclude, JsonPropertyName("dest")] + public Elastic.Clients.Elasticsearch.Core.Reindex.Destination Dest { get; init; } + [JsonInclude, JsonPropertyName("frequency")] + public Elastic.Clients.Elasticsearch.Duration? Frequency { get; init; } + [JsonInclude, JsonPropertyName("id")] + public string Id { get; init; } + [JsonInclude, JsonPropertyName("latest")] + public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; init; } + [JsonInclude, JsonPropertyName("_meta")] + public IReadOnlyDictionary? Meta { get; init; } + + /// + /// The pivot method transforms the data by aggregating and grouping it. + /// + [JsonInclude, JsonPropertyName("pivot")] + public Elastic.Clients.Elasticsearch.TransformManagement.Pivot? Pivot { get; init; } + [JsonInclude, JsonPropertyName("retention_policy")] + public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; init; } + + /// + /// Defines optional transform settings. + /// + [JsonInclude, JsonPropertyName("settings")] + public Elastic.Clients.Elasticsearch.TransformManagement.Settings? Settings { get; init; } + + /// + /// The source of the data for the transform. + /// + [JsonInclude, JsonPropertyName("source")] + public Elastic.Clients.Elasticsearch.TransformManagement.Source Source { get; init; } + + /// + /// Defines the properties transforms require to run continuously. + /// + [JsonInclude, JsonPropertyName("sync")] + public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; init; } + + /// + /// The version of Elasticsearch that existed on the node when the transform was created. + /// + [JsonInclude, JsonPropertyName("version")] + public string? Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs new file mode 100644 index 00000000000..538fc9b2b69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Analytics +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("stats")] + public Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics Stats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs new file mode 100644 index 00000000000..12c118671c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class AnalyticsStatistics +{ + [JsonInclude, JsonPropertyName("boxplot_usage")] + public long BoxplotUsage { get; init; } + [JsonInclude, JsonPropertyName("cumulative_cardinality_usage")] + public long CumulativeCardinalityUsage { get; init; } + [JsonInclude, JsonPropertyName("moving_percentiles_usage")] + public long MovingPercentilesUsage { get; init; } + [JsonInclude, JsonPropertyName("multi_terms_usage")] + public long? MultiTermsUsage { get; init; } + [JsonInclude, JsonPropertyName("normalize_usage")] + public long NormalizeUsage { get; init; } + [JsonInclude, JsonPropertyName("rate_usage")] + public long RateUsage { get; init; } + [JsonInclude, JsonPropertyName("string_stats_usage")] + public long StringStatsUsage { get; init; } + [JsonInclude, JsonPropertyName("top_metrics_usage")] + public long TopMetricsUsage { get; init; } + [JsonInclude, JsonPropertyName("t_test_usage")] + public long TTestUsage { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs new file mode 100644 index 00000000000..d9e3680fe49 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Archive +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs new file mode 100644 index 00000000000..132da819d02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Audit +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("outputs")] + public IReadOnlyCollection? Outputs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs new file mode 100644 index 00000000000..420fd303292 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Base +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs new file mode 100644 index 00000000000..e0a6b18adc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class BuildInformation +{ + [JsonInclude, JsonPropertyName("date")] + public DateTimeOffset Date { get; init; } + [JsonInclude, JsonPropertyName("hash")] + public string Hash { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs new file mode 100644 index 00000000000..0d569ae2799 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Ccr +{ + [JsonInclude, JsonPropertyName("auto_follow_patterns_count")] + public int AutoFollowPatternsCount { get; init; } + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("follower_indices_count")] + public int FollowerIndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs new file mode 100644 index 00000000000..120310b71a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Counter +{ + [JsonInclude, JsonPropertyName("active")] + public long Active { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs new file mode 100644 index 00000000000..3bb13dcf397 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class DataStreams +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public long DataStreams2 { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs new file mode 100644 index 00000000000..63c34137165 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class DataTierPhaseStatistics +{ + [JsonInclude, JsonPropertyName("doc_count")] + public long DocCount { get; init; } + [JsonInclude, JsonPropertyName("index_count")] + public long IndexCount { get; init; } + [JsonInclude, JsonPropertyName("node_count")] + public long NodeCount { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_count")] + public long PrimaryShardCount { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_avg_bytes")] + public long PrimaryShardSizeAvgBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_mad_bytes")] + public long PrimaryShardSizeMadBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_shard_size_median_bytes")] + public long PrimaryShardSizeMedianBytes { get; init; } + [JsonInclude, JsonPropertyName("primary_size_bytes")] + public long PrimarySizeBytes { get; init; } + [JsonInclude, JsonPropertyName("total_shard_count")] + public long TotalShardCount { get; init; } + [JsonInclude, JsonPropertyName("total_size_bytes")] + public long TotalSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs new file mode 100644 index 00000000000..03a49a676b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class DataTiers +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("data_cold")] + public Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics DataCold { get; init; } + [JsonInclude, JsonPropertyName("data_content")] + public Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics DataContent { get; init; } + [JsonInclude, JsonPropertyName("data_frozen")] + public Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics? DataFrozen { get; init; } + [JsonInclude, JsonPropertyName("data_hot")] + public Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics DataHot { get; init; } + [JsonInclude, JsonPropertyName("data_warm")] + public Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics DataWarm { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs new file mode 100644 index 00000000000..4c19e3aa874 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Datafeed +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs new file mode 100644 index 00000000000..aeeff39388f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Eql +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("features")] + public Elastic.Clients.Elasticsearch.Xpack.EqlFeatures Features { get; init; } + [JsonInclude, JsonPropertyName("queries")] + public IReadOnlyDictionary Queries { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs new file mode 100644 index 00000000000..e820c76935f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class EqlFeatures +{ + [JsonInclude, JsonPropertyName("event")] + public int Event { get; init; } + [JsonInclude, JsonPropertyName("join")] + public int Join { get; init; } + [JsonInclude, JsonPropertyName("joins")] + public Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin Joins { get; init; } + [JsonInclude, JsonPropertyName("keys")] + public Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys Keys { get; init; } + [JsonInclude, JsonPropertyName("pipes")] + public Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes Pipes { get; init; } + [JsonInclude, JsonPropertyName("sequence")] + public int Sequence { get; init; } + [JsonInclude, JsonPropertyName("sequences")] + public Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences Sequences { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs new file mode 100644 index 00000000000..0761d68af39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class EqlFeaturesJoin +{ + [JsonInclude, JsonPropertyName("join_queries_five_or_more")] + public int JoinQueriesFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("join_queries_four")] + public int JoinQueriesFour { get; init; } + [JsonInclude, JsonPropertyName("join_queries_three")] + public int JoinQueriesThree { get; init; } + [JsonInclude, JsonPropertyName("join_queries_two")] + public int JoinQueriesTwo { get; init; } + [JsonInclude, JsonPropertyName("join_until")] + public int JoinUntil { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs new file mode 100644 index 00000000000..cf94aae096c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class EqlFeaturesKeys +{ + [JsonInclude, JsonPropertyName("join_keys_five_or_more")] + public int JoinKeysFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("join_keys_four")] + public int JoinKeysFour { get; init; } + [JsonInclude, JsonPropertyName("join_keys_one")] + public int JoinKeysOne { get; init; } + [JsonInclude, JsonPropertyName("join_keys_three")] + public int JoinKeysThree { get; init; } + [JsonInclude, JsonPropertyName("join_keys_two")] + public int JoinKeysTwo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs new file mode 100644 index 00000000000..19703894702 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class EqlFeaturesPipes +{ + [JsonInclude, JsonPropertyName("pipe_head")] + public int PipeHead { get; init; } + [JsonInclude, JsonPropertyName("pipe_tail")] + public int PipeTail { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs new file mode 100644 index 00000000000..d96ca705d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class EqlFeaturesSequences +{ + [JsonInclude, JsonPropertyName("sequence_maxspan")] + public int SequenceMaxspan { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_five_or_more")] + public int SequenceQueriesFiveOrMore { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_four")] + public int SequenceQueriesFour { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_three")] + public int SequenceQueriesThree { get; init; } + [JsonInclude, JsonPropertyName("sequence_queries_two")] + public int SequenceQueriesTwo { get; init; } + [JsonInclude, JsonPropertyName("sequence_until")] + public int SequenceUntil { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs new file mode 100644 index 00000000000..d31c476d398 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Feature +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("description")] + public string? Description { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("native_code_info")] + public Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation? NativeCodeInfo { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs new file mode 100644 index 00000000000..e547848815b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class FeatureToggle +{ + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs new file mode 100644 index 00000000000..4f64a20937c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Features +{ + [JsonInclude, JsonPropertyName("aggregate_metric")] + public Elastic.Clients.Elasticsearch.Xpack.Feature AggregateMetric { get; init; } + [JsonInclude, JsonPropertyName("analytics")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Analytics { get; init; } + [JsonInclude, JsonPropertyName("archive")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Archive { get; init; } + [JsonInclude, JsonPropertyName("ccr")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Ccr { get; init; } + [JsonInclude, JsonPropertyName("data_frame")] + public Elastic.Clients.Elasticsearch.Xpack.Feature? DataFrame { get; init; } + [JsonInclude, JsonPropertyName("data_science")] + public Elastic.Clients.Elasticsearch.Xpack.Feature? DataScience { get; init; } + [JsonInclude, JsonPropertyName("data_streams")] + public Elastic.Clients.Elasticsearch.Xpack.Feature DataStreams { get; init; } + [JsonInclude, JsonPropertyName("data_tiers")] + public Elastic.Clients.Elasticsearch.Xpack.Feature DataTiers { get; init; } + [JsonInclude, JsonPropertyName("enrich")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Enrich { get; init; } + [JsonInclude, JsonPropertyName("eql")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Eql { get; init; } + [JsonInclude, JsonPropertyName("flattened")] + public Elastic.Clients.Elasticsearch.Xpack.Feature? Flattened { get; init; } + [JsonInclude, JsonPropertyName("frozen_indices")] + public Elastic.Clients.Elasticsearch.Xpack.Feature FrozenIndices { get; init; } + [JsonInclude, JsonPropertyName("graph")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Graph { get; init; } + [JsonInclude, JsonPropertyName("ilm")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Ilm { get; init; } + [JsonInclude, JsonPropertyName("logstash")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Logstash { get; init; } + [JsonInclude, JsonPropertyName("ml")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Ml { get; init; } + [JsonInclude, JsonPropertyName("monitoring")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Monitoring { get; init; } + [JsonInclude, JsonPropertyName("rollup")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Rollup { get; init; } + [JsonInclude, JsonPropertyName("runtime_fields")] + public Elastic.Clients.Elasticsearch.Xpack.Feature? RuntimeFields { get; init; } + [JsonInclude, JsonPropertyName("searchable_snapshots")] + public Elastic.Clients.Elasticsearch.Xpack.Feature SearchableSnapshots { get; init; } + [JsonInclude, JsonPropertyName("security")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Security { get; init; } + [JsonInclude, JsonPropertyName("slm")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Slm { get; init; } + [JsonInclude, JsonPropertyName("spatial")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Spatial { get; init; } + [JsonInclude, JsonPropertyName("sql")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Sql { get; init; } + [JsonInclude, JsonPropertyName("transform")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Transform { get; init; } + [JsonInclude, JsonPropertyName("vectors")] + public Elastic.Clients.Elasticsearch.Xpack.Feature? Vectors { get; init; } + [JsonInclude, JsonPropertyName("voting_only")] + public Elastic.Clients.Elasticsearch.Xpack.Feature VotingOnly { get; init; } + [JsonInclude, JsonPropertyName("watcher")] + public Elastic.Clients.Elasticsearch.Xpack.Feature Watcher { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs new file mode 100644 index 00000000000..dccb63491cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Flattened +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("field_count")] + public int FieldCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FrozenIndices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FrozenIndices.g.cs new file mode 100644 index 00000000000..ae0d4ec9870 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FrozenIndices.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class FrozenIndices +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public long IndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs new file mode 100644 index 00000000000..6cabfd845bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class HealthStatistics +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("invocations")] + public Elastic.Clients.Elasticsearch.Xpack.Invocations Invocations { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs new file mode 100644 index 00000000000..5f1a8cd67db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Ilm +{ + [JsonInclude, JsonPropertyName("policy_count")] + public int PolicyCount { get; init; } + [JsonInclude, JsonPropertyName("policy_stats")] + public IReadOnlyCollection PolicyStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs new file mode 100644 index 00000000000..b684b4369bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class IlmPolicyStatistics +{ + [JsonInclude, JsonPropertyName("indices_managed")] + public int IndicesManaged { get; init; } + [JsonInclude, JsonPropertyName("phases")] + public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases Phases { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs new file mode 100644 index 00000000000..620cd40ce5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Invocations +{ + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs new file mode 100644 index 00000000000..63922a45741 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class IpFilter +{ + [JsonInclude, JsonPropertyName("http")] + public bool Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public bool Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs new file mode 100644 index 00000000000..b6a7c4a4f12 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class JobUsage +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("created_by")] + public IReadOnlyDictionary CreatedBy { get; init; } + [JsonInclude, JsonPropertyName("detectors")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics Detectors { get; init; } + [JsonInclude, JsonPropertyName("forecasts")] + public Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts Forecasts { get; init; } + [JsonInclude, JsonPropertyName("model_size")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics ModelSize { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs new file mode 100644 index 00000000000..0717410db5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MachineLearning +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("datafeeds")] + public IReadOnlyDictionary Datafeeds { get; init; } + [JsonInclude, JsonPropertyName("data_frame_analytics_jobs")] + public Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs DataFrameAnalyticsJobs { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("inference")] + public Elastic.Clients.Elasticsearch.Xpack.MlInference Inference { get; init; } + + /// + /// Job usage statistics. The `_all` entry is always present and gathers statistics for all jobs. + /// + [JsonInclude, JsonPropertyName("jobs")] + public IReadOnlyDictionary Jobs { get; init; } + [JsonInclude, JsonPropertyName("node_count")] + public int NodeCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs new file mode 100644 index 00000000000..3e02ab1c587 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MinimalLicenseInformation +{ + [JsonInclude, JsonPropertyName("expiry_date_in_millis")] + public long ExpiryDateInMillis { get; init; } + [JsonInclude, JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType Mode { get; init; } + [JsonInclude, JsonPropertyName("status")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus Status { get; init; } + [JsonInclude, JsonPropertyName("type")] + public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType Type { get; init; } + [JsonInclude, JsonPropertyName("uid")] + public string Uid { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs new file mode 100644 index 00000000000..7345dd77661 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlCounter +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs new file mode 100644 index 00000000000..80bbc62ee26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobs +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount All { get; init; } + [JsonInclude, JsonPropertyName("analysis_counts")] + public Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis? AnalysisCounts { get; init; } + [JsonInclude, JsonPropertyName("memory_usage")] + public Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory? MemoryUsage { get; init; } + [JsonInclude, JsonPropertyName("stopped")] + public Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount? Stopped { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs new file mode 100644 index 00000000000..9d9fbaa8399 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsAnalysis +{ + [JsonInclude, JsonPropertyName("classification")] + public int? Classification { get; init; } + [JsonInclude, JsonPropertyName("outlier_detection")] + public int? OutlierDetection { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public int? Regression { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs new file mode 100644 index 00000000000..0a7209a5ec7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsCount +{ + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs new file mode 100644 index 00000000000..b600c7f9d85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlDataFrameAnalyticsJobsMemory +{ + [JsonInclude, JsonPropertyName("peak_usage_bytes")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics PeakUsageBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs new file mode 100644 index 00000000000..aa17db3f94a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInference +{ + [JsonInclude, JsonPropertyName("deployments")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments? Deployments { get; init; } + [JsonInclude, JsonPropertyName("ingest_processors")] + public IReadOnlyDictionary IngestProcessors { get; init; } + [JsonInclude, JsonPropertyName("trained_models")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels TrainedModels { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs new file mode 100644 index 00000000000..b50292e908f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceDeployments +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("inference_counts")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics InferenceCounts { get; init; } + [JsonInclude, JsonPropertyName("model_sizes_bytes")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics ModelSizesBytes { get; init; } + [JsonInclude, JsonPropertyName("time_ms")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs TimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs new file mode 100644 index 00000000000..6f80030c46d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceDeploymentsTimeMs +{ + [JsonInclude, JsonPropertyName("avg")] + public double Avg { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs new file mode 100644 index 00000000000..fa1f1ed6c0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceIngestProcessor +{ + [JsonInclude, JsonPropertyName("num_docs_processed")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount NumDocsProcessed { get; init; } + [JsonInclude, JsonPropertyName("num_failures")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount NumFailures { get; init; } + [JsonInclude, JsonPropertyName("pipelines")] + public Elastic.Clients.Elasticsearch.Xpack.MlCounter Pipelines { get; init; } + [JsonInclude, JsonPropertyName("time_ms")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount TimeMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs new file mode 100644 index 00000000000..81432177e78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceIngestProcessorCount +{ + [JsonInclude, JsonPropertyName("max")] + public long Max { get; init; } + [JsonInclude, JsonPropertyName("min")] + public long Min { get; init; } + [JsonInclude, JsonPropertyName("sum")] + public long Sum { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs new file mode 100644 index 00000000000..ba8ddee8101 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceTrainedModels +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Xpack.MlCounter All { get; init; } + [JsonInclude, JsonPropertyName("count")] + public Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount? Count { get; init; } + [JsonInclude, JsonPropertyName("estimated_heap_memory_usage_bytes")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? EstimatedHeapMemoryUsageBytes { get; init; } + [JsonInclude, JsonPropertyName("estimated_operations")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? EstimatedOperations { get; init; } + [JsonInclude, JsonPropertyName("model_size_bytes")] + public Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics? ModelSizeBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs new file mode 100644 index 00000000000..146bf75c66d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlInferenceTrainedModelsCount +{ + [JsonInclude, JsonPropertyName("classification")] + public long? Classification { get; init; } + [JsonInclude, JsonPropertyName("ner")] + public long? Ner { get; init; } + [JsonInclude, JsonPropertyName("other")] + public long Other { get; init; } + [JsonInclude, JsonPropertyName("pass_through")] + public long? PassThrough { get; init; } + [JsonInclude, JsonPropertyName("prepackaged")] + public long Prepackaged { get; init; } + [JsonInclude, JsonPropertyName("regression")] + public long? Regression { get; init; } + [JsonInclude, JsonPropertyName("text_embedding")] + public long? TextEmbedding { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs new file mode 100644 index 00000000000..ced49dda3bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class MlJobForecasts +{ + [JsonInclude, JsonPropertyName("forecasted_jobs")] + public long ForecastedJobs { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs new file mode 100644 index 00000000000..2381689892d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Monitoring +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("collection_enabled")] + public bool CollectionEnabled { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("enabled_exporters")] + public IReadOnlyDictionary EnabledExporters { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs new file mode 100644 index 00000000000..e02ac911b76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class NativeCodeInformation +{ + [JsonInclude, JsonPropertyName("build_hash")] + public string BuildHash { get; init; } + [JsonInclude, JsonPropertyName("version")] + public string Version { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs new file mode 100644 index 00000000000..740351a98e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Realm +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("cache")] + public IReadOnlyCollection? Cache { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("has_authorization_realms")] + public IReadOnlyCollection? HasAuthorizationRealms { get; init; } + [JsonInclude, JsonPropertyName("has_default_username_pattern")] + public IReadOnlyCollection? HasDefaultUsernamePattern { get; init; } + [JsonInclude, JsonPropertyName("has_truststore")] + public IReadOnlyCollection? HasTruststore { get; init; } + [JsonInclude, JsonPropertyName("is_authentication_delegated")] + public IReadOnlyCollection? IsAuthenticationDelegated { get; init; } + [JsonInclude, JsonPropertyName("name")] + public IReadOnlyCollection? Name { get; init; } + [JsonInclude, JsonPropertyName("order")] + public IReadOnlyCollection? Order { get; init; } + [JsonInclude, JsonPropertyName("size")] + public IReadOnlyCollection? Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs new file mode 100644 index 00000000000..387dcdcf335 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class RealmCache +{ + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs new file mode 100644 index 00000000000..05292438aca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class RoleMapping +{ + [JsonInclude, JsonPropertyName("enabled")] + public int Enabled { get; init; } + [JsonInclude, JsonPropertyName("size")] + public int Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs new file mode 100644 index 00000000000..362fada688a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class RuntimeFieldTypes +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("field_types")] + public IReadOnlyCollection FieldTypes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs new file mode 100644 index 00000000000..1416aca66e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class RuntimeFieldsType +{ + [JsonInclude, JsonPropertyName("chars_max")] + public long CharsMax { get; init; } + [JsonInclude, JsonPropertyName("chars_total")] + public long CharsTotal { get; init; } + [JsonInclude, JsonPropertyName("count")] + public long Count { get; init; } + [JsonInclude, JsonPropertyName("doc_max")] + public long DocMax { get; init; } + [JsonInclude, JsonPropertyName("doc_total")] + public long DocTotal { get; init; } + [JsonInclude, JsonPropertyName("index_count")] + public long IndexCount { get; init; } + [JsonInclude, JsonPropertyName("lang")] + public IReadOnlyCollection Lang { get; init; } + [JsonInclude, JsonPropertyName("lines_max")] + public long LinesMax { get; init; } + [JsonInclude, JsonPropertyName("lines_total")] + public long LinesTotal { get; init; } + [JsonInclude, JsonPropertyName("name")] + public string Name { get; init; } + [JsonInclude, JsonPropertyName("scriptless_count")] + public long ScriptlessCount { get; init; } + [JsonInclude, JsonPropertyName("shadowed_count")] + public long ShadowedCount { get; init; } + [JsonInclude, JsonPropertyName("source_max")] + public long SourceMax { get; init; } + [JsonInclude, JsonPropertyName("source_total")] + public long SourceTotal { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs new file mode 100644 index 00000000000..bec733cbe70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SearchableSnapshots +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("full_copy_indices_count")] + public int? FullCopyIndicesCount { get; init; } + [JsonInclude, JsonPropertyName("indices_count")] + public int IndicesCount { get; init; } + [JsonInclude, JsonPropertyName("shared_cache_indices_count")] + public int? SharedCacheIndicesCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs new file mode 100644 index 00000000000..211ed2cfadf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Security +{ + [JsonInclude, JsonPropertyName("anonymous")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Anonymous { get; init; } + [JsonInclude, JsonPropertyName("api_key_service")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle ApiKeyService { get; init; } + [JsonInclude, JsonPropertyName("audit")] + public Elastic.Clients.Elasticsearch.Xpack.Audit Audit { get; init; } + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("fips_140")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Fips140 { get; init; } + [JsonInclude, JsonPropertyName("ipfilter")] + public Elastic.Clients.Elasticsearch.Xpack.IpFilter Ipfilter { get; init; } + [JsonInclude, JsonPropertyName("operator_privileges")] + public Elastic.Clients.Elasticsearch.Xpack.Base OperatorPrivileges { get; init; } + [JsonInclude, JsonPropertyName("realms")] + public IReadOnlyDictionary Realms { get; init; } + [JsonInclude, JsonPropertyName("role_mapping")] + public IReadOnlyDictionary RoleMapping { get; init; } + [JsonInclude, JsonPropertyName("roles")] + public Elastic.Clients.Elasticsearch.Xpack.SecurityRoles Roles { get; init; } + [JsonInclude, JsonPropertyName("ssl")] + public Elastic.Clients.Elasticsearch.Xpack.Ssl Ssl { get; init; } + [JsonInclude, JsonPropertyName("system_key")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle? SystemKey { get; init; } + [JsonInclude, JsonPropertyName("token_service")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle TokenService { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs new file mode 100644 index 00000000000..030ac839f55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SecurityRoles +{ + [JsonInclude, JsonPropertyName("dls")] + public Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls Dls { get; init; } + [JsonInclude, JsonPropertyName("file")] + public Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile File { get; init; } + [JsonInclude, JsonPropertyName("native")] + public Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative Native { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs new file mode 100644 index 00000000000..fd9a684bbb6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SecurityRolesDls +{ + [JsonInclude, JsonPropertyName("bit_set_cache")] + public Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache BitSetCache { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs new file mode 100644 index 00000000000..f98d3c6cab0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SecurityRolesDlsBitSetCache +{ + [JsonInclude, JsonPropertyName("count")] + public int Count { get; init; } + [JsonInclude, JsonPropertyName("memory")] + public Elastic.Clients.Elasticsearch.ByteSize? Memory { get; init; } + [JsonInclude, JsonPropertyName("memory_in_bytes")] + public long MemoryInBytes { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs new file mode 100644 index 00000000000..ffa666dcac8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SecurityRolesFile +{ + [JsonInclude, JsonPropertyName("dls")] + public bool Dls { get; init; } + [JsonInclude, JsonPropertyName("fls")] + public bool Fls { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs new file mode 100644 index 00000000000..d170e7a2fab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class SecurityRolesNative +{ + [JsonInclude, JsonPropertyName("dls")] + public bool Dls { get; init; } + [JsonInclude, JsonPropertyName("fls")] + public bool Fls { get; init; } + [JsonInclude, JsonPropertyName("size")] + public long Size { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs new file mode 100644 index 00000000000..27a52c04a4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Slm +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("policy_count")] + public int? PolicyCount { get; init; } + [JsonInclude, JsonPropertyName("policy_stats")] + public Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics? PolicyStats { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs new file mode 100644 index 00000000000..bb01bb673a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Sql +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("features")] + public IReadOnlyDictionary Features { get; init; } + [JsonInclude, JsonPropertyName("queries")] + public IReadOnlyDictionary Queries { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs new file mode 100644 index 00000000000..43f5fdeef8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Ssl +{ + [JsonInclude, JsonPropertyName("http")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Http { get; init; } + [JsonInclude, JsonPropertyName("transport")] + public Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Transport { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs new file mode 100644 index 00000000000..3837f93624a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Vector +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("dense_vector_dims_avg_count")] + public int DenseVectorDimsAvgCount { get; init; } + [JsonInclude, JsonPropertyName("dense_vector_fields_count")] + public int DenseVectorFieldsCount { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("sparse_vector_fields_count")] + public int? SparseVectorFieldsCount { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs new file mode 100644 index 00000000000..9d26dfbbfa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class Watcher +{ + [JsonInclude, JsonPropertyName("available")] + public bool Available { get; init; } + [JsonInclude, JsonPropertyName("count")] + public Elastic.Clients.Elasticsearch.Xpack.Counter Count { get; init; } + [JsonInclude, JsonPropertyName("enabled")] + public bool Enabled { get; init; } + [JsonInclude, JsonPropertyName("execution")] + public Elastic.Clients.Elasticsearch.Xpack.WatcherActions Execution { get; init; } + [JsonInclude, JsonPropertyName("watch")] + public Elastic.Clients.Elasticsearch.Xpack.WatcherWatch Watch { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs new file mode 100644 index 00000000000..1094b1bd0cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class WatcherActionTotals +{ + [JsonInclude, JsonPropertyName("total")] + public Elastic.Clients.Elasticsearch.Duration Total { get; init; } + [JsonInclude, JsonPropertyName("total_time_in_ms")] + public long TotalTimeInMs { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs new file mode 100644 index 00000000000..9372f8fb7f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class WatcherActions +{ + [JsonInclude, JsonPropertyName("actions")] + public IReadOnlyDictionary Actions { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs new file mode 100644 index 00000000000..c865d7bd206 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class WatcherWatch +{ + [JsonInclude, JsonPropertyName("action")] + public IReadOnlyDictionary? Action { get; init; } + [JsonInclude, JsonPropertyName("condition")] + public IReadOnlyDictionary? Condition { get; init; } + [JsonInclude, JsonPropertyName("input")] + public IReadOnlyDictionary Input { get; init; } + [JsonInclude, JsonPropertyName("trigger")] + public Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger Trigger { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs new file mode 100644 index 00000000000..8ff7b000de5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class WatcherWatchTrigger +{ + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Xpack.Counter All { get; init; } + [JsonInclude, JsonPropertyName("schedule")] + public Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule? Schedule { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs new file mode 100644 index 00000000000..4224582c241 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class WatcherWatchTriggerSchedule +{ + [JsonInclude, JsonPropertyName("active")] + public long Active { get; init; } + [JsonInclude, JsonPropertyName("_all")] + public Elastic.Clients.Elasticsearch.Xpack.Counter All { get; init; } + [JsonInclude, JsonPropertyName("cron")] + public Elastic.Clients.Elasticsearch.Xpack.Counter Cron { get; init; } + [JsonInclude, JsonPropertyName("total")] + public long Total { get; init; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs new file mode 100644 index 00000000000..271b6182cb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.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.Fluent; +using Elastic.Clients.Elasticsearch.Serialization; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +public sealed partial class XpackUsageQuery +{ + [JsonInclude, JsonPropertyName("count")] + public int? Count { get; init; } + [JsonInclude, JsonPropertyName("failed")] + public int? Failed { get; init; } + [JsonInclude, JsonPropertyName("paging")] + public int? Paging { get; init; } + [JsonInclude, JsonPropertyName("total")] + public int? Total { get; init; } +} \ No newline at end of file